Skip to content

Commit f94aafb

Browse files
committed
Merge remote-tracking branch 'origin/3.4.x' into 4.1.x
2 parents c2340f0 + f531bae commit f94aafb

File tree

7 files changed

+65
-26
lines changed

7 files changed

+65
-26
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ on:
1212
jobs:
1313
coding-standards:
1414
name: "Coding Standards"
15-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.3.0"
15+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@8.0.0"

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
phpunit:
1414
name: "PHPUnit"
15-
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@7.3.0"
15+
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@8.0.0"
1616
with:
1717
php-versions: '["8.1", "8.2", "8.3", "8.4", "8.5"]'
1818
secrets:

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@7.3.0"
11+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@8.0.0"
1212
secrets:
1313
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1414
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ on:
1212
jobs:
1313
static-analysis:
1414
name: "Static Analysis"
15-
uses: "doctrine/.github/.github/workflows/phpstan.yml@7.3.0"
15+
uses: "doctrine/.github/.github/workflows/phpstan.yml@8.0.0"

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"psr/cache": "^1.0 || ^2.0 || ^3.0"
2626
},
2727
"require-dev": {
28-
"phpstan/phpstan": "1.12.7",
29-
"phpstan/phpstan-phpunit": "^1",
30-
"phpstan/phpstan-strict-rules": "^1.6",
31-
"doctrine/coding-standard": "^12",
28+
"phpstan/phpstan": "2.1.30",
29+
"phpstan/phpstan-phpunit": "^2",
30+
"phpstan/phpstan-strict-rules": "^2",
31+
"doctrine/coding-standard": "^14",
3232
"phpunit/phpunit": "^9.6",
3333
"symfony/cache": "^4.4 || ^5.4 || ^6.0 || ^7.0",
3434
"symfony/finder": "^4.4 || ^5.4 || ^6.0 || ^7.0"

phpstan-baseline.neon

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,121 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Call to an undefined static method T of object\\:\\:loadMetadata\\(\\)\\.$#"
4+
message: '#^Call to an undefined static method T of object\:\:loadMetadata\(\)\.$#'
5+
identifier: staticMethod.notFound
56
count: 1
67
path: src/Persistence/Mapping/Driver/StaticPHPDriver.php
78

89
-
9-
message: "#^Method Doctrine\\\\Persistence\\\\Reflection\\\\EnumReflectionProperty\\:\\:toEnum\\(\\) should return array\\<BackedEnum\\>\\|BackedEnum but returns array\\<BackedEnum\\|int\\|string\\>\\.$#"
10+
message: '#^Template type TObjectManager is declared as covariant, but occurs in invariant position in property Doctrine\\Persistence\\ObjectManagerDecorator\:\:\$wrapped\.$#'
11+
identifier: generics.variance
12+
count: 1
13+
path: src/Persistence/ObjectManagerDecorator.php
14+
15+
-
16+
message: '#^Method Doctrine\\Persistence\\Reflection\\EnumReflectionProperty\:\:toEnum\(\) should return array\<BackedEnum\>\|BackedEnum but returns array\<BackedEnum\|int\|string\>\.$#'
17+
identifier: return.type
1018
count: 1
1119
path: src/Persistence/Reflection/EnumReflectionProperty.php
1220

1321
-
14-
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(BackedEnum\\|int\\|string\\)\\: mixed\\)\\|null, array\\{class\\-string\\<BackedEnum\\>, 'from'\\} given\\.$#"
22+
message: '#^Parameter \#1 \$callback of function array_map expects \(callable\(BackedEnum\|int\|string\)\: mixed\)\|null, array\{class\-string\<BackedEnum\>, ''from''\} given\.$#'
23+
identifier: argument.type
1524
count: 1
1625
path: src/Persistence/Reflection/EnumReflectionProperty.php
1726

