8000 bug #26236 [PropertyInfo] ReflectionExtractor: give a chance to other… · symfony/symfony@ddc32e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit ddc32e3

Browse files
committed
bug #26236 [PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties (dunglas)
This PR was merged into the 2.8 branch. Discussion ---------- [PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #25803 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | n/a For instance when using `__call()`, see #25803. <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Replace this comment by a description of what your PR is solving. --> Commits ------- 270147b [PropertyInfo] ReflectionExtractor: give a chance to other extractors if no properties
2 parents 9cbb256 + 270147b commit ddc32e3

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getProperties($class, array $context = array())
7676
$properties[$propertyName] = $propertyName;
7777
}
7878

79-
return array_values($properties);
79+
return $properties ? array_values($properties) : null;
8080
}
8181

8282
/**

src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public function testGetProperties()
5757
),
5858
$this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy')
5959
);
60+
61+
$this->assertNull($this->extractor->getProperties('Symfony\Component\PropertyInfo\Tests\Fixtures\NoProperties'));
6062
}
6163

6264
/**
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
4+
5+
/*
6+
* This file is part of the Symfony package.
7+
*
8+
* (c) Fabien Potencier <fabien@symfony.com>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
15+
16+
/**
17+
* @author Kévin Dunglas <dunglas@gmail.com>
18+
*/
19+
class NoProperties
20+
{
21+
}

0 commit comments

Comments
 (0)
0