From ff21da2c1feeb2e3f8e78a56f4a524ff903b4d57 Mon Sep 17 00:00:00 2001 From: Stewart Marsh Date: Fri, 22 Nov 2024 13:46:17 +0000 Subject: [PATCH 1/4] feat: Add support for PHPStan 2.0 fix: PHPStan errors chore: normalize composer.json --- composer.json | 74 +++++++++++++++++++++---------------------- phpstan-baseline.neon | 39 +++++++++++++++++++++++ phpstan.neon.dist | 6 ---- 3 files changed, 76 insertions(+), 43 deletions(-) diff --git a/composer.json b/composer.json index caa7203..bdebe90 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,11 @@ { "name": "spatie/laravel-ray", "description": "Easily debug Laravel apps", + "license": "MIT", "keywords": [ "spatie", "laravel-ray" ], - "homepage": "https://github.com/spatie/laravel-ray", - "license": "MIT", "authors": [ { "name": "Freek Van der Herten", @@ -15,29 +14,42 @@ "role": "Developer" } ], + "homepage": "https://github.com/spatie/laravel-ray", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/spatie" + }, + { + "type": "other", + "url": "https://spatie.be/open-source/support-us" + } + ], "require": { + "php": "^7.4 || ^8.0", "ext-json": "*", - "php": "^7.4|^8.0", - "illuminate/contracts": "^7.20|^8.19|^9.0|^10.0|^11.0", - "illuminate/database": "^7.20|^8.19|^9.0|^10.0|^11.0", - "illuminate/queue": "^7.20|^8.19|^9.0|^10.0|^11.0", - "illuminate/support": "^7.20|^8.19|^9.0|^10.0|^11.0", - "rector/rector": "^0.19.2|^1.0", + "illuminate/contracts": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", + "illuminate/database": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", + "illuminate/queue": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", + "illuminate/support": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", + "rector/rector": "dev-main", "spatie/backtrace": "^1.0", "spatie/ray": "^1.41.1", - "symfony/stopwatch": "4.2|^5.1|^6.0|^7.0", - "zbateson/mail-mime-parser": "^1.3.1|^2.0|^3.0" + "symfony/stopwatch": "4.2 || ^5.1 || ^6.0 || ^7.0", + "zbateson/mail-mime-parser": "^1.3.1 || ^2.0 || ^3.0" }, "require-dev": { "guzzlehttp/guzzle": "^7.3", - "laravel/framework": "^7.20|^8.19|^9.0|^10.0|^11.0", - "orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0|^9.0", - "pestphp/pest": "^1.22|^2.0", - "phpstan/phpstan": "^1.10.57", - "phpunit/phpunit": "^9.3|^10.1", - "spatie/pest-plugin-snapshots": "^1.1|^2.0", - "symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0.3" + "laravel/framework": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", + "orchestra/testbench-core": "^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "pestphp/pest": "^1.22 || ^2.0", + "phpstan/phpstan": "^1.10.57 || ^2.0.2", + "phpunit/phpunit": "^9.3 || ^10.1", + "spatie/pest-plugin-snapshots": "^1.1 || ^2.0", + "symfony/var-dumper": "^4.2 || ^5.1 || ^6.0 || ^7.0.3" }, + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "Spatie\\LaravelRay\\": "src" @@ -48,17 +60,11 @@ "Spatie\\LaravelRay\\Tests\\": "tests" } }, - "scripts": { - "analyse": "vendor/bin/phpstan", - "test": "vendor/bin/pest", - "test-coverage": "vendor/bin/pest --coverage", - "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" - }, "config": { - "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true - } + }, + "sort-packages": true }, "extra": { "branch-alias": { @@ -70,16 +76,10 @@ ] } }, - "minimum-stability": "dev", - "prefer-stable": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/spatie" - }, - { - "type": "other", - "url": "https://spatie.be/open-source/support-us" - } - ] + "scripts": { + "analyse": "vendor/bin/phpstan --memory-limit=512M -vvv", + "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", + "test": "vendor/bin/pest", + "test-coverage": "vendor/bin/pest --coverage" + } } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6b85c3f..07e0ffb 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15,6 +15,11 @@ parameters: count: 1 path: src/Watchers/ExceptionWatcher.php + - + message: "#^Call to method createReport\\(\\) on an unknown class Spatie\\\\FlareClient\\\\Flare\\.$#" + count: 1 + path: src/Watchers/ExceptionWatcher.php + - message: "#^Call to method trim\\(\\) on an unknown class Facade\\\\FlareClient\\\\Truncation\\\\ReportTrimmer\\.$#" count: 1 @@ -50,3 +55,37 @@ parameters: count: 1 path: src/Watchers/ExceptionWatcher.php + - + message: "#^Access to an undefined property Illuminate\\\\Support\\\\Optional::\\$file.$#" + count: 1 + path: src/OriginFactory.php + + - + message: "#^Access to an undefined property Illuminate\\\\Support\\\\Optional::\\$lineNumber.$#" + count: 1 + path: src/OriginFactory.php + + - + message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional::applyCalledMethods\\(\\).$#" + count: 10 + path: src/ + + - + message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional::getActionName\\(\\).$#" + count: 1 + path: src/Watchers/RequestWatcher.php + + - + message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional::gatherMiddleware\\(\\).$#" + count: 1 + path: src/Watchers/RequestWatcher.php + + - + message: "#^Access to protected property Illuminate\\\\Support\\\\Collection::\\$items.$#" + count: 2 + path: src/RayServiceProvider.php + + - + message: "#^Access to protected property Illuminate\\\\Support\\\\Stringable::\\$value.$#" + count: 2 + path: src/RayServiceProvider.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2c029ab..c5e840f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -11,9 +11,3 @@ parameters: - '#^Call to method \w+\(\) on an unknown class Spatie\\WordPressRay\\Ray\.$#' - '#^Call to method \w+\(\) on an unknown class Spatie\\RayBundle\\Ray\.$#' - '#^Access to an undefined property Spatie\\Ray\\Settings\\Settings\:\:\$\w+\.$#' - - - message: '#^Access to an undefined property Spatie\\LaravelRay\\RayServiceProvider\:\:\$items\.$#' - path: src/RayServiceProvider.php - - - message: '#^Access to an undefined property Spatie\\LaravelRay\\RayServiceProvider\:\:\$value\.$#' - path: src/RayServiceProvider.php From 73152b861cff41f0b86ffe01fd06c3dc2e9745d9 Mon Sep 17 00:00:00 2001 From: Stewart Marsh Date: Fri, 22 Nov 2024 14:15:02 +0000 Subject: [PATCH 2/4] chore: cleanup analyse command --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdebe90..1d8fcf8 100644 --- a/composer.json +++ b/composer.json @@ -77,7 +77,7 @@ } }, "scripts": { - "analyse": "vendor/bin/phpstan --memory-limit=512M -vvv", + "analyse": "vendor/bin/phpstan", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/pest --coverage" From 5abbd977f8137945177b5243e00eba71fb833a98 Mon Sep 17 00:00:00 2001 From: Stewart Marsh Date: Mon, 2 Dec 2024 14:50:53 +0000 Subject: [PATCH 3/4] chore: bump spatie/ray to 1.41.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1d8fcf8..64dbcd7 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "illuminate/support": "^7.20 || ^8.19 || ^9.0 || ^10.0 || ^11.0", "rector/rector": "dev-main", "spatie/backtrace": "^1.0", - "spatie/ray": "^1.41.1", + "spatie/ray": "^1.41.3", "symfony/stopwatch": "4.2 || ^5.1 || ^6.0 || ^7.0", "zbateson/mail-mime-parser": "^1.3.1 || ^2.0 || ^3.0" }, From fd58b0337e265659410130cf98bb26a4a45e31fb Mon Sep 17 00:00:00 2001 From: Stewart Marsh Date: Mon, 2 Dec 2024 14:56:30 +0000 Subject: [PATCH 4/4] chore: Add PHP 8.4 to tests workflow --- .github/workflows/run-tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 99a6493..48fe5c5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php: [8.3, 8.2, 8.1, 8.0, 7.4] + php: [8.4, 8.3, 8.2, 8.1, 8.0, 7.4] laravel: [11.*, 10.*, 9.*, 8.*, 7.*] dependency-version: [prefer-stable] include: @@ -34,12 +34,18 @@ jobs: php: 8.0 - laravel: 10.* php: 7.4 + - laravel: 9.* + php: 8.4 - laravel: 9.* php: 8.3 - laravel: 9.* php: 7.4 + - laravel: 8.* + php: 8.4 - laravel: 8.* php: 8.3 + - laravel: 7.* + php: 8.4 - laravel: 7.* php: 8.3 - laravel: 7.*