Skip to content

Commit

Permalink
Merge branch 'v1.x' into v1.x-autumn
Browse files Browse the repository at this point in the history
  • Loading branch information
Triplkrypl committed Feb 16, 2023
2 parents 37eae23 + 7de72eb commit 0940aca
Show file tree
Hide file tree
Showing 19 changed files with 149 additions and 128 deletions.
2 changes: 2 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ interacts with The Pay's REST API. To get started see examples below.
## Requirements

- PHP 5.3+
**DEPRECATED VERSIONS**: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1
**deprecated PHP versions** will be completely unsupported after 2023-01-01T00:00:00+01:00
- **curl** extension
- **json** extension

Expand Down
116 changes: 37 additions & 79 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,43 @@ name: CI
on:
push:
branches:
- "*"
- "**"

jobs:
php82:
name: "php 8.2"
runs-on: ubuntu-latest
container: "nofutur3/php-tests:8.2"
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
run: composer install --no-interaction
- name: Old phpunit compatibility for php 8
run: composer require christiaanbye/polyfill-each --dev --no-interaction

# Disabled for now, fixer do not support PHP 8.2 yet.
#
#- name: Check code style
# run: composer cs-check

- name: Run static analysis
run: composer stan

- name: Run tests
run: composer test81

php81:
name: "php 8.1"
runs-on: ubuntu-latest
container: "nofutur3/php-tests:8.1"
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction
- name: Old phpunit compatibility for php 8
run: composer require christiaanbye/polyfill-each --dev --no-interaction

Expand All @@ -36,12 +58,10 @@ jobs:
container: "nofutur3/php-tests:8.0"
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction
- name: Old phpunit compatibility for php 8
run: composer require christiaanbye/polyfill-each --dev --no-interaction

Expand All @@ -60,12 +80,10 @@ jobs:
container: "nofutur3/php-tests:7.4"
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction

- name: Run static analysis
run: composer stan7
Expand All @@ -83,8 +101,6 @@ jobs:

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction

- name: Run static analysis
run: composer stan7
Expand All @@ -97,91 +113,33 @@ jobs:
runs-on: ubuntu-latest
container: "nofutur3/php-tests:7.2"
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Deprecation example for future support removal.
#
#- name: Deprecation check (2023-01-01T00:00:00+01:00)
# run: if [ "$(date +%s)" -gt "1672527600" ]; then echo "This PHP version support ended"; exit1; else echo "Deprecation OK"; fi

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction

- name: Run static analysis
run: composer stan7

- name: Run tests
run: composer test

php71:
name: "php 7.1"
runs-on: ubuntu-latest
container: "nofutur3/php-tests:7.1"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction
- name: Phpstan has to be added in pipeline bc it requires PHP 7.1+
run: composer require phpstan/phpstan --dev --no-interaction

- name: Run static analysis
run: composer stan7

- name: Run tests
run: composer test

php70:
name: "php 7.0"
npm:
name: "npm"
runs-on: ubuntu-latest
container: "nofutur3/php-component:7.0"
container: "node"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction
run: npm install

- name: Run tests
run: composer test

php56:
name: "php 5.6"
runs-on: ubuntu-latest
container: "nofutur3/php-component:5.6"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction

- name: Run tests
run: composer test

php55:
name: "php 5.5"
runs-on: ubuntu-latest
container: "nofutur3/php-component:5.5"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction

- name: Run tests
run: composer test

php53:
name: "php 5.3"
runs-on: ubuntu-latest
container: "nofutur3/php-component:5.3"
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --no-interaction

- name: Run tests
run: composer test
run: npm test
2 changes: 1 addition & 1 deletion assets/dist/thepay.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/dist/thepay.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions assets/scss/_payments.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
@use 'sass:math';

// THEPAY PAYMENTS GRID
// Container for payment buttons.
.tp-btn-grid {
display: $tp-btn-grid-display;
flex-wrap: $tp-btn-grid-wrap;
justify-content: $tp-btn-grid-justify;

margin: -$tp-btn-grid-spacing / 2;
margin: math.div(-$tp-btn-grid-spacing, 2);

// Button in grid
.tp-btn {
margin: $tp-btn-grid-spacing / 2;
margin: math.div($tp-btn-grid-spacing, 2);
width: calc(100% - #{$tp-btn-grid-spacing});
min-width: $tp-btn-grid-min-btn-width;
@each $breakpoint, $count in $tp-btn-grid-cols {
@include tp-media-breakpoint-up($breakpoint){
width: calc(#{100% / $count} - #{$tp-btn-grid-spacing});
width: calc(#{math.div(100%, $count)} - #{$tp-btn-grid-spacing});
}
}

Expand All @@ -29,7 +31,6 @@
text-align: center;
display: inline-block;
box-sizing: border-box;
text-align: center;
max-width: 100%;
border: $tp-btn-border solid $tp-btn-border-color;
box-shadow: $tp-btn-shadow;
Expand All @@ -39,7 +40,6 @@
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
background-color: $tp-icon-bg;
margin: $tp-icon-margin;
transition: $tp-icon-transition;
Expand Down
3 changes: 2 additions & 1 deletion assets/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:math';

// THEPAY COLOR VARIABLES
$tp-white: #ffffff !default;
Expand Down Expand Up @@ -63,7 +64,7 @@ $tp-icon-bg: $tp-white !default;
$tp-icon-border: $tp-border !default;
$tp-icon-border-color: $tp-border-color !default;
$tp-icon-shadow: none !default;
$tp-icon-margin: 0 0 $tp-spacing / 2 !default;
$tp-icon-margin: 0 0 math.div($tp-spacing, 2) !default;
$tp-icon-transition: .3s !default;
$tp-icon-hover-border-color: $tp-main-color !default;
$tp-icon-hover-shadow: 0 4px 5px transparentize($tp-icon-hover-border-color, .31) !default;
Expand Down
14 changes: 14 additions & 0 deletions assets/tests/dist.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require('node:fs');
const path = require('node:path');

let assetContent = (filename) => fs.readFileSync(path.resolve('assets', filename)).toString();

test('Dist style is minified', () => {
// Minified style does not have more than 5 lines.
return expect(assetContent('dist/thepay.css').split(/\n/).length).toBeLessThan(5);
});

test('Dist script is minified', () => {
// Minified script does not have more than 5 lines.
return expect(assetContent('dist/thepay.js').split(/\n/).length).toBeLessThan(5);
});
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "*",
"mockery/mockery": "*",
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "~4.0"
},
"config": {
Expand Down
Binary file modified doc/img/the-admin-credentials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/

module.exports = {
// The root directory that Jest should scan for tests and modules within
rootDir: 'assets/tests',
};
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"build": "mix --production",
"test": "jest"
},

"devDependencies": {
"cross-env": "^7.0.2",
"laravel-mix": "^5.0.4",
"node-sass": "^4.14.1"
"jest": "^29.1.2",
"laravel-mix": "^6.0.49",
"resolve-url-loader": "^5.0.0",
"sass": "^1.55.0",
"sass-loader": "^12.1.0"
}
}
Loading

0 comments on commit 0940aca

Please sign in to comment.