File tree Expand file tree Collapse file tree 8 files changed +34
-12
lines changed
lib/Doctrine/Persistence/Mapping/Driver
tests/Doctrine/Tests/Persistence/Mapping Expand file tree Collapse file tree 8 files changed +34
-12
lines changed Original file line number Diff line number Diff line change 1414 name : " Coding Standards"
1515 uses :
" doctrine/.github/.github/workflows/[email protected] " 1616 with :
17- composer-root-version : " 2.2 "
18- php-version : " 7.4 "
17+ composer-root-version : " 2.3 "
18+ php-version : " 8.1 "
Original file line number Diff line number Diff line change 1414 name : " Static Analysis"
1515 uses :
" doctrine/.github/.github/workflows/[email protected] " 1616 with :
17- composer-root-version : " 2.2 "
18- php-version : " 7.4 "
17+ composer-root-version : " 2.3 "
18+ php-version : " 8.1 "
Original file line number Diff line number Diff line change 2929 },
3030 "require-dev" : {
3131 "composer/package-versions-deprecated" : " ^1.11" ,
32- "phpstan/phpstan" : " 1.2.0 " ,
32+ "phpstan/phpstan" : " 1.4.6 " ,
3333 "doctrine/annotations" : " ^1.0" ,
34- "doctrine/coding-standard" : " ^6.0 || ^ 9.0" ,
34+ "doctrine/coding-standard" : " ^9.0" ,
3535 "doctrine/common" : " ^3.0" ,
36- "phpunit/phpunit" : " ^7.5.20 || ^8.0 || ^9.0 " ,
37- "symfony/cache" : " ^4.4 || ^5.0 || ^6.0" ,
38- "vimeo/psalm" : " 4.20 .0"
36+ "phpunit/phpunit" : " ^7.5.20 || ^8.5 || ^9.5 " ,
37+ "symfony/cache" : " ^4.4 || ^5.4 || ^6.0" ,
38+ "vimeo/psalm" : " 4.21 .0"
3939 },
4040 "conflict" : {
4141 "doctrine/annotations" : " <1.0 || >=2.0" ,
42- "doctrine/common" : " <2.10@dev "
42+ "doctrine/common" : " <2.10"
4343 },
4444 "autoload" : {
4545 "psr-4" : {
5252 "Doctrine\\ Tests\\ " : " tests/Doctrine/Tests" ,
5353 "Doctrine\\ Tests_PHP74\\ " : " tests/Doctrine/Tests_PHP74"
5454 }
55+ },
56+ "config" : {
57+ "allow-plugins" : {
58+ "dealerdirect/phpcodesniffer-composer-installer" : true
59+ }
5560 }
5661}
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ public function getAllClassNames()
220220 foreach ($ iterator as $ file ) {
221221 $ sourceFile = $ file [0 ];
222222
223- if (! preg_match ('(^phar:)i ' , $ sourceFile )) {
223+ if (preg_match ('(^phar:)i ' , $ sourceFile ) === 0 ) {
224224 $ sourceFile = realpath ($ sourceFile );
225225 }
226226
Original file line number Diff line number Diff line change 99 <!-- Ignore warnings and show progress of the run -->
1010 <arg value =" nps" />
1111
12+ <config name =" php_version" value =" 70100" />
13+
1214 <file >lib</file >
1315 <file >tests</file >
1416
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ includes:
33
44parameters :
55 level : 7
6+ phpVersion : 80100
67
78 paths :
89 - lib
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<psalm
33 errorLevel =" 3"
4+ phpVersion =" 8.1"
45 findUnusedPsalmSuppress =" true"
56 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
67 xmlns =" https://getpsalm.org/schema/config"
Original file line number Diff line number Diff line change 77use Doctrine \Persistence \Mapping \ClassMetadata ;
88use Doctrine \Persistence \Mapping \Driver \AnnotationDriver ;
99use Doctrine \TestClass ;
10+ use Generator ;
1011use PHPUnit \Framework \TestCase ;
1112
1213class AnnotationDriverTest extends TestCase
1314{
14- public function testGetAllClassNames (): void
15+ /**
16+ * @dataProvider pathProvider
17+ */
18+ public function testGetAllClassNames (string $ path ): void
1519 {
1620 $ reader = new AnnotationReader ();
1721 $ driver = new SimpleAnnotationDriver ($ reader , [__DIR__ . '/_files/annotation ' ]);
@@ -20,6 +24,15 @@ public function testGetAllClassNames(): void
2024
2125 self ::assertSame ([TestClass::class], $ classes );
2226 }
27+
28+ /**
29+ * @return Generator<string, array{string}>
30+ */
31+ public function pathProvider (): Generator
32+ {
33+ yield 'straigthforward path ' => [__DIR__ . '/_files/annotation ' ];
34+ yield 'winding path ' => [__DIR__ . '/../Mapping/_files/annotation ' ];
35+ }
2336}
2437
2538class SimpleAnnotationDriver extends AnnotationDriver
You can’t perform that action at this time.
0 commit comments