diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 406615b..8ab7a4f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -37,3 +37,6 @@ jobs: - name: Run SCA run: composer run-script phpstan + + - name: Run CS + run: composer run-script fix-cs:dry-run diff --git a/.gitignore b/.gitignore index c3fbeb4..0b78b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ vendor/ composer.lock client.php -/.phpunit.result.cache -/.idea/ -/.php_cs.cache +.phpunit.result.cache +.idea/ +.php_cs.cache +.php-cs-fixer.cache diff --git a/CHANGELOG.md b/CHANGELOG.md index ad42bf2..178b84c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v3.0.0 (22. Mar 2022) + +Changes: +- Added full PHP 8 support +- Removed support for pre PHP 7.4 +- Improved the code style and added SCA + - Added type hints +- Copyright updated + ## v2.1.1 (21. Mar 2022) Bug Fixes: diff --git a/composer.json b/composer.json index 6858dd8..98744d6 100644 --- a/composer.json +++ b/composer.json @@ -3,16 +3,20 @@ "description": "Implementation of the Billbee custom shop API in PHP", "type": "library", "require": { - "php": "5.6.* || ^7.0 || ^8.0", + "php": "^7.4 || ^8.0", "psr/http-message": "^1.0", "jms/serializer": "^1.14.0 || ^3.14.0", "ralouphie/getallheaders": "~3.0", - "mintware-de/streams": "^1.0", + "mintware-de/streams": "^2.0.0", "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^7.0 || ^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "^2.15" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^v3.8.0", + "phpstan/phpstan": "^1.4" + }, + "suggest": { + "ext-xdebug": "*" }, "license": "MIT", "authors": [ @@ -32,6 +36,16 @@ "fix-cs": [ "./vendor/bin/php-cs-fixer fix ./src/ --using-cache=no --rules=@PSR2", "./vendor/bin/php-cs-fixer fix ./tests/ --using-cache=no --rules=@PSR2" + ], + "fix-cs:dry-run": [ + "./vendor/bin/php-cs-fixer fix ./src/ --using-cache=no --rules=@PSR2 --dry-run", + "./vendor/bin/php-cs-fixer fix ./tests/ --using-cache=no --rules=@PSR2 --dry-run" + ], + "phpstan": [ + "./vendor/bin/phpstan" + ], + "test": [ + "./vendor/bin/phpunit" ] }, "archive": { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..a4c8812 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: max + paths: + - src + - tests diff --git a/phpunit.xml b/phpunit.xml index 28f7a6a..d45b2c6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@