diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 43b5820b..499e651c 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,14 +24,14 @@ jobs: fail-fast: false matrix: # quotes are needed it is treated as a number and zero at decimal part is gone at runtime - laravel: ["9.x"] - php: ["8.0", "8.1"] + laravel: ["11.x"] + php: ["8.2"] runs-on: ubuntu-latest steps: - name: "Checkout repository..." - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/marketplace/actions/composer-php-actions - name: "Installing dependencies..." diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 251f4e05..0b00a8cb 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -26,15 +26,16 @@ jobs: # do not stop the workflow if single run failed fail-fast: false matrix: - # quotes are needed it is treated as a number and zero at decimal part is gone at runtime - laravel: ["9.x"] - php: ["8.0", "8.1"] + # quotes are needed it is treated as a number and zero at decimal part is gone + # at runtime i.e. 8.10 -> 8.1, while "8.10" => "8.10". + laravel: ["11.0"] + php: ["8.2"] runs-on: ubuntu-latest steps: - name: "Checkout repository..." - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/marketplace/actions/composer-php-actions - name: "Installing dependencies..." diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 9ce6ff8b..a729a09d 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # https://github.com/marketplace/actions/my-markdown-linter - name: "Running markdown linter..." diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 4a989368..7008a303 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -26,15 +26,16 @@ jobs: # do not stop the workflow if single run failed fail-fast: false matrix: - # quotes are needed it is treated as a number and zero at decimal part is gone at runtime - laravel: ["10.x"] - php: ["8.1"] + # quotes are needed it is treated as a number and zero at decimal part is gone + # at runtime i.e. 8.10 -> 8.1, while "8.10" => "8.10". + laravel: ["11.0"] + php: ["8.2"] runs-on: ubuntu-latest steps: - name: "Checkout repository..." - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/marketplace/actions/composer-php-actions - name: "Installing dependencies..." diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index d011af56..d9fd26c4 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -26,15 +26,16 @@ jobs: # do not stop the workflow if single run failed fail-fast: false matrix: - # quotes are needed it is treated as a number and zero at decimal part is gone at runtime - laravel: ["10.x"] - php: ["8.1"] + # quotes are needed it is treated as a number and zero at decimal part is gone + # at runtime i.e. 8.10 -> 8.1, while "8.10" => "8.10". + laravel: ["11.0"] + php: ["8.2"] runs-on: ubuntu-latest steps: - name: "Checkout repository..." - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/marketplace/actions/composer-php-actions - name: "Installing dependencies..." @@ -44,12 +45,9 @@ jobs: php_version: "${{ matrix.php }}" dev: yes - # https://github.com/marketplace/actions/phpunit-php-actions - name: "Running PHPUnit..." - uses: php-actions/phpunit@v3 - with: - bootstrap: "vendor/autoload.php" - configuration: "tests/phpunit.xml" - # version: "10.0.89" - # memory_limit: "16M" - php_version: "${{ matrix.php }}" + shell: bash + run: | + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + /usr/local/bin/composer install --no-interaction + /usr/local/bin/composer test diff --git a/composer.json b/composer.json index 7f7d77f5..5480e683 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "marcin-orlowski/laravel-api-response-builder", "description": "Helps building nice, normalized and easy to consume Laravel REST API.", "homepage": "https://github.com/MarcinOrlowski/laravel-api-response-builder", - "version": "10.0.0", + "version": "11.0.0", "keywords": [ "laravel", "laravel10", @@ -13,7 +13,8 @@ "helper", "php", "php8", - "php81", + "php82", + "php83", "mobile", "android", "ios" @@ -44,19 +45,29 @@ } }, "require": { - "php": "^8.1|^8.2", - "laravel/framework": "^10.0" + "php": "^8.2|^8.3", + "laravel/framework": "^11.0" }, "require-dev": { "marcin-orlowski/phpunit-extra-asserts": "^5.1.0", - "orchestra/testbench": "^8.0", - "phpunit/phpunit": "^10.0.0", - "phpunit/php-code-coverage": "^10.0", - "nunomaduro/larastan": "^2.0", - "marcin-orlowski/php-lockpick": "^1.0" + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^11.0", + "phpunit/php-code-coverage": "^11.0", + "larastan/larastan": "^2.0", + "marcin-orlowski/lockpick": "^1.0" }, "scripts": { - "test": "vendor/bin/phpunit -c tests/phpunit.xml", - "mdlint": "markdownlint --config .markdownlint.yaml --ignore vendor **/*.md .github/**/*.md docs README.md" + "test": [ + "Composer\\Config::disableProcessTimeout", + "vendor/bin/phpunit -c tests/phpunit.xml" + ], + "lint": [ + "Composer\\Config::disableProcessTimeout", + "vendor/bin/phpstan analyse --no-progress --no-interaction -c phpstan.neon" + ], + "mdlint": [ + "Composer\\Config::disableProcessTimeout", + "markdownlint --config .markdownlint.yaml --ignore vendor **/*.md .github/**/*.md docs README.md" + ] } } diff --git a/docs/CHANGES.md b/docs/CHANGES.md index df0b07e2..99f05b4a 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -18,6 +18,10 @@ should be able to easily backport future new features to older versions rather e ## CHANGE LOG ## +* dev + * Added support for Laravel v11. + * Corrected documentation (thanks to Ehsan Soleimanian) + * v10.0.0 (2023-02-20) * **BACKWARD INCOMPATIBLE CHANGES** ([more info](compatibility.md)). * Added support for Laravel v10. diff --git a/docs/exceptions.md b/docs/exceptions.md index 07aa0903..c67fa233 100644 --- a/docs/exceptions.md +++ b/docs/exceptions.md @@ -49,7 +49,7 @@ use MarcinOrlowski\ResponseBuilder\ExceptionHandlerHelper; public function register() { $this->renderable(function (Throwable $ex, $request) { - return ExceptionHandlerHelper::handle($ex, $request); + return ExceptionHandlerHelper::render($request ,$ex ); }); } ``` diff --git a/phpstan.neon b/phpstan.neon index 80b81152..516f2bed 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -10,7 +10,7 @@ ################################################################################## includes: - - vendor/nunomaduro/larastan/extension.neon + - vendor/larastan/larastan/extension.neon parameters: checkGenericClassInNonGenericObjectType: false level: max diff --git a/tests/phpunit/Models/TestModelJsonSerializable.php b/tests/phpunit/Models/TestModelJsonSerializable.php index b56f14d2..4622bc67 100644 --- a/tests/phpunit/Models/TestModelJsonSerializable.php +++ b/tests/phpunit/Models/TestModelJsonSerializable.php @@ -29,6 +29,7 @@ public function __construct(protected mixed $val) {} public function getVal(): string { + /** @phpstan-ignore-next-line */ return $this->val; }