1827
-
19-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Doctrine\\\\\\\\Tests…', 'Doctrine\\\\\\\\Tests\\\\\\\\ORM…', 'Doctrine\\\\\\\\Tests\\\\\\\\ORM…'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
28+
message: '#^PHPDoc tag @var with type Doctrine\\Persistence\\Mapping\\ClassMetadata\<object\> is not subtype of native type PHPUnit\\Framework\\MockObject\\MockObject\.$#'
29+
identifier: varTag.nativeType
30+
count: 1
31+
path: tests/Persistence/Mapping/ClassMetadataFactoryTest.php
32+
33+
-
34+
message: '#^Parameter \#1 \$directories of static method Doctrine\\Persistence\\Mapping\\Driver\\FileClassLocator\:\:createFromDirectories\(\) expects list\<string\>, non\-empty\-array\<int, string\> given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: tests/Persistence/Mapping/ColocatedMappingDriverTest.php
38+
39+
-
40+
message: '#^Parameter \#2 \$excludedDirectories of static method Doctrine\\Persistence\\Mapping\\Driver\\FileClassLocator\:\:createFromDirectories\(\) expects list\<string\>, array\<int, string\> given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: tests/Persistence/Mapping/ColocatedMappingDriverTest.php
44+
45+
-
46+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with array\{''Doctrine\\\\Tests…'', ''Doctrine\\\\Tests\\\\ORM…'', ''Doctrine\\\\Tests\\\\ORM…''\} and list\<class\-string\> will always evaluate to false\.$#'
47+
identifier: staticMethod.impossibleType
2048
count: 1
2149
path: tests/Persistence/Mapping/DriverChainTest.php
2250

2351
-
24-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Doctrine\\\\\\\\Tests…', 'Other\\\\\\\\Class'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
52+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with array\{''Doctrine\\\\Tests…'', ''Other\\\\Class''\} and list\<class\-string\> will always evaluate to false\.$#'
53+
identifier: staticMethod.impossibleType
2554
count: 1
2655
path: tests/Persistence/Mapping/DriverChainTest.php
2756

2857
-
29-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Doctrine\\\\\\\\Persistence\\\\\\\\Reflection\\\\\\\\RuntimeReflectionProperty' and Doctrine\\\\Persistence\\\\Reflection\\\\RuntimeReflectionProperty will always evaluate to true\\.$#"
58+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''Doctrine\\\\Persistence\\\\Reflection\\\\RuntimeReflectionProperty'' and Doctrine\\Persistence\\Reflection\\RuntimeReflectionProperty will always evaluate to true\.$#'
59+
identifier: staticMethod.alreadyNarrowedType
3060
count: 3
3161
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
3262

3363
-
34-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'ReflectionProperty' and Doctrine\\\\Persistence\\\\Reflection\\\\RuntimeReflectionProperty will always evaluate to true\\.$#"
64+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''ReflectionProperty'' and Doctrine\\Persistence\\Reflection\\RuntimeReflectionProperty will always evaluate to true\.$#'
65+
identifier: staticMethod.alreadyNarrowedType
3566
count: 5
3667
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
3768

3869
-
39-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedDefaultProperty is never read, only written\\.$#"
70+
message: '#^Property Doctrine\\Tests\\Persistence\\Mapping\\RuntimeReflectionServiceTest\:\:\$nonTypedDefaultProperty is never read, only written\.$#'
71+
identifier: property.onlyWritten
4072
count: 1
4173
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
4274

4375
-
44-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$nonTypedNoDefaultProperty is unused\\.$#"
76+
message: '#^Property Doctrine\\Tests\\Persistence\\Mapping\\RuntimeReflectionServiceTest\:\:\$nonTypedNoDefaultProperty is unused\.$#'
77+
identifier: property.unused
4578
count: 1
4679
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
4780

4881
-
49-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedDefaultProperty is never read, only written\\.$#"
82+
message: '#^Property Doctrine\\Tests\\Persistence\\Mapping\\RuntimeReflectionServiceTest\:\:\$typedDefaultProperty is never read, only written\.$#'
83+
identifier: property.onlyWritten
5084
count: 1
5185
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
5286

