diff --git a/.gitignore b/.gitignore index 2ad28e1..69ae8d8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /.couscous/ /vendor/ Makefile -.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 d87f263..6e131c8 100644 --- a/composer.json +++ b/composer.json @@ -14,18 +14,37 @@ "homepage": "https://github.com/Respect/Relational/graphs/contributors" } ], + "config": { + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, "require": { "php": ">=8.5.0", "respect/data": "dev-master" }, "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..0572243 --- /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..6250649 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,11 @@ +parameters: + level: 1 + paths: + - library/ + - tests/ + ignoreErrors: + - message: '/Call to an undefined static method Respect\\Relational\\Sql::\w+\(\)\./' + - message: '/Call to an undefined static method Respect\\Data\\Collections\\(Collection|Filtered|Mix|Typed)::\w+\(\)\./' + - message: '/Unsafe usage of new static\(\)\./' + - message: '/Cannot unset property .+ because it might have hooks in a subclass\./' + - message: '/Array has \d+ duplicate keys/'