From 0d14aac8801661b75b7a4e070f9785eddadf6f70 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Fri, 20 May 2016 15:47:36 +0200 Subject: [PATCH 01/13] Removed UTC specification with timestamp --- .../DataTransformer/DateTimeToLocalizedStringTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php index b38680a1bb..5418f7feae 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php @@ -126,7 +126,7 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer try { // read timestamp into DateTime object - the formatter delivers in UTC - $dateTime = new \DateTime(sprintf('@%s UTC', $timestamp)); + $dateTime = new \DateTime(sprintf('@%s', $timestamp)); } catch (\Exception $e) { throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); } From 142b1a4b468505c4a6bdd44625c959fc2dfebf27 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 29 May 2016 12:39:28 +0200 Subject: [PATCH 02/13] force enabling the external XML entity loaders --- .../DependencyInjection/Loader/XmlFileLoader.php | 2 ++ .../Tests/Loader/XmlFileLoaderTest.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index f324aa969c..076f4fa659 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -333,7 +333,9 @@ $imports EOF ; + $disableEntities = libxml_disable_entity_loader(false); $valid = @$dom->schemaValidateSource($source); + libxml_disable_entity_loader($disableEntities); foreach ($tmpfiles as $tmpfile) { @unlink($tmpfile); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index a8f8f35133..d2e2a684a8 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -83,6 +83,19 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', $xml, '->parseFile() returns an SimpleXMLElement object'); } + public function testLoaderTurnsOnEntityLoaderIfNecessary() + { + $oldValue = libxml_disable_entity_loader(true); + + $containerBuilder = new ContainerBuilder(); + $loader = new XmlFileLoader($containerBuilder, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('services2.xml'); + + libxml_disable_entity_loader($oldValue); + + $this->assertTrue(count($containerBuilder->getParameterBag()->all()) > 0, 'Parameters can be read from the config file.'); + } + public function testLoadParameters() { $container = new ContainerBuilder(); From 7d78196d0c25188eb3c16c9f0fc7cfa2706612c7 Mon Sep 17 00:00:00 2001 From: Anton Bakai Date: Tue, 24 May 2016 23:58:05 +0300 Subject: [PATCH 03/13] Fix for #18843 --- src/Symfony/Component/Yaml/Dumper.php | 2 +- src/Symfony/Component/Yaml/Inline.php | 30 +++++++++++++++---- .../Component/Yaml/Tests/InlineTest.php | 20 +++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Component/Yaml/Dumper.php b/src/Symfony/Component/Yaml/Dumper.php index 21351a5c34..9bd9389c07 100644 --- a/src/Symfony/Component/Yaml/Dumper.php +++ b/src/Symfony/Component/Yaml/Dumper.php @@ -58,7 +58,7 @@ class Dumper if ($inline <= 0 || !is_array($input) || empty($input)) { $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); } else { - $isAHash = array_keys($input) !== range(0, count($input) - 1); + $isAHash = Inline::isHash($input); foreach ($input as $key => $value) { $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 5f15e3c5b4..0ce1ced7d7 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -145,6 +145,28 @@ class Inline } } + /** + * Check if given array is hash or just normal indexed array. + * + * @internal + * + * @param array $value The PHP array to check + * + * @return bool true if value is hash array, false otherwise + */ + public static function isHash(array $value) + { + $expectedKey = 0; + + foreach ($value as $key => $val) { + if ($key !== $expectedKey++) { + return true; + } + } + + return false; + } + /** * Dumps a PHP array to a YAML string. * @@ -157,11 +179,7 @@ class Inline private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) { // array - $keys = array_keys($value); - $keysCount = count($keys); - if ((1 === $keysCount && '0' == $keys[0]) - || ($keysCount > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) - ) { + if ($value && !self::isHash($value)) { $output = array(); foreach ($value as $val) { $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); @@ -170,7 +188,7 @@ class Inline return sprintf('[%s]', implode(', ', $output)); } - // mapping + // hash $output = array(); foreach ($value as $key => $val) { $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 255928d16d..b1263d8d29 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -169,6 +169,24 @@ class InlineTest extends \PHPUnit_Framework_TestCase Inline::parse('{ foo: * #foo }'); } + /** + * @dataProvider getDataForIsHash + */ + public function testIsHash($array, $expected) + { + $this->assertSame($expected, Inline::isHash($array)); + } + + public function getDataForIsHash() + { + return array( + array(array(), false), + array(array(1, 2, 3), false), + array(array(2 => 1, 1 => 2, 0 => 3), true), + array(array('foo' => 1, 'bar' => 2), true), + ); + } + protected function getTestsForParse() { return array( @@ -296,6 +314,8 @@ class InlineTest extends \PHPUnit_Framework_TestCase '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), + + '{ foo: { bar: { 1: 2, baz: 3 } } }' => array('foo' => array('bar' => array(1 => 2, 'baz' => 3))), ); } } From b73400d70777ea4179230ada751bfd461b467310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Tue, 24 May 2016 11:36:46 +0100 Subject: [PATCH 04/13] [Serializer] Add missing @throws annotations --- src/Symfony/Component/Serializer/Encoder/ChainDecoder.php | 2 +- .../Component/Serializer/Encoder/DecoderInterface.php | 4 ++++ .../Component/Serializer/Encoder/EncoderInterface.php | 4 ++++ src/Symfony/Component/Serializer/Encoder/XmlEncoder.php | 2 ++ .../Serializer/Normalizer/DenormalizableInterface.php | 6 ++++++ .../Serializer/Normalizer/DenormalizerInterface.php | 4 ++++ .../Serializer/Normalizer/NormalizableInterface.php | 4 ++++ .../Component/Serializer/Normalizer/NormalizerInterface.php | 4 ++++ src/Symfony/Component/Serializer/Serializer.php | 4 ++++ src/Symfony/Component/Serializer/SerializerInterface.php | 6 ++++++ 10 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php b/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php index f8f17b4f72..352ba584a7 100644 --- a/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php +++ b/src/Symfony/Component/Serializer/Encoder/ChainDecoder.php @@ -59,7 +59,7 @@ class ChainDecoder implements DecoderInterface * * @return DecoderInterface * - * @throws RuntimeException if no decoder is found + * @throws RuntimeException If no decoder is found. */ private function getDecoder($format) { diff --git a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php index be788ee7c5..3b3e478e7b 100644 --- a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php +++ b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Encoder; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the interface of decoders. * @@ -30,6 +32,8 @@ interface DecoderInterface * are encouraged to document which formats they support in a non-inherited * phpdoc comment. * + * @throws Exception + * * @return mixed */ public function decode($data, $format, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php b/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php index 1ac6a17180..662a087ad4 100644 --- a/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php +++ b/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Encoder; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the interface of encoders. * @@ -25,6 +27,8 @@ interface EncoderInterface * @param string $format Format name * @param array $context options that normalizers/encoders have access to. * + * @throws Exception + * * @return string|bool|int|float|null */ public function encode($data, $format, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index 6a2b5cf452..247cb9382b 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -399,6 +399,8 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec * @param \DOMNode $node * @param mixed $val * + * @throws UnexpectedValueException + * * @return bool */ private function selectNodeType(\DOMNode $node, $val) diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php index 55c030c7c4..b3bbf50a6d 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the most basic interface a class must implement to be denormalizable. * @@ -33,6 +35,10 @@ interface DenormalizableInterface * @param string|null $format The format is optionally given to be able to denormalize differently * based on different input formats. * @param array $context options for denormalizing + * + * @throws Exception + * + * @return object */ public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array()); } diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index 8b6c233395..40c5890bd3 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the interface of denormalizers. * @@ -26,6 +28,8 @@ interface DenormalizerInterface * @param string $format format the given data was extracted from * @param array $context options available to the denormalizer * + * @throws Exception + * * @return object */ public function denormalize($data, $class, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php index 79cba123ff..9f323b9d0c 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the most basic interface a class must implement to be normalizable. * @@ -33,6 +35,8 @@ interface NormalizableInterface * based on different output formats. * @param array $context Options for normalizing this object * + * @throws Exception + * * @return array|string|bool|int|float|null */ public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index 2a51d631b1..0ce5b3aef2 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer\Normalizer; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the interface of normalizers. * @@ -25,6 +27,8 @@ interface NormalizerInterface * @param string $format format the normalization result will be encoded as * @param array $context Context options for the normalizer * + * @throws Exception + * * @return array|string|bool|int|float|null */ public function normalize($object, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index c3e07e821c..6160b5205c 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -169,6 +169,8 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz /** * {@inheritdoc} + * + * @throws RuntimeException */ private function getNormalizer($data, $format = null) { @@ -183,6 +185,8 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz /** * {@inheritdoc} + * + * @throws RuntimeException */ private function getDenormalizer($data, $type, $format = null) { diff --git a/src/Symfony/Component/Serializer/SerializerInterface.php b/src/Symfony/Component/Serializer/SerializerInterface.php index c79db91892..ed2e71c2cd 100644 --- a/src/Symfony/Component/Serializer/SerializerInterface.php +++ b/src/Symfony/Component/Serializer/SerializerInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Serializer; +use Symfony\Component\Serializer\Exception\Exception; + /** * Defines the interface of the Serializer. * @@ -25,6 +27,8 @@ interface SerializerInterface * @param string $format format name * @param array $context options normalizers/encoders have access to * + * @throws Exception + * * @return string */ public function serialize($data, $format, array $context = array()); @@ -37,6 +41,8 @@ interface SerializerInterface * @param string $format * @param array $context * + * @throws Exception + * * @return object */ public function deserialize($data, $type, $format, array $context = array()); From 893cf00a52ed1f35f06d41e06b575be776fdc17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Proch=C3=A1zka?= Date: Thu, 12 May 2016 17:11:08 +0200 Subject: [PATCH 05/13] Catch \Throwable --- .../Bundle/FrameworkBundle/Routing/DelegatingLoader.php | 5 ++++- .../WebProfilerBundle/Controller/ProfilerController.php | 5 +++-- src/Symfony/Component/Config/Loader/FileLoader.php | 3 +++ src/Symfony/Component/DependencyInjection/Container.php | 5 +++++ .../Component/DependencyInjection/ContainerBuilder.php | 4 ++++ .../DependencyInjection/ContainerAwareHttpKernel.php | 5 +++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php b/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php index b37bee83d4..801149372a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php @@ -77,6 +77,9 @@ class DelegatingLoader extends BaseDelegatingLoader } catch (\Exception $e) { $this->loading = false; throw $e; + } catch (\Throwable $e) { + $this->loading = false; + throw $e; } $this->loading = false; @@ -85,7 +88,7 @@ class DelegatingLoader extends BaseDelegatingLoader if ($controller = $route->getDefault('_controller')) { try { $controller = $this->parser->parse($controller); - } catch (\Exception $e) { + } catch (\InvalidArgumentException $e) { // unable to optimize unknown notation } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index 173616fd9f..a152313df9 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; +use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** @@ -193,8 +194,8 @@ class ProfilerController $url = null; try { $url = $this->generator->generate('_profiler', array('token' => $token)); - } catch (\Exception $e) { - // the profiler is not enabled + } catch (RouteNotFoundException $e) { + // the named route doesn't exist => the profiler is not enabled } return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( diff --git a/src/Symfony/Component/Config/Loader/FileLoader.php b/src/Symfony/Component/Config/Loader/FileLoader.php index 9c1b4d9f1e..f25d477069 100644 --- a/src/Symfony/Component/Config/Loader/FileLoader.php +++ b/src/Symfony/Component/Config/Loader/FileLoader.php @@ -108,6 +108,9 @@ abstract class FileLoader extends Loader } catch (\Exception $e) { unset(self::$loading[$resource]); throw $e; + } catch (\Throwable $e) { + unset(self::$loading[$resource]); + throw $e; } unset(self::$loading[$resource]); diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index 9243b66c8e..084c4da6fe 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -320,6 +320,11 @@ class Container implements IntrospectableContainerInterface return; } + throw $e; + } catch (\Throwable $e) { + unset($this->loading[$id]); + unset($this->services[$id]); + throw $e; } diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index ad2f89ae77..7c60f0a7d4 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -461,6 +461,10 @@ class ContainerBuilder extends Container implements TaggedContainerInterface return; } + throw $e; + } catch (\Throwable $e) { + unset($this->loading[$id]); + throw $e; } diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php b/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php index c9b8a211d4..e288720b97 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php @@ -64,6 +64,11 @@ class ContainerAwareHttpKernel extends HttpKernel $this->container->set('request', null, 'request'); $this->container->leaveScope('request'); + throw $e; + } catch (\Throwable $e) { + $this->container->set('request', null, 'request'); + $this->container->leaveScope('request'); + throw $e; } From 6f3673364e9bdd8ae96a7b242310e4931dbe68ad Mon Sep 17 00:00:00 2001 From: Robert Meijers Date: Thu, 26 May 2016 16:08:43 +0200 Subject: [PATCH 06/13] [DependencyInjection] Skip deep reference check for 'service_container' Deep checks on whether a service references another service need to exclude the 'service_container' service as it doesn't exist. Without this dumping the container will fail if a service definition references an inlined service which has a direct or indirect dependency to the service_container. --- .../DependencyInjection/Dumper/PhpDumper.php | 2 +- .../Tests/Dumper/PhpDumperTest.php | 11 ++++ .../Tests/Fixtures/php/services13.php | 54 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index d239b7d7d5..d7ab4fc2b8 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1173,7 +1173,7 @@ EOF; return true; } - if ($deep && !isset($visited[(string) $argument])) { + if ($deep && !isset($visited[(string) $argument]) && 'service_container' !== (string) $argument) { $visited[(string) $argument] = true; $service = $this->container->getDefinition((string) $argument); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 311026c5e6..219ea63e82 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -226,4 +226,15 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase $dumper = new PhpDumper($container); $dumper->dump(); } + + public function testInlinedDefinitionReferencingServiceContainer() + { + $container = new ContainerBuilder(); + $container->register('foo', 'stdClass')->addMethodCall('add', array(new Reference('service_container')))->setPublic(false); + $container->register('bar', 'stdClass')->addArgument(new Reference('foo')); + $container->compile(); + + $dumper = new PhpDumper($container); + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services13.php', $dumper->dump(), '->dump() dumps inline definitions which reference service_container'); + } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php new file mode 100644 index 0000000000..0c33b7b3ea --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php @@ -0,0 +1,54 @@ +services = + $this->scopedServices = + $this->scopeStacks = array(); + $this->scopes = array(); + $this->scopeChildren = array(); + $this->methodMap = array( + 'bar' => 'getBarService', + ); + + $this->aliases = array(); + } + + /** + * Gets the 'bar' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return \stdClass A stdClass instance. + */ + protected function getBarService() + { + $a = new \stdClass(); + $a->add($this); + + return $this->services['bar'] = new \stdClass($a); + } +} From b3cd2679b861a249f31253ed6e67187190fb25cc Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 30 May 2016 10:16:24 +0200 Subject: [PATCH 07/13] Partial revert of previous PR --- .../WebProfilerBundle/Controller/ProfilerController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index a152313df9..173616fd9f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -18,7 +18,6 @@ use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\WebProfilerBundle\Profiler\TemplateManager; -use Symfony\Component\Routing\Exception\RouteNotFoundException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** @@ -194,8 +193,8 @@ class ProfilerController $url = null; try { $url = $this->generator->generate('_profiler', array('token' => $token)); - } catch (RouteNotFoundException $e) { - // the named route doesn't exist => the profiler is not enabled + } catch (\Exception $e) { + // the profiler is not enabled } return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array( From 91635a805480bf635c9ef2aa7243c17b25524742 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 30 May 2016 10:31:06 +0200 Subject: [PATCH 08/13] Revert "bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)" This reverts commit 44f6f893083831ce9845c7d27c5e2cc855e0100b, reversing changes made to 57d6053822866a56be7d7ea1db61a69390dcc528. --- .../DependencyInjection/Loader/XmlFileLoader.php | 2 -- .../Tests/Loader/XmlFileLoaderTest.php | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 076f4fa659..f324aa969c 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -333,9 +333,7 @@ $imports EOF ; - $disableEntities = libxml_disable_entity_loader(false); $valid = @$dom->schemaValidateSource($source); - libxml_disable_entity_loader($disableEntities); foreach ($tmpfiles as $tmpfile) { @unlink($tmpfile); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index d2e2a684a8..a8f8f35133 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -83,19 +83,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', $xml, '->parseFile() returns an SimpleXMLElement object'); } - public function testLoaderTurnsOnEntityLoaderIfNecessary() - { - $oldValue = libxml_disable_entity_loader(true); - - $containerBuilder = new ContainerBuilder(); - $loader = new XmlFileLoader($containerBuilder, new FileLocator(self::$fixturesPath.'/xml')); - $loader->load('services2.xml'); - - libxml_disable_entity_loader($oldValue); - - $this->assertTrue(count($containerBuilder->getParameterBag()->all()) > 0, 'Parameters can be read from the config file.'); - } - public function testLoadParameters() { $container = new ContainerBuilder(); From 7d8dc87616b5fe291967dd8c09cdd1dd422df517 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 May 2016 10:40:50 +0200 Subject: [PATCH 09/13] updated CHANGELOG for 2.3.42 --- CHANGELOG-2.3.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md index 1d8ff9479e..2758f011f3 100644 --- a/CHANGELOG-2.3.md +++ b/CHANGELOG-2.3.md @@ -7,6 +7,22 @@ in 2.3 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1 +* 2.3.42 (2016-05-30) + + * bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) + * bug #18893 [DependencyInjection] Skip deep reference check for 'service_container' (RobertMe) + * bug #18812 Catch \Throwable (fprochazka) + * bug #18821 [Form] Removed UTC specification with timestamp (francisbesset) + * bug #18861 Fix for #18843 (inso) + * bug #18907 [Routing] Fix the annotation loader taking a class constant as a beginning of a class name (jakzal, nicolas-grekas) + * bug #18864 [Console][DX] Fixed ambiguous error message when using a duplicate option shortcut (peterrehm) + * bug #18844 [Yaml] fix exception contexts (xabbuh) + * bug #18840 [Yaml] properly handle unindented collections (xabbuh) + * bug #18839 People - person singularization (Keeo) + * bug #18828 [Yaml] chomp newlines only at the end of YAML documents (xabbuh) + * bug #18635 [Console] Prevent fatal error when calling Command::getHelper without helperSet (chalasr) + * bug #18761 [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper (issei-m) + * 2.3.41 (2016-05-09) * security #18733 limited the maximum length of a submitted username (fabpot) From b4a9d258814792a89d8379975bcb14e7d2ef2914 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 May 2016 10:40:59 +0200 Subject: [PATCH 10/13] update CONTRIBUTORS for 2.3.42 --- CONTRIBUTORS.md | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d8e08d8711..94711183ff 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -23,8 +23,8 @@ Symfony is the result of the work of many people who made the code better - Pascal Borreli (pborreli) - Joseph Bielawski (stloyd) - Wouter De Jong (wouterj) - - Karma Dordrak (drak) - Romain Neutron (romain) + - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) - Martin Hasoň (hason) - Jeremy Mikola (jmikola) @@ -53,11 +53,11 @@ Symfony is the result of the work of many people who made the code better - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - Kevin Bond (kbond) + - Peter Rehm (rpet) - Gábor Egyed (1ed) - Michel Weimerskirch (mweimerskirch) - Eric Clemmons (ericclemmons) - Andrej Hudec (pulzarraider) - - Peter Rehm (rpet) - Christian Raue - Matthias Pigulla (mpdude) - Deni @@ -67,6 +67,7 @@ Symfony is the result of the work of many people who made the code better - Iltar van der Berg (kjarli) - Ener-Getick (energetick) - Douglas Greenshields (shieldo) + - Charles Sarrazin (csarrazi) - Lee McDermott - Brandon Turner - Luis Cordova (cordoval) @@ -74,7 +75,6 @@ Symfony is the result of the work of many people who made the code better - Pierre du Plessis (pierredup) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) - - Charles Sarrazin (csarrazi) - John Wards (johnwards) - Toni Uebernickel (havvg) - Fran Moreno (franmomu) @@ -89,6 +89,7 @@ Symfony is the result of the work of many people who made the code better - Alexander M. Turek (derrabus) - Dariusz Ruminski - marc.weistroff + - Issei Murasawa (issei_m) - lenar - Włodzimierz Gajda (gajdaw) - Alexander Schwenn (xelaris) @@ -97,13 +98,12 @@ Symfony is the result of the work of many people who made the code better - Colin Frei - Adrien Brault (adrienbrault) - Joshua Thijssen - - Issei Murasawa (issei_m) + - Baptiste Clavié (talus) - Peter Kokot (maastermedia) - excelwebzone - Jacob Dreesen (jdreesen) - Jérémy DERUSSÉ (jderusse) - Vladimir Reznichenko (kalessil) - - Baptiste Clavié (talus) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - David Buchmann (dbu) @@ -121,6 +121,7 @@ Symfony is the result of the work of many people who made the code better - Evgeniy (ewgraf) - Guilherme Blanco (guilhermeblanco) - Pablo Godel (pgodel) + - Titouan Galopin (tgalopin) - Jérémie Augustin (jaugustin) - Sebastiaan Stok (sstok) - Tugdual Saunier (tucksaun) @@ -129,10 +130,10 @@ Symfony is the result of the work of many people who made the code better - Arnaud Kleinpeter (nanocom) - Joel Wurtz (brouznouf) - Philipp Wahala (hifi) - - Titouan Galopin (tgalopin) - Richard Shank (iampersistent) - Thomas Rabaix (rande) - Vincent AUBERT (vincent) + - Rouven Weßling (realityking) - Mikael Pajunen - Clemens Tolboom - Helmer Aaviksoo @@ -143,7 +144,6 @@ Symfony is the result of the work of many people who made the code better - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba - - Rouven Weßling (realityking) - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) @@ -211,6 +211,7 @@ Symfony is the result of the work of many people who made the code better - Kristen Gilden (kgilden) - Dawid Nowak - Pierre-Yves LEBECQ (pylebecq) + - Daniel Espendiller - Jakub Kucharovic (jkucharovic) - Eugene Leonovich (rybakit) - Filippo Tessarotto @@ -240,7 +241,6 @@ Symfony is the result of the work of many people who made the code better - Michael Holm (hollo) - Marc Weistroff (futurecat) - Hidde Wieringa (hiddewie) - - Daniel Espendiller - Chris Smith (cs278) - Florian Klein (docteurklein) - Manuel Kiessling (manuelkiessling) @@ -293,6 +293,7 @@ Symfony is the result of the work of many people who made the code better - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Tomasz Kowalczyk (thunderer) + - Christian Schmidt - François-Xavier de Guillebon (de-gui_f) - Damien Alexandre (damienalexandre) - Felix Labrecque @@ -309,6 +310,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Kräutli (pkraeutli) - Kirill chEbba Chebunin (chebba) - Greg Thornton (xdissent) + - Robin Chalas (chalas_r) - Costin Bereveanu (schniper) - Loïc Chardonnet (gnusat) - Marek Kalnik (marekkalnik) @@ -319,12 +321,14 @@ Symfony is the result of the work of many people who made the code better - Pavel Volokitin (pvolok) - Endre Fejes - Tobias Naumann (tna) + - Daniel Beyer - Shein Alexey - Baptiste Lafontaine - Joe Lencioni - Daniel Tschinder - Kai - Lee Rowlands + - Krzysztof Piasecki (krzysztek) - Maximilian Reichel (phramz) - Loick Piera (pyrech) - Karoly Negyesi (chx) @@ -364,7 +368,6 @@ Symfony is the result of the work of many people who made the code better - EdgarPE - Florian Pfitzer (marmelatze) - Asier Illarramendi (doup) - - Christian Schmidt - Chris Sedlmayr (catchamonkey) - Seb Koelen - Christoph Mewes (xrstf) @@ -382,6 +385,7 @@ Symfony is the result of the work of many people who made the code better - Mathieu Lemoine - franek (franek) - Christian Wahler + - Mathieu Lemoine - Gintautas Miselis - Zander Baldwin - Adam Harvey @@ -419,7 +423,6 @@ Symfony is the result of the work of many people who made the code better - Anthony Ferrara - Ioan Negulescu - Jakub Škvára (jskvara) - - Daniel Beyer - Andrew Udvare (audvare) - alexpods - Tristan Darricau (nicofuma) @@ -448,6 +451,7 @@ Symfony is the result of the work of many people who made the code better - Denis Gorbachev (starfall) - Peter van Dommelen - Tim van Densen + - Martin Morávek (keeo) - Steven Surowiec - Kevin Saliou (kbsali) - NothingWeAre @@ -462,7 +466,6 @@ Symfony is the result of the work of many people who made the code better - Ziumin - Jeremy Benoist - Lenar Lõhmus - - Krzysztof Piasecki (krzysztek) - Benjamin Laugueux (yzalis) - Zach Badgett (zachbadgett) - Aurélien Fredouelle @@ -501,6 +504,7 @@ Symfony is the result of the work of many people who made the code better - Javier López (loalf) - Reinier Kip - Dustin Dobervich (dustin10) + - dantleech - Anne-Sophie Bachelard (annesophie) - Sebastian Marek (proofek) - Erkhembayar Gantulga (erheme318) @@ -563,6 +567,7 @@ Symfony is the result of the work of many people who made the code better - Peter Ward - Dominik Ritter (dritter) - Sebastian Grodzicki (sgrodzicki) + - SpacePossum - Martin Hujer (martinhujer) - Pascal Helfenstein - Baldur Rensch (brensch) @@ -613,6 +618,7 @@ Symfony is the result of the work of many people who made the code better - Adrien Lucas (adrienlucas) - James Michael DuPont - Tom Klingenberg + - Filip Procházka (fprochazka) - Christopher Hall (mythmakr) - Paul Kamer (pkamer) - Rafał Wrzeszcz (rafalwrzeszcz) @@ -629,6 +635,7 @@ Symfony is the result of the work of many people who made the code better - Alaattin Kahramanlar (alaattin) - Maksim Kotlyar (makasim) - Neil Ferreira + - Nathanael Noblet (gnat) - Dmitry Parnas (parnas) - Théo FIDRY (theofidry) - Paul LE CORRE @@ -745,7 +752,6 @@ Symfony is the result of the work of many people who made the code better - Guillaume Royer - Artem (digi) - boite - - dantleech - Vadim Tyukov (vatson) - Sortex - chispita @@ -851,6 +857,7 @@ Symfony is the result of the work of many people who made the code better - Christian Sciberras - Anton Bakai - Clement Herreman (clemherreman) + - Dan Ionut Dumitriu (danionut90) - Nyro (nyro) - Marco - Marc Torres @@ -870,7 +877,6 @@ Symfony is the result of the work of many people who made the code better - ConneXNL - Aharon Perkel - Abdul.Mohsen B. A. A - - SpacePossum - Benoît Burnichon - Remi Collet - pthompson @@ -1059,6 +1065,7 @@ Symfony is the result of the work of many people who made the code better - stloyd - Chris Tickner - Andrew Coulton + - Jeremy Benoist - Michal Gebauer - Gleb Sidora - David Stone @@ -1108,7 +1115,6 @@ Symfony is the result of the work of many people who made the code better - Simon Sargeant - efeen - Michał Dąbrowski (defrag) - - Nathanael Noblet (gnat) - Simone Fumagalli (hpatoio) - Brian Graham (incognito) - Kevin Vergauwen (innocenzo) @@ -1214,8 +1220,10 @@ Symfony is the result of the work of many people who made the code better - Alan Chen - Maerlyn - Even André Fiskvik + - Erik van Wingerden - Dane Powell - Gerrit Drost + - Linnaea Von Lavia - Lenar Lõhmus - Cristian Gonzalez - AlberT @@ -1271,6 +1279,7 @@ Symfony is the result of the work of many people who made the code better - Joseph Deray - Damian Sromek - Ben + - dasmfm - Arnaud Buathier (arnapou) - chesteroni (chesteroni) - Mauricio Lopez (diaspar) @@ -1358,7 +1367,6 @@ Symfony is the result of the work of many people who made the code better - Norman Soetbeer - zorn - Benjamin Long - - Robin Chalas - Matt Janssen - Peter Gribanov - kwiateusz @@ -1443,6 +1451,7 @@ Symfony is the result of the work of many people who made the code better - ollie harridge (ollietb) - Paul Andrieux (paulandrieux) - Paweł Szczepanek (pauluz) + - Philippe Degeeter (pdegeeter) - Christian López Espínola (penyaskito) - Petr Jaroš (petajaros) - Philipp Hoffmann (philipphoffmann) From 7143b2974cc2b47542df987901db0e2eda33a8d5 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 May 2016 10:41:10 +0200 Subject: [PATCH 11/13] updated VERSION for 2.3.42 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 85df657668..7f4823220c 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.3.42-DEV'; + const VERSION = '2.3.42'; const VERSION_ID = 20342; const MAJOR_VERSION = 2; const MINOR_VERSION = 3; const RELEASE_VERSION = 42; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; /** * Constructor. From cb850fef26af00920ebe5552f636fc9d6715133b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 6 Jun 2016 11:00:08 +0200 Subject: [PATCH 12/13] Fix merge --- .../Component/DependencyInjection/Dumper/PhpDumper.php | 2 +- .../Tests/Fixtures/php/services13.php | 8 ++++++++ .../Component/Serializer/Encoder/XmlEncoder.php | 2 +- .../Serializer/Normalizer/DenormalizableInterface.php | 6 +++--- .../Serializer/Normalizer/DenormalizerInterface.php | 6 +++--- .../Serializer/Normalizer/NormalizableInterface.php | 8 ++++---- .../Serializer/Normalizer/NormalizerInterface.php | 8 ++++---- src/Symfony/Component/Serializer/Serializer.php | 4 ---- .../Component/Serializer/SerializerInterface.php | 10 +++++----- src/Symfony/Component/Yaml/Tests/InlineTest.php | 2 -- 10 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index de8c4dae42..aa1257d845 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1268,7 +1268,7 @@ EOF; return true; } - if ($deep && !isset($visited[$argumentId]) && 'service_container' !== (string) $argument) { + if ($deep && !isset($visited[$argumentId]) && 'service_container' !== $argumentId) { $visited[$argumentId] = true; $service = $this->container->getDefinition($argumentId); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php index 0c33b7b3ea..f6038f3903 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php @@ -36,6 +36,14 @@ class ProjectServiceContainer extends Container $this->aliases = array(); } + /** + * {@inheritdoc} + */ + public function compile() + { + throw new LogicException('You cannot compile a dumped frozen container.'); + } + /** * Gets the 'bar' service. * diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index 94cff517dc..be6688bc3d 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -461,7 +461,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec * @param mixed $val * * @throws UnexpectedValueException - * + * * @return bool */ private function selectNodeType(\DOMNode $node, $val) diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php index 765a1c6567..b515611e78 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\Exception; +use Symfony\Component\Serializer\Exception\ExceptionInterface; /** * Defines the most basic interface a class must implement to be denormalizable. @@ -36,9 +36,9 @@ interface DenormalizableInterface * based on different input formats * @param array $context options for denormalizing * - * @return object + * @throws ExceptionInterface * - * @throws Exception + * @return object */ public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array()); } diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index 40c5890bd3..a544124f29 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\Exception; +use Symfony\Component\Serializer\Exception\ExceptionInterface; /** * Defines the interface of denormalizers. @@ -28,8 +28,8 @@ interface DenormalizerInterface * @param string $format format the given data was extracted from * @param array $context options available to the denormalizer * - * @throws Exception - * + * @throws ExceptionInterface + * * @return object */ public function denormalize($data, $class, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php index b4718cd482..ac3edb680d 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\Exception; +use Symfony\Component\Serializer\Exception\ExceptionInterface; /** * Defines the most basic interface a class must implement to be normalizable. @@ -35,9 +35,9 @@ interface NormalizableInterface * based on different output formats. * @param array $context Options for normalizing this object * - * @throws Exception - * - * @return array|string|bool|int|float|null + * @throws ExceptionInterface + * + * @return array|scalar */ public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array()); } diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index 0ce5b3aef2..333397044b 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\Exception; +use Symfony\Component\Serializer\Exception\ExceptionInterface; /** * Defines the interface of normalizers. @@ -27,9 +27,9 @@ interface NormalizerInterface * @param string $format format the normalization result will be encoded as * @param array $context Context options for the normalizer * - * @throws Exception - * - * @return array|string|bool|int|float|null + * @throws ExceptionInterface + * + * @return array|scalar */ public function normalize($object, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index d95873800e..0259bfeda6 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -183,8 +183,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz * @param string $format format name, present to give the option to normalizers to act differently based on formats * * @return NormalizerInterface|null - * - * @throws RuntimeException */ private function getNormalizer($data, $format) { @@ -203,8 +201,6 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz * @param string $format format name, present to give the option to normalizers to act differently based on formats * * @return DenormalizerInterface|null - * - * @throws RuntimeException */ private function getDenormalizer($data, $class, $format) { diff --git a/src/Symfony/Component/Serializer/SerializerInterface.php b/src/Symfony/Component/Serializer/SerializerInterface.php index ed2e71c2cd..7d1fb2e465 100644 --- a/src/Symfony/Component/Serializer/SerializerInterface.php +++ b/src/Symfony/Component/Serializer/SerializerInterface.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Serializer; -use Symfony\Component\Serializer\Exception\Exception; +use Symfony\Component\Serializer\Exception\ExceptionInterface; /** * Defines the interface of the Serializer. @@ -27,8 +27,8 @@ interface SerializerInterface * @param string $format format name * @param array $context options normalizers/encoders have access to * - * @throws Exception - * + * @throws ExceptionInterface + * * @return string */ public function serialize($data, $format, array $context = array()); @@ -41,8 +41,8 @@ interface SerializerInterface * @param string $format * @param array $context * - * @throws Exception - * + * @throws ExceptionInterface + * * @return object */ public function deserialize($data, $type, $format, array $context = array()); diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 1fbd62f56e..0e03e36a87 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -398,8 +398,6 @@ class InlineTest extends \PHPUnit_Framework_TestCase array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), - array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), - array('{ foo: { bar: { 1: 2, baz: 3 } } }', array('foo' => array('bar' => array(1 => 2, 'baz' => 3)))), ); } From bf3a2c0abd48927ede8d2820c98838762ba6339d Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 6 Jun 2016 11:38:47 +0200 Subject: [PATCH 13/13] `@throws` annotations should go after `@return` --- src/Symfony/Bridge/Twig/NodeVisitor/Scope.php | 4 ++-- .../Translation/PhpExtractor.php | 4 ++-- .../TwigBundle/Extension/AssetsExtension.php | 4 ++-- .../Component/CssSelector/Parser/Parser.php | 16 +++++++-------- .../CssSelector/Parser/TokenStream.php | 12 +++++------ .../CssSelector/XPath/Translator.php | 4 ++-- .../EventDispatcher/GenericEvent.php | 8 ++++---- .../Finder/Expression/Expression.php | 4 ++-- src/Symfony/Component/Finder/Finder.php | 4 ++-- src/Symfony/Component/Form/Form.php | 16 +++++++-------- .../HttpFoundation/ResponseHeaderBag.php | 4 ++-- .../Storage/SessionStorageInterface.php | 4 ++-- .../HttpKernel/HttpCache/HttpCache.php | 8 ++++---- src/Symfony/Component/Process/Process.php | 8 ++++---- .../Security/Acl/Dbal/MutableAclProvider.php | 20 +++++++++---------- .../Security/Acl/Domain/ObjectIdentity.php | 4 ++-- .../Security/Acl/Model/AclInterface.php | 4 ++-- .../Acl/Model/MutableAclProviderInterface.php | 4 ++-- .../Security/Acl/Permission/MaskBuilder.php | 4 ++-- .../Serializer/Encoder/XmlEncoder.php | 4 ++-- .../Normalizer/DenormalizableInterface.php | 4 ---- .../Normalizer/DenormalizerInterface.php | 4 ---- .../Normalizer/NormalizableInterface.php | 4 ---- .../Normalizer/NormalizerInterface.php | 4 ---- .../Serializer/SerializerInterface.php | 6 ------ .../Component/Stopwatch/StopwatchEvent.php | 2 -- .../Extractor/AbstractFileExtractor.php | 4 ++-- .../Translation/Loader/XliffFileLoader.php | 3 +-- .../Translation/TranslatorBagInterface.php | 4 ++-- .../Translation/TranslatorInterface.php | 8 ++++---- 30 files changed, 79 insertions(+), 104 deletions(-) diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php b/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php index 1712bd5afe..f9333bf683 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php @@ -67,9 +67,9 @@ class Scope * @param string $key * @param mixed $value * - * @throws \LogicException - * * @return Scope Current scope + * + * @throws \LogicException */ public function set($key, $value) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php b/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php index ca9e7f994c..cf7f3c5769 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/PhpExtractor.php @@ -182,9 +182,9 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * @param string $file * - * @throws \InvalidArgumentException - * * @return bool + * + * @throws \InvalidArgumentException */ protected function canBeExtracted($file) { diff --git a/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php index fc62ef059d..976086920e 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/AssetsExtension.php @@ -95,9 +95,9 @@ class AssetsExtension extends \Twig_Extension * * @param string $url The URL that has to be absolute * - * @throws \RuntimeException - * * @return string The absolute URL + * + * @throws \RuntimeException */ private function ensureUrlIsAbsolute($url) { diff --git a/src/Symfony/Component/CssSelector/Parser/Parser.php b/src/Symfony/Component/CssSelector/Parser/Parser.php index 9625e3e8a1..8b86bce3b7 100644 --- a/src/Symfony/Component/CssSelector/Parser/Parser.php +++ b/src/Symfony/Component/CssSelector/Parser/Parser.php @@ -56,9 +56,9 @@ class Parser implements ParserInterface * * @param Token[] $tokens * - * @throws SyntaxErrorException - * * @return array + * + * @throws SyntaxErrorException */ public static function parseSeries(array $tokens) { @@ -131,9 +131,9 @@ class Parser implements ParserInterface * * @param TokenStream $stream * - * @throws SyntaxErrorException - * * @return Node\SelectorNode + * + * @throws SyntaxErrorException */ private function parserSelectorNode(TokenStream $stream) { @@ -171,9 +171,9 @@ class Parser implements ParserInterface * @param TokenStream $stream * @param bool $insideNegation * - * @throws SyntaxErrorException - * * @return array + * + * @throws SyntaxErrorException */ private function parseSimpleSelector(TokenStream $stream, $insideNegation = false) { @@ -328,9 +328,9 @@ class Parser implements ParserInterface * @param Node\NodeInterface $selector * @param TokenStream $stream * - * @throws SyntaxErrorException - * * @return Node\AttributeNode + * + * @throws SyntaxErrorException */ private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream) { diff --git a/src/Symfony/Component/CssSelector/Parser/TokenStream.php b/src/Symfony/Component/CssSelector/Parser/TokenStream.php index c0525d7a83..0c166eff22 100644 --- a/src/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/src/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -83,9 +83,9 @@ class TokenStream /** * Returns next token. * - * @throws InternalErrorException If there is no more token - * * @return Token + * + * @throws InternalErrorException If there is no more token */ public function getNext() { @@ -131,9 +131,9 @@ class TokenStream /** * Returns nex identifier token. * - * @throws SyntaxErrorException If next token is not an identifier - * * @return string The identifier token value + * + * @throws SyntaxErrorException If next token is not an identifier */ public function getNextIdentifier() { @@ -149,9 +149,9 @@ class TokenStream /** * Returns nex identifier or star delimiter token. * - * @throws SyntaxErrorException If next token is not an identifier or a star delimiter - * * @return null|string The identifier token value or null if star found + * + * @throws SyntaxErrorException If next token is not an identifier or a star delimiter */ public function getNextIdentifierOrStar() { diff --git a/src/Symfony/Component/CssSelector/XPath/Translator.php b/src/Symfony/Component/CssSelector/XPath/Translator.php index 5053793ea0..aac2691f1a 100644 --- a/src/Symfony/Component/CssSelector/XPath/Translator.php +++ b/src/Symfony/Component/CssSelector/XPath/Translator.php @@ -266,9 +266,9 @@ class Translator implements TranslatorInterface * @param string $attribute * @param string $value * - * @throws ExpressionErrorException - * * @return XPathExpr + * + * @throws ExpressionErrorException */ public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value) { diff --git a/src/Symfony/Component/EventDispatcher/GenericEvent.php b/src/Symfony/Component/EventDispatcher/GenericEvent.php index 6458180a5a..03cbcfe334 100644 --- a/src/Symfony/Component/EventDispatcher/GenericEvent.php +++ b/src/Symfony/Component/EventDispatcher/GenericEvent.php @@ -61,9 +61,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate * * @param string $key Key. * - * @throws \InvalidArgumentException If key is not found. - * * @return mixed Contents of array key. + * + * @throws \InvalidArgumentException If key is not found. */ public function getArgument($key) { @@ -130,9 +130,9 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate * * @param string $key Array key. * - * @throws \InvalidArgumentException If key does not exist in $this->args. - * * @return mixed + * + * @throws \InvalidArgumentException If key does not exist in $this->args. */ public function offsetGet($key) { diff --git a/src/Symfony/Component/Finder/Expression/Expression.php b/src/Symfony/Component/Finder/Expression/Expression.php index 900260751e..a4f1f219a8 100644 --- a/src/Symfony/Component/Finder/Expression/Expression.php +++ b/src/Symfony/Component/Finder/Expression/Expression.php @@ -123,9 +123,9 @@ class Expression implements ValueInterface } /** - * @throws \LogicException - * * @return Glob + * + * @throws \LogicException */ public function getGlob() { diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index a7c7500e09..c83a024eab 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -128,9 +128,9 @@ class Finder implements \IteratorAggregate, \Countable * * @param string $name * - * @throws \InvalidArgumentException - * * @return Finder The current Finder instance + * + * @throws \InvalidArgumentException */ public function setAdapter($name) { diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 47c38c5718..a395f42708 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -1072,9 +1072,9 @@ class Form implements \IteratorAggregate, FormInterface * * @param mixed $value The value to transform * - * @throws TransformationFailedException If the value cannot be transformed to "normalized" format - * * @return mixed + * + * @throws TransformationFailedException If the value cannot be transformed to "normalized" format */ private function modelToNorm($value) { @@ -1098,9 +1098,9 @@ class Form implements \IteratorAggregate, FormInterface * * @param string $value The value to reverse transform * - * @throws TransformationFailedException If the value cannot be transformed to "model" format - * * @return mixed + * + * @throws TransformationFailedException If the value cannot be transformed to "model" format */ private function normToModel($value) { @@ -1126,9 +1126,9 @@ class Form implements \IteratorAggregate, FormInterface * * @param mixed $value The value to transform * - * @throws TransformationFailedException If the value cannot be transformed to "view" format - * * @return mixed + * + * @throws TransformationFailedException If the value cannot be transformed to "view" format */ private function normToView($value) { @@ -1161,9 +1161,9 @@ class Form implements \IteratorAggregate, FormInterface * * @param string $value The value to reverse transform * - * @throws TransformationFailedException If the value cannot be transformed to "normalized" format - * * @return mixed + * + * @throws TransformationFailedException If the value cannot be transformed to "normalized" format */ private function viewToNorm($value) { diff --git a/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php b/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php index 06534aa75b..1d26e86b9b 100644 --- a/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php +++ b/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php @@ -181,9 +181,9 @@ class ResponseHeaderBag extends HeaderBag * * @param string $format * - * @throws \InvalidArgumentException When the $format is invalid - * * @return array + * + * @throws \InvalidArgumentException When the $format is invalid */ public function getCookies($format = self::COOKIES_FLAT) { diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php index 4b2f5d27aa..206f18e77f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php @@ -24,9 +24,9 @@ interface SessionStorageInterface /** * Starts the session. * - * @throws \RuntimeException If something goes wrong starting the session. - * * @return bool True if started. + * + * @throws \RuntimeException If something goes wrong starting the session. */ public function start(); diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 6075d235b6..f794d94e29 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -153,9 +153,9 @@ class HttpCache implements HttpKernelInterface, TerminableInterface /** * Gets the Surrogate instance. * - * @throws \LogicException - * * @return SurrogateInterface A Surrogate instance + * + * @throws \LogicException */ public function getSurrogate() { @@ -169,10 +169,10 @@ class HttpCache implements HttpKernelInterface, TerminableInterface /** * Gets the Esi instance. * - * @throws \LogicException - * * @return Esi An Esi instance * + * @throws \LogicException + * * @deprecated since version 2.6, to be removed in 3.0. Use getSurrogate() instead */ public function getEsi() diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 08742df2d9..67ea654589 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -477,10 +477,10 @@ class Process * In comparison with the getOutput method which always return the whole * output, this one returns the new output since the last call. * + * @return string The process output since the last call + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started - * - * @return string The process output since the last call */ public function getIncrementalOutput() { @@ -536,10 +536,10 @@ class Process * whole error output, this one returns the new error output since the last * call. * + * @return string The process error output since the last call + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started - * - * @return string The process error output since the last call */ public function getIncrementalErrorOutput() { diff --git a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php index 273625a48e..bd1976fa31 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php @@ -554,9 +554,9 @@ QUERY; * * @param SecurityIdentityInterface $sid * - * @throws \InvalidArgumentException - * * @return string + * + * @throws \InvalidArgumentException */ protected function getInsertSecurityIdentitySql(SecurityIdentityInterface $sid) { @@ -626,9 +626,9 @@ QUERY; * * @param SecurityIdentityInterface $sid * - * @throws \InvalidArgumentException - * * @return string + * + * @throws \InvalidArgumentException */ protected function getSelectSecurityIdentityIdSql(SecurityIdentityInterface $sid) { @@ -655,9 +655,9 @@ QUERY; * * @param SecurityIdentityInterface $sid * - * @throws \InvalidArgumentException - * * @return string + * + * @throws \InvalidArgumentException */ protected function getDeleteSecurityIdentityIdSql(SecurityIdentityInterface $sid) { @@ -673,9 +673,9 @@ QUERY; * @param int $pk * @param array $changes * - * @throws \InvalidArgumentException - * * @return string + * + * @throws \InvalidArgumentException */ protected function getUpdateObjectIdentitySql($pk, array $changes) { @@ -723,9 +723,9 @@ QUERY; * @param int $pk * @param array $sets * - * @throws \InvalidArgumentException - * * @return string + * + * @throws \InvalidArgumentException */ protected function getUpdateAccessControlEntrySql($pk, array $sets) { diff --git a/src/Symfony/Component/Security/Acl/Domain/ObjectIdentity.php b/src/Symfony/Component/Security/Acl/Domain/ObjectIdentity.php index 871bda7b10..ec817e2e87 100644 --- a/src/Symfony/Component/Security/Acl/Domain/ObjectIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/ObjectIdentity.php @@ -52,9 +52,9 @@ final class ObjectIdentity implements ObjectIdentityInterface * * @param object $domainObject * - * @throws InvalidDomainObjectException - * * @return ObjectIdentity + * + * @throws InvalidDomainObjectException */ public static function fromDomainObject($domainObject) { diff --git a/src/Symfony/Component/Security/Acl/Model/AclInterface.php b/src/Symfony/Component/Security/Acl/Model/AclInterface.php index 6a70a7c594..13a6cf8394 100644 --- a/src/Symfony/Component/Security/Acl/Model/AclInterface.php +++ b/src/Symfony/Component/Security/Acl/Model/AclInterface.php @@ -97,9 +97,9 @@ interface AclInterface extends \Serializable * @param array $securityIdentities * @param bool $administrativeMode * - * @throws NoAceFoundException when no ACE was applicable for this request - * * @return bool + * + * @throws NoAceFoundException when no ACE was applicable for this request */ public function isGranted(array $masks, array $securityIdentities, $administrativeMode = false); diff --git a/src/Symfony/Component/Security/Acl/Model/MutableAclProviderInterface.php b/src/Symfony/Component/Security/Acl/Model/MutableAclProviderInterface.php index 95f531e09b..ee6d7c406e 100644 --- a/src/Symfony/Component/Security/Acl/Model/MutableAclProviderInterface.php +++ b/src/Symfony/Component/Security/Acl/Model/MutableAclProviderInterface.php @@ -25,10 +25,10 @@ interface MutableAclProviderInterface extends AclProviderInterface * * @param ObjectIdentityInterface $oid * + * @return MutableAclInterface + * * @throws AclAlreadyExistsException when there already is an ACL for the given * object identity - * - * @return MutableAclInterface */ public function createAcl(ObjectIdentityInterface $oid); diff --git a/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php b/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php index 0b5f388b48..ed13ecb885 100644 --- a/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php +++ b/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php @@ -96,10 +96,10 @@ class MaskBuilder extends AbstractMaskBuilder * * @param int $mask * + * @return string + * * @throws \InvalidArgumentException * @throws \RuntimeException - * - * @return string */ public static function getCode($mask) { diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index be6688bc3d..4c17fb6b8d 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -460,9 +460,9 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec * @param \DOMNode $node * @param mixed $val * - * @throws UnexpectedValueException - * * @return bool + * + * @throws UnexpectedValueException */ private function selectNodeType(\DOMNode $node, $val) { diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php index b515611e78..8ad1386a6c 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\ExceptionInterface; - /** * Defines the most basic interface a class must implement to be denormalizable. * @@ -36,8 +34,6 @@ interface DenormalizableInterface * based on different input formats * @param array $context options for denormalizing * - * @throws ExceptionInterface - * * @return object */ public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index a544124f29..8b6c233395 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\ExceptionInterface; - /** * Defines the interface of denormalizers. * @@ -28,8 +26,6 @@ interface DenormalizerInterface * @param string $format format the given data was extracted from * @param array $context options available to the denormalizer * - * @throws ExceptionInterface - * * @return object */ public function denormalize($data, $class, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php index ac3edb680d..e19fe5ce58 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\ExceptionInterface; - /** * Defines the most basic interface a class must implement to be normalizable. * @@ -35,8 +33,6 @@ interface NormalizableInterface * based on different output formats. * @param array $context Options for normalizing this object * - * @throws ExceptionInterface - * * @return array|scalar */ public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index 333397044b..f4bd355232 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Serializer\Normalizer; -use Symfony\Component\Serializer\Exception\ExceptionInterface; - /** * Defines the interface of normalizers. * @@ -27,8 +25,6 @@ interface NormalizerInterface * @param string $format format the normalization result will be encoded as * @param array $context Context options for the normalizer * - * @throws ExceptionInterface - * * @return array|scalar */ public function normalize($object, $format = null, array $context = array()); diff --git a/src/Symfony/Component/Serializer/SerializerInterface.php b/src/Symfony/Component/Serializer/SerializerInterface.php index 7d1fb2e465..c79db91892 100644 --- a/src/Symfony/Component/Serializer/SerializerInterface.php +++ b/src/Symfony/Component/Serializer/SerializerInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Serializer; -use Symfony\Component\Serializer\Exception\ExceptionInterface; - /** * Defines the interface of the Serializer. * @@ -27,8 +25,6 @@ interface SerializerInterface * @param string $format format name * @param array $context options normalizers/encoders have access to * - * @throws ExceptionInterface - * * @return string */ public function serialize($data, $format, array $context = array()); @@ -41,8 +37,6 @@ interface SerializerInterface * @param string $format * @param array $context * - * @throws ExceptionInterface - * * @return object */ public function deserialize($data, $type, $format, array $context = array()); diff --git a/src/Symfony/Component/Stopwatch/StopwatchEvent.php b/src/Symfony/Component/Stopwatch/StopwatchEvent.php index 930722d2f5..957a5d0dae 100644 --- a/src/Symfony/Component/Stopwatch/StopwatchEvent.php +++ b/src/Symfony/Component/Stopwatch/StopwatchEvent.php @@ -87,8 +87,6 @@ class StopwatchEvent /** * Stops the last started event period. * - * @throws \LogicException When start wasn't called before stopping - * * @return StopwatchEvent The event * * @throws \LogicException When stop() is called without a matching call to start() diff --git a/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php b/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php index 196bc33410..57fd4938d2 100644 --- a/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php +++ b/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php @@ -54,9 +54,9 @@ abstract class AbstractFileExtractor /** * @param string $file * - * @throws \InvalidArgumentException - * * @return bool + * + * @throws \InvalidArgumentException */ protected function isFile($file) { diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 0e335db425..0381a4ca4d 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -112,10 +112,9 @@ class XliffFileLoader implements LoaderInterface * * @param string $file * - * @throws \RuntimeException - * * @return \SimpleXMLElement * + * @throws \RuntimeException * @throws InvalidResourceException */ private function parseFile($file) diff --git a/src/Symfony/Component/Translation/TranslatorBagInterface.php b/src/Symfony/Component/Translation/TranslatorBagInterface.php index 6f650b5ee0..14fbb17f5e 100644 --- a/src/Symfony/Component/Translation/TranslatorBagInterface.php +++ b/src/Symfony/Component/Translation/TranslatorBagInterface.php @@ -23,9 +23,9 @@ interface TranslatorBagInterface * * @param string|null $locale The locale or null to use the default * - * @throws \InvalidArgumentException If the locale contains invalid characters - * * @return MessageCatalogueInterface + * + * @throws \InvalidArgumentException If the locale contains invalid characters */ public function getCatalogue($locale = null); } diff --git a/src/Symfony/Component/Translation/TranslatorInterface.php b/src/Symfony/Component/Translation/TranslatorInterface.php index 869e0b9004..6916c335bd 100644 --- a/src/Symfony/Component/Translation/TranslatorInterface.php +++ b/src/Symfony/Component/Translation/TranslatorInterface.php @@ -26,9 +26,9 @@ interface TranslatorInterface * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * - * @throws \InvalidArgumentException If the locale contains invalid characters - * * @return string The translated string + * + * @throws \InvalidArgumentException If the locale contains invalid characters */ public function trans($id, array $parameters = array(), $domain = null, $locale = null); @@ -41,9 +41,9 @@ interface TranslatorInterface * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * - * @throws \InvalidArgumentException If the locale contains invalid characters - * * @return string The translated string + * + * @throws \InvalidArgumentException If the locale contains invalid characters */ public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);