diff --git a/.gitignore b/.gitignore index a0bf9c4..bd0d78a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ composer.lock Makefile /vendor/ -.phpunit.result.cache \ No newline at end of file +.phpunit.result.cache +.phpcs.cache \ No newline at end of file diff --git a/composer.json b/composer.json index b88538e..0e683fc 100644 --- a/composer.json +++ b/composer.json @@ -14,17 +14,36 @@ "homepage": "https://github.com/Respect/Data/graphs/contributors" } ], + "config": { + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, "require": { "php": ">=8.5" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0", + "respect/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "^4.0" }, "autoload": { "psr-4": { "Respect\\": "library/Respect" } }, + "scripts": { + "phpcs": "vendor/bin/phpcs", + "phpstan": "vendor/bin/phpstan analyze", + "phpunit": "vendor/bin/phpunit", + "qa": [ + "@phpcs", + "@phpstan", + "@phpunit" + ] + }, "extra": { "branch-alias": { "dev-master": "3.0-dev" diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..e46b5b1 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,18 @@ + + + + + + + + + + library/ + tests/ + + + diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..863cf16 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,9 @@ +parameters: + level: 1 + paths: + - library/ + - tests/ + ignoreErrors: + - message: '/Call to an undefined static method Respect\\Data\\Collections\\(Collection|Filtered|Mix|Typed)::\w+\(\)\./' + - message: '/Call to an undefined method Respect\\Data\\AbstractMapper::\w+\(\)\./' + - message: '/Unsafe usage of new static\(\)\./'