Please sign in to comment.
bug #21370 [FrameworkBundle] Execute the PhpDocExtractor earlier (Gui…
…lhemN) This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #21370). Discussion ---------- [FrameworkBundle] Execute the PhpDocExtractor earlier | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes, but safer to apply on master | New feature? | no | BC breaks? | is changing a priority a bc break? | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21367 | License | MIT | Doc PR | Fixes #21367. > I wonder if this is logical to execute the PhpDocExtractor after the ReflectionExtractor: when you use phpdocs it's because they are more precise than php type hints. This causes an issue in NelmioApiDocBundle, for example you can't use int with a setter as the type mixed will be returned instead of int. > > ~~Would you accept bumping its priority to -999?~~ This PR changes the priority of the `ReflectionExtractor` to `-1002` to make sure it is executed after the `PhpDocExtractor`. Commits ------- 0425e05 [FrameworkBundle] Execute the PhpDocExtractor earlier
- Loading branch information...
Showing with 36 additions and 1 deletion.
|@@ -0,0 +1,35 @@|
|+ * This file is part of the Symfony package.|
|+ * (c) Fabien Potencier <firstname.lastname@example.org>|
|+ * For the full copyright and license information, please view the LICENSE|
|+ * file that was distributed with this source code.|
|+class PropertyInfoTest extends WebTestCase|
|+ public function testPhpDocPriority()|
|+ static::bootKernel(array('test_case' => 'Serializer'));|
|+ $container = static::$kernel->getContainer();|
|+ $this->assertEquals(array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_INT))), $container->get('property_info')->getTypes(Dummy::class, 'codes'));|
|+ * @param int $codes|
|+ public function setCodes(array $codes)|