Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.gitignore export-ignore
.phpactor.json export-ignore
CHANGELOG.md export-ignore
composer-dependency-analyser.php export-ignore
docs/ export-ignore
phpstan-baseline.neon export-ignore
phpstan-bootstrap.php export-ignore
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,20 @@ jobs:

- name: Install dependencies
run: |
# The matrix pins below rewrite composer.json for this job only.
# Put the published file back before validate and the dependency analyser.
cp composer.json "$RUNNER_TEMP/composer.json.orig"
composer remove --dev --no-update larastan/larastan phpstan/phpstan-deprecation-rules phpstan/phpstan-phpunit phpstan/extension-installer
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require --dev --no-update "nunomaduro/collision:^8.0"
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --with-all-dependencies
mv "$RUNNER_TEMP/composer.json.orig" composer.json

- name: Validate composer.json
run: composer validate --strict --no-check-lock

- name: Analyse composer dependencies
run: vendor/bin/composer-dependency-analyser

- name: Execute tests
run: vendor/bin/pest
Expand Down
20 changes: 20 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

// orchestra/testbench installs laravel/framework, which replaces illuminate/*.
// Class files from those components are then attributed to laravel/framework,
// and the illuminate packages look unused.
return (new Configuration())
->ignoreErrorsOnPackage('laravel/framework', [ErrorType::SHADOW_DEPENDENCY])
->ignoreErrorsOnPackages(
[
'illuminate/collections',
'illuminate/console',
'illuminate/http',
'illuminate/process',
'illuminate/support',
],
[ErrorType::UNUSED_DEPENDENCY],
);
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"pestphp/pest-plugin-laravel": "^2.3||^3.0||^4.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1||^2.0",
"phpstan/phpstan-phpunit": "^1.3||^2.0"
"phpstan/phpstan-phpunit": "^1.3||^2.0",
"shipmonk/composer-dependency-analyser": "^1.8"
},
"autoload": {
"psr-4": {
Expand Down
Loading