Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e4151f

Browse files
Merge branch '5.4' into 6.0
* 5.4: bug #45043 [ErrorHandler] ignore ``@return`` when there is an ``@template`` (nicolas-grekas) [Finder] fix tests on Windows
2 parents 2ed7d0d + 326944d commit 5e4151f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,12 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
371371

372372
$parent = get_parent_class($class) ?: null;
373373
self::$returnTypes[$class] = [];
374+
$classIsTemplate = false;
374375

375376
// Detect annotations on the class
376377
if ($doc = $this->parsePhpDoc($refl)) {
378+
$classIsTemplate = isset($doc['template']);
379+
377380
foreach (['final', 'deprecated', 'internal'] as $annotation) {
378381
if (null !== $description = $doc[$annotation][0] ?? null) {
379382
self::${$annotation}[$class] = '' !== $description ? ' '.$description.(preg_match('/[.!]$/', $description) ? '' : '.') : '.';
@@ -517,6 +520,10 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
517520
// To read method annotations
518521
$doc = $this->parsePhpDoc($method);
519522

523+
if (($classIsTemplate || isset($doc['template'])) && $method->hasReturnType()) {
524+
unset($doc['return']);
525+
}
526+
520527
if (isset(self::$annotatedParameters[$class][$method->name])) {
521528
$definedParameters = [];
522529
foreach ($method->getParameters() as $parameter) {

src/Symfony/Component/Process/Tests/PhpExecutableFinderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public function testNotExitsBinaryFile()
6565

6666
public function testFindWithExecutableDirectory()
6767
{
68+
if ('\\' === \DIRECTORY_SEPARATOR) {
69+
$this->markTestSkipped('Directories are not executable on Windows');
70+
}
71+
6872
$originalPhpBinary = getenv('PHP_BINARY');
6973

7074
try {

0 commit comments

Comments
 (0)