Skip to content

Commit

Permalink
Add composer analyser checker (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neirda24 authored Oct 13, 2024
1 parent 121d8d9 commit 5eebf45
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ jobs:
with:
dependency-versions: '${{ matrix.deps }}'

- name: 'Validate dependencies'
run: './vendor/bin/composer-dependency-analyser --show-all-usages'

- name: 'Run test suite'
run: 'php vendor/bin/phpunit'
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
__DIR__ . '/src',
__DIR__ . '/tests',
])
->notPath('var')
;

return (new PhpCsFixer\Config())
Expand Down
22 changes: 22 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

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

$config = new Configuration();

return $config
->addPathToScan(__DIR__.'/src', isDev: false)
->addPathToScan(__DIR__.'/src/DataCollector', isDev: true)
->addPathToScan(__DIR__.'/src/Debug', isDev: true)
->addPathToScan(__DIR__.'/tests', isDev: true)

->ignoreErrorsOnPackage('symfony/routing', [
ErrorType::DEV_DEPENDENCY_IN_PROD,
])
->ignoreErrorsOnPackage('twig/twig', [
ErrorType::DEV_DEPENDENCY_IN_PROD,
])
;
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,31 @@
"require": {
"php": ">=8.1",
"ext-json": "*",
"psr/container": "^2.0",
"psr/log": "^3.0",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/filesystem": "^6.4 || ^7.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/http-client-contracts": "^3.5",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/mime": "^6.4 || ^7.0",
"symfony/string": "^6.4 || ^7.0"
"symfony/mime": "^6.4 || ^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.41",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^10.4",
"shipmonk/composer-dependency-analyser": "^1.7",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/monolog-bundle": "^3.10",
"symfony/routing": "^6.4 || ^7.0",
"symfony/stopwatch": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/var-dumper": "^6.4 || ^7.0"
"symfony/var-dumper": "^6.4 || ^7.0",
"twig/twig": "^3.14"
},
"config": {
"allow-plugins": {
Expand Down
1 change: 1 addition & 0 deletions tests/Builder/Pdf/AbstractChromiumPdfBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#[CoversClass(AbstractChromiumPdfBuilder::class)]
#[UsesClass(AbstractPdfBuilder::class)]
#[UsesClass(Unit::class)]
#[UsesClass(PaperSize::class)]
#[UsesClass(AssetBaseDirFormatter::class)]
#[UsesClass(GotenbergAssetExtension::class)]
#[UsesClass(PaperSize::class)]
Expand Down

0 comments on commit 5eebf45

Please sign in to comment.