5387
-
54-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Mapping\\\\RuntimeReflectionServiceTest\\:\\:\\$typedNoDefaultProperty is unused\\.$#"
88+
message: '#^Property Doctrine\\Tests\\Persistence\\Mapping\\RuntimeReflectionServiceTest\:\:\$typedNoDefaultProperty is unused\.$#'
89+
identifier: property.unused
5590
count: 1
5691
path: tests/Persistence/Mapping/RuntimeReflectionServiceTest.php
5792

5893
-
59-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\{'Foo\\\\\\\\stdClass', 'Foo\\\\\\\\sub\\\\\\\\subClass', 'Foo\\\\\\\\sub\\\\\\\\subsub…'\\} and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
94+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with array\{''Foo\\\\stdClass'', ''Foo\\\\sub\\\\subClass'', ''Foo\\\\sub\\\\subsub…''\} and list\<class\-string\> will always evaluate to false\.$#'
95+
identifier: staticMethod.impossibleType
6096
count: 1
6197
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
6298

6399
-
64-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\global'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
100+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with non\-empty\-list\<''Foo\\\\Bar\\\\subDirClass''\|''Foo\\\\global''\|''Foo\\\\stdClass''\> and list\<class\-string\> will always evaluate to false\.$#'
101+
identifier: staticMethod.impossibleType
65102
count: 1
66103
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
67104

68105
-
69-
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with non\\-empty\\-array\\<int, 'Foo\\\\\\\\Bar\\\\\\\\subDirClass'\\|'Foo\\\\\\\\stdClass'\\> and array\\<int, class\\-string\\> will always evaluate to false\\.$#"
106+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with non\-empty\-list\<''Foo\\\\Bar\\\\subDirClass''\|''Foo\\\\stdClass''\> and list\<class\-string\> will always evaluate to false\.$#'
107+
identifier: staticMethod.impossibleType
70108
count: 1
71109
path: tests/Persistence/Mapping/SymfonyFileLocatorTest.php
72110

73111
-
74-
message: "#^Property Doctrine\\\\Tests\\\\Persistence\\\\Reflection\\\\TypedFoo\\:\\:\\$id is never read, only written\\.$#"
112+
message: '#^Property Doctrine\\Tests\\Persistence\\Reflection\\TypedFoo\:\:\$id is never read, only written\.$#'
113+
identifier: property.onlyWritten
75114
count: 1
76115
path: tests/Persistence/Reflection/TypedNoDefaultReflectionPropertyTest.php
77116

78117
-
79-
message: "#^Method Doctrine\\\\Tests\\\\Persistence\\\\RuntimeReflectionPropertyTestProxyMock\\:\\:__setInitialized\\(\\) has parameter \\$initialized with no type specified\\.$#"
118+
message: '#^Method Doctrine\\Tests\\Persistence\\RuntimeReflectionPropertyTestProxyMock\:\:__setInitialized\(\) has parameter \$initialized with no type specified\.$#'
119+
identifier: missingType.parameter
80120
count: 1
81121
path: tests/Persistence/RuntimeReflectionPropertyTest.php

src/Persistence/Mapping/Driver/FileDriver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Doctrine\Persistence\Mapping\Driver;
66

7-
use Doctrine\Persistence\Mapping\ClassMetadata;
87
use Doctrine\Persistence\Mapping\MappingException;
98

109
use function array_keys;
@@ -122,7 +121,7 @@ public function getAllClassNames(): array
122121
return $this->locator->getAllClassNames($this->globalBasename);
123122
}
124123

125-
/** @phpstan-var array<class-string, ClassMetadata<object>> $classCache */
124+
/** @phpstan-var non-empty-array<class-string, T> $classCache */
126125
$classCache = $this->classCache;
127126

128127
/** @var list<class-string> $keys */

0 commit comments

Comments
 (0)