Compare commits

..

23 commits
1.1.1 ... main

Author SHA1 Message Date
b7e3418f0f
remove deprecated rectors
All checks were successful
/ ls (push) Successful in 28s
2024-08-18 09:17:23 +02:00
e40beaa2d1
bump-dependencies
All checks were successful
/ ls (push) Successful in 29s
2024-08-18 09:09:16 +02:00
2793c36fa9 Merge pull request 'add_ClassAttributeSeparationFixer' (#3) from add_ClassAttributeSeparationFixer into main
All checks were successful
/ ls (push) Successful in 13s
Reviewed-on: #3
2024-05-04 18:26:43 +00:00
e7ecf55e04
ci-fix
All checks were successful
/ ls (push) Successful in 12s
2024-05-04 20:24:57 +02:00
Continuous Integration
00f72e3be9 Continuous Integration Fixes 2024-05-04 17:42:09 +00:00
9993d760d6
add ClassAttributeSeparationFixer
All checks were successful
/ ls (push) Successful in 17s
2024-05-04 19:41:48 +02:00
b1792809e1 Merge pull request 'add workflow' (#2) from add_actions into main
All checks were successful
/ ls (push) Successful in 16s
Reviewed-on: #2
2024-05-04 17:34:39 +00:00
713b047068
add workflow
All checks were successful
/ ls (push) Successful in 16s
2024-05-04 19:33:42 +02:00
d668217619 temporary skip linelengthfixer 2024-04-25 21:01:06 +02:00
cfd59433a4 bump dependencies 2024-04-25 18:07:52 +02:00
894d6ec850 clean up rector config 2024-02-03 10:58:53 +01:00
8c90c27762 bump versions and set php83 as new target 2024-02-03 01:07:15 +01:00
f30fbd3758 bump dependencies and update config 2024-01-25 18:31:04 +01:00
3c81249b90 update rules 2023-11-29 18:27:33 +01:00
3c9679da8e bump dependencies 2023-11-29 17:14:42 +01:00
lubiana
5d731e63f9
update rector rules. bump versions 2023-09-01 07:52:22 +02:00
lubiana
a83530af35
bump versions 2023-05-29 20:30:17 +02:00
lubiana
7b5380e87d
update dependencies 2023-03-25 20:17:33 +01:00
lubiana
10d4f1321a
update dependencies 2023-02-21 18:33:15 +01:00
lubiana
27f6d414bf
Add Attribute Spacing sniff 2023-01-25 22:33:15 +01:00
lubiana
b470778d3f
bump dependencies 2023-01-25 21:55:46 +01:00
lubiana
367800702e
add new strict type rectors 2022-12-12 20:01:10 +01:00
lubiana
5520d8231d
remove deprecated rectors 2022-12-12 19:32:54 +01:00
9 changed files with 296 additions and 225 deletions

View file

@ -0,0 +1,34 @@
on: [push]
jobs:
ls:
runs-on: docker
container:
image: git.php.fail/lubiana/container/php:ci
steps:
- name: Manually checkout
env:
REPO: '${{ github.repository }}'
TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GIT_SERVER: 'git.php.fail'
run: |
git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git .
git fetch
git checkout ${{ github.head_ref }}
- name: composer install
env:
COMPOSER_CACHE_DIR: /opt/hostedtoolcache/.composer/cache/files
run: |
mkdir -p ${{ env.COMPOSER_CACHE_DIR }}
composer install
- run: composer lint
- name: GIT commit and push all changed files
env:
CI_COMMIT_MESSAGE: Continuous Integration Fixes
CI_COMMIT_AUTHOR: Continuous Integration
run: |
if [[ -n "$(git status -s)" ]]; then
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "gitbot@users.noreply.php.fail"
git commit -am "${{ env.CI_COMMIT_MESSAGE }}"
git push
fi

View file

@ -1,19 +1,28 @@
{ {
"name": "lubiana/code-quality", "name": "lubiana/code-quality",
"license": ["MIT"], "license": ["MIT"],
"keywords": ["dev"],
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Lubiana\\CodeQuality\\": "src/" "Lubiana\\CodeQuality\\": "src/"
} }
}, },
"require": { "require": {
"slevomat/coding-standard": "^8.6.4", "php": "^8.3",
"symplify/easy-coding-standard": "^11.1.17", "slevomat/coding-standard": "^8.15",
"rector/rector": "^0.15.0" "symplify/easy-coding-standard": "^12.3.5",
"rector/rector": "^1.0.5"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true "dealerdirect/phpcodesniffer-composer-installer": true
} }
},
"scripts": {
"lint": [
"rector",
"ecs --fix",
"ecs --fix"
]
} }
} }

