File tree Expand file tree Collapse file tree 7 files changed +74
-9
lines changed Expand file tree Collapse file tree 7 files changed +74
-9
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515 - Upstream projects not having phpunit installed will install phpunit with an @stable version.
1616- Added support for Drupal configuration and templates.
1717- Migration docs for migration from v2 to v3 of the testing suite.
18- - Option to use PHP CS Fixer instead of PHPCS
19- - Pimcore coding standards with [ PER coding standards] ( https://www.php-fig.org/per/coding-style/ )
20- - Added support for an Allow List within the Security Checker.
18+ - Option to use PHP CS Fixer instead of PHPCS.
19+ - Pimcore coding standards with [ PER coding standards] ( https://www.php-fig.org/per/coding-style/ ) .
20+ - Added support for an Allow List within the Security Checker.
21+ - Pimcore PHPStan default config.
2122
2223### Changed
2324- [ BREAKING] The composer.json configurations ` config.youwe-testing-suite.type ` and ` config.mediact-testing-suite.type `
Original file line number Diff line number Diff line change @@ -9,6 +9,4 @@ parameters:
99 phpcs.enabled : false
1010 phpcsfixer.enabled : true
1111
12- # securitychecker.allow_list:
13- # - CVE-2002-0121 # Add a jira ticket indicating when this vulnerability will be fixed (update/upgrade will be
14- # performed). Within that ticket explain this (new) vulnerability.
12+ phpstan.level : 6
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ // Using same bootstrap as Pimcore (Bundles) uses themselves for PHPStan
6+ // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
7+
8+ if (file_exists (__DIR__ . '/../../../../../vendor/autoload.php ' )) {
9+ define ('PIMCORE_PROJECT_ROOT ' , __DIR__ . '/../../../../.. ' );
10+ } elseif (getenv ('PIMCORE_PROJECT_ROOT ' )) {
11+ if (file_exists (getenv ('PIMCORE_PROJECT_ROOT ' ) . '/vendor/autoload.php ' )) {
12+ define ('PIMCORE_PROJECT_ROOT ' , getenv ('PIMCORE_PROJECT_ROOT ' ));
13+ } else {
14+ throw new \Exception ('Invalid Pimcore project root " ' . getenv ('PIMCORE_PROJECT_ROOT ' ) . '" ' );
15+ }
16+ } else {
17+ throw new \Exception (
18+ 'Unknown configuration! Pimcore project root not found, please set env variable PIMCORE_PROJECT_ROOT. '
19+ );
20+ }
21+
22+ include PIMCORE_PROJECT_ROOT . '/vendor/autoload.php ' ;
23+ \Pimcore \Bootstrap::setProjectRoot ();
24+ \Pimcore \Bootstrap::bootstrap ();
25+
26+ if (!defined ('PIMCORE_TEST ' )) {
27+ define ('PIMCORE_TEST ' , true );
28+ }
Original file line number Diff line number Diff line change 11parameters :
22 excludePaths :
3+ - config/pimcore/phpstan-bootstrap.php
34 - src/installers.php
45 - tests/*
56 ignoreErrors :
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ class PackagesInstaller implements InstallerInterface
5555 'updateDependencies ' => true ,
5656 ]
5757 ],
58+ 'pimcore ' => [
59+ 'phpstan/phpstan-symfony ' => [
60+ 'version ' => '@stable ' ,
61+ 'updateDependencies ' => true ,
62+ ],
63+ ],
5864 ];
5965
6066 /**
Original file line number Diff line number Diff line change 11imports :
2- - resource : ' vendor/youwe/testing-suite/config/pimcore/grumphp.yml'
2+ - resource : ' vendor/youwe/testing-suite/config/pimcore/grumphp.yml'
3+
4+ parameters :
5+ # phpstan.level: 6 # The default PHPStan level for Pimcore is 6, but you might want to lower it for your project
6+ # when you're working towards stricter rules (and then increment it with every refactoring).
7+ # See https://phpstan.org/user-guide/rule-levels for more explanation about the different levels.
8+ # - For Pimcore 10.4 till 10.x: suggest to use level 5 maximum
9+ # - For Pimcore 10.0 till 10.3.x: suggest to use level 4 maximum
10+
11+ # securitychecker.allow_list:
12+ # - CVE-2002-0121 # Add a jira ticket indicating when this vulnerability will be fixed (update/upgrade will be
13+ # performed). Within that ticket explain this (new) vulnerability.
Original file line number Diff line number Diff line change 1+ includes :
2+ - vendor/phpstan/phpstan-symfony/extension.neon
3+
14parameters :
2- excludes_analyse :
3- # - %rootDir%/../../../path/to/exclude/*
5+ excludePaths :
6+ # Symfony files
7+ - %rootDir%/../../../bin/console
8+ - %rootDir%/../../../public/index.php
9+ # Full var folder, contains all kind of auto-generated files (e.g. cache, generated Pimcore DataObject classes)
10+ - %rootDir%/../../../var/*
11+ # Configuration written by Pimcore (which is written either to var/ or to config/pimcore/ depending on settings)
12+ - %rootDir%/../../../config/pimcore/*
13+ # Unit tests
14+ - %rootDir%/../../../tests/fixtures/*
15+ # Deployer (which would be nice if it is correct too, but does need its own composer install, therefore excluding)
16+ - %rootDir%/../../../build/deployer/*
17+
18+ # Custom excludes
19+ # - %rootDir%/../../../path/to/exclude/*
20+
21+ # Point PHPStan to internal constants that are bootstrapped
22+ bootstrapFiles :
23+ - ./vendor/youwe/testing-suite/config/pimcore/phpstan-bootstrap.php
You can’t perform that action at this time.
0 commit comments