Skip to content
Open
11 changes: 7 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
codestyle:
name: "Code Style"
name: "Rector + Code Style"
runs-on: ubuntu-latest

steps:
Expand All @@ -22,11 +22,14 @@ jobs:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"
php-version: "8.2"

- name: Install dependencies
uses: ramsey/composer-install@v4

- name: "Run Rector"
run: "vendor/bin/rector --dry-run"

- name: "Run PHP-CS-Fixer"
run: "vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run"

Expand Down Expand Up @@ -62,10 +65,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
- "8.5"
deps:
- "highest"
codestyle:
Expand All @@ -74,7 +77,7 @@ jobs:
- php-version: "8.4"
deps: "locked"
codestyle: "true"
- php-version: "8.1"
- php-version: "8.2"
deps: "lowest"
codestyle: "false"

Expand Down
38 changes: 1 addition & 37 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,9 @@
* These rules will be added to default rules or will override them if the same key already exists.
*/

$additionalRules = [
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'visibility_required' => true,
'heredoc_indentation' => true,
'heredoc_to_nowdoc' => true,
'no_null_property_initialization' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'constant_case' => true,
'declare_strict_types' => true,
'indentation_type' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'phpdoc_line_span' => [
'const' => 'single',
'method' => 'multi',
'property' => 'single',
],
'phpdoc_trim_consecutive_blank_line_separation' => true,
// risky rules
'fopen_flag_order' => true,
'fopen_flags' => true,
'ereg_to_preg' => true,
'implode_call' => true,
'no_unset_on_property' => true,
// custom
'comment_to_phpdoc' => true,
'phpdoc_to_comment' => false,
];
$rulesProvider = new Facile\CodingStandards\Rules\CompositeRulesProvider([
new Facile\CodingStandards\Rules\DefaultRulesProvider(),
new Facile\CodingStandards\Rules\ArrayRulesProvider($additionalRules),
new Facile\CodingStandards\Rules\RiskyRulesProvider(),
]);

$config = new PhpCsFixer\Config();
Expand Down
27 changes: 17 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"minimum-stability": "stable",
"config": {
"sort-packages": true,
"platform": {
"php": "8.2.99"
},
"allow-plugins": {
"facile-it/facile-coding-standard": true,
"laminas/laminas-component-installer": true,
Expand All @@ -28,9 +31,9 @@
"identity"
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"facile-it/php-jose-verifier": "^0.5.0",
"facile-it/php-jose-verifier": "^1.0",
"php-http/discovery": "^1.6",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "^1.0",
Expand All @@ -41,7 +44,7 @@
"psr/http-server-middleware": "^1.0",
"spomky-labs/aes-key-wrap": "^7.0",
"symfony/polyfill-php83": "^1.33",
"web-token/jwt-library": "^3.4.3"
"web-token/jwt-library": "^4.0"
},
"autoload": {
"files": [
Expand All @@ -66,7 +69,7 @@
},
"require-dev": {
"dflydev/fig-cookies": "^2.0 || ^3.0",
"facile-it/facile-coding-standard": "^0.5.2 || ^1.0.0",
"facile-it/facile-coding-standard": "1.5.0",
"friendsofphp/php-cs-fixer": "^3.0",
"laminas/laminas-component-installer": "^2.1 || ^3.0",
"laminas/laminas-config-aggregator": "^1.1",
Expand All @@ -79,6 +82,7 @@
"phpspec/prophecy": "^1.10.3",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^10.5.60 || ^11.5.46 || ^12.0.0",
"rector/rector": "2.3.9",
"symfony/console": "^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
"vimeo/psalm": "^6.14.3"
},
Expand All @@ -88,13 +92,16 @@
"dflydev/fig-cookies": "To use the SessionCookieMiddleware"
},
"scripts": {
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --dry-run --diff --allow-risky=yes",
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --diff --allow-risky=yes",
"psalm": "psalm",
"test": "phpunit",
"test-coverage": "phpunit --coverage-text",
"rector-check": "vendor/bin/rector --dry-run",
"rector-fix": "vendor/bin/rector",
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --diff --allow-risky=yes",
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --diff --allow-risky=yes",
"psalm": "vendor/bin/psalm",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-text",
"check": [
"@cs-check",
"@rector-fix",
"@cs-fix",
"@psalm",
"@test"
]
Expand Down
Loading