File tree 4 files changed +11
-5
lines changed
Filter options
src/Symfony/Component/ErrorHandler 4 files changed +11
-5
lines changed
Original file line number Diff line number Diff line change 15
15
switch (true ) {
16
16
case false !== strpos ($ file = realpath ($ file ), '/vendor/ ' ):
17
17
case false !== strpos ($ file , '/src/Symfony/Bridge/PhpUnit/ ' ):
18
- case false !== strpos ($ file , '/Attribute/ ' ):
19
18
case false !== strpos ($ file , '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php ' ):
20
19
case false !== strpos ($ file , '/src/Symfony/Component/Cache/Tests/Fixtures/DriverWrapper.php ' ):
21
20
case false !== strpos ($ file , '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php ' ):
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ jobs:
139
139
if : " ${{ matrix.php == '8.0' && ! matrix.mode }}"
140
140
run : |
141
141
sed -i 's/"\*\*\/Tests\/"//' composer.json
142
+ git add .
142
143
composer install -q --optimize-autoloader
143
144
SYMFONY_PATCH_TYPE_DECLARATIONS='force=1&php=7.2' php .github/patch-types.php
144
145
SYMFONY_PATCH_TYPE_DECLARATIONS='force=1&php=7.2' php .github/patch-types.php # ensure the script is idempotent
Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 5.4
5
+ ---
6
+
7
+ * make ` DebugClassLoader ` trigger deprecation notices on missing return types
8
+ * add ` SYMFONY_PATCH_TYPE_DECLARATIONS='force=2' ` mode to ` DebugClassLoader ` to turn annotations into native return types
9
+
4
10
5.2.0
5
11
-----
6
12
Original file line number Diff line number Diff line change 34
34
* which is a url-encoded array with the follow parameters:
35
35
* - "force": any value enables deprecation notices - can be any of:
36
36
* - "phpdoc" to patch only docblock annotations
37
- * - "object" to turn union types to the "object" type when possible (not recommended)
38
- * - "1" to add all possible return types including magic methods
39
- * - "0" to add possible return types excluding magic methods
37
+ * - "2" to add all possible return types
38
+ * - "1" to add return types but only to tests/final/internal/private methods
40
39
* - "php": the target version of PHP - e.g. "7.1" doesn't generate "object" types
41
40
* - "deprecations": "1" to trigger a deprecation notice when a child class misses a
42
41
* return type while the parent declares an "@return" annotation
@@ -534,7 +533,8 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
534
533
$ this ->patchTypes ['force ' ] = $ forcePatchTypes ?: 'docblock ' ;
535
534
}
536
535
537
- $ canAddReturnType = false !== strpos ($ refl ->getFileName (), \DIRECTORY_SEPARATOR .'Tests ' .\DIRECTORY_SEPARATOR )
536
+ $ canAddReturnType = 2 === (int ) $ forcePatchTypes
537
+ || false !== stripos ($ method ->getFileName (), \DIRECTORY_SEPARATOR .'Tests ' .\DIRECTORY_SEPARATOR )
538
538
|| $ refl ->isFinal ()
539
539
|| $ method ->isFinal ()
540
540
|| $ method ->isPrivate ()
You can’t perform that action at this time.
0 commit comments