diff --git a/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php b/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php index 8315b4f347..6881476533 100644 --- a/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php +++ b/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php @@ -24,8 +24,8 @@ use Symfony\Bridge\Propel1\Form\EventListener\TranslationFormListener; class TranslationType extends AbstractType { /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addEventSubscriber( diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index 7e3d275899..6bf4ebd545 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -353,14 +353,17 @@ class ClassCollectionLoader $unresolved = new \ArrayObject(); } $nodeName = $node->getName(); - $unresolved[$nodeName] = $node; - foreach ($tree[$nodeName] as $dependency) { - if (!$resolved->offsetExists($dependency->getName())) { - self::resolveDependencies($tree, $dependency, $resolved, $unresolved); + + if (isset($tree[$nodeName])) { + $unresolved[$nodeName] = $node; + foreach ($tree[$nodeName] as $dependency) { + if (!$resolved->offsetExists($dependency->getName())) { + self::resolveDependencies($tree, $dependency, $resolved, $unresolved); + } } + $resolved[$nodeName] = $node; + unset($unresolved[$nodeName]); } - $resolved[$nodeName] = $node; - unset($unresolved[$nodeName]); return $resolved; } diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php index 696943ed93..e821e45063 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassCollectionLoaderTest.php @@ -146,6 +146,38 @@ class ClassCollectionLoaderTest extends \PHPUnit_Framework_TestCase ); } + public function testFixClassWithTraitsOrdering() + { + if (PHP_VERSION_ID < 50400) { + $this->markTestSkipped('Requires PHP > 5.4'); + + return; + } + + require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php'; + require_once __DIR__.'/Fixtures/ClassesWithParents/F.php'; + require_once __DIR__.'/Fixtures/ClassesWithParents/G.php'; + + $classes = array( + 'ClassesWithParents\\F', + 'ClassesWithParents\\G', + ); + + $expected = array( + 'ClassesWithParents\\CTrait', + 'ClassesWithParents\\F', + 'ClassesWithParents\\G', + ); + + $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader'); + $m = $r->getMethod('getOrderedClasses'); + $m->setAccessible(true); + + $ordered = $m->invoke('Symfony\Component\ClassLoader\ClassCollectionLoader', $classes); + + $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered)); + } + /** * @dataProvider getFixNamespaceDeclarationsData */ diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/F.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/F.php new file mode 100644 index 0000000000..a0a5172d71 --- /dev/null +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/F.php @@ -0,0 +1,8 @@ + - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek * * @api */ diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcher.php b/src/Symfony/Component/EventDispatcher/EventDispatcher.php index 222a937141..89559f1b06 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -17,13 +17,13 @@ namespace Symfony\Component\EventDispatcher; * Listeners are registered on the manager and events are dispatched through the * manager. * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek - * @author Fabien Potencier - * @author Jordi Boggiano - * @author Jordan Alliot + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek + * @author Fabien Potencier + * @author Jordi Boggiano + * @author Jordan Alliot * * @api */ diff --git a/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php b/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php index 080f892fdf..ff7e305cd5 100644 --- a/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php +++ b/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php @@ -17,10 +17,10 @@ namespace Symfony\Component\EventDispatcher; * {@link getSubscribedEvents} and registers the subscriber as a listener for all * returned events. * - * @author Guilherme Blanco - * @author Jonathan Wage - * @author Roman Borschel - * @author Bernhard Schussek + * @author Guilherme Blanco + * @author Jonathan Wage + * @author Roman Borschel + * @author Bernhard Schussek * * @api */ diff --git a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php index a00104913e..fea260558f 100644 --- a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php @@ -164,7 +164,7 @@ class CurrencyDataGenerator extends AbstractDataGenerator } /** - * @param $rootBundle + * @param ArrayAccessibleResourceBundle $rootBundle * * @return array */ diff --git a/src/Symfony/Component/PropertyAccess/StringUtil.php b/src/Symfony/Component/PropertyAccess/StringUtil.php index c8176db964..91adedb2bc 100644 --- a/src/Symfony/Component/PropertyAccess/StringUtil.php +++ b/src/Symfony/Component/PropertyAccess/StringUtil.php @@ -186,7 +186,7 @@ class StringUtil return $singulars; } - return $newBase.($firstUpper ? ucFirst($newSuffix) : $newSuffix); + return $newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix); } // Suffix is longer than word diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php index 401df6da64..8007234175 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php @@ -24,12 +24,12 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac */ interface AuthenticationProviderInterface extends AuthenticationManagerInterface { - /** - * Checks whether this provider supports the given token. - * - * @param TokenInterface $token A TokenInterface instance - * - * @return bool true if the implementation supports the Token, false otherwise - */ + /** + * Checks whether this provider supports the given token. + * + * @param TokenInterface $token A TokenInterface instance + * + * @return bool true if the implementation supports the Token, false otherwise + */ public function supports(TokenInterface $token); } diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index 8c47e418a5..1df80f8c17 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -117,17 +117,17 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec return $data; } - /** - * {@inheritdoc} - */ + /** + * {@inheritdoc} + */ public function supportsEncoding($format) { return 'xml' === $format; } /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function supportsDecoding($format) { return 'xml' === $format; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php b/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php index e881ad1397..7525d5c928 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/TestDenormalizer.php @@ -21,15 +21,15 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class TestDenormalizer implements DenormalizerInterface { /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function denormalize($data, $class, $format = null, array $context = array()) { } /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function supportsDenormalization($data, $type, $format = null) { return true; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php b/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php index 4c000b3eb4..4b29e8fa5d 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/TestNormalizer.php @@ -21,15 +21,15 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class TestNormalizer implements NormalizerInterface { /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function normalize($object, $format = null, array $context = array()) { } /** - * {@inheritdoc} - */ + * {@inheritdoc} + */ public function supportsNormalization($data, $format = null) { return true;