219
composer.lock generated
View file

@ -4,39 +4,42 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "ed43b0a7a305296de34ea31e50e17720", "content-hash": "6eb7806e6594ecc073d158d2f9b483f0",
"packages": [ "packages": [
{ {
"name": "dealerdirect/phpcodesniffer-composer-installer", "name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.7.2", "version": "v1.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", "url": "https://github.com/PHPCSStandards/composer-installer.git",
"reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" "reference": "4be43904336affa5c2f70744a348312336afd0da"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da",
"reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "reference": "4be43904336affa5c2f70744a348312336afd0da",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer-plugin-api": "^1.0 || ^2.0", "composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3", "php": ">=5.4",
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
}, },
"require-dev": { "require-dev": {
"composer/composer": "*", "composer/composer": "*",
"ext-json": "*",
"ext-zip": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.1", "php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "^9.0" "phpcompatibility/php-compatibility": "^9.0",
"yoast/phpunit-polyfills": "^1.0"
}, },
"type": "composer-plugin", "type": "composer-plugin",
"extra": { "extra": {
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -52,7 +55,7 @@
}, },
{ {
"name": "Contributors", "name": "Contributors",
"homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
} }
], ],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin", "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
@ -76,29 +79,31 @@
"tests" "tests"
], ],
"support": { "support": {
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "issues": "https://github.com/PHPCSStandards/composer-installer/issues",
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" "source": "https://github.com/PHPCSStandards/composer-installer"
}, },
"time": "2022-02-04T12:51:07+00:00" "time": "2023-01-05T11:28:13+00:00"
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "1.13.1", "version": "1.28.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "aac44118344d197e6d5f7c6cee91885f0a89acdd" "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/aac44118344d197e6d5f7c6cee91885f0a89acdd", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb",
"reference": "aac44118344d197e6d5f7c6cee91885f0a89acdd", "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2 || ^8.0" "php": "^7.2 || ^8.0"
}, },
"require-dev": { "require-dev": {
"doctrine/annotations": "^2.0",
"nikic/php-parser": "^4.15",
"php-parallel-lint/php-parallel-lint": "^1.2", "php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/extension-installer": "^1.0", "phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.5", "phpstan/phpstan": "^1.5",
@ -122,22 +127,22 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": { "support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues", "issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.13.1" "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0"
}, },
"time": "2022-11-20T08:52:26+00:00" "time": "2024-04-03T18:51:33+00:00"
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "1.9.2", "version": "1.10.67",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493",
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -166,8 +171,11 @@
"static analysis" "static analysis"
], ],
"support": { "support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues", "issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.9.2" "security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
}, },
"funding": [ "funding": [
{ {
@ -177,48 +185,41 @@
{ {
"url": "https://github.com/phpstan", "url": "https://github.com/phpstan",
"type": "github" "type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
} }
], ],
"time": "2022-11-10T09:56:11+00:00" "time": "2024-04-16T07:22:02+00:00"
}, },
{ {
"name": "rector/rector", "name": "rector/rector",
"version": "0.15.0", "version": "1.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/rectorphp/rector.git", "url": "https://github.com/rectorphp/rector.git",
"reference": "fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91" "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91", "url": "https://api.github.com/repos/rectorphp/rector/zipball/73eb63e4f9011dba6b7c66c3262543014e352f34",
"reference": "fbfbe499d0fedfac7fe2fed1a55a00bd08f19c91", "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.2|^8.0", "php": "^7.2|^8.0",
"phpstan/phpstan": "^1.9.2" "phpstan/phpstan": "^1.10.57"
}, },
"conflict": { "conflict": {
"rector/rector-doctrine": "*", "rector/rector-doctrine": "*",
"rector/rector-downgrade-php": "*", "rector/rector-downgrade-php": "*",
"rector/rector-php-parser": "*",
"rector/rector-phpunit": "*", "rector/rector-phpunit": "*",
"rector/rector-symfony": "*" "rector/rector-symfony": "*"
}, },
"suggest": {
"ext-dom": "To manipulate phpunit.xml via the custom-rule command"
},
"bin": [ "bin": [
"bin/rector" "bin/rector"
], ],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-main": "0.14-dev"
}
},
"autoload": { "autoload": {
"files": [ "files": [
"bootstrap.php" "bootstrap.php"
@ -229,9 +230,15 @@
"MIT" "MIT"
], ],
"description": "Instant Upgrade and Automated Refactoring of any PHP code", "description": "Instant Upgrade and Automated Refactoring of any PHP code",
"keywords": [
"automation",
"dev",
"migration",
"refactoring"
],
"support": { "support": {
"issues": "https://github.com/rectorphp/rector/issues", "issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/0.15.0" "source": "https://github.com/rectorphp/rector/tree/1.0.5"
}, },
"funding": [ "funding": [
{ {
@ -239,36 +246,36 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-12-04T22:40:18+00:00" "time": "2024-05-10T05:31:15+00:00"
}, },
{ {
"name": "slevomat/coding-standard", "name": "slevomat/coding-standard",
"version": "8.6.4", "version": "8.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/slevomat/coding-standard.git", "url": "https://github.com/slevomat/coding-standard.git",
"reference": "8a02c83e59c3230a2a4367b29956a2f2b56e3a24" "reference": "7d1d957421618a3803b593ec31ace470177d7817"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/slevomat/coding-standard/zipball/8a02c83e59c3230a2a4367b29956a2f2b56e3a24", "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817",
"reference": "8a02c83e59c3230a2a4367b29956a2f2b56e3a24", "reference": "7d1d957421618a3803b593ec31ace470177d7817",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0",
"php": "^7.2 || ^8.0", "php": "^7.2 || ^8.0",
"phpstan/phpdoc-parser": ">=1.11.0 <1.14.0", "phpstan/phpdoc-parser": "^1.23.1",
"squizlabs/php_codesniffer": "^3.7.1" "squizlabs/php_codesniffer": "^3.9.0"
}, },
"require-dev": { "require-dev": {
"phing/phing": "2.17.4", "phing/phing": "2.17.4",
"php-parallel-lint/php-parallel-lint": "1.3.2", "php-parallel-lint/php-parallel-lint": "1.3.2",
"phpstan/phpstan": "1.4.10|1.9.2", "phpstan/phpstan": "1.10.60",
"phpstan/phpstan-deprecation-rules": "1.0.0", "phpstan/phpstan-deprecation-rules": "1.1.4",
"phpstan/phpstan-phpunit": "1.0.0|1.2.2", "phpstan/phpstan-phpunit": "1.3.16",
"phpstan/phpstan-strict-rules": "1.4.4", "phpstan/phpstan-strict-rules": "1.5.2",
"phpunit/phpunit": "7.5.20|8.5.21|9.5.26" "phpunit/phpunit": "8.5.21|9.6.8|10.5.11"
}, },
"type": "phpcodesniffer-standard", "type": "phpcodesniffer-standard",
"extra": { "extra": {
@ -278,7 +285,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"SlevomatCodingStandard\\": "SlevomatCodingStandard" "SlevomatCodingStandard\\": "SlevomatCodingStandard/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -292,7 +299,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/slevomat/coding-standard/issues", "issues": "https://github.com/slevomat/coding-standard/issues",
"source": "https://github.com/slevomat/coding-standard/tree/8.6.4" "source": "https://github.com/slevomat/coding-standard/tree/8.15.0"
}, },
"funding": [ "funding": [
{ {
@ -304,20 +311,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2022-11-14T09:26:24+00:00" "time": "2024-03-09T15:20:58+00:00"
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "3.7.1", "version": "3.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480",
"reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -327,11 +334,11 @@
"php": ">=5.4.0" "php": ">=5.4.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
}, },
"bin": [ "bin": [
"bin/phpcs", "bin/phpcbf",
"bin/phpcbf" "bin/phpcs"
], ],
"type": "library", "type": "library",
"extra": { "extra": {
@ -346,52 +353,75 @@
"authors": [ "authors": [
{ {
"name": "Greg Sherwood", "name": "Greg Sherwood",
"role": "lead" "role": "Former lead"
},
{
"name": "Juliette Reinders Folmer",
"role": "Current lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
} }
], ],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
"keywords": [ "keywords": [
"phpcs", "phpcs",
"standards" "standards",
"static analysis"
], ],
"support": { "support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer", "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
"wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
}, },
"time": "2022-06-18T07:21:10+00:00" "funding": [
{
"url": "https://github.com/PHPCSStandards",
"type": "github"
},
{
"url": "https://github.com/jrfnl",
"type": "github"
},
{
"url": "https://opencollective.com/php_codesniffer",
"type": "open_collective"
}
],
"time": "2024-04-23T20:25:34+00:00"
}, },
{ {
"name": "symplify/easy-coding-standard", "name": "symplify/easy-coding-standard",
"version": "11.1.17", "version": "12.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symplify/easy-coding-standard.git", "url": "https://github.com/easy-coding-standard/easy-coding-standard.git",
"reference": "2a98e5b976a3ab573d8e5604d6eb39d9f5783760" "reference": "0d7c2cfee3debdf11c12135e90d69d1d9f4eef03"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symplify/easy-coding-standard/zipball/2a98e5b976a3ab573d8e5604d6eb39d9f5783760", "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/0d7c2cfee3debdf11c12135e90d69d1d9f4eef03",
"reference": "2a98e5b976a3ab573d8e5604d6eb39d9f5783760", "reference": "0d7c2cfee3debdf11c12135e90d69d1d9f4eef03",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2" "php": ">=7.2"
}, },
"conflict": { "conflict": {
"friendsofphp/php-cs-fixer": "<3.0", "friendsofphp/php-cs-fixer": "<3.46",
"squizlabs/php_codesniffer": "<3.6" "phpcsstandards/php_codesniffer": "<3.8",
"symplify/coding-standard": "<12.1"
},
"suggest": {
"ext-dom": "Needed to support checkstyle output format in class CheckstyleOutputFormatter"
}, },
"bin": [ "bin": [
"bin/ecs" "bin/ecs"
], ],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-main": "10.3-dev"
}
},
"autoload": { "autoload": {
"files": [ "files": [
"bootstrap.php" "bootstrap.php"
@ -401,9 +431,16 @@
"license": [ "license": [
"MIT" "MIT"
], ],
"description": "Prefixed scoped version of ECS package", "description": "Use Coding Standard with 0-knowledge of PHP-CS-Fixer and PHP_CodeSniffer",
"keywords": [
"Code style",
"automation",
"fixer",
"static analysis"
],
"support": { "support": {
"source": "https://github.com/symplify/easy-coding-standard/tree/11.1.17" "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues",
"source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.3.5"
}, },
"funding": [ "funding": [
{ {
@ -415,7 +452,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-11-10T15:20:49+00:00" "time": "2024-08-08T08:43:50+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
@ -424,7 +461,9 @@
"stability-flags": [], "stability-flags": [],
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": {
"php": "^8.3"
},
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }

View file

@ -1,11 +1,15 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
use PhpCsFixer\Fixer\Basic\BracesFixer; use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer; use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer;
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
use PhpCsFixer\Fixer\Operator\NewWithParenthesesFixer;
use PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer;
use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer; use PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer; use PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer;
use SlevomatCodingStandard\Sniffs\Attributes\AttributeAndTargetSpacingSniff;
use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff; use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff;
use SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff; use SlevomatCodingStandard\Sniffs\ControlStructures\NewWithoutParenthesesSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff; use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff;
@ -18,44 +22,38 @@ use SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff; use SlevomatCodingStandard\Sniffs\TypeHints\UnionTypeHintFormatSniff;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer; use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $c): void { return ECSConfig::configure()
$c->skip([ ->withPreparedSets(
BlankLineAfterOpeningTagFixer::class, symplify: true,
NewWithBracesFixer::class, arrays: true,
OrderedImportsFixer::class, comments: true,
]); docblocks: true,
spaces: true,
$c->sets([ namespaces: true,
SetList::ARRAY, controlStructures: true,
SetList::CLEAN_CODE, strict: true,
SetList::COMMENTS, cleanCode: true
SetList::COMMON, )
SetList::CONTROL_STRUCTURES, ->withPhpCsFixerSets(
SetList::DOCBLOCK, perCS: true,
SetList::NAMESPACES, perCSRisky: true,
SetList::PSR_12, php80MigrationRisky: true,
SetList::SPACES, php83Migration: true,
SetList::STRICT, )
SetList::SYMPLIFY, ->withRules([
]);
// force visibility declaration on class constants
$c->ruleWithConfiguration(ClassConstantVisibilitySniff::class, [
'fixable' => true,
]);
// sort all use statements
$c->rules([
AlphabeticallySortedUsesSniff::class, AlphabeticallySortedUsesSniff::class,
DisallowGroupUseSniff::class, DisallowGroupUseSniff::class,
MultipleUsesPerLineSniff::class, MultipleUsesPerLineSniff::class,
NamespaceSpacingSniff::class, NamespaceSpacingSniff::class,
]); OperatorLinebreakFixer::class,
NoWhitespaceInBlankLineFixer::class,
// import all namespaces, and event php core functions and classes NewWithoutParenthesesSniff::class,
$c->ruleWithConfiguration( ])
->withConfiguredRule(ClassConstantVisibilitySniff::class, [
'fixable' => true,
])
->withConfiguredRule(
ReferenceUsedNamesOnlySniff::class, ReferenceUsedNamesOnlySniff::class,
[ [
'allowFallbackGlobalConstants' => false, 'allowFallbackGlobalConstants' => false,
@ -68,46 +66,57 @@ return static function (ECSConfig $c): void {
'allowFullyQualifiedNameForCollidingFunctions' => true, 'allowFullyQualifiedNameForCollidingFunctions' => true,
'searchAnnotations' => true, 'searchAnnotations' => true,
] ]
); )
// define newlines between use statements // define newlines between use statements
$c->ruleWithConfiguration(UseSpacingSniff::class, [ ->withConfiguredRule(
'linesCountAfterLastUse' => 1, UseSpacingSniff::class,
'linesCountBeforeFirstUse' => 1, [
'linesCountBetweenUseTypes' => 1, 'linesCountAfterLastUse' => 1,
]); 'linesCountBeforeFirstUse' => 1,
'linesCountBetweenUseTypes' => 1,
// strict types declaration should be on same line as opening tag ]
$c->ruleWithConfiguration( )
->withConfiguredRule(
ClassAttributesSeparationFixer::class,
[
'elements' => [
'const' => 'none',
'method' => 'one',
'property' => 'none',
'trait_import' => 'none',
'case' => 'none',
],
],
)->withConfiguredRule(
DeclareStrictTypesSniff::class, DeclareStrictTypesSniff::class,
[ [
'declareOnFirstLine' => true, 'declareOnFirstLine' => true,
'spacesCountAroundEqualsSign' => 0, 'spacesCountAroundEqualsSign' => 0,
] ]
); )
->withConfiguredRule(
// disallow ?Foo typehint in favor of Foo|null UnionTypeHintFormatSniff::class,
$c->ruleWithConfiguration(UnionTypeHintFormatSniff::class, [ [
'nullPosition' => 'last', 'nullPosition' => 'last',
'shortNullable' => 'no', 'shortNullable' => 'no',
'withSpaces' => 'no', 'withSpaces' => 'no',
]); ]
)
// Remove useless parentheses in new statements ->withConfiguredRule(
$c->rule(BracesFixer::class);
$c->rule(NewWithoutParenthesesSniff::class);
// do not inline short multilinestatements
$c->ruleWithConfiguration(LineLengthFixer::class, [
LineLengthFixer::INLINE_SHORT_LINES => false,
]);
$c->ruleWithConfiguration(
NoExtraBlankLinesFixer::class, NoExtraBlankLinesFixer::class,
[ [
'tokens' => ['square_brace_block', 'return', 'extra'], 'tokens' => ['square_brace_block', 'return', 'extra'],
] ]
); )
->withConfiguredRule(AttributeAndTargetSpacingSniff::class, [
$c->rule(NoWhitespaceInBlankLineFixer::class); 'linesCount' => 0,
}; ])
->withSkip([
BlankLineAfterOpeningTagFixer::class,
OrderedImportsFixer::class,
FunctionToConstantFixer::class,
NewWithParenthesesFixer::class,
NewWithBracesFixer::class,
LineLengthFixer::class,
]);

View file

@ -4,6 +4,7 @@ use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector; use Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector;
use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector; use Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector; use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\FuncCall\InlineIsAInstanceOfRector; use Rector\CodeQuality\Rector\FuncCall\InlineIsAInstanceOfRector;
use Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector; use Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector;
use Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector; use Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector;
@ -13,78 +14,79 @@ use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector; use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector; use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
use Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector; use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector;
use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector; use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector;
use Rector\Set\ValueObject\LevelSetList; use Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector; use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnDirectArrayRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictBoolReturnExprRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictConstantReturnRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector;
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\FunctionLike\AddParamTypeSplFixedArrayRector;
use Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector; use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector;
use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector;
return static function (RectorConfig $c): void { return RectorConfig::configure()
$c->sets([LevelSetList::UP_TO_PHP_81]); ->withPhpSets(php83: true)
$c->rules([ ->withPreparedSets(
AddArrayParamDocTypeRector::class, deadCode: true,
AddArrayReturnDocTypeRector::class, codeQuality: true,
typeDeclarations: true,
earlyReturn: true,
strictBooleans: true,
)
->withRules([
AddArrowFunctionReturnTypeRector::class, AddArrowFunctionReturnTypeRector::class,
AddClosureReturnTypeRector::class,
AddMethodCallBasedStrictParamTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class,
AddParamTypeFromPropertyTypeRector::class,
AddParamTypeSplFixedArrayRector::class,
AddReturnTypeDeclarationBasedOnParentClassMethodRector::class, AddReturnTypeDeclarationBasedOnParentClassMethodRector::class,
AddReturnTypeDeclarationFromYieldsRector::class,
BooleanNotIdenticalToNotIdenticalRector::class, BooleanNotIdenticalToNotIdenticalRector::class,
ChangeAndIfToEarlyReturnRector::class,
ChangeNestedForeachIfsToEarlyContinueRector::class, ChangeNestedForeachIfsToEarlyContinueRector::class,
ChangeNestedIfsToEarlyReturnRector::class, ChangeNestedIfsToEarlyReturnRector::class,
ChangeOrIfContinueToMultiContinueRector::class, ChangeOrIfContinueToMultiContinueRector::class,
ChangeOrIfReturnToEarlyReturnRector::class, ClassOnThisVariableObjectRector::class,
CountArrayToEmptyArrayComparisonRector::class, CountArrayToEmptyArrayComparisonRector::class,
ExplicitBoolCompareRector::class, ExplicitBoolCompareRector::class,
InlineArrayReturnAssignRector::class, InlineArrayReturnAssignRector::class,
InlineIsAInstanceOfRector::class, InlineIsAInstanceOfRector::class,
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class, NewlineBeforeNewAssignSetRector::class,
NullableCompareToNullRector::class, NullableCompareToNullRector::class,
ParamTypeByMethodCallTypeRector::class, ParamTypeByMethodCallTypeRector::class,
ParamTypeByParentCallTypeRector::class, ParamTypeByParentCallTypeRector::class,
ParamTypeFromStrictTypedPropertyRector::class,
PreparedValueToEarlyReturnRector::class, PreparedValueToEarlyReturnRector::class,
ReplaceMultipleBooleanNotRector::class, ReplaceMultipleBooleanNotRector::class,
ReturnBinaryAndToEarlyReturnRector::class,
ReturnBinaryOrToEarlyReturnRector::class, ReturnBinaryOrToEarlyReturnRector::class,
ReturnEarlyIfVariableRector::class, ReturnEarlyIfVariableRector::class,
ReturnTypeDeclarationRector::class, ReturnTypeFromReturnDirectArrayRector::class,
ReturnTypeFromReturnNewRector::class, ReturnTypeFromReturnNewRector::class,
ReturnTypeFromStrictBoolReturnExprRector::class, ReturnTypeFromStrictConstantReturnRector::class,
ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNativeCallRector::class,
ReturnTypeFromStrictNewArrayRector::class, ReturnTypeFromStrictNewArrayRector::class,
ReturnTypeFromStrictTypedCallRector::class,
ReturnTypeFromStrictTypedPropertyRector::class, ReturnTypeFromStrictTypedPropertyRector::class,
SimplifyConditionsRector::class, SimplifyConditionsRector::class,
SimplifyEmptyArrayCheckRector::class, SimplifyEmptyArrayCheckRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
StaticArrowFunctionRector::class, StaticArrowFunctionRector::class,
StaticClosureRector::class, StaticClosureRector::class,
ThrowWithPreviousExceptionRector::class, ThrowWithPreviousExceptionRector::class,
TypedPropertyFromStrictConstructorRector::class, TypedPropertyFromStrictConstructorRector::class,
TypedPropertyFromStrictGetterMethodReturnTypeRector::class, RemoveAlwaysElseRector::class,
]); ])
}; ;

18
ecs.php
View file

@ -3,13 +3,11 @@
use Lubiana\CodeQuality\LubiSetList; use Lubiana\CodeQuality\LubiSetList;
use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\Config\ECSConfig;
return static function (ECSConfig $c): void { return ECSConfig::configure()
$c->paths([ ->withSets([LubiSetList::ECS])
__DIR__ . '/src', ->withPaths(
__DIR__ . '/config', [
__DIR__ . '/rector.php', __DIR__ . '/src',
__DIR__ . '/ecs.php', __DIR__ . '/config',
]); ]
)->withRootFiles();
$c->sets([LubiSetList::ECS]);
};

View file

@ -3,13 +3,11 @@
use Lubiana\CodeQuality\LubiSetList; use Lubiana\CodeQuality\LubiSetList;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
return static function (RectorConfig $c): void { return RectorConfig::configure()
$c->paths([ ->withPaths([
__DIR__ . '/src', __DIR__ . '/src',
__DIR__ . '/config', __DIR__ . '/config',
__DIR__ . '/rector.php', ])
__DIR__ . '/ecs.php', ->withSets([LubiSetList::RECTOR])
]); ->withRootFiles()
;
$c->sets([LubiSetList::RECTOR]);
};

View file

@ -4,7 +4,6 @@ namespace Lubiana\CodeQuality;
final class LubiSetList final class LubiSetList
{ {
public const RECTOR = __DIR__ . '/../config/rector.php'; public const string RECTOR = __DIR__ . '/../config/rector.php';
public const string ECS = __DIR__ . '/../config/ecs.php';
public const ECS = __DIR__ . '/../config/ecs.php';
} }

View file

@ -1,17 +0,0 @@
<?php declare(strict_types=1);
namespace Lubiana\CodeQuality;
/** @deprecated use LubiSetList */
final class SetList
{
/**
* @deprecated use LubiSetList::RECTOR
*/
public const RECTOR = LubiSetList::RECTOR;
/**
* @deprecated use LubiSetList::ECS
*/
public const ECS = LubiSetList::ECS;
}