diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..9c1c04b --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,34 @@ +in(__DIR__) +; + +$header = << +@link https://www.oxidmodule.com +EOF; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PHP80Migration' => true, + '@PSR12' => true, + 'header_comment' => [ + 'comment_type' => 'PHPDoc', + 'header' => $header, + 'location' => 'after_open', + 'separate' => 'both', + ], + 'php_unit_test_class_requires_covers' => true, + 'doctrine_annotation_indentation' => true, +]) + ->setFinder($finder) +; \ No newline at end of file diff --git a/composer.json b/composer.json index 0f3f30d..ddb662f 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=8.0", + "php": "^8.0", "composer/composer": "^2.7.1", "doctrine/collections": "^1.8.0", "guzzlehttp/guzzle": "~7.0", @@ -26,12 +26,23 @@ "phpunit/phpunit": "^9.3", "overtrue/phplint": "^1.2", "squizlabs/php_codesniffer": "3.*", - "phpstan/phpstan": "^1.9" + "phpstan/phpstan": "^2.0", + "friendsofphp/php-cs-fixer": "^3.65" }, "autoload": { "psr-4": { "D3\\KlicktippPhpClient\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "D3\\KlicktippPhpClient\\tests\\": "tests/" + } + }, + "scripts": { + "test": "./vendor/bin/phpunit --no-coverage", + "check-style": "./vendor/bin/php-cs-fixer fix --verbose --dry-run", + "fix-style": "./vendor/bin/php-cs-fixer fix --verbose", + "check-code": "./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --ansi" } } - diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..1fb084b --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + paths: + - src + level: 10 + phpVersion: 80000 \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ddff8e0 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,20 @@ + + + + + src + + + + + + + ./tests + + +