diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index c6fad1eb5bcd5..f87a36fac430b 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,27 @@ in 3.4 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/v3.4.0...v3.4.1 +* 3.4.0-BETA3 (2017-11-05) + + * bug #24531 [HttpFoundation] Fix forward-compat of NativeSessionStorage with PHP 7.2 (sroze) + * bug #24828 [DI] Fix the "almost-circular refs" fix (nicolas-grekas) + * bug #24665 Fix dump panel hidden when closing a dump (julienfalque) + * bug #24802 [TwigBridge] [Bootstrap 4] Fix hidden errors (ostrolucky) + * bug #24816 [Serializer] Fix extra attributes when no group specified (ogizanagi) + * bug #24822 [DI] Fix "almost-circular" dependencies handling (nicolas-grekas) + * bug #24821 symfony/form auto-enables symfony/validator, even when not present (weaverryan) + * bug #24824 [FrameworkBundle][Config] fix: do not add resource checkers for no-debug (dmaicher) + * bug #24814 [Intl] Make intl-data tests pass and save language aliases again (jakzal) + * bug #24810 [Serializer] readd default argument value (xabbuh) + * bug #24809 [Config] Fix dump of config references for deprecated nodes (chalasr) + * bug #24796 [PhpUnitBridge] Fixed fatal error in CoverageListener when something goes wrong in Test::setUpBeforeClass (lyrixx) + * bug #24774 [HttpKernel] Let the storage manage the session starts (sroze) + * bug #24735 [VarDumper] fix trailling comma when dumping an exception (Simperfit) + * bug #24770 [Validator] Fix TraceableValidator is reset on data collector instantiation (ogizanagi) + * bug #24764 [HttpFoundation] add Early Hints to Reponse to fix test (Simperfit) + * bug #24759 Removes \n or space when $context/$extra are empty (kirkmadera) + * bug #24758 Throwing exception if redis and predis unavailable (aequasi) + * 3.4.0-BETA2 (2017-10-30) * bug #24728 [Bridge\Twig] fix bootstrap checkbox_row to render properly & remove spaceless (arkste) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php index 2a9da54961d39..f154083b29de6 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php @@ -21,11 +21,11 @@ */ class DoctrineValidationPass implements CompilerPassInterface { - /** - * @var string - */ private $managerType; + /** + * @param string $managerType + */ public function __construct($managerType) { $this->managerType = $managerType; diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php index 045f0edaedcf7..18f700a894193 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -113,7 +113,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface * present to enable the mapping. Set to false * to not do any check, optional. * @param string $configurationPattern Pattern for the Configuration service name - * @param string $registerAliasMethodName name of Configuration class method to + * @param string $registerAliasMethodName Name of Configuration class method to * register alias * @param string[] $aliasMap Map of alias to namespace */ @@ -178,7 +178,7 @@ protected function getChainDriverServiceName(ContainerBuilder $container) /** * Create the service definition for the metadata driver. * - * @param ContainerBuilder $container passed on in case an extending class + * @param ContainerBuilder $container Passed on in case an extending class * needs access to the container * * @return Definition|Reference the metadata driver to add to all chain drivers diff --git a/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php b/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php index e2eb6e664557b..9440147f23937 100644 --- a/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php +++ b/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php @@ -24,9 +24,6 @@ */ class DoctrineParserCache implements ParserCacheInterface { - /** - * @var Cache - */ private $cache; public function __construct(Cache $cache) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php index 1212b1b9c8309..f23d878db2f63 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -24,24 +24,9 @@ */ class DoctrineChoiceLoader implements ChoiceLoaderInterface { - /** - * @var ObjectManager - */ private $manager; - - /** - * @var string - */ private $class; - - /** - * @var IdReader - */ private $idReader; - - /** - * @var null|EntityLoaderInterface - */ private $objectLoader; /** @@ -57,13 +42,10 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface * mapper implementations. * * @param ObjectManager $manager The object manager - * @param string $class The class name of the - * loaded objects - * @param IdReader $idReader the reader for the object - * IDs + * @param string $class The class name of the loaded objects + * @param IdReader $idReader The reader for the object IDs * @param null|EntityLoaderInterface $objectLoader The objects loader - * @param ChoiceListFactoryInterface $factory The factory for creating - * the loaded choice list + * @param ChoiceListFactoryInterface $factory The factory for creating the loaded choice list */ public function __construct($manager, $class, $idReader = null, $objectLoader = null, $factory = null) { diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php index 793e035f82c28..75798d279919e 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php @@ -24,29 +24,10 @@ */ class IdReader { - /** - * @var ObjectManager - */ private $om; - - /** - * @var ClassMetadata - */ private $classMetadata; - - /** - * @var bool - */ private $singleId; - - /** - * @var bool - */ private $intId; - - /** - * @var string - */ private $idField; /** diff --git a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php index ae7e0da5a0243..079ff8263fe29 100644 --- a/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php +++ b/src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php @@ -27,9 +27,6 @@ */ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface { - /** - * @var ClassMetadataFactory - */ private $classMetadataFactory; public function __construct(ClassMetadataFactory $classMetadataFactory) diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index 95e8197c35fac..e03ef3c555b37 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -26,9 +26,6 @@ */ class UniqueEntityValidator extends ConstraintValidator { - /** - * @var ManagerRegistry - */ private $registry; public function __construct(ManagerRegistry $registry) diff --git a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php index ab474c1f58e3b..dbf43d51ff4c3 100644 --- a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php +++ b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php @@ -117,12 +117,20 @@ public function format(array $record) $levelColor = self::$levelColorMap[$record['level']]; if ($this->options['multiline']) { - $context = $extra = "\n"; + $separator = "\n"; } else { - $context = $extra = ' '; + $separator = ' '; + } + + $context = $this->dumpData($record['context']); + if ($context) { + $context = $separator.$context; + } + + $extra = $this->dumpData($record['extra']); + if ($extra) { + $extra = $separator.$extra; } - $context .= $this->dumpData($record['context']); - $extra .= $this->dumpData($record['extra']); $formatted = strtr($this->options['format'], array( '%datetime%' => $record['datetime']->format($this->options['date_format']), diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php index 0a1603e646cbf..1c84ff32c0b74 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php @@ -12,6 +12,7 @@ namespace Symfony\Bridge\PhpUnit\Legacy; use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Warning; /** @@ -36,6 +37,10 @@ public function __construct(callable $sutFqcnResolver = null, $warningOnSutNotFo public function startTest($test) { + if (!$test instanceof TestCase) { + return; + } + $annotations = $test->getAnnotations(); $ignoredAnnotations = array('covers', 'coversDefaultClass', 'coversNothing'); diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index e28301e09ae2d..7fb99404a404f 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -26,19 +26,8 @@ */ class ProxyDumper implements DumperInterface { - /** - * @var string - */ private $salt; - - /** - * @var LazyLoadingValueHolderGenerator - */ private $proxyGenerator; - - /** - * @var BaseGeneratorStrategy - */ private $classGenerator; /** diff --git a/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php b/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php index cb91ff428b0a2..48d99b8c7eac3 100644 --- a/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php @@ -23,10 +23,6 @@ class StopwatchExtension extends AbstractExtension { private $stopwatch; - - /** - * @var bool - */ private $enabled; public function __construct(Stopwatch $stopwatch = null, $enabled = true) diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php index c04ce13a1881b..1a60e67a2f945 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php @@ -30,9 +30,6 @@ */ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor { - /** - * @var Scope - */ private $scope; public function __construct() diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index 2407b16d9b99a..4997a94cf5dd0 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -2,6 +2,54 @@ {# Widgets #} +{% block money_widget -%} + {% if not valid %} + {% set group_class = ' form-control is-invalid' %} + {% set valid = true %} + {% endif %} + {{- parent() -}} +{%- endblock money_widget %} + +{% block datetime_widget -%} + {%- if widget != 'single_text' and not valid -%} + {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%} + {% set valid = true %} + {%- endif -%} + {{- parent() -}} +{%- endblock datetime_widget %} + +{% block date_widget -%} + {%- if widget != 'single_text' and not valid -%} + {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%} + {% set valid = true %} + {%- endif -%} + {{- parent() -}} +{%- endblock date_widget %} + +{% block time_widget -%} + {%- if widget != 'single_text' and not valid -%} + {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%} + {% set valid = true %} + {%- endif -%} + {{- parent() -}} +{%- endblock time_widget %} + +{% block dateinterval_widget -%} + {%- if widget != 'single_text' and not valid -%} + {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%} + {% set valid = true %} + {%- endif -%} + {{- parent() -}} +{%- endblock dateinterval_widget %} + +{% block percent_widget -%} +
+ {% set valid = true %} + {{- block('form_widget_simple') -}} + % +
+{%- endblock percent_widget %} + {% block form_widget_simple -%} {% if type is not defined or type != 'hidden' %} {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control' ~ (type|default('') == 'file' ? '-file' : ''))|trim}) -%} @@ -11,7 +59,7 @@ {%- block widget_attributes -%} {%- if not valid %} - {% set attr = attr|merge({class: (attr.class|default('') ~ ' is-invalid')|trim}) %} + {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) %} {% endif -%} {{ parent() }} {%- endblock widget_attributes -%} @@ -27,7 +75,7 @@ {% if 'checkbox-inline' in parent_label_class %} {{- form_label(form, null, { widget: parent() }) -}} {% else -%} -
+
{{- form_label(form, null, { widget: parent() }) -}}
{%- endif -%} @@ -39,7 +87,7 @@ {%- if 'radio-inline' in parent_label_class -%} {{- form_label(form, null, { widget: parent() }) -}} {%- else -%} -
+
{{- form_label(form, null, { widget: parent() }) -}}
{%- endif -%} @@ -55,6 +103,9 @@ }) -}} {% endfor -%} {%- else -%} + {%- if not valid -%} + {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) %} + {%- endif -%}
{%- for child in form %} {{- form_widget(child, { diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig index cdb9dbc88ef96..6793064520eb3 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig @@ -8,7 +8,7 @@ {%- endblock textarea_widget %} {% block money_widget -%} -
+
{%- set append = money_pattern starts with '{{' -%} {%- if not append -%} {{ money_pattern|replace({ '{{ widget }}':''}) }} diff --git a/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php b/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php index bd35fe5a8b1eb..db388ab70ba91 100644 --- a/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php +++ b/src/Symfony/Bridge/Twig/Translation/TwigExtractor.php @@ -42,11 +42,6 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface */ private $prefix = ''; - /** - * The twig environment. - * - * @var Environment - */ private $twig; public function __construct(Environment $twig) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php index b3d668e6f139d..fab8f5659613d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Controller; +use Doctrine\Common\Persistence\ManagerRegistry; use Psr\Container\ContainerInterface; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\JsonResponse; @@ -23,10 +24,9 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Form\Extension\Core\Type\FormType; -use Symfony\Component\Form\Form; -use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Doctrine\Bundle\DoctrineBundle\Registry; /** * Common features needed in controllers. @@ -71,7 +71,7 @@ protected function get($id) * Generates a URL from the given parameters. * * @param string $route The name of the route - * @param mixed $parameters An array of parameters + * @param array $parameters An array of parameters * @param int $referenceType The type of reference (one of the constants in UrlGeneratorInterface) * * @return string The generated URL @@ -380,7 +380,7 @@ protected function createAccessDeniedException($message = 'Access Denied.', \Exc * @param mixed $data The initial data for the form * @param array $options Options for the form * - * @return Form + * @return FormInterface * * @final since version 3.4 */ @@ -395,7 +395,7 @@ protected function createForm($type, $data = null, array $options = array()) * @param mixed $data The initial data for the form * @param array $options Options for the form * - * @return FormBuilder + * @return FormBuilderInterface * * @final since version 3.4 */ @@ -407,7 +407,7 @@ protected function createFormBuilder($data = null, array $options = array()) /** * Shortcut to return the Doctrine Registry service. * - * @return Registry + * @return ManagerRegistry * * @throws \LogicException If DoctrineBundle is not available * diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index d7d0e16d56115..2844bbc783e2c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -241,9 +241,10 @@ public function load(array $configs, ContainerBuilder $container) if ($this->isConfigEnabled($container, $config['form'])) { $this->formConfigEnabled = true; $this->registerFormConfiguration($config, $container, $loader); - $config['validation']['enabled'] = true; - if (!class_exists('Symfony\Component\Validator\Validation')) { + if (class_exists('Symfony\Component\Validator\Validation')) { + $config['validation']['enabled'] = true; + } else { $container->setParameter('validator.translation_domain', 'validators'); $container->removeDefinition('form.type_extension.form.validator'); @@ -361,6 +362,11 @@ public function load(array $configs, ContainerBuilder $container) $container->registerForAutoconfiguration(ObjectInitializerInterface::class) ->addTag('validator.initializer'); + if (!$container->getParameter('kernel.debug')) { + // remove tagged iterator argument for resource checkers + $container->getDefinition('config_cache_factory')->setArguments(array()); + } + if (\PHP_VERSION_ID < 70000) { $this->addClassesToCompile(array( 'Symfony\\Component\\Config\\ConfigCache', diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml index f515d33c0c311..74643a9d208f7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml @@ -59,7 +59,6 @@ - %router.resource% @@ -75,7 +74,6 @@ %router.options.matcher.cache_class% - diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator_debug.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator_debug.xml index ac4724580a53e..2548926ca3354 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator_debug.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator_debug.xml @@ -9,6 +9,7 @@ + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php index 8d5a6e710d682..6d9a256e06ce2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\File; @@ -21,8 +22,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; -use Symfony\Component\HttpFoundation\StreamedResponse; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\User\User; @@ -533,98 +532,25 @@ public function testGetDoctrine() trait TestControllerTrait { - public function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) - { - return parent::generateUrl($route, $parameters, $referenceType); - } - - public function redirect($url, $status = 302) - { - return parent::redirect($url, $status); - } - - public function forward($controller, array $path = array(), array $query = array()) - { - return parent::forward($controller, $path, $query); - } - - public function getUser() - { - return parent::getUser(); - } - - public function json($data, $status = 200, $headers = array(), $context = array()) - { - return parent::json($data, $status, $headers, $context); - } - - public function file($file, $fileName = null, $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT) - { - return parent::file($file, $fileName, $disposition); - } - - public function isGranted($attributes, $object = null) - { - return parent::isGranted($attributes, $object); - } - - public function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') - { - parent::denyAccessUnlessGranted($attributes, $object, $message); - } - - public function redirectToRoute($route, array $parameters = array(), $status = 302) - { - return parent::redirectToRoute($route, $parameters, $status); - } - - public function addFlash($type, $message) - { - parent::addFlash($type, $message); - } - - public function isCsrfTokenValid($id, $token) - { - return parent::isCsrfTokenValid($id, $token); - } - - public function renderView($view, array $parameters = array()) - { - return parent::renderView($view, $parameters); - } - - public function render($view, array $parameters = array(), Response $response = null) - { - return parent::render($view, $parameters, $response); - } - - public function stream($view, array $parameters = array(), StreamedResponse $response = null) - { - return parent::stream($view, $parameters, $response); - } - - public function createNotFoundException($message = 'Not Found', \Exception $previous = null) - { - return parent::createNotFoundException($message, $previous); - } - - public function createAccessDeniedException($message = 'Access Denied.', \Exception $previous = null) - { - return parent::createAccessDeniedException($message, $previous); - } - - public function createForm($type, $data = null, array $options = array()) - { - return parent::createForm($type, $data, $options); - } - - public function createFormBuilder($data = null, array $options = array()) - { - return parent::createFormBuilder($data, $options); - } - - public function getDoctrine() - { - return parent::getDoctrine(); + use ControllerTrait { + generateUrl as public; + redirect as public; + forward as public; + getUser as public; + json as public; + file as public; + isGranted as public; + denyAccessUnlessGranted as public; + redirectToRoute as public; + addFlash as public; + isCsrfTokenValid as public; + renderView as public; + render as public; + stream as public; + createNotFoundException as public; + createAccessDeniedException as public; + createForm as public; + createFormBuilder as public; + getDoctrine as public; } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 31f34c9859e12..8b2841dc9ab60 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -988,6 +988,17 @@ public function testCachePoolServices() $this->assertCachePoolServiceDefinitionIsCreated($container, 'cache.def', 'cache.app', 11); } + public function testRemovesResourceCheckerConfigCacheFactoryArgumentOnlyIfNoDebug() + { + $container = $this->createContainer(array('kernel.debug' => true)); + (new FrameworkExtension())->load(array(), $container); + $this->assertCount(1, $container->getDefinition('config_cache_factory')->getArguments()); + + $container = $this->createContainer(array('kernel.debug' => false)); + (new FrameworkExtension())->load(array(), $container); + $this->assertEmpty($container->getDefinition('config_cache_factory')->getArguments()); + } + protected function createContainer(array $data = array()) { return new ContainerBuilder(new ParameterBag(array_merge(array( diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php index b125c75c0676c..34881b2d4b20f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php @@ -24,8 +24,8 @@ class TranslationLoader extends TranslationReader /** * Loads translation messages from a directory to the catalogue. * - * @param string $directory the directory to look into - * @param MessageCatalogue $catalogue the catalogue + * @param string $directory The directory to look into + * @param MessageCatalogue $catalogue The catalogue */ public function loadMessages($directory, MessageCatalogue $catalogue) { diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index 57886da3b4693..b2dfab96ea278 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -29,12 +29,12 @@ class ExceptionController { protected $twig; + protected $debug; /** - * @var bool Show error (false) or exception (true) pages by default + * @param Environment $twig + * @param bool $debug Show error (false) or exception (true) pages by default */ - protected $debug; - public function __construct(Environment $twig, $debug) { $this->twig = $twig; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig index 33a59d4322925..933cd360dd238 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_js.html.twig @@ -98,6 +98,16 @@ Sfjs.toggleClass(this.parentNode, 'hover'); }); + + var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info'); + if (null !== dumpInfo) { + Sfjs.addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () { + dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px'; + }); + Sfjs.addEventListener(dumpInfo, 'mouseleave', function () { + dumpInfo.style.minHeight = ''; + }); + } }, function(xhr) { if (xhr.status !== 0) { diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php index 5e5e7a21fe76b..ec420107dfd05 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php @@ -84,12 +84,29 @@ public function testToolbarIsInjected() $this->assertEquals("\nWDT\n", $response->getContent()); } + /** + * @depends testToolbarIsInjected + */ + public function testToolbarIsNotInjectedOnNonHtmlContentType() + { + $response = new Response(''); + $response->headers->set('X-Debug-Token', 'xxxxxxxx'); + $response->headers->set('Content-Type', 'text/xml'); + $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response); + + $listener = new WebDebugToolbarListener($this->getTwigMock()); + $listener->onKernelResponse($event); + + $this->assertEquals('', $response->getContent()); + } + /** * @depends testToolbarIsInjected */ public function testToolbarIsNotInjectedOnContentDispositionAttachment() { $response = new Response(''); + $response->headers->set('X-Debug-Token', 'xxxxxxxx'); $response->headers->set('Content-Disposition', 'attachment; filename=test.html'); $event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html'), HttpKernelInterface::MASTER_REQUEST, $response); diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 467e602070c7a..ae07ad39a140d 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -16,6 +16,7 @@ use Predis\Connection\Aggregate\PredisCluster; use Predis\Connection\Aggregate\RedisCluster; use Predis\Response\Status; +use Symfony\Component\Cache\Exception\CacheException; use Symfony\Component\Cache\Exception\InvalidArgumentException; /** @@ -108,6 +109,9 @@ public static function createConnection($dsn, array $options = array()) $params += $query; } $params += $options + self::$defaultConnectionOptions; + if (null === $params['class'] && !extension_loaded('redis') && !class_exists(\Predis\Client::class)) { + throw new CacheException(sprintf('Cannot find the "redis" extension, and "predis/predis" is not installed: %s', $dsn)); + } $class = null === $params['class'] ? (extension_loaded('redis') ? \Redis::class : \Predis\Client::class) : $params['class']; if (is_a($class, \Redis::class, true)) { diff --git a/src/Symfony/Component/ClassLoader/XcacheClassLoader.php b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php index 6c9d753480988..74dbdc85d25e5 100644 --- a/src/Symfony/Component/ClassLoader/XcacheClassLoader.php +++ b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php @@ -51,12 +51,6 @@ class XcacheClassLoader { private $prefix; - - /** - * A class loader object that implements the findFile() method. - * - * @var object - */ private $decorated; /** diff --git a/src/Symfony/Component/Config/ConfigCacheFactory.php b/src/Symfony/Component/Config/ConfigCacheFactory.php index 396536e2d8ed8..06dbe6c2947ed 100644 --- a/src/Symfony/Component/Config/ConfigCacheFactory.php +++ b/src/Symfony/Component/Config/ConfigCacheFactory.php @@ -22,9 +22,6 @@ */ class ConfigCacheFactory implements ConfigCacheFactoryInterface { - /** - * @var bool Debug flag passed to the ConfigCache - */ private $debug; /** diff --git a/src/Symfony/Component/Config/Definition/ArrayNode.php b/src/Symfony/Component/Config/Definition/ArrayNode.php index 6fb8a44be1bb2..fa2faea7fe87d 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -82,7 +82,7 @@ public function getChildren() /** * Sets the xml remappings that should be performed. * - * @param array $remappings an array of the form array(array(string, string)) + * @param array $remappings An array of the form array(array(string, string)) */ public function setXmlRemappings(array $remappings) { diff --git a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php index b8533b79e77a7..c8d929e95149e 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -68,7 +68,7 @@ public function children() /** * Sets a prototype for child nodes. * - * @param string $type the type of node + * @param string $type The type of node * * @return NodeDefinition */ @@ -154,7 +154,7 @@ public function addDefaultsIfNotSet() * * This method is applicable to prototype nodes only. * - * @param int|string|array|null $children the number of children|The child name|The children names to be added + * @param int|string|array|null $children The number of children|The child name|The children names to be added * * @return $this */ diff --git a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php index 9b325f189b841..152a497b14339 100644 --- a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php +++ b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php @@ -61,7 +61,7 @@ public function arrayNode($name) /** * Creates a child scalar node. * - * @param string $name the name of the node + * @param string $name The name of the node * * @return ScalarNodeDefinition The child node */ @@ -85,7 +85,7 @@ public function booleanNode($name) /** * Creates a child integer node. * - * @param string $name the name of the node + * @param string $name The name of the node * * @return IntegerNodeDefinition The child node */ @@ -97,7 +97,7 @@ public function integerNode($name) /** * Creates a child float node. * - * @param string $name the name of the node + * @param string $name The name of the node * * @return FloatNodeDefinition The child node */ diff --git a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php index 44cc9ea9ab79b..f78bc7c3a258b 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php @@ -154,7 +154,7 @@ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $name } if ($child->isDeprecated()) { - $comments[] = sprintf('Deprecated (%s)', $child->getDeprecationMessage($child->getName(), $child->getPath())); + $comments[] = sprintf('Deprecated (%s)', $child->getDeprecationMessage($child->getName(), $node->getPath())); } if ($child instanceof EnumNode) { diff --git a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php index 8f51087de9fc2..5a0e76c5255a3 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php @@ -70,11 +70,12 @@ public function dumpNode(NodeInterface $node) } /** - * @param NodeInterface $node - * @param int $depth - * @param bool $prototypedArray + * @param NodeInterface $node + * @param NodeInterface|null $parentNode + * @param int $depth + * @param bool $prototypedArray */ - private function writeNode(NodeInterface $node, $depth = 0, $prototypedArray = false) + private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, $depth = 0, $prototypedArray = false) { $comments = array(); $default = ''; @@ -125,7 +126,7 @@ private function writeNode(NodeInterface $node, $depth = 0, $prototypedArray = f // deprecated? if ($node->isDeprecated()) { - $comments[] = sprintf('Deprecated (%s)', $node->getDeprecationMessage($node->getName(), $node->getPath())); + $comments[] = sprintf('Deprecated (%s)', $node->getDeprecationMessage($node->getName(), $parentNode ? $parentNode->getPath() : $node->getPath())); } // example @@ -171,7 +172,7 @@ private function writeNode(NodeInterface $node, $depth = 0, $prototypedArray = f if ($children) { foreach ($children as $childNode) { - $this->writeNode($childNode, $depth + 1, $node instanceof PrototypedArrayNode && !$node->getKeyAttribute()); + $this->writeNode($childNode, $node, $depth + 1, $node instanceof PrototypedArrayNode && !$node->getKeyAttribute()); } } } diff --git a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php index ab8c99eeadaa5..d2c5eff24703a 100644 --- a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php +++ b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php @@ -68,7 +68,11 @@ public function isFresh() return false; } - if (!$this->resourceCheckers) { + if ($this->resourceCheckers instanceof \Traversable && !$this->resourceCheckers instanceof \Countable) { + $this->resourceCheckers = iterator_to_array($this->resourceCheckers); + } + + if (!count($this->resourceCheckers)) { return true; // shortcut - if we don't have any checkers we don't need to bother with the meta file at all } diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php index 3123c9740a24c..5bc961bab65cf 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php @@ -38,8 +38,8 @@ private function getConfigurationAsString() return str_replace("\n", PHP_EOL, <<<'EOL' - - + + assertFalse($cache->isFresh()); } - public function testCacheIsFreshIfNocheckerProvided() + public function testCacheIsFreshIfNoCheckerProvided() { /* For example in prod mode, you may choose not to run any checkers at all. In that case, the cache should always be considered fresh. */ @@ -65,6 +65,12 @@ public function testCacheIsFreshIfNocheckerProvided() $this->assertTrue($cache->isFresh()); } + public function testCacheIsFreshIfEmptyCheckerIteratorProvided() + { + $cache = new ResourceCheckerConfigCache($this->cacheFile, new \ArrayIterator(array())); + $this->assertTrue($cache->isFresh()); + } + public function testResourcesWithoutcheckersAreIgnoredAndConsideredFresh() { /* As in the previous test, but this time we have a resource. */ diff --git a/src/Symfony/Component/Console/ConsoleEvents.php b/src/Symfony/Component/Console/ConsoleEvents.php index 7f7d4a3f28ff0..bf6cab9a19ab4 100644 --- a/src/Symfony/Component/Console/ConsoleEvents.php +++ b/src/Symfony/Component/Console/ConsoleEvents.php @@ -24,8 +24,6 @@ final class ConsoleEvents * before they are handled to the command. * * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - * - * @var string */ const COMMAND = 'console.command'; @@ -34,8 +32,6 @@ final class ConsoleEvents * executed by the console. * * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - * - * @var string */ const TERMINATE = 'console.terminate'; @@ -48,8 +44,6 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleExceptionEvent") * - * @var string - * * @deprecated The console.exception event is deprecated since version 3.3 and will be removed in 4.0. Use the console.error event instead. */ const EXCEPTION = 'console.exception'; @@ -61,8 +55,6 @@ final class ConsoleEvents * to modify the thrown exception. * * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - * - * @var string */ const ERROR = 'console.error'; } diff --git a/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php b/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php index 92adf1ef96ceb..2f517c1db373f 100644 --- a/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php +++ b/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php @@ -25,8 +25,6 @@ class ConsoleCommandEvent extends ConsoleEvent /** * Indicates if the command should be run or skipped. - * - * @var bool */ private $commandShouldRun = true; diff --git a/src/Symfony/Component/Console/Helper/ProgressBar.php b/src/Symfony/Component/Console/Helper/ProgressBar.php index 31c49ef730f02..247b59133b6a6 100644 --- a/src/Symfony/Component/Console/Helper/ProgressBar.php +++ b/src/Symfony/Component/Console/Helper/ProgressBar.php @@ -24,7 +24,6 @@ */ final class ProgressBar { - // options private $barWidth = 28; private $barChar; private $emptyBarChar = '-'; @@ -32,10 +31,6 @@ final class ProgressBar private $format; private $internalFormat; private $redrawFreq = 1; - - /** - * @var OutputInterface - */ private $output; private $step = 0; private $max; diff --git a/src/Symfony/Component/Console/Input/InputDefinition.php b/src/Symfony/Component/Console/Input/InputDefinition.php index 2e0c9a148e020..d5b99ab3965e1 100644 --- a/src/Symfony/Component/Console/Input/InputDefinition.php +++ b/src/Symfony/Component/Console/Input/InputDefinition.php @@ -306,7 +306,7 @@ public function hasShortcut($name) /** * Gets an InputOption by shortcut. * - * @param string $shortcut the Shortcut name + * @param string $shortcut The Shortcut name * * @return InputOption An InputOption object */ diff --git a/src/Symfony/Component/Console/Output/BufferedOutput.php b/src/Symfony/Component/Console/Output/BufferedOutput.php index 205b02f5fd5d1..8afc8931ed49c 100644 --- a/src/Symfony/Component/Console/Output/BufferedOutput.php +++ b/src/Symfony/Component/Console/Output/BufferedOutput.php @@ -16,9 +16,6 @@ */ class BufferedOutput extends Output { - /** - * @var string - */ private $buffer = ''; /** diff --git a/src/Symfony/Component/Console/Output/ConsoleOutput.php b/src/Symfony/Component/Console/Output/ConsoleOutput.php index 2c1278673f0ab..edef356c4e2bf 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutput.php @@ -29,9 +29,6 @@ */ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { - /** - * @var StreamOutput - */ private $stderr; /** diff --git a/src/Symfony/Component/Console/Tester/CommandTester.php b/src/Symfony/Component/Console/Tester/CommandTester.php index 5f8b8b2a603ed..39723b2613c5a 100644 --- a/src/Symfony/Component/Console/Tester/CommandTester.php +++ b/src/Symfony/Component/Console/Tester/CommandTester.php @@ -132,8 +132,8 @@ public function getStatusCode() /** * Sets the user inputs. * - * @param array an array of strings representing each input - * passed to the command input stream + * @param array $inputs An array of strings representing each input + * passed to the command input stream * * @return CommandTester */ diff --git a/src/Symfony/Component/CssSelector/Node/ElementNode.php b/src/Symfony/Component/CssSelector/Node/ElementNode.php index 06e343e969c11..bcdce7a7a5207 100644 --- a/src/Symfony/Component/CssSelector/Node/ElementNode.php +++ b/src/Symfony/Component/CssSelector/Node/ElementNode.php @@ -23,14 +23,7 @@ */ class ElementNode extends AbstractNode { - /** - * @var string|null - */ private $namespace; - - /** - * @var string|null - */ private $element; /** diff --git a/src/Symfony/Component/CssSelector/Parser/Reader.php b/src/Symfony/Component/CssSelector/Parser/Reader.php index 546730b8f5c67..5a1be30cd957a 100644 --- a/src/Symfony/Component/CssSelector/Parser/Reader.php +++ b/src/Symfony/Component/CssSelector/Parser/Reader.php @@ -23,19 +23,8 @@ */ class Reader { - /** - * @var string - */ private $source; - - /** - * @var int - */ private $length; - - /** - * @var int - */ private $position = 0; /** diff --git a/src/Symfony/Component/CssSelector/Parser/Token.php b/src/Symfony/Component/CssSelector/Parser/Token.php index c20837edd3a2b..9baaa6dd8d165 100644 --- a/src/Symfony/Component/CssSelector/Parser/Token.php +++ b/src/Symfony/Component/CssSelector/Parser/Token.php @@ -31,19 +31,8 @@ class Token const TYPE_NUMBER = 'number'; const TYPE_STRING = 'string'; - /** - * @var int - */ private $type; - - /** - * @var string - */ private $value; - - /** - * @var int - */ private $position; /** diff --git a/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php b/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php index a91583f343c2d..30584ca92ee85 100644 --- a/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php +++ b/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php @@ -23,64 +23,17 @@ */ class TokenizerPatterns { - /** - * @var string - */ private $unicodeEscapePattern; - - /** - * @var string - */ private $simpleEscapePattern; - - /** - * @var string - */ private $newLineEscapePattern; - - /** - * @var string - */ private $escapePattern; - - /** - * @var string - */ private $stringEscapePattern; - - /** - * @var string - */ private $nonAsciiPattern; - - /** - * @var string - */ private $nmCharPattern; - - /** - * @var string - */ private $nmStartPattern; - - /** - * @var string - */ private $identifierPattern; - - /** - * @var string - */ private $hashPattern; - - /** - * @var string - */ private $numberPattern; - - /** - * @var string - */ private $quotedStringPattern; public function __construct() diff --git a/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php b/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php index 6c2473c1a2f8b..715d9611a8267 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -31,9 +31,6 @@ class NodeExtension extends AbstractExtension const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; - /** - * @var int - */ private $flags; /** diff --git a/src/Symfony/Component/CssSelector/XPath/XPathExpr.php b/src/Symfony/Component/CssSelector/XPath/XPathExpr.php index 38ca295540071..fa59bce2e0bb5 100644 --- a/src/Symfony/Component/CssSelector/XPath/XPathExpr.php +++ b/src/Symfony/Component/CssSelector/XPath/XPathExpr.php @@ -23,19 +23,8 @@ */ class XPathExpr { - /** - * @var string - */ private $path; - - /** - * @var string - */ private $element; - - /** - * @var string - */ private $condition; /** diff --git a/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php b/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php index cdc9ddb507c38..3da1a0d5be8e3 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php @@ -26,9 +26,6 @@ class RepeatedPass implements CompilerPassInterface */ private $repeat = false; - /** - * @var RepeatablePassInterface[] - */ private $passes; /** diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 7018ca9b4a3bd..afd44db98d3c9 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -122,6 +122,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface private $autoconfiguredInstanceof = array(); private $removedIds = array(); + private $alreadyLoading = array(); public function __construct(ParameterBagInterface $parameterBag = null) { @@ -144,7 +145,7 @@ public function __construct(ParameterBagInterface $parameterBag = null) * If you are not using the loaders and therefore don't want * to depend on the Config component, set this flag to false. * - * @param bool $track true if you want to track resources, false otherwise + * @param bool $track True if you want to track resources, false otherwise */ public function setResourceTracking($track) { @@ -154,7 +155,7 @@ public function setResourceTracking($track) /** * Checks if resources are tracked. * - * @return bool true if resources are tracked, false otherwise + * @return bool true If resources are tracked, false otherwise */ public function isTrackingResources() { @@ -594,12 +595,13 @@ private function doGet($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_ throw $e; } - $this->loading[$id] = true; + $loading = isset($this->alreadyLoading[$id]) ? 'loading' : 'alreadyLoading'; + $this->{$loading}[$id] = true; try { $service = $this->createService($definition, $id); } finally { - unset($this->loading[$id]); + unset($this->{$loading}[$id]); } return $service; @@ -1089,6 +1091,10 @@ private function createService(Definition $definition, $id, $tryProxy = true) $arguments = $this->resolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments()))); + if (null !== $id && $definition->isShared() && isset($this->services[$id]) && ($tryProxy || !$definition->isLazy())) { + return $this->services[$id]; + } + if (null !== $factory = $definition->getFactory()) { if (is_array($factory)) { $factory = array($this->resolveServices($parameterBag->resolveValue($factory[0])), $factory[1]); @@ -1551,7 +1557,8 @@ private function callMethod($service, $call) private function shareService(Definition $definition, $service, $id) { if (null !== $id && $definition->isShared()) { - $this->services[$this->normalizeId($id)] = $service; + $this->services[$id] = $service; + unset($this->loading[$id], $this->alreadyLoading[$id]); } } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index dca78f563a3f1..62d3e2bbd30b1 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -42,15 +42,11 @@ class PhpDumper extends Dumper { /** * Characters that might appear in the generated variable name as first character. - * - * @var string */ const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz'; /** * Characters that might appear in the generated variable name as any but the first character. - * - * @var string */ const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_'; @@ -261,13 +257,15 @@ private function addServiceLocalTempVariables($cId, Definition $definition, arra array_unshift($inlinedDefinitions, $definition); + $isNonLazyShared = !$this->getProxyDumper()->isProxyCandidate($definition) && $definition->isShared(); $calls = $behavior = array(); foreach ($inlinedDefinitions as $iDefinition) { - $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior); - $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior); - $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior); - $this->getServiceCallsFromArguments(array($iDefinition->getConfigurator()), $calls, $behavior); - $this->getServiceCallsFromArguments(array($iDefinition->getFactory()), $calls, $behavior); + $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior, $isNonLazyShared); + $isPreInstantiation = $isNonLazyShared && $iDefinition !== $definition && !$this->hasReference($cId, $iDefinition->getMethodCalls(), true) && !$this->hasReference($cId, $iDefinition->getProperties(), true); + $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior, $isPreInstantiation); + $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior, $isPreInstantiation); + $this->getServiceCallsFromArguments(array($iDefinition->getConfigurator()), $calls, $behavior, $isPreInstantiation); + $this->getServiceCallsFromArguments(array($iDefinition->getFactory()), $calls, $behavior, $isNonLazyShared); } $code = ''; @@ -289,6 +287,16 @@ private function addServiceLocalTempVariables($cId, Definition $definition, arra } if ('' !== $code) { + if ($isNonLazyShared) { + $code .= <<services['$cId'])) { + return \$this->services['$cId']; + } + +EOTXT; + } + $code .= "\n"; } @@ -495,7 +503,7 @@ private function isTrivialInstance(Definition $definition) } foreach ($definition->getArguments() as $arg) { - if (!$arg || ($arg instanceof Reference && 'service_container' !== (string) $arg)) { + if (!$arg || ($arg instanceof Reference && 'service_container' === (string) $arg)) { continue; } if (is_array($arg) && 3 >= count($arg)) { @@ -503,7 +511,7 @@ private function isTrivialInstance(Definition $definition) if ($this->dumpValue($k) !== $this->dumpValue($k, false)) { return false; } - if (!$v || ($v instanceof Reference && 'service_container' !== (string) $v)) { + if (!$v || ($v instanceof Reference && 'service_container' === (string) $v)) { continue; } if (!is_scalar($v) || $this->dumpValue($v) !== $this->dumpValue($v, false)) { @@ -1396,16 +1404,16 @@ private function getServiceConditionals($value) /** * Builds service calls from arguments. */ - private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) + private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior, $isPreInstantiation) { foreach ($arguments as $argument) { if (is_array($argument)) { - $this->getServiceCallsFromArguments($argument, $calls, $behavior); + $this->getServiceCallsFromArguments($argument, $calls, $behavior, $isPreInstantiation); } elseif ($argument instanceof Reference) { $id = (string) $argument; if (!isset($calls[$id])) { - $calls[$id] = 0; + $calls[$id] = (int) $isPreInstantiation; } if (!isset($behavior[$id])) { $behavior[$id] = $argument->getInvalidBehavior(); @@ -1482,29 +1490,37 @@ private function hasReference($id, array $arguments, $deep = false, array &$visi if ($this->hasReference($id, $argument, $deep, $visited)) { return true; } + + continue; } elseif ($argument instanceof Reference) { $argumentId = (string) $argument; if ($id === $argumentId) { return true; } - if ($deep && !isset($visited[$argumentId]) && 'service_container' !== $argumentId) { - $visited[$argumentId] = true; + if (!$deep || isset($visited[$argumentId]) || 'service_container' === $argumentId) { + continue; + } - $service = $this->container->getDefinition($argumentId); + $visited[$argumentId] = true; - // if the proxy manager is enabled, disable searching for references in lazy services, - // as these services will be instantiated lazily and don't have direct related references. - if ($service->isLazy() && !$this->getProxyDumper() instanceof NullDumper) { - continue; - } + $service = $this->container->getDefinition($argumentId); + } elseif ($argument instanceof Definition) { + $service = $argument; + } else { + continue; + } - $arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties()); + // if the proxy manager is enabled, disable searching for references in lazy services, + // as these services will be instantiated lazily and don't have direct related references. + if ($service->isLazy() && !$this->getProxyDumper() instanceof NullDumper) { + continue; + } - if ($this->hasReference($id, $arguments, $deep, $visited)) { - return true; - } - } + $arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties()); + + if ($this->hasReference($id, $arguments, $deep, $visited)) { + return true; } } diff --git a/src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php b/src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php index a8dd5252ed285..417ab908a39c6 100644 --- a/src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php +++ b/src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php @@ -25,11 +25,10 @@ interface InstantiatorInterface /** * Instantiates a proxy object. * - * @param ContainerInterface $container the container from which the service is being requested - * @param Definition $definition the definition of the requested service - * @param string $id identifier of the requested service - * @param callable $realInstantiator zero-argument callback that is capable of producing the real - * service instance + * @param ContainerInterface $container The container from which the service is being requested + * @param Definition $definition The definition of the requested service + * @param string $id Identifier of the requested service + * @param callable $realInstantiator Zero-argument callback that is capable of producing the real service instance * * @return object */ diff --git a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php index 08e8fffc4d43f..f2d0476f6e4a4 100644 --- a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php +++ b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php @@ -31,8 +31,8 @@ public function isProxyCandidate(Definition $definition); * Generates the code to be used to instantiate a proxy in the dumped factory code. * * @param Definition $definition - * @param string $id service identifier - * @param string $factoryCode the code to execute to create the service, will be added to the interface in 4.0 + * @param string $id Service identifier + * @param string $factoryCode The code to execute to create the service, will be added to the interface in 4.0 * * @return string */ diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 80c9eb4559809..ac73138a9dfd9 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -1203,6 +1203,26 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } + public function testAlmostCircularPrivate() + { + $public = false; + $container = include __DIR__.'/Fixtures/containers/container_almost_circular.php'; + + $foo = $container->get('foo'); + + $this->assertSame($foo, $foo->bar->foobar->foo); + } + + public function testAlmostCircularPublic() + { + $public = true; + $container = include __DIR__.'/Fixtures/containers/container_almost_circular.php'; + + $foo = $container->get('foo'); + + $this->assertSame($foo, $foo->bar->foobar->foo); + } + public function testRegisterForAutoconfiguration() { $container = new ContainerBuilder(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 472858aa67949..3c330620c85a6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -764,6 +764,40 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } + public function testAlmostCircularPrivate() + { + $public = false; + $container = include self::$fixturesPath.'/containers/container_almost_circular.php'; + $container->compile(); + $dumper = new PhpDumper($container); + + $this->assertStringEqualsFile(self::$fixturesPath.'/php/container_almost_circular_private.php', $dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Almost_Circular_Private'))); + + require self::$fixturesPath.'/php/container_almost_circular_private.php'; + + $container = new \Symfony_DI_PhpDumper_Test_Almost_Circular_Private(); + $foo = $container->get('foo'); + + $this->assertSame($foo, $foo->bar->foobar->foo); + } + + public function testAlmostCircularPublic() + { + $public = true; + $container = include self::$fixturesPath.'/containers/container_almost_circular.php'; + $container->compile(); + $dumper = new PhpDumper($container); + + $this->assertStringEqualsFile(self::$fixturesPath.'/php/container_almost_circular_public.php', $dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Almost_Circular_Public'))); + + require self::$fixturesPath.'/php/container_almost_circular_public.php'; + + $container = new \Symfony_DI_PhpDumper_Test_Almost_Circular_Public(); + $foo = $container->get('foo'); + + $this->assertSame($foo, $foo->bar->foobar->foo); + } + public function testDumpHandlesLiteralClassWithRootNamespace() { $container = new ContainerBuilder(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php new file mode 100644 index 0000000000000..eaef674a3ec5b --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php @@ -0,0 +1,19 @@ +register('foo', FooCircular::class)->setPublic(true) + ->addArgument(new Reference('bar')); + +$container->register('bar', BarCircular::class)->setPublic($public) + ->addMethodCall('addFoobar', array(new Reference('foobar'))); + +$container->register('foobar', FoobarCircular::class)->setPublic($public) + ->addArgument(new Reference('foo')); + +return $container; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php index cbb6a6e507faf..ab07fadc25052 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php @@ -110,3 +110,27 @@ public function __construct($lazyValues, $lazyEmptyValues) $this->lazyEmptyValues = $lazyEmptyValues; } } + +class FoobarCircular +{ + public function __construct(FooCircular $foo) + { + $this->foo = $foo; + } +} + +class FooCircular +{ + public function __construct(BarCircular $bar) + { + $this->bar = $bar; + } +} + +class BarCircular +{ + public function addFoobar(FoobarCircular $foobar) + { + $this->foobar = $foobar; + } +} diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_private.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_private.php new file mode 100644 index 0000000000000..055f409a5318c --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_private.php @@ -0,0 +1,75 @@ +services = array(); + $this->methodMap = array( + 'foo' => 'getFooService', + ); + + $this->aliases = array(); + } + + public function getRemovedIds() + { + return array( + 'Psr\\Container\\ContainerInterface' => true, + 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true, + 'bar' => true, + 'foobar' => true, + ); + } + + public function compile() + { + throw new LogicException('You cannot compile a dumped container that was already compiled.'); + } + + public function isCompiled() + { + return true; + } + + public function isFrozen() + { + @trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED); + + return true; + } + + /** + * Gets the public 'foo' shared service. + * + * @return \FooCircular + */ + protected function getFooService() + { + $a = new \BarCircular(); + + $this->services['foo'] = $instance = new \FooCircular($a); + + $a->addFoobar(new \FoobarCircular($instance)); + + + return $instance; + } +} diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php new file mode 100644 index 0000000000000..5c4057d7fa1af --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php @@ -0,0 +1,104 @@ +services = array(); + $this->methodMap = array( + 'bar' => 'getBarService', + 'foo' => 'getFooService', + 'foobar' => 'getFoobarService', + ); + + $this->aliases = array(); + } + + public function getRemovedIds() + { + return array( + 'Psr\\Container\\ContainerInterface' => true, + 'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true, + ); + } + + public function compile() + { + throw new LogicException('You cannot compile a dumped container that was already compiled.'); + } + + public function isCompiled() + { + return true; + } + + public function isFrozen() + { + @trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the isCompiled() method instead.', __METHOD__), E_USER_DEPRECATED); + + return true; + } + + /** + * Gets the public 'bar' shared service. + * + * @return \BarCircular + */ + protected function getBarService() + { + $this->services['bar'] = $instance = new \BarCircular(); + + $instance->addFoobar(${($_ = isset($this->services['foobar']) ? $this->services['foobar'] : $this->getFoobarService()) && false ?: '_'}); + + return $instance; + } + + /** + * Gets the public 'foo' shared service. + * + * @return \FooCircular + */ + protected function getFooService() + { + $a = ${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->getBarService()) && false ?: '_'}; + + if (isset($this->services['foo'])) { + return $this->services['foo']; + } + + return $this->services['foo'] = new \FooCircular($a); + } + + /** + * Gets the public 'foobar' shared service. + * + * @return \FoobarCircular + */ + protected function getFoobarService() + { + $a = ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'}; + + if (isset($this->services['foobar'])) { + return $this->services['foobar']; + } + + return $this->services['foobar'] = new \FoobarCircular($a); + } +} diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php index 30b94d456ef6f..3a1c8bc301a57 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php @@ -82,6 +82,10 @@ protected function getBarService() { $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + if (isset($this->services['bar'])) { + return $this->services['bar']; + } + $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar')); $a->configure($instance); @@ -182,7 +186,13 @@ protected function getDeprecatedServiceService() */ protected function getFactoryServiceService() { - return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}->getInstance(); + $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + + if (isset($this->services['factory_service'])) { + return $this->services['factory_service']; + } + + return $this->services['factory_service'] = $a->getInstance(); } /** @@ -192,7 +202,13 @@ protected function getFactoryServiceService() */ protected function getFactoryServiceSimpleService() { - return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}->getInstance(); + $a = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}; + + if (isset($this->services['factory_service_simple'])) { + return $this->services['factory_service_simple']; + } + + return $this->services['factory_service_simple'] = $a->getInstance(); } /** @@ -204,6 +220,10 @@ protected function getFooService() { $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + if (isset($this->services['foo'])) { + return $this->services['foo']; + } + $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'foobar' => $this->getParameter('foo')), true, $this); $instance->foo = 'bar'; @@ -321,7 +341,13 @@ protected function getMethodCall1Service() */ protected function getNewFactoryServiceService() { - $this->services['new_factory_service'] = $instance = ${($_ = isset($this->services['new_factory']) ? $this->services['new_factory'] : $this->getNewFactoryService()) && false ?: '_'}->getInstance(); + $a = ${($_ = isset($this->services['new_factory']) ? $this->services['new_factory'] : $this->getNewFactoryService()) && false ?: '_'}; + + if (isset($this->services['new_factory_service'])) { + return $this->services['new_factory_service']; + } + + $this->services['new_factory_service'] = $instance = $a->getInstance(); $instance->foo = 'bar'; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt index 83074c984e382..4bdf469a93cdf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt @@ -22,6 +22,10 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/getFoo_BazService.php')) && false ?: '_'}; +if (isset($this->services['bar'])) { + return $this->services['bar']; +} + $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar')); $a->configure($instance); @@ -48,12 +52,18 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; // This file has been auto-generated by the Symfony Dependency Injection Component for internal use. // Returns the public 'configured_service' shared service. -$a = new \ConfClass(); -$a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(__DIR__.'/getBazService.php')) && false ?: '_'}); +$a = ${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->load(__DIR__.'/getBazService.php')) && false ?: '_'}; + +if (isset($this->services['configured_service'])) { + return $this->services['configured_service']; +} + +$b = new \ConfClass(); +$b->setFoo($a); $this->services['configured_service'] = $instance = new \stdClass(); -$a->configureStdClass($instance); +$b->configureStdClass($instance); return $instance; @@ -106,7 +116,13 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; // This file has been auto-generated by the Symfony Dependency Injection Component for internal use. // Returns the public 'factory_service' shared service. -return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/getFoo_BazService.php')) && false ?: '_'}->getInstance(); +$a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/getFoo_BazService.php')) && false ?: '_'}; + +if (isset($this->services['factory_service'])) { + return $this->services['factory_service']; +} + +return $this->services['factory_service'] = $a->getInstance(); [Container%s/getFactoryServiceSimpleService.php] => services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->load(__DIR__.'/getFactorySimpleService.php')) && false ?: '_'}->getInstance(); +$a = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->load(__DIR__.'/getFactorySimpleService.php')) && false ?: '_'}; + +if (isset($this->services['factory_service_simple'])) { + return $this->services['factory_service_simple']; +} + +return $this->services['factory_service_simple'] = $a->getInstance(); [Container%s/getFactorySimpleService.php] => services['foo.baz']) ? $this->services['foo.baz'] : $this->load(__DIR__.'/getFoo_BazService.php')) && false ?: '_'}; +if (isset($this->services['foo'])) { + return $this->services['foo']; +} + $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this); $instance->foo = 'bar'; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php index 403eb12954fe1..f0615f5e56d56 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php @@ -101,6 +101,10 @@ protected function getBarService() { $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + if (isset($this->services['bar'])) { + return $this->services['bar']; + } + $this->services['bar'] = $instance = new \Bar\FooClass('foo', $a, $this->getParameter('foo_bar')); $a->configure($instance); @@ -129,12 +133,18 @@ protected function getBazService() */ protected function getConfiguredServiceService() { - $a = new \ConfClass(); - $a->setFoo(${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->getBazService()) && false ?: '_'}); + $a = ${($_ = isset($this->services['baz']) ? $this->services['baz'] : $this->getBazService()) && false ?: '_'}; + + if (isset($this->services['configured_service'])) { + return $this->services['configured_service']; + } + + $b = new \ConfClass(); + $b->setFoo($a); $this->services['configured_service'] = $instance = new \stdClass(); - $a->configureStdClass($instance); + $b->configureStdClass($instance); return $instance; } @@ -194,7 +204,13 @@ protected function getDeprecatedServiceService() */ protected function getFactoryServiceService() { - return $this->services['factory_service'] = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}->getInstance(); + $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + + if (isset($this->services['factory_service'])) { + return $this->services['factory_service']; + } + + return $this->services['factory_service'] = $a->getInstance(); } /** @@ -204,7 +220,13 @@ protected function getFactoryServiceService() */ protected function getFactoryServiceSimpleService() { - return $this->services['factory_service_simple'] = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}->getInstance(); + $a = ${($_ = isset($this->services['factory_simple']) ? $this->services['factory_simple'] : $this->getFactorySimpleService()) && false ?: '_'}; + + if (isset($this->services['factory_service_simple'])) { + return $this->services['factory_service_simple']; + } + + return $this->services['factory_service_simple'] = $a->getInstance(); } /** @@ -216,6 +238,10 @@ protected function getFooService() { $a = ${($_ = isset($this->services['foo.baz']) ? $this->services['foo.baz'] : $this->getFoo_BazService()) && false ?: '_'}; + if (isset($this->services['foo'])) { + return $this->services['foo']; + } + $this->services['foo'] = $instance = \Bar\FooClass::getInstance('foo', $a, array('bar' => 'foo is bar', 'foobar' => 'bar'), true, $this); $instance->foo = 'bar'; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_legacy_privates.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_legacy_privates.php index f8c33ae59966a..50e29ae4ec3bc 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_legacy_privates.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_legacy_privates.php @@ -90,7 +90,13 @@ public function isFrozen() */ protected function getBarService() { - return $this->services['bar'] = new \stdClass(${($_ = isset($this->services['private_not_inlined']) ? $this->services['private_not_inlined'] : $this->services['private_not_inlined'] = new \stdClass()) && false ?: '_'}); + $a = ${($_ = isset($this->services['private_not_inlined']) ? $this->services['private_not_inlined'] : $this->services['private_not_inlined'] = new \stdClass()) && false ?: '_'}; + + if (isset($this->services['bar'])) { + return $this->services['bar']; + } + + return $this->services['bar'] = new \stdClass($a); } /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php index 339076ea3bea2..af794f49cfe17 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php @@ -75,7 +75,13 @@ public function isFrozen() */ protected function getBarServiceService() { - return $this->services['bar_service'] = new \stdClass(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}); + $a = ${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}; + + if (isset($this->services['bar_service'])) { + return $this->services['bar_service']; + } + + return $this->services['bar_service'] = new \stdClass($a); } /** @@ -86,7 +92,7 @@ protected function getBarServiceService() protected function getFooServiceService() { return $this->services['foo_service'] = new \Symfony\Component\DependencyInjection\ServiceLocator(array('bar' => function () { - return ${($_ = isset($this->services['bar_service']) ? $this->services['bar_service'] : $this->services['bar_service'] = new \stdClass(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'})) && false ?: '_'}; + return ${($_ = isset($this->services['bar_service']) ? $this->services['bar_service'] : $this->getBarServiceService()) && false ?: '_'}; }, 'baz' => function () { $f = function (\stdClass $v) { return $v; }; return $f(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}); }, 'nil' => function () { @@ -161,6 +167,10 @@ protected function getTranslator3Service() { $a = ${($_ = isset($this->services['translator.loader_3']) ? $this->services['translator.loader_3'] : $this->services['translator.loader_3'] = new \stdClass()) && false ?: '_'}; + if (isset($this->services['translator_3'])) { + return $this->services['translator_3']; + } + $this->services['translator_3'] = $instance = new \Symfony\Component\DependencyInjection\Tests\Fixtures\StubbedTranslator(new \Symfony\Component\DependencyInjection\ServiceLocator(array('translator.loader_3' => function () { return ${($_ = isset($this->services['translator.loader_3']) ? $this->services['translator.loader_3'] : $this->services['translator.loader_3'] = new \stdClass()) && false ?: '_'}; }))); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php index 59857ecac3ef8..b71508c9d3f5b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php @@ -66,7 +66,13 @@ public function isFrozen() */ protected function getBarServiceService() { - return $this->services['bar_service'] = new \stdClass(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}); + $a = ${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}; + + if (isset($this->services['bar_service'])) { + return $this->services['bar_service']; + } + + return $this->services['bar_service'] = new \stdClass($a); } /** @@ -76,7 +82,13 @@ protected function getBarServiceService() */ protected function getFooServiceService() { - return $this->services['foo_service'] = new \stdClass(${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}); + $a = ${($_ = isset($this->services['baz_service']) ? $this->services['baz_service'] : $this->services['baz_service'] = new \stdClass()) && false ?: '_'}; + + if (isset($this->services['foo_service'])) { + return $this->services['foo_service']; + } + + return $this->services['foo_service'] = new \stdClass($a); } /** diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index 6da1a569d25fa..ac75ee3d3d1ab 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -20,9 +20,6 @@ */ class Crawler implements \Countable, \IteratorAggregate { - /** - * @var string The current URI - */ protected $uri; /** @@ -58,14 +55,14 @@ class Crawler implements \Countable, \IteratorAggregate private $isHtml = true; /** - * @param mixed $node A Node to use as the base for the crawling - * @param string $currentUri The current URI - * @param string $baseHref The base href value + * @param mixed $node A Node to use as the base for the crawling + * @param string $uri The current URI + * @param string $baseHref The base href value */ - public function __construct($node = null, $currentUri = null, $baseHref = null) + public function __construct($node = null, $uri = null, $baseHref = null) { - $this->uri = $currentUri; - $this->baseHref = $baseHref ?: $currentUri; + $this->uri = $uri; + $this->baseHref = $baseHref ?: $uri; $this->add($node); } diff --git a/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php b/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php index 887a7ec328efc..0b5f5629971e2 100644 --- a/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php +++ b/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php @@ -24,19 +24,8 @@ */ class RegisterListenersPass implements CompilerPassInterface { - /** - * @var string - */ protected $dispatcherService; - - /** - * @var string - */ protected $listenerTag; - - /** - * @var string - */ protected $subscriberTag; /** diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php b/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php index ba85df28366bc..d3d0cb8a452d2 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php @@ -26,7 +26,7 @@ interface EventDispatcherInterface * @param string $eventName The name of the event to dispatch. The name of * the event is the name of the method that is * invoked on listeners. - * @param Event $event the event to pass to the event handlers/listeners + * @param Event $event The event to pass to the event handlers/listeners * If not supplied, an empty Event instance is created * * @return Event diff --git a/src/Symfony/Component/EventDispatcher/GenericEvent.php b/src/Symfony/Component/EventDispatcher/GenericEvent.php index 8907a0c2dc8d0..95c99408de20f 100644 --- a/src/Symfony/Component/EventDispatcher/GenericEvent.php +++ b/src/Symfony/Component/EventDispatcher/GenericEvent.php @@ -20,22 +20,13 @@ */ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate { - /** - * Event subject. - * - * @var mixed usually object or callable - */ protected $subject; - - /** - * Array of arguments. - */ protected $arguments; /** * Encapsulate an event with $subject and $args. * - * @param mixed $subject The subject of the event, usually an object + * @param mixed $subject The subject of the event, usually an object or a callable * @param array $arguments Arguments to store in the event */ public function __construct($subject = null, array $arguments = array()) diff --git a/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php b/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php index 9aeefce672c59..a9cfc4caf7688 100644 --- a/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php +++ b/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php @@ -23,9 +23,6 @@ */ class ExpressionLanguage { - /** - * @var CacheItemPoolInterface - */ private $cache; private $lexer; private $parser; diff --git a/src/Symfony/Component/Filesystem/LockHandler.php b/src/Symfony/Component/Filesystem/LockHandler.php index a05529f13c3ec..f1bb8d0ebf5bc 100644 --- a/src/Symfony/Component/Filesystem/LockHandler.php +++ b/src/Symfony/Component/Filesystem/LockHandler.php @@ -62,7 +62,7 @@ public function __construct($name, $lockPath = null) /** * Lock the resource. * - * @param bool $blocking wait until the lock is released + * @param bool $blocking Wait until the lock is released * * @return bool Returns true if the lock was acquired, false otherwise * diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php index d6f0ad677bbf5..cde01e50eb8a5 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php @@ -92,7 +92,7 @@ protected function tearDown() } /** - * @param int $expectedFilePerms expected file permissions as three digits (i.e. 755) + * @param int $expectedFilePerms Expected file permissions as three digits (i.e. 755) * @param string $filePath */ protected function assertFilePermissions($expectedFilePerms, $filePath) diff --git a/src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php b/src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php index d03a9ac78e251..cfe31c90f7414 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/MockSplFileInfo.php @@ -13,9 +13,9 @@ class MockSplFileInfo extends \SplFileInfo { - const TYPE_DIRECTORY = 1; - const TYPE_FILE = 2; - const TYPE_UNKNOWN = 3; + const TYPE_DIRECTORY = 1; + const TYPE_FILE = 2; + const TYPE_UNKNOWN = 3; private $contents = null; private $mode = null; diff --git a/src/Symfony/Component/Form/AbstractRendererEngine.php b/src/Symfony/Component/Form/AbstractRendererEngine.php index 9643ed782c791..fb0e68a9cfa4d 100644 --- a/src/Symfony/Component/Form/AbstractRendererEngine.php +++ b/src/Symfony/Component/Form/AbstractRendererEngine.php @@ -129,13 +129,13 @@ abstract protected function loadResourceForBlockName($cacheKey, FormView $view, * * @see getResourceForBlockHierarchy() * - * @param string $cacheKey the cache key used for storing the + * @param string $cacheKey The cache key used for storing the * resource - * @param FormView $view the form view for finding the applying + * @param FormView $view The form view for finding the applying * themes - * @param array $blockNameHierarchy the block hierarchy, with the most + * @param array $blockNameHierarchy The block hierarchy, with the most * specific block name at the end - * @param int $hierarchyLevel the level in the block hierarchy that + * @param int $hierarchyLevel The level in the block hierarchy that * should be loaded * * @return bool True if the resource could be loaded, false otherwise diff --git a/src/Symfony/Component/Form/CallbackTransformer.php b/src/Symfony/Component/Form/CallbackTransformer.php index de82ec36fadb5..5a0574ac823ac 100644 --- a/src/Symfony/Component/Form/CallbackTransformer.php +++ b/src/Symfony/Component/Form/CallbackTransformer.php @@ -16,18 +16,7 @@ class CallbackTransformer implements DataTransformerInterface { - /** - * The callback used for forward transform. - * - * @var callable - */ private $transform; - - /** - * The callback used for reverse transform. - * - * @var callable - */ private $reverseTransform; /** diff --git a/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php b/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php index e8e37b359566f..17179cec88b93 100644 --- a/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php +++ b/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php @@ -27,11 +27,6 @@ */ class LazyChoiceList implements ChoiceListInterface { - /** - * The choice loader. - * - * @var ChoiceLoaderInterface - */ private $loader; /** @@ -65,8 +60,7 @@ class LazyChoiceList implements ChoiceListInterface * argument. * * @param ChoiceLoaderInterface $loader The choice loader - * @param null|callable $value The callable generating the choice - * values + * @param null|callable $value The callable generating the choice values */ public function __construct(ChoiceLoaderInterface $loader, callable $value = null) { diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php index 5daf64072bc49..17546182d5443 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php @@ -18,26 +18,14 @@ */ class ChoiceGroupView implements \IteratorAggregate { - /** - * The label of the group. - * - * @var string - */ public $label; - - /** - * The choice views in the group. - * - * @var ChoiceGroupView[]|ChoiceView[] - */ public $choices; /** * Creates a new choice group view. * * @param string $label The label of the group - * @param ChoiceGroupView[]|ChoiceView[] $choices the choice views in the - * group + * @param ChoiceGroupView[]|ChoiceView[] $choices the choice views in the group */ public function __construct($label, array $choices = array()) { diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceListView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceListView.php index 05c40a48831cd..add892aab69ff 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceListView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceListView.php @@ -22,26 +22,14 @@ */ class ChoiceListView { - /** - * The choices. - * - * @var ChoiceGroupView[]|ChoiceView[] - */ public $choices; - - /** - * The preferred choices. - * - * @var ChoiceGroupView[]|ChoiceView[] - */ public $preferredChoices; /** * Creates a new choice list view. * * @param ChoiceGroupView[]|ChoiceView[] $choices The choice views - * @param ChoiceGroupView[]|ChoiceView[] $preferredChoices the preferred - * choice views + * @param ChoiceGroupView[]|ChoiceView[] $preferredChoices the preferred choice views */ public function __construct(array $choices = array(), array $preferredChoices = array()) { diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php index c6a88e4340592..8feed2106e27b 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php @@ -18,25 +18,8 @@ */ class ChoiceView { - /** - * The label displayed to humans. - * - * @var string - */ public $label; - - /** - * The view representation of the choice. - * - * @var string - */ public $value; - - /** - * The original choice value. - * - * @var mixed - */ public $data; /** diff --git a/src/Symfony/Component/Form/Extension/Core/CoreExtension.php b/src/Symfony/Component/Form/Extension/Core/CoreExtension.php index 857792ad9f066..99578b49927ff 100644 --- a/src/Symfony/Component/Form/Extension/Core/CoreExtension.php +++ b/src/Symfony/Component/Form/Extension/Core/CoreExtension.php @@ -26,14 +26,7 @@ */ class CoreExtension extends AbstractExtension { - /** - * @var PropertyAccessorInterface - */ private $propertyAccessor; - - /** - * @var ChoiceListFactoryInterface - */ private $choiceListFactory; public function __construct(PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null) diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php index f98b787cacde8..592d90862f06d 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php @@ -22,17 +22,10 @@ */ class BooleanToStringTransformer implements DataTransformerInterface { - /** - * The value emitted upon transform if the input is true. - * - * @var string - */ private $trueValue; /** - * Sets the value emitted upon transform if the input is true. - * - * @param string $trueValue + * @param string $trueValue The value emitted upon transform if the input is true */ public function __construct($trueValue) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php index 23ac73155fb29..dda3414b75f2c 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php @@ -149,7 +149,7 @@ public function reverseTransform($value) /** * Returns a preconfigured IntlDateFormatter instance. * - * @param bool $ignoreTimezone use UTC regardless of the configured timezone + * @param bool $ignoreTimezone Use UTC regardless of the configured timezone * * @return \IntlDateFormatter * diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php index fdb142f84e761..b843aa1823bda 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php @@ -32,7 +32,6 @@ class PercentToLocalizedStringTransformer implements DataTransformerInterface ); private $type; - private $scale; /** diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php index bfc5e00e22805..698a95de2d48a 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php @@ -21,27 +21,12 @@ */ class MergeCollectionListener implements EventSubscriberInterface { - /** - * Whether elements may be added to the collection. - * - * @var bool - */ private $allowAdd; - - /** - * Whether elements may be removed from the collection. - * - * @var bool - */ private $allowDelete; /** - * Creates a new listener. - * - * @param bool $allowAdd whether values might be added to the - * collection - * @param bool $allowDelete whether values might be removed from the - * collection + * @param bool $allowAdd Whether values might be added to the collection + * @param bool $allowDelete Whether values might be removed from the collection */ public function __construct($allowAdd = false, $allowDelete = false) { diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index aa13abdf75692..53614ed515af6 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -34,8 +34,8 @@ class ResizeFormListener implements EventSubscriberInterface /** * @param string $type * @param array $options - * @param bool $allowAdd whether children could be added to the group - * @param bool $allowDelete whether children could be removed from the group + * @param bool $allowAdd Whether children could be added to the group + * @param bool $allowDelete Whether children could be removed from the group * @param bool|callable $deleteEmpty */ public function __construct($type, array $options = array(), $allowAdd = false, $allowDelete = false, $deleteEmpty = false) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 8bd79419e65ed..a9af81d204058 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -37,11 +37,6 @@ class ChoiceType extends AbstractType { - /** - * Caches created choice lists. - * - * @var ChoiceListFactoryInterface - */ private $choiceListFactory; public function __construct(ChoiceListFactoryInterface $choiceListFactory = null) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index c538c09a00737..d34d1c210044c 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -30,7 +30,6 @@ class DateTimeType extends AbstractType { const DEFAULT_DATE_FORMAT = \IntlDateFormatter::MEDIUM; - const DEFAULT_TIME_FORMAT = \IntlDateFormatter::MEDIUM; /** diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index 7690305f38012..20b1f301657e8 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -27,7 +27,6 @@ class DateType extends AbstractType { const DEFAULT_FORMAT = \IntlDateFormatter::MEDIUM; - const HTML5_FORMAT = 'yyyy-MM-dd'; private static $acceptedFormats = array( diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php index 86894f1adc6bf..9a8c7d427b2cf 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -24,9 +24,6 @@ class FormType extends BaseType { - /** - * @var PropertyAccessorInterface - */ private $propertyAccessor; public function __construct(PropertyAccessorInterface $propertyAccessor = null) diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php index f3ac92088d667..3331b6b3baad0 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php @@ -22,19 +22,8 @@ */ class CsrfExtension extends AbstractExtension { - /** - * @var CsrfTokenManagerInterface - */ private $tokenManager; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; /** diff --git a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php index c5406b360460c..9eab35ed26b90 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php +++ b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -25,50 +25,12 @@ */ class CsrfValidationListener implements EventSubscriberInterface { - /** - * The name of the CSRF field. - * - * @var string - */ private $fieldName; - - /** - * The generator for CSRF tokens. - * - * @var CsrfTokenManagerInterface - */ private $tokenManager; - - /** - * A text mentioning the tokenId of the CSRF token. - * - * Validation of the token will only succeed if it was generated in the - * same session and with the same tokenId. - * - * @var string - */ private $tokenId; - - /** - * The message displayed in case of an error. - * - * @var string - */ private $errorMessage; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; - - /** - * @var ServerParams - */ private $serverParams; public static function getSubscribedEvents() diff --git a/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php b/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php index d47ebd3c3c284..f7f9bc0d9152d 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php +++ b/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php @@ -26,36 +26,21 @@ */ class FormTypeCsrfExtension extends AbstractTypeExtension { - /** - * @var CsrfTokenManagerInterface - */ private $defaultTokenManager; - - /** - * @var bool - */ private $defaultEnabled; - - /** - * @var string - */ private $defaultFieldName; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; + private $serverParams; /** - * @var ServerParams + * @param CsrfTokenManagerInterface $defaultTokenManager + * @param bool $defaultEnabled + * @param string $defaultFieldName + * @param TranslatorInterface $translator + * @param null|string $translationDomain + * @param ServerParams $serverParams */ - private $serverParams; - public function __construct(CsrfTokenManagerInterface $defaultTokenManager, $defaultEnabled = true, $defaultFieldName = '_token', TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null) { $this->defaultTokenManager = $defaultTokenManager; diff --git a/src/Symfony/Component/Form/Extension/DataCollector/DataCollectorExtension.php b/src/Symfony/Component/Form/Extension/DataCollector/DataCollectorExtension.php index 2f2e51c0901c7..5b60cfbbcd78a 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/DataCollectorExtension.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/DataCollectorExtension.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Form\Extension\DataCollector; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\AbstractExtension; /** @@ -22,9 +21,6 @@ */ class DataCollectorExtension extends AbstractExtension { - /** - * @var EventSubscriberInterface - */ private $dataCollector; public function __construct(FormDataCollectorInterface $dataCollector) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php b/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php index c80dd67141a0e..1ae6e9f3ec3d4 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/EventListener/DataCollectorListener.php @@ -24,9 +24,6 @@ */ class DataCollectorListener implements EventSubscriberInterface { - /** - * @var FormDataCollectorInterface - */ private $dataCollector; public function __construct(FormDataCollectorInterface $dataCollector) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php b/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php index fc3ba00ebd368..c403be374b2d4 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeDataCollectorProxy.php @@ -25,14 +25,7 @@ */ class ResolvedTypeDataCollectorProxy implements ResolvedFormTypeInterface { - /** - * @var ResolvedFormTypeInterface - */ private $proxiedType; - - /** - * @var FormDataCollectorInterface - */ private $dataCollector; public function __construct(ResolvedFormTypeInterface $proxiedType, FormDataCollectorInterface $dataCollector) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php b/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php index 5051d0bb6390a..068d5cc0bf75b 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php @@ -24,14 +24,7 @@ */ class ResolvedTypeFactoryDataCollectorProxy implements ResolvedFormTypeFactoryInterface { - /** - * @var ResolvedFormTypeFactoryInterface - */ private $proxiedFactory; - - /** - * @var FormDataCollectorInterface - */ private $dataCollector; public function __construct(ResolvedFormTypeFactoryInterface $proxiedFactory, FormDataCollectorInterface $dataCollector) diff --git a/src/Symfony/Component/Form/Extension/DataCollector/Type/DataCollectorTypeExtension.php b/src/Symfony/Component/Form/Extension/DataCollector/Type/DataCollectorTypeExtension.php index 966cb8503d521..5c4076d06095d 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/Type/DataCollectorTypeExtension.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/Type/DataCollectorTypeExtension.php @@ -25,7 +25,7 @@ class DataCollectorTypeExtension extends AbstractTypeExtension { /** - * @var \Symfony\Component\EventDispatcher\EventSubscriberInterface + * @var DataCollectorListener */ private $listener; diff --git a/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php b/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php index 004f4778f98a0..f65ee33f87a0c 100644 --- a/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php +++ b/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php @@ -26,9 +26,6 @@ */ class HttpFoundationRequestHandler implements RequestHandlerInterface { - /** - * @var ServerParams - */ private $serverParams; /** diff --git a/src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php b/src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php index 16249c6067e81..7d389828ea3b5 100644 --- a/src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php +++ b/src/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php @@ -20,9 +20,6 @@ */ class TemplatingRendererEngine extends AbstractRendererEngine { - /** - * @var EngineInterface - */ private $engine; public function __construct(EngineInterface $engine, array $defaultThemes = array()) diff --git a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php index 0f7c27bceb843..761f93158de53 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php @@ -23,14 +23,7 @@ */ class FormTypeValidatorExtension extends BaseValidatorExtension { - /** - * @var ValidatorInterface - */ private $validator; - - /** - * @var ViolationMapper - */ private $violationMapper; public function __construct(ValidatorInterface $validator) diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index 3b809a2e21786..bde7458258224 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -242,7 +242,7 @@ public function guessPatternForConstraint(Constraint $constraint) * @param string $property The property for which to find constraints * @param \Closure $closure The closure that returns a guess * for a given constraint - * @param mixed $defaultValue the default value assumed if no other value + * @param mixed $defaultValue The default value assumed if no other value * can be guessed * * @return Guess|null The guessed value with the highest confidence diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php index dc37a1570752e..1fac736e8c9eb 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php @@ -19,21 +19,15 @@ */ class MappingRule { - /** - * @var FormInterface - */ private $origin; - - /** - * @var string - */ private $propertyPath; + private $targetPath; /** - * @var string + * @param FormInterface $origin + * @param string $propertyPath + * @param string $targetPath */ - private $targetPath; - public function __construct(FormInterface $origin, $propertyPath, $targetPath) { $this->origin = $origin; diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php index ef5c9fad05463..658bad5a48f50 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php @@ -19,9 +19,6 @@ */ class RelativePath extends PropertyPath { - /** - * @var FormInterface - */ private $root; /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php index 7f3a4297c3fcb..49b7076b528fb 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php @@ -24,10 +24,8 @@ interface ViolationMapperInterface * the given form. * * @param ConstraintViolation $violation The violation to map - * @param FormInterface $form the root form of the tree - * to map it to - * @param bool $allowNonSynchronized whether to allow - * mapping to non-synchronized forms + * @param FormInterface $form The root form of the tree to map it to + * @param bool $allowNonSynchronized Whether to allow mapping to non-synchronized forms */ public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false); } diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php index fcc2b7c103d85..007968ab4c24b 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php @@ -48,8 +48,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface /** * Creates a new violation path from a string. * - * @param string $violationPath the property path of a {@link \Symfony\Component\Validator\ConstraintViolation} - * object + * @param string $violationPath The property path of a {@link \Symfony\Component\Validator\ConstraintViolation} object */ public function __construct($violationPath) { diff --git a/src/Symfony/Component/Form/FormConfigBuilderInterface.php b/src/Symfony/Component/Form/FormConfigBuilderInterface.php index bd9e8d8de7107..31e5a82210998 100644 --- a/src/Symfony/Component/Form/FormConfigBuilderInterface.php +++ b/src/Symfony/Component/Form/FormConfigBuilderInterface.php @@ -48,7 +48,7 @@ public function addEventSubscriber(EventSubscriberInterface $subscriber); * view to the normalized format. * * @param DataTransformerInterface $viewTransformer - * @param bool $forcePrepend if set to true, prepend instead of appending + * @param bool $forcePrepend If set to true, prepend instead of appending * * @return $this The configuration object */ @@ -70,7 +70,7 @@ public function resetViewTransformers(); * normalized to the model format. * * @param DataTransformerInterface $modelTransformer - * @param bool $forceAppend if set to true, append instead of prepending + * @param bool $forceAppend If set to true, append instead of prepending * * @return $this The configuration object */ @@ -146,7 +146,7 @@ public function setRequired($required); /** * Sets the property path that the form should be mapped to. * - * @param null|string|PropertyPathInterface $propertyPath the property path or null if the path should be set + * @param null|string|PropertyPathInterface $propertyPath The property path or null if the path should be set * automatically based on the form's name * * @return $this The configuration object @@ -166,7 +166,7 @@ public function setMapped($mapped); /** * Sets whether the form's data should be modified by reference. * - * @param bool $byReference whether the data should be + * @param bool $byReference Whether the data should be * modified by reference * * @return $this The configuration object diff --git a/src/Symfony/Component/Form/FormErrorIterator.php b/src/Symfony/Component/Form/FormErrorIterator.php index 13dac154fa73a..857fde678c360 100644 --- a/src/Symfony/Component/Form/FormErrorIterator.php +++ b/src/Symfony/Component/Form/FormErrorIterator.php @@ -33,26 +33,17 @@ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \Array { /** * The prefix used for indenting nested error messages. - * - * @var string */ const INDENTATION = ' '; - /** - * @var FormInterface - */ private $form; - - /** - * @var FormError[]|FormErrorIterator[] - */ private $errors; /** * Creates a new iterator. * - * @param FormInterface $form The erroneous form - * @param array $errors The form errors + * @param FormInterface $form The erroneous form + * @param FormError[]|FormErrorIterator[] $errors The form errors * * @throws InvalidArgumentException If the errors are invalid */ diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index 73e146ec0d37b..253f28dd7a1ef 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -171,7 +171,7 @@ public function getName(); /** * Returns the property path that the form is mapped to. * - * @return \Symfony\Component\PropertyAccess\PropertyPathInterface The property path + * @return \Symfony\Component\PropertyAccess\PropertyPathInterface|null The property path */ public function getPropertyPath(); @@ -268,7 +268,7 @@ public function handleRequest($request = null); * Submits data to the form, transforms and validates it. * * @param mixed $submittedData The submitted data - * @param bool $clearMissing whether to set fields to NULL when they + * @param bool $clearMissing Whether to set fields to NULL when they * are missing in the submitted data * * @return $this diff --git a/src/Symfony/Component/Form/FormRendererEngineInterface.php b/src/Symfony/Component/Form/FormRendererEngineInterface.php index dcc15b6a2450f..6f5a262d68831 100644 --- a/src/Symfony/Component/Form/FormRendererEngineInterface.php +++ b/src/Symfony/Component/Form/FormRendererEngineInterface.php @@ -42,7 +42,7 @@ public function setTheme(FormView $view, $themes /*, $useDefaultThemes = true */ * First the themes attached directly to the * view with {@link setTheme()} are considered, * then the ones of its parent etc. - * @param string $blockName the name of the block to render + * @param string $blockName The name of the block to render * * @return mixed the renderer resource or false, if none was found */ @@ -76,7 +76,7 @@ public function getResourceForBlockName(FormView $view, $blockName); * First the themes attached directly to * the view with {@link setTheme()} are * considered, then the ones of its parent etc. - * @param array $blockNameHierarchy the block name hierarchy, with the root block + * @param array $blockNameHierarchy The block name hierarchy, with the root block * at the beginning * @param int $hierarchyLevel The level in the hierarchy at which to start * looking. Level 0 indicates the root block, i.e. @@ -116,7 +116,7 @@ public function getResourceForBlockNameHierarchy(FormView $view, array $blockNam * First the themes attached directly to * the view with {@link setTheme()} are * considered, then the ones of its parent etc. - * @param array $blockNameHierarchy the block name hierarchy, with the root block + * @param array $blockNameHierarchy The block name hierarchy, with the root block * at the beginning * @param int $hierarchyLevel The level in the hierarchy at which to start * looking. Level 0 indicates the root block, i.e. diff --git a/src/Symfony/Component/Form/Guess/Guess.php b/src/Symfony/Component/Form/Guess/Guess.php index 2576b59437859..b216af5d55dc6 100644 --- a/src/Symfony/Component/Form/Guess/Guess.php +++ b/src/Symfony/Component/Form/Guess/Guess.php @@ -26,29 +26,21 @@ abstract class Guess { /** * Marks an instance with a value that is extremely likely to be correct. - * - * @var int */ const VERY_HIGH_CONFIDENCE = 3; /** * Marks an instance with a value that is very likely to be correct. - * - * @var int */ const HIGH_CONFIDENCE = 2; /** * Marks an instance with a value that is likely to be correct. - * - * @var int */ const MEDIUM_CONFIDENCE = 1; /** * Marks an instance with a value that may be correct. - * - * @var int */ const LOW_CONFIDENCE = 0; diff --git a/src/Symfony/Component/Form/PreloadedExtension.php b/src/Symfony/Component/Form/PreloadedExtension.php index c9ab2bccaf961..be720a3430451 100644 --- a/src/Symfony/Component/Form/PreloadedExtension.php +++ b/src/Symfony/Component/Form/PreloadedExtension.php @@ -20,19 +20,8 @@ */ class PreloadedExtension implements FormExtensionInterface { - /** - * @var FormTypeInterface[] - */ private $types = array(); - - /** - * @var array[FormTypeExtensionInterface[]] - */ private $typeExtensions = array(); - - /** - * @var FormTypeGuesserInterface - */ private $typeGuesser; /** diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php index f874e5a4390ef..53243c88f74d6 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php @@ -29,11 +29,8 @@ class ViolationMapperTest extends TestCase { const LEVEL_0 = 0; - const LEVEL_1 = 1; - const LEVEL_1B = 2; - const LEVEL_2 = 3; /** diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt index a579a90e53b58..c622057cdbdfd 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt @@ -16,8 +16,8 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain Allowed values - %s ---------------- --------------------%s Normalizer Closure { %s - parameters: 2, %s - file: "%s%eExtension%eCore%eType%eChoiceType.php", + parameters: 2 %s + file: "%s%eExtension%eCore%eType%eChoiceType.php" line: "%s to %s" %s } %s ---------------- --------------------%s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt index 662d982979bc4..231d1319bbeff 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt @@ -9,13 +9,13 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data) %s Closure(s): [ %s Closure { %s - parameters: 1, %s - file: "%s%eExtension%eCore%eType%eFormType.php", + parameters: 1 %s + file: "%s%eExtension%eCore%eType%eFormType.php" line: "%s to %s" %s }, %s Closure { %s - parameters: 2, %s - file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php", + parameters: 2 %s + file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s } %s ] %s diff --git a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt index 049b692f1dc7f..da3e6c82d8b1a 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt +++ b/src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt @@ -17,8 +17,8 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo) ] %s ---------------- --------------------%s Normalizer Closure { %s - parameters: 2, %s - file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php", + parameters: 2 %s + file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php" line: "%s to %s" %s } %s ---------------- --------------------%s diff --git a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php index 11562475d822e..d9d874af61a1b 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMapIterator.php @@ -58,9 +58,9 @@ class OrderedHashMapIterator implements \Iterator /** * Creates a new iterator. * - * @param array $elements the elements of the map, indexed by their + * @param array $elements The elements of the map, indexed by their * keys - * @param array $orderedKeys the keys of the map in the order in which + * @param array $orderedKeys The keys of the map in the order in which * they should be iterated * @param array $managedCursors An array from which to reference the * iterator's cursor as long as it is alive. diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index 4106c65890aa2..7afb274b4d27e 100644 --- a/src/Symfony/Component/Form/composer.json +++ b/src/Symfony/Component/Form/composer.json @@ -32,7 +32,7 @@ "symfony/http-kernel": "^3.3.5|~4.0", "symfony/security-csrf": "~2.8|~3.0|~4.0", "symfony/translation": "~2.8|~3.0|~4.0", - "symfony/var-dumper": "~3.3|~4.0", + "symfony/var-dumper": "~3.3.11|~3.4-beta3|~4.0-beta3", "symfony/console": "~3.4|~4.0" }, "conflict": { diff --git a/src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php b/src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php index e07a48aa95332..c69dbbba35663 100644 --- a/src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php +++ b/src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php @@ -18,24 +18,9 @@ */ class AcceptHeaderItem { - /** - * @var string - */ private $value; - - /** - * @var float - */ private $quality = 1.0; - - /** - * @var int - */ private $index = 0; - - /** - * @var array - */ private $attributes = array(); /** diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index 9a2d28491a1fd..082d8d534e17a 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -24,41 +24,10 @@ */ class UploadedFile extends File { - /** - * Whether the test mode is activated. - * - * Local files are used in test mode hence the code should not enforce HTTP uploads. - * - * @var bool - */ private $test = false; - - /** - * The original name of the uploaded file. - * - * @var string - */ private $originalName; - - /** - * The mime type provided by the uploader. - * - * @var string - */ private $mimeType; - - /** - * The file size provided by the uploader. - * - * @var int|null - */ private $size; - - /** - * The UPLOAD_ERR_XXX constant provided by the uploader. - * - * @var int - */ private $error; /** @@ -76,11 +45,12 @@ class UploadedFile extends File * Calling any other method on an non-valid instance will cause an unpredictable result. * * @param string $path The full temporary path to the file - * @param string $originalName The original file name + * @param string $originalName The original file name of the uploaded file * @param string|null $mimeType The type of the file as provided by PHP; null defaults to application/octet-stream - * @param int|null $size The file size + * @param int|null $size The file size provided by the uploader * @param int|null $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK * @param bool $test Whether the test mode is active + * Local files are used in test mode hence the code should not enforce HTTP uploads * * @throws FileException If file_uploads is disabled * @throws FileNotFoundException If the file does not exist diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 06144543d1a2e..d45d54091ef97 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -795,8 +795,8 @@ public static function getHttpMethodParameterOverride() * * Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY * - * @param string $key the key - * @param mixed $default the default value if the parameter key does not exist + * @param string $key The key + * @param mixed $default The default value if the parameter key does not exist * * @return mixed */ @@ -1928,12 +1928,12 @@ protected function prepareBaseUrl() */ protected function prepareBasePath() { - $filename = basename($this->server->get('SCRIPT_FILENAME')); $baseUrl = $this->getBaseUrl(); if (empty($baseUrl)) { return ''; } + $filename = basename($this->server->get('SCRIPT_FILENAME')); if (basename($baseUrl) === $filename) { $basePath = dirname($baseUrl); } else { @@ -1954,8 +1954,6 @@ protected function prepareBasePath() */ protected function preparePathInfo() { - $baseUrl = $this->getBaseUrl(); - if (null === ($requestUri = $this->getRequestUri())) { return '/'; } @@ -1968,12 +1966,14 @@ protected function preparePathInfo() $requestUri = '/'.$requestUri; } + if (null === ($baseUrl = $this->getBaseUrl())) { + return $requestUri; + } + $pathInfo = substr($requestUri, strlen($baseUrl)); - if (null !== $baseUrl && (false === $pathInfo || '' === $pathInfo)) { + if (false === $pathInfo || '' === $pathInfo) { // If substr() returns false then PATH_INFO is set to an empty string return '/'; - } elseif (null === $baseUrl) { - return $requestUri; } return (string) $pathInfo; diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 9c98203147247..e079ae2e95d55 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -126,6 +126,7 @@ class Response 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', // RFC2518 + 103 => 'Early Hints', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', diff --git a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php index e149801aad9d8..abbf37ee7c33c 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php @@ -19,11 +19,6 @@ */ class NamespacedAttributeBag extends AttributeBag { - /** - * Namespace character. - * - * @var string - */ private $namespaceCharacter; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index f063651a18ebf..09caa3442fa49 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -24,21 +24,9 @@ */ class Session implements SessionInterface, \IteratorAggregate, \Countable { - /** - * Storage driver. - * - * @var SessionStorageInterface - */ protected $storage; - /** - * @var string - */ private $flashName; - - /** - * @var string - */ private $attributeName; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php index 2978ef4a2c1fa..84f4357b1232e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -20,9 +20,6 @@ */ class MemcacheSessionHandler implements \SessionHandlerInterface { - /** - * @var \Memcache Memcache driver - */ private $memcache; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php index a31642cc83524..2d600b66cd406 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -21,9 +21,6 @@ */ class MemcachedSessionHandler extends AbstractSessionHandler { - /** - * @var \Memcached Memcached driver - */ private $memcached; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index 7d770421c55ef..264144d5b5235 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -21,9 +21,6 @@ */ class MongoDbSessionHandler extends AbstractSessionHandler { - /** - * @var \Mongo|\MongoClient|\MongoDB\Client - */ private $mongo; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php index 638a633076e38..2fc7e09195d35 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php @@ -22,9 +22,6 @@ */ class WriteCheckSessionHandler implements \SessionHandlerInterface { - /** - * @var \SessionHandlerInterface - */ private $wrappedSessionHandler; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php index 8c1bf73caefb3..0a580d6027c4f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -24,9 +24,6 @@ */ class MockFileSessionStorage extends MockArraySessionStorage { - /** - * @var string - */ private $savePath; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index 2975e4104c9e0..c034c59038624 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -100,6 +100,12 @@ class NativeSessionStorage implements SessionStorageInterface */ public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) { + $this->setMetadataBag($metaBag); + + if (\PHP_SESSION_ACTIVE === session_status()) { + return; + } + $options += array( 'cache_limiter' => 'private_no_expire', 'cache_expire' => 0, @@ -109,7 +115,6 @@ public function __construct(array $options = array(), $handler = null, MetadataB session_register_shutdown(); - $this->setMetadataBag($metaBag); $this->setOptions($options); $this->setSaveHandler($handler); } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php index b6696af6726cc..460abe15c3b75 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php @@ -14,7 +14,7 @@ @trigger_error('The '.__NAMESPACE__.'\NativeProxy class is deprecated since version 3.4 and will be removed in 4.0. Use your session handler implementation directly.', E_USER_DEPRECATED); /** - * This proxy is built-in session handlers in PHP 5.3.x + * This proxy is built-in session handlers in PHP 5.3.x. * * @deprecated since version 3.4, to be removed in 4.0. Use your session handler implementation directly. * diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php index 359bb877b5e30..53c1209a1c07d 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -16,9 +16,6 @@ */ class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface { - /** - * @var \SessionHandlerInterface - */ protected $handler; public function __construct(\SessionHandlerInterface $handler) diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php index 05470ed80a363..dda43c805ba7d 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php @@ -23,6 +23,7 @@ class MemcacheSessionHandlerTest extends TestCase { const PREFIX = 'prefix_'; const TTL = 1000; + /** * @var MemcacheSessionHandler */ diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index e5b080d8a48d0..8864bb7069e3e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -242,4 +242,24 @@ public function testRestart() $this->assertSame($id, $storage->getId(), 'Same session ID after restarting'); $this->assertSame(7, $storage->getBag('attributes')->get('lucky'), 'Data still available'); } + + public function testCanCreateNativeSessionStorageWhenSessionAlreadyStarted() + { + session_start(); + $this->getStorage(); + + // Assert no exception has been thrown by `getStorage()` + $this->addToAssertionCount(1); + } + + public function testSetSessionOptionsOnceSessionStartedIsIgnored() + { + session_start(); + $this->getStorage(array( + 'name' => 'something-else', + )); + + // Assert no exception has been thrown by `getStorage()` + $this->addToAssertionCount(1); + } } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index d27940266a8f1..576bf22b87f3d 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -131,7 +131,7 @@ public function collect(Request $request, Response $response, \Exception $except unset($this->controllers[$request]); } - if (null !== $session && $session->isStarted()) { + if (null !== $session) { if ($request->attributes->has('_redirected')) { $this->data['redirect'] = $session->remove('sf_redirect'); } @@ -315,7 +315,7 @@ public function onKernelController(FilterControllerEvent $event) public function onKernelResponse(FilterResponseEvent $event) { - if (!$event->isMasterRequest() || !$event->getRequest()->hasSession() || !$event->getRequest()->getSession()->isStarted()) { + if (!$event->isMasterRequest() || !$event->getRequest()->hasSession()) { return; } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php b/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php index f1e48311c0429..ce201f5e768b2 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php @@ -24,8 +24,8 @@ class ValueExporter * Converts a PHP value to a string. * * @param mixed $value The PHP value - * @param int $depth only for internal usage - * @param bool $deep only for internal usage + * @param int $depth Only for internal usage + * @param bool $deep Only for internal usage * * @return string The string representation of the given value */ diff --git a/src/Symfony/Component/HttpKernel/Event/KernelEvent.php b/src/Symfony/Component/HttpKernel/Event/KernelEvent.php index 2043a01758ce8..992f6b4dc033e 100644 --- a/src/Symfony/Component/HttpKernel/Event/KernelEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/KernelEvent.php @@ -22,28 +22,16 @@ */ class KernelEvent extends Event { - /** - * The kernel in which this event was thrown. - * - * @var HttpKernelInterface - */ private $kernel; - - /** - * The request the kernel is currently processing. - * - * @var Request - */ private $request; + private $requestType; /** - * The request type the kernel is currently processing. One of - * HttpKernelInterface::MASTER_REQUEST and HttpKernelInterface::SUB_REQUEST. - * - * @var int + * @param HttpKernelInterface $kernel The kernel in which this event was thrown + * @param Request $request The request the kernel is currently processing + * @param int $requestType The request type the kernel is currently processing; one of + * HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST */ - private $requestType; - public function __construct(HttpKernelInterface $kernel, Request $request, $requestType) { $this->kernel = $kernel; diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index d2d7c422662d1..e3e4e7620e4ee 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -40,8 +40,8 @@ class ProfilerListener implements EventSubscriberInterface * @param Profiler $profiler A Profiler instance * @param RequestStack $requestStack A RequestStack instance * @param RequestMatcherInterface|null $matcher A RequestMatcher instance - * @param bool $onlyException true if the profiler only collects data when an exception occurs, false otherwise - * @param bool $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise + * @param bool $onlyException True if the profiler only collects data when an exception occurs, false otherwise + * @param bool $onlyMasterRequests True if the profiler only collects data when the request is a master request, false otherwise */ public function __construct(Profiler $profiler, RequestStack $requestStack, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false) { diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 91fda4f36399d..8f7b6dab9fca1 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -290,7 +290,7 @@ protected function invalidate(Request $request, $catch = false) * it triggers "miss" processing. * * @param Request $request A Request instance - * @param bool $catch whether to process exceptions + * @param bool $catch Whether to process exceptions * * @return Response A Response instance * @@ -399,7 +399,7 @@ protected function validate(Request $request, Response $entry, $catch = false) * stores it in the cache if is cacheable. * * @param Request $request A Request instance - * @param bool $catch whether to process exceptions + * @param bool $catch Whether to process exceptions * * @return Response A Response instance */ diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 283b7227b316b..0c54c4ad17e02 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.0-BETA2'; + const VERSION = '3.4.0-BETA3'; const VERSION_ID = 30400; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'BETA2'; + const EXTRA_VERSION = 'BETA3'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; diff --git a/src/Symfony/Component/HttpKernel/KernelEvents.php b/src/Symfony/Component/HttpKernel/KernelEvents.php index 3e961737b844e..6743763258597 100644 --- a/src/Symfony/Component/HttpKernel/KernelEvents.php +++ b/src/Symfony/Component/HttpKernel/KernelEvents.php @@ -26,8 +26,6 @@ final class KernelEvents * other code in the framework is executed. * * @Event("Symfony\Component\HttpKernel\Event\GetResponseEvent") - * - * @var string */ const REQUEST = 'kernel.request'; @@ -38,8 +36,6 @@ final class KernelEvents * to modify the thrown exception. * * @Event("Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent") - * - * @var string */ const EXCEPTION = 'kernel.exception'; @@ -51,8 +47,6 @@ final class KernelEvents * controller. * * @Event("Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent") - * - * @var string */ const VIEW = 'kernel.view'; @@ -64,8 +58,6 @@ final class KernelEvents * request. * * @Event("Symfony\Component\HttpKernel\Event\FilterControllerEvent") - * - * @var string */ const CONTROLLER = 'kernel.controller'; @@ -76,8 +68,6 @@ final class KernelEvents * the controller. * * @Event("Symfony\Component\HttpKernel\Event\FilterControllerArgumentsEvent") - * - * @var string */ const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments'; @@ -89,8 +79,6 @@ final class KernelEvents * replied. * * @Event("Symfony\Component\HttpKernel\Event\FilterResponseEvent") - * - * @var string */ const RESPONSE = 'kernel.response'; @@ -100,8 +88,6 @@ final class KernelEvents * This event allows you to run expensive post-response jobs. * * @Event("Symfony\Component\HttpKernel\Event\PostResponseEvent") - * - * @var string */ const TERMINATE = 'kernel.terminate'; @@ -112,8 +98,6 @@ final class KernelEvents * the application, when it was changed during the request. * * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent") - * - * @var string */ const FINISH_REQUEST = 'kernel.finish_request'; } diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profile.php b/src/Symfony/Component/HttpKernel/Profiler/Profile.php index 483baa290a4ae..c21c9d38a343d 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profile.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -164,7 +164,7 @@ public function getTime() } /** - * @param int The time + * @param int $time The time */ public function setTime($time) { diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php index 93767b96841dd..2ff1ed4cee645 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -17,7 +17,6 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\HttpKernel; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector; @@ -71,20 +70,6 @@ public function testCollectWithoutRouteParams() $this->assertEquals(array(), $c->getRouteParams()); } - public function testKernelResponseDoesNotStartSession() - { - $kernel = $this->getMockBuilder(HttpKernelInterface::class)->getMock(); - $request = new Request(); - $session = new Session(new MockArraySessionStorage()); - $request->setSession($session); - $response = new Response(); - - $c = new RequestDataCollector(); - $c->onKernelResponse(new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response)); - - $this->assertFalse($session->isStarted()); - } - /** * @dataProvider provideControllerCallables */ diff --git a/src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php b/src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php index b3df7387c23ad..ef54e402e9294 100644 --- a/src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php +++ b/src/Symfony/Component/Intl/Data/Bundle/Compiler/GenrbCompiler.php @@ -22,17 +22,13 @@ */ class GenrbCompiler implements BundleCompilerInterface { - /** - * @var string The path to the "genrb" executable - */ private $genrb; /** * Creates a new compiler based on the "genrb" executable. * * @param string $genrb Optional. The path to the "genrb" executable - * @param string $envVars Optional. Environment variables to be loaded when - * running "genrb". + * @param string $envVars Optional. Environment variables to be loaded when running "genrb". * * @throws RuntimeException if the "genrb" cannot be found */ diff --git a/src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php b/src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php index 1826fcd0fa798..5fee153259281 100644 --- a/src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php +++ b/src/Symfony/Component/Intl/Data/Bundle/Reader/BufferedBundleReader.php @@ -20,19 +20,14 @@ */ class BufferedBundleReader implements BundleReaderInterface { - /** - * @var BundleReaderInterface - */ private $reader; - private $buffer; /** * Buffers a given reader. * * @param BundleReaderInterface $reader The reader to buffer - * @param int $bufferSize the number of entries to store - * in the buffer + * @param int $bufferSize The number of entries to store in the buffer */ public function __construct(BundleReaderInterface $reader, $bufferSize) { diff --git a/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php b/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php index a0fb4334f907d..3a444fd350edb 100644 --- a/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php +++ b/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php @@ -46,7 +46,7 @@ public function write($path, $locale, $data, $fallback = true) * @param resource $file The file handle to write to * @param string $bundleName The name of the bundle * @param mixed $value The value of the node - * @param bool $fallback whether the resource bundle should be merged + * @param bool $fallback Whether the resource bundle should be merged * with the fallback locale * * @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt @@ -66,8 +66,7 @@ private function writeResourceBundle($file, $bundleName, $value, $fallback) * @param resource $file The file handle to write to * @param mixed $value The value of the node * @param int $indentation The number of levels to indent - * @param bool $requireBraces whether to require braces to be printed - * around the value + * @param bool $requireBraces Whether to require braces to be printedaround the value * * @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt */ @@ -153,7 +152,7 @@ private function writeIntVector($file, array $value, $indentation) * * @param resource $file The file handle to write to * @param string $value The value of the node - * @param bool $requireBraces whether to require braces to be printed + * @param bool $requireBraces Whether to require braces to be printed * around the value * * @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt @@ -199,7 +198,7 @@ private function writeArray($file, array $value, $indentation) * @param resource $file The file handle to write to * @param array|\Traversable $value The value of the node * @param int $indentation The number of levels to indent - * @param bool $fallback whether the table should be merged + * @param bool $fallback Whether the table should be merged * with the fallback locale * * @throws UnexpectedTypeException when $value is not an array and not a diff --git a/src/Symfony/Component/Intl/Data/Generator/AbstractDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/AbstractDataGenerator.php index 6b7cf5a0caf1d..68a27c432389e 100644 --- a/src/Symfony/Component/Intl/Data/Generator/AbstractDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/AbstractDataGenerator.php @@ -26,20 +26,13 @@ */ abstract class AbstractDataGenerator { - /** - * @var GenrbCompiler - */ private $compiler; - - /** - * @var string - */ private $dirName; public function __construct(GenrbCompiler $compiler, $dirName) { $this->compiler = $compiler; - $this->dirName = $dirName; + $this->dirName = (string) $dirName; } public function generateData(GeneratorConfig $config) diff --git a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php index cd9da7c13cb3f..bd186643457ed 100644 --- a/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/CurrencyDataGenerator.php @@ -26,29 +26,17 @@ class CurrencyDataGenerator extends AbstractDataGenerator { const UNKNOWN_CURRENCY_ID = 'XXX'; - const EUROPEAN_COMPOSITE_UNIT_ID = 'XBA'; - const EUROPEAN_MONETARY_UNIT_ID = 'XBB'; - const EUROPEAN_UNIT_OF_ACCOUNT_XBC_ID = 'XBC'; - const EUROPEAN_UNIT_OF_ACCOUNT_XBD_ID = 'XBD'; - const TESTING_CURRENCY_CODE_ID = 'XTS'; - const ADB_UNIT_OF_ACCOUNT_ID = 'XUA'; - const GOLD_ID = 'XAU'; - const SILVER_ID = 'XAG'; - const PLATINUM_ID = 'XPT'; - const PALLADIUM_ID = 'XPD'; - const SUCRE_ID = 'XSU'; - const SPECIAL_DRAWING_RIGHTS_ID = 'XDR'; /** diff --git a/src/Symfony/Component/Intl/Data/Generator/GeneratorConfig.php b/src/Symfony/Component/Intl/Data/Generator/GeneratorConfig.php index 78e16ef4d8dbc..9bb9304db0159 100644 --- a/src/Symfony/Component/Intl/Data/Generator/GeneratorConfig.php +++ b/src/Symfony/Component/Intl/Data/Generator/GeneratorConfig.php @@ -22,14 +22,7 @@ */ class GeneratorConfig { - /** - * @var string - */ private $sourceDir; - - /** - * @var string - */ private $icuVersion; /** @@ -37,6 +30,10 @@ class GeneratorConfig */ private $bundleWriters = array(); + /** + * @param string $sourceDir + * @param string $icuVersion + */ public function __construct($sourceDir, $icuVersion) { $this->sourceDir = $sourceDir; diff --git a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php index 77bcb00c85f4f..52225f4941a1c 100644 --- a/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php @@ -157,20 +157,20 @@ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir) return array( 'Version' => $rootBundle['Version'], 'Languages' => $this->languageCodes, - 'Aliases' => $metadataBundle['languageAlias'], + 'Aliases' => array_map(function (\ResourceBundle $bundle) { + return $bundle['replacement']; + }, iterator_to_array($metadataBundle['alias']['language'])), 'Alpha2ToAlpha3' => $this->generateAlpha2ToAlpha3Mapping($metadataBundle), ); } private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $metadataBundle) { - // Data structure has changed in ICU 5.5 from "languageAlias" to "alias->language" - $aliases = $metadataBundle['languageAlias'] ?: $metadataBundle['alias']['language']; + $aliases = iterator_to_array($metadataBundle['alias']['language']); $alpha2ToAlpha3 = array(); foreach ($aliases as $alias => $language) { - // $language is a string before ICU 5.5 - $language = is_string($language) ? $language : $language['replacement']; + $language = $language['replacement']; if (2 === strlen($language) && 3 === strlen($alias)) { if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) { // Validate to prevent typos @@ -184,7 +184,7 @@ private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $me } $alpha3 = self::$preferredAlpha2ToAlpha3Mapping[$language]; - $alpha2 = is_string($aliases[$alpha3]) ? $aliases[$alpha3] : $aliases[$alpha3]['replacement']; + $alpha2 = $aliases[$alpha3]['replacement']; if ($language !== $alpha2) { throw new RuntimeException( diff --git a/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php index e89e5e8757b67..5951a77043eeb 100644 --- a/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php @@ -29,29 +29,14 @@ */ class LocaleDataGenerator { - /** - * @var string - */ private $dirName; - - /** - * @var LanguageDataProvider - */ private $languageDataProvider; - - /** - * @var ScriptDataProvider - */ private $scriptDataProvider; - - /** - * @var RegionDataProvider - */ private $regionDataProvider; public function __construct($dirName, LanguageDataProvider $languageDataProvider, ScriptDataProvider $scriptDataProvider, RegionDataProvider $regionDataProvider) { - $this->dirName = $dirName; + $this->dirName = (string) $dirName; $this->languageDataProvider = $languageDataProvider; $this->scriptDataProvider = $scriptDataProvider; $this->regionDataProvider = $regionDataProvider; diff --git a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php index 9c9006d7bac28..7ae31bd121ffb 100644 --- a/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php +++ b/src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php @@ -28,17 +28,11 @@ class RegionDataGenerator extends AbstractDataGenerator { const UNKNOWN_REGION_ID = 'ZZ'; - const OUTLYING_OCEANIA_REGION_ID = 'QO'; - const EUROPEAN_UNION_ID = 'EU'; - const NETHERLANDS_ANTILLES_ID = 'AN'; - const BOUVET_ISLAND_ID = 'BV'; - const HEARD_MCDONALD_ISLANDS_ID = 'HM'; - const CLIPPERTON_ISLAND_ID = 'CP'; /** diff --git a/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php index c2747f08062da..6818a7948d579 100644 --- a/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/CurrencyDataProvider.php @@ -25,21 +25,11 @@ class CurrencyDataProvider { const INDEX_SYMBOL = 0; - const INDEX_NAME = 1; - const INDEX_FRACTION_DIGITS = 0; - const INDEX_ROUNDING_INCREMENT = 1; - /** - * @var string - */ private $path; - - /** - * @var BundleEntryReaderInterface - */ private $reader; /** diff --git a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php index b601c91405b2c..0eb5987d10ff5 100644 --- a/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php @@ -23,23 +23,14 @@ */ class LanguageDataProvider { - /** - * @var string - */ private $path; - - /** - * @var BundleEntryReaderInterface - */ private $reader; /** * Creates a data provider that reads locale-related data from .res files. * - * @param string $path The path to the directory - * containing the .res files. - * @param BundleEntryReaderInterface $reader The reader for reading the .res - * files. + * @param string $path The path to the directory containing the .res files + * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { diff --git a/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php index dc8bd64149f37..0eb82f621e155 100644 --- a/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/LocaleDataProvider.php @@ -23,23 +23,14 @@ */ class LocaleDataProvider { - /** - * @var string - */ private $path; - - /** - * @var BundleEntryReaderInterface - */ private $reader; /** * Creates a data provider that reads locale-related data from .res files. * - * @param string $path The path to the directory - * containing the .res files. - * @param BundleEntryReaderInterface $reader The reader for reading the .res - * files. + * @param string $path The path to the directory containing the .res files + * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { diff --git a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php index 6adea143a1c70..d3c8164158a97 100644 --- a/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/RegionDataProvider.php @@ -23,23 +23,14 @@ */ class RegionDataProvider { - /** - * @var string - */ private $path; - - /** - * @var BundleEntryReaderInterface - */ private $reader; /** * Creates a data provider that reads locale-related data from .res files. * - * @param string $path The path to the directory - * containing the .res files. - * @param BundleEntryReaderInterface $reader The reader for reading the .res - * files. + * @param string $path The path to the directory containing the .res files + * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { diff --git a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php index 462690d4d4f25..29ff1d63ae9b1 100644 --- a/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php +++ b/src/Symfony/Component/Intl/Data/Provider/ScriptDataProvider.php @@ -23,23 +23,14 @@ */ class ScriptDataProvider { - /** - * @var string - */ private $path; - - /** - * @var BundleEntryReaderInterface - */ private $reader; /** * Creates a data provider that reads locale-related data from .res files. * - * @param string $path The path to the directory - * containing the .res files. - * @param BundleEntryReaderInterface $reader The reader for reading the .res - * files. + * @param string $path The path to the directory containing the .res files + * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { diff --git a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php index 809707593f013..7b3dfdfc22195 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -94,14 +94,7 @@ class IntlDateFormatter self::SHORT => 'h:mm a', ); - /** - * @var int - */ private $datetype; - - /** - * @var int - */ private $timetype; /** @@ -163,7 +156,7 @@ public function __construct($locale, $datetype, $timetype, $timezone = null, $ca * @param int $datetype Type of date formatting, one of the format type constants * @param int $timetype Type of time formatting, one of the format type constants * @param string $timezone Timezone identifier - * @param int $calendar calendar to use for formatting or parsing; default is Gregorian + * @param int $calendar Calendar to use for formatting or parsing; default is Gregorian * One of the calendar constants * @param string $pattern Optional pattern to use when formatting * diff --git a/src/Symfony/Component/Intl/Globals/IntlGlobals.php b/src/Symfony/Component/Intl/Globals/IntlGlobals.php index ec2ee174699c5..4e520695efa9f 100644 --- a/src/Symfony/Component/Intl/Globals/IntlGlobals.php +++ b/src/Symfony/Component/Intl/Globals/IntlGlobals.php @@ -22,29 +22,21 @@ abstract class IntlGlobals { /** * Indicates that no error occurred. - * - * @var int */ const U_ZERO_ERROR = 0; /** * Indicates that an invalid argument was passed. - * - * @var int */ const U_ILLEGAL_ARGUMENT_ERROR = 1; /** * Indicates that the parse() operation failed. - * - * @var int */ const U_PARSE_ERROR = 9; /** * All known error codes. - * - * @var array */ private static $errorCodes = array( self::U_ZERO_ERROR => 'U_ZERO_ERROR', @@ -54,15 +46,11 @@ abstract class IntlGlobals /** * The error code of the last operation. - * - * @var int */ private static $errorCode = self::U_ZERO_ERROR; /** * The error code of the last operation. - * - * @var int */ private static $errorMessage = 'U_ZERO_ERROR'; diff --git a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php index 20d20336ae05e..844d61cecbc75 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -150,8 +150,6 @@ class NumberFormatter /** * Default values for the en locale. - * - * @var array */ private $attributes = array( self::FRACTION_DIGITS => 0, @@ -161,15 +159,11 @@ class NumberFormatter /** * Holds the initialized attributes code. - * - * @var array */ private $initializedAttributes = array(); /** * The supported styles to the constructor $styles argument. - * - * @var array */ private static $supportedStyles = array( 'CURRENCY' => self::CURRENCY, @@ -178,8 +172,6 @@ class NumberFormatter /** * Supported attributes to the setAttribute() $attr argument. - * - * @var array */ private static $supportedAttributes = array( 'FRACTION_DIGITS' => self::FRACTION_DIGITS, @@ -191,8 +183,6 @@ class NumberFormatter * The available rounding modes for setAttribute() usage with * NumberFormatter::ROUNDING_MODE. NumberFormatter::ROUND_DOWN * and NumberFormatter::ROUND_UP does not have a PHP only equivalent. - * - * @var array */ private static $roundingModes = array( 'ROUND_HALFEVEN' => self::ROUND_HALFEVEN, @@ -209,8 +199,6 @@ class NumberFormatter * modes in PHP's round() function. * * @see http://www.php.net/manual/en/function.round.php - * - * @var array */ private static $phpRoundingMap = array( self::ROUND_HALFDOWN => \PHP_ROUND_HALF_DOWN, @@ -222,8 +210,6 @@ class NumberFormatter * The list of supported rounding modes which aren't available modes in * PHP's round() function, but there's an equivalent. Keys are rounding * modes, values does not matter. - * - * @var array */ private static $customRoundingList = array( self::ROUND_CEILING => true, @@ -234,8 +220,6 @@ class NumberFormatter /** * The maximum value of the integer type in 32 bit platforms. - * - * @var int */ private static $int32Max = 2147483647; @@ -355,7 +339,7 @@ public function formatCurrency($value, $currency) /** * Format a number. * - * @param int|float $value the value to format + * @param int|float $value The value to format * @param int $type Type of the formatting, one of the format type constants. * Only type NumberFormatter::TYPE_DEFAULT is currently supported. * @@ -516,9 +500,9 @@ public function parseCurrency($value, &$currency, &$position = null) /** * Parse a number. * - * @param string $value the value to parse + * @param string $value The value to parse * @param int $type Type of the formatting, one of the format type constants. NumberFormatter::TYPE_DOUBLE by default. - * @param int $position offset to begin the parsing on return this value will hold the offset at which the parsing ended + * @param int $position Offset to begin the parsing on return this value will hold the offset at which the parsing ended * * @return int|float|false The parsed value of false on error * @@ -569,7 +553,7 @@ public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0) * @param int $attr An attribute specifier, one of the numeric attribute constants. * The only currently supported attributes are NumberFormatter::FRACTION_DIGITS, * NumberFormatter::GROUPING_USED and NumberFormatter::ROUNDING_MODE. - * @param int $value the attribute value + * @param int $value The attribute value * * @return bool true on success or false on failure * diff --git a/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php b/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php index 5a4b35519f8b6..b528b3b0a7fe3 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/CurrencyBundle.php @@ -25,9 +25,6 @@ */ class CurrencyBundle extends CurrencyDataProvider implements CurrencyBundleInterface { - /** - * @var LocaleDataProvider - */ private $localeProvider; /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php index d12b892a10dcb..ee319544e5414 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php @@ -26,14 +26,7 @@ */ class LanguageBundle extends LanguageDataProvider implements LanguageBundleInterface { - /** - * @var LocaleDataProvider - */ private $localeProvider; - - /** - * @var ScriptDataProvider - */ private $scriptProvider; /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php b/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php index 29697d6883dd0..d709ba55626f6 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php @@ -25,9 +25,6 @@ */ class RegionBundle extends RegionDataProvider implements RegionBundleInterface { - /** - * @var LocaleDataProvider - */ private $localeProvider; /** diff --git a/src/Symfony/Component/Intl/Resources/data/languages/meta.json b/src/Symfony/Component/Intl/Resources/data/languages/meta.json index 5fa96ae47fd2a..1ef29bc6efb9f 100644 --- a/src/Symfony/Component/Intl/Resources/data/languages/meta.json +++ b/src/Symfony/Component/Intl/Resources/data/languages/meta.json @@ -619,7 +619,344 @@ "zxx", "zza" ], - "Aliases": null, + "Aliases": { + "aa_SAAHO": "ssy", + "aar": "aa", + "abk": "ab", + "afr": "af", + "aju": "jrb", + "aka": "ak", + "alb": "sq", + "als": "sq", + "amh": "am", + "ara": "ar", + "arb": "ar", + "arg": "an", + "arm": "hy", + "art_lojban": "jbo", + "asm": "as", + "ava": "av", + "ave": "ae", + "aym": "ay", + "ayr": "ay", + "az_AZ": "az_Latn_AZ", + "aze": "az", + "azj": "az", + "bak": "ba", + "bam": "bm", + "baq": "eu", + "bcc": "bal", + "bcl": "bik", + "bel": "be", + "ben": "bn", + "bh": "bho", + "bih": "bho", + "bis": "bi", + "bod": "bo", + "bos": "bs", + "bre": "br", + "bs_BA": "bs_Latn_BA", + "bul": "bg", + "bur": "my", + "bxk": "luy", + "bxr": "bua", + "cat": "ca", + "ces": "cs", + "cha": "ch", + "che": "ce", + "chi": "zh", + "chu": "cu", + "chv": "cv", + "cld": "syr", + "cmn": "zh", + "cor": "kw", + "cos": "co", + "cre": "cr", + "cwd": "cr", + "cym": "cy", + "cze": "cs", + "dan": "da", + "deu": "de", + "dgo": "doi", + "dhd": "mwr", + "dik": "din", + "diq": "zza", + "div": "dv", + "dut": "nl", + "dzo": "dz", + "ekk": "et", + "ell": "el", + "emk": "man", + "eng": "en", + "epo": "eo", + "esk": "ik", + "est": "et", + "eus": "eu", + "ewe": "ee", + "fao": "fo", + "fas": "fa", + "fat": "ak", + "fij": "fj", + "fin": "fi", + "fra": "fr", + "fre": "fr", + "fry": "fy", + "fuc": "ff", + "ful": "ff", + "gaz": "om", + "gbo": "grb", + "geo": "ka", + "ger": "de", + "gla": "gd", + "gle": "ga", + "glg": "gl", + "glv": "gv", + "gno": "gon", + "gre": "el", + "grn": "gn", + "gug": "gn", + "guj": "gu", + "gya": "gba", + "ha_Latn_GH": "ha_GH", + "ha_Latn_NE": "ha_NE", + "ha_Latn_NG": "ha_NG", + "hat": "ht", + "hau": "ha", + "hbs": "sr_Latn", + "hdn": "hai", + "hea": "hmn", + "heb": "he", + "her": "hz", + "him": "srx", + "hin": "hi", + "hmo": "ho", + "hrv": "hr", + "hun": "hu", + "hye": "hy", + "i_ami": "ami", + "i_bnn": "bnn", + "i_hak": "hak", + "i_klingon": "tlh", + "i_lux": "lb", + "i_navajo": "nv", + "i_pwn": "pwn", + "i_tao": "tao", + "i_tay": "tay", + "i_tsu": "tsu", + "ibo": "ig", + "ice": "is", + "ido": "io", + "iii": "ii", + "ike": "iu", + "iku": "iu", + "ile": "ie", + "in": "id", + "ina": "ia", + "ind": "id", + "ipk": "ik", + "isl": "is", + "ita": "it", + "iw": "he", + "jav": "jv", + "ji": "yi", + "jpn": "ja", + "jw": "jv", + "kal": "kl", + "kan": "kn", + "kas": "ks", + "kat": "ka", + "kau": "kr", + "kaz": "kk", + "khk": "mn", + "khm": "km", + "kik": "ki", + "kin": "rw", + "kir": "ky", + "kk_Cyrl_KZ": "kk_KZ", + "kmr": "ku", + "knc": "kr", + "kng": "kg", + "knn": "kok", + "kom": "kv", + "kon": "kg", + "kor": "ko", + "kpv": "kv", + "ks_Arab_IN": "ks_IN", + "kua": "kj", + "kur": "ku", + "ky_Cyrl_KG": "ky_KG", + "lao": "lo", + "lat": "la", + "lav": "lv", + "lbk": "bnc", + "lim": "li", + "lin": "ln", + "lit": "lt", + "ltz": "lb", + "lub": "lu", + "lug": "lg", + "lvs": "lv", + "mac": "mk", + "mah": "mh", + "mal": "ml", + "mao": "mi", + "mar": "mr", + "may": "ms", + "mhr": "chm", + "mkd": "mk", + "mlg": "mg", + "mlt": "mt", + "mn_Cyrl_MN": "mn_MN", + "mnk": "man", + "mo": "ro_MD", + "mol": "ro_MD", + "mon": "mn", + "mri": "mi", + "ms_Latn_BN": "ms_BN", + "ms_Latn_MY": "ms_MY", + "ms_Latn_SG": "ms_SG", + "msa": "ms", + "mup": "raj", + "mya": "my", + "nau": "na", + "nav": "nv", + "nbl": "nr", + "nde": "nd", + "ndo": "ng", + "nep": "ne", + "nld": "nl", + "nno": "nn", + "no": "nb", + "no_BOKMAL": "nb", + "no_NYNORSK": "nn", + "no_bok": "nb", + "no_nyn": "nn", + "nob": "nb", + "nor": "nb", + "npi": "ne", + "nya": "ny", + "oci": "oc", + "ojg": "oj", + "oji": "oj", + "ori": "or", + "orm": "om", + "ory": "or", + "oss": "os", + "pa_IN": "pa_Guru_IN", + "pa_PK": "pa_Arab_PK", + "pan": "pa", + "pbu": "ps", + "per": "fa", + "pes": "fa", + "pli": "pi", + "plt": "mg", + "pnb": "lah", + "pol": "pl", + "por": "pt", + "prs": "fa_AF", + "pus": "ps", + "que": "qu", + "quz": "qu", + "rmy": "rom", + "roh": "rm", + "ron": "ro", + "rum": "ro", + "run": "rn", + "rus": "ru", + "sag": "sg", + "san": "sa", + "scc": "sr", + "scr": "hr", + "sgn_BE_FR": "sfb", + "sgn_BE_NL": "vgt", + "sgn_CH_DE": "sgg", + "sh": "sr_Latn", + "shi_MA": "shi_Tfng_MA", + "sin": "si", + "slk": "sk", + "slo": "sk", + "slv": "sl", + "sme": "se", + "smo": "sm", + "sna": "sn", + "snd": "sd", + "som": "so", + "sot": "st", + "spa": "es", + "spy": "kln", + "sqi": "sq", + "sr_BA": "sr_Cyrl_BA", + "sr_ME": "sr_Latn_ME", + "sr_RS": "sr_Cyrl_RS", + "sr_XK": "sr_Cyrl_XK", + "src": "sc", + "srd": "sc", + "srp": "sr", + "ssw": "ss", + "sun": "su", + "swa": "sw", + "swc": "sw_CD", + "swe": "sv", + "swh": "sw", + "tah": "ty", + "tam": "ta", + "tat": "tt", + "tel": "te", + "tgk": "tg", + "tgl": "fil", + "tha": "th", + "tib": "bo", + "tir": "ti", + "tl": "fil", + "ton": "to", + "tsn": "tn", + "tso": "ts", + "ttq": "tmh", + "tuk": "tk", + "tur": "tr", + "tw": "ak", + "twi": "ak", + "tzm_Latn_MA": "tzm_MA", + "ug_Arab_CN": "ug_CN", + "uig": "ug", + "ukr": "uk", + "umu": "del", + "urd": "ur", + "uz_AF": "uz_Arab_AF", + "uz_UZ": "uz_Latn_UZ", + "uzb": "uz", + "uzn": "uz", + "vai_LR": "vai_Vaii_LR", + "ven": "ve", + "vie": "vi", + "vol": "vo", + "wel": "cy", + "wln": "wa", + "wol": "wo", + "xho": "xh", + "xpe": "kpe", + "xsl": "den", + "ydd": "yi", + "yid": "yi", + "yor": "yo", + "yue_CN": "yue_Hans_CN", + "yue_HK": "yue_Hant_HK", + "zai": "zap", + "zh_CN": "zh_Hans_CN", + "zh_HK": "zh_Hant_HK", + "zh_MO": "zh_Hant_MO", + "zh_SG": "zh_Hans_SG", + "zh_TW": "zh_Hant_TW", + "zh_guoyu": "zh", + "zh_hakka": "hak", + "zh_min_nan": "nan", + "zh_xiang": "hsn", + "zha": "za", + "zho": "zh", + "zsm": "ms", + "zul": "zu", + "zyb": "za" + }, "Alpha2ToAlpha3": { "aa": "aar", "ab": "abk", diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php index 7387e0e47d737..efbc45cd6edda 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractCurrencyDataProviderTest.php @@ -77,6 +77,7 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest 'BUK', 'BWP', 'BYB', + 'BYN', 'BYR', 'BZD', 'CAD', @@ -310,249 +311,250 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest ); protected static $alpha3ToNumeric = array( - 'ADP' => 20, - 'AED' => 784, 'AFA' => 4, - 'AFN' => 971, 'ALL' => 8, - 'AMD' => 51, - 'ANG' => 532, - 'AOA' => 973, + 'DZD' => 12, + 'ADP' => 20, 'AON' => 24, - 'AOR' => 982, - 'ARA' => 32, - 'ARP' => 32, + 'AZM' => 31, 'ARS' => 32, - 'ATS' => 40, + 'ARP' => 32, + 'ARA' => 32, 'AUD' => 36, - 'AWG' => 533, - 'AZM' => 31, - 'AZN' => 944, - 'BAD' => 70, - 'BAM' => 977, - 'BBD' => 52, + 'ATS' => 40, + 'BSD' => 44, + 'BHD' => 48, 'BDT' => 50, - 'BEC' => 993, + 'AMD' => 51, + 'BBD' => 52, 'BEF' => 56, - 'BEL' => 992, - 'BGL' => 100, - 'BGN' => 975, - 'BHD' => 48, - 'BIF' => 108, 'BMD' => 60, - 'BND' => 96, - 'BOB' => 68, - 'BOV' => 984, - 'BRC' => 76, - 'BRE' => 76, - 'BRL' => 986, - 'BRN' => 76, - 'BRR' => 987, - 'BSD' => 44, 'BTN' => 64, + 'BOB' => 68, + 'BAD' => 70, 'BWP' => 72, - 'BYB' => 112, - 'BYR' => 974, + 'BRN' => 76, + 'BRE' => 76, + 'BRC' => 76, 'BZD' => 84, + 'SBD' => 90, + 'BND' => 96, + 'BGL' => 100, + 'MMK' => 104, + 'BIF' => 108, + 'BYB' => 112, + 'KHR' => 116, 'CAD' => 124, - 'CDF' => 976, - 'CHE' => 947, - 'CHF' => 756, - 'CHW' => 948, - 'CLF' => 990, + 'CVE' => 132, + 'KYD' => 136, + 'LKR' => 144, 'CLP' => 152, 'CNY' => 156, 'COP' => 170, - 'COU' => 970, + 'KMF' => 174, + 'ZRN' => 180, + 'ZRZ' => 180, 'CRC' => 188, - 'CSD' => 891, - 'CSK' => 200, - 'CUC' => 931, + 'HRK' => 191, + 'HRD' => 191, 'CUP' => 192, - 'CVE' => 132, 'CYP' => 196, + 'CSK' => 200, 'CZK' => 203, - 'DDM' => 278, - 'DEM' => 276, - 'DJF' => 262, 'DKK' => 208, 'DOP' => 214, - 'DZD' => 12, 'ECS' => 218, - 'ECV' => 983, - 'EEK' => 233, - 'EGP' => 818, - 'ERN' => 232, - 'ESA' => 996, - 'ESB' => 995, - 'ESP' => 724, + 'SVC' => 222, + 'GQE' => 226, 'ETB' => 230, - 'EUR' => 978, - 'FIM' => 246, - 'FJD' => 242, + 'ERN' => 232, + 'EEK' => 233, 'FKP' => 238, + 'FJD' => 242, + 'FIM' => 246, 'FRF' => 250, - 'GBP' => 826, + 'DJF' => 262, 'GEK' => 268, - 'GEL' => 981, + 'GMD' => 270, + 'DEM' => 276, + 'DDM' => 278, 'GHC' => 288, - 'GHS' => 936, 'GIP' => 292, - 'GMD' => 270, - 'GNF' => 324, - 'GQE' => 226, 'GRD' => 300, 'GTQ' => 320, - 'GWP' => 624, + 'GNF' => 324, 'GYD' => 328, - 'HKD' => 344, - 'HNL' => 340, - 'HRD' => 191, - 'HRK' => 191, 'HTG' => 332, + 'HNL' => 340, + 'HKD' => 344, 'HUF' => 348, + 'ISK' => 352, + 'INR' => 356, 'IDR' => 360, + 'IRR' => 364, + 'IQD' => 368, 'IEP' => 372, 'ILS' => 376, - 'INR' => 356, - 'IQD' => 368, - 'IRR' => 364, - 'ISK' => 352, 'ITL' => 380, 'JMD' => 388, - 'JOD' => 400, 'JPY' => 392, + 'KZT' => 398, + 'JOD' => 400, 'KES' => 404, - 'KGS' => 417, - 'KHR' => 116, - 'KMF' => 174, 'KPW' => 408, 'KRW' => 410, 'KWD' => 414, - 'KYD' => 136, - 'KZT' => 398, + 'KGS' => 417, 'LAK' => 418, 'LBP' => 422, - 'LKR' => 144, - 'LRD' => 430, 'LSL' => 426, - 'LTL' => 440, - 'LTT' => 440, - 'LUC' => 989, - 'LUF' => 442, - 'LUL' => 988, 'LVL' => 428, 'LVR' => 428, + 'LRD' => 430, 'LYD' => 434, - 'MAD' => 504, - 'MDL' => 498, - 'MGA' => 969, + 'LTT' => 440, + 'LTL' => 440, + 'LUF' => 442, + 'MOP' => 446, 'MGF' => 450, - 'MKD' => 807, + 'MWK' => 454, + 'MYR' => 458, + 'MVR' => 462, 'MLF' => 466, - 'MMK' => 104, - 'MNT' => 496, - 'MOP' => 446, - 'MRO' => 478, 'MTL' => 470, + 'MRO' => 478, 'MUR' => 480, - 'MVR' => 462, - 'MWK' => 454, 'MXN' => 484, - 'MXV' => 979, - 'MYR' => 458, + 'MNT' => 496, + 'MDL' => 498, + 'MAD' => 504, 'MZM' => 508, - 'MZN' => 943, + 'OMR' => 512, 'NAD' => 516, - 'NGN' => 566, - 'NIO' => 558, - 'NLG' => 528, - 'NOK' => 578, 'NPR' => 524, + 'NLG' => 528, + 'ANG' => 532, + 'AWG' => 533, + 'VUV' => 548, 'NZD' => 554, - 'OMR' => 512, + 'NIO' => 558, + 'NGN' => 566, + 'NOK' => 578, + 'PKR' => 586, 'PAB' => 590, + 'PGK' => 598, + 'PYG' => 600, 'PEI' => 604, 'PEN' => 604, 'PES' => 604, - 'PGK' => 598, 'PHP' => 608, - 'PKR' => 586, - 'PLN' => 985, 'PLZ' => 616, 'PTE' => 620, - 'PYG' => 600, + 'GWP' => 624, + 'TPE' => 626, 'QAR' => 634, 'ROL' => 642, - 'RON' => 946, - 'RSD' => 941, 'RUB' => 643, - 'RUR' => 810, 'RWF' => 646, + 'SHP' => 654, + 'STD' => 678, 'SAR' => 682, - 'SBD' => 90, 'SCR' => 690, - 'SDD' => 736, - 'SDG' => 938, - 'SEK' => 752, + 'SLL' => 694, 'SGD' => 702, - 'SHP' => 654, - 'SIT' => 705, 'SKK' => 703, - 'SLL' => 694, + 'VND' => 704, + 'SIT' => 705, 'SOS' => 706, - 'SRD' => 968, - 'SRG' => 740, + 'ZAR' => 710, + 'ZWD' => 716, + 'YDD' => 720, + 'ESP' => 724, 'SSP' => 728, - 'STD' => 678, - 'SVC' => 222, - 'SYP' => 760, + 'SDD' => 736, + 'SRG' => 740, 'SZL' => 748, - 'THB' => 764, + 'SEK' => 752, + 'CHF' => 756, + 'SYP' => 760, 'TJR' => 762, - 'TJS' => 972, - 'TMM' => 795, - 'TMT' => 934, - 'TND' => 788, + 'THB' => 764, 'TOP' => 776, - 'TPE' => 626, - 'TRL' => 792, - 'TRY' => 949, 'TTD' => 780, - 'TWD' => 901, - 'TZS' => 834, - 'UAH' => 980, - 'UAK' => 804, + 'AED' => 784, + 'TND' => 788, + 'TRL' => 792, + 'TMM' => 795, 'UGX' => 800, + 'UAK' => 804, + 'MKD' => 807, + 'RUR' => 810, + 'EGP' => 818, + 'GBP' => 826, + 'TZS' => 834, 'USD' => 840, - 'USN' => 997, - 'USS' => 998, - 'UYI' => 940, 'UYU' => 858, 'UZS' => 860, 'VEB' => 862, - 'VEF' => 937, - 'VND' => 704, - 'VUV' => 548, 'WST' => 882, - 'XAF' => 950, - 'XCD' => 951, - 'XEU' => 954, - 'XOF' => 952, - 'XPF' => 953, - 'YDD' => 720, 'YER' => 886, - 'YUM' => 891, 'YUN' => 890, - 'ZAL' => 991, - 'ZAR' => 710, + 'CSD' => 891, + 'YUM' => 891, 'ZMK' => 894, - 'ZMW' => 967, - 'ZRN' => 180, - 'ZRZ' => 180, - 'ZWD' => 716, + 'TWD' => 901, + 'CUC' => 931, 'ZWL' => 932, + 'BYN' => 933, + 'TMT' => 934, 'ZWR' => 935, + 'GHS' => 936, + 'VEF' => 937, + 'SDG' => 938, + 'UYI' => 940, + 'RSD' => 941, + 'MZN' => 943, + 'AZN' => 944, + 'RON' => 946, + 'CHE' => 947, + 'CHW' => 948, + 'TRY' => 949, + 'XAF' => 950, + 'XCD' => 951, + 'XOF' => 952, + 'XPF' => 953, + 'XEU' => 954, + 'ZMW' => 967, + 'SRD' => 968, + 'MGA' => 969, + 'COU' => 970, + 'AFN' => 971, + 'TJS' => 972, + 'AOA' => 973, + 'BYR' => 974, + 'BGN' => 975, + 'CDF' => 976, + 'BAM' => 977, + 'EUR' => 978, + 'MXV' => 979, + 'UAH' => 980, + 'GEL' => 981, + 'AOR' => 982, + 'ECV' => 983, + 'BOV' => 984, + 'PLN' => 985, + 'BRL' => 986, + 'BRR' => 987, + 'LUL' => 988, + 'LUC' => 989, + 'CLF' => 990, + 'ZAL' => 991, + 'BEL' => 992, + 'BEC' => 993, + 'ESB' => 995, + 'ESA' => 996, + 'USN' => 997, + 'USS' => 998, ); /** @@ -595,7 +597,7 @@ public function testGetNames($displayLocale) $collator = new \Collator($displayLocale); $collator->asort($names); - $this->assertSame($sortedNames, $names); + $this->assertEquals($sortedNames, $names); } public function testGetNamesDefaultLocale() diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php index e852c1eb34e57..4af76a04ac37b 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractDataProviderTest.php @@ -27,704 +27,596 @@ abstract class AbstractDataProviderTest extends TestCase // providers. private static $locales = array( - 'af', - 'af_NA', - 'af_ZA', - 'agq', - 'agq_CM', - 'ak', - 'ak_GH', - 'am', - 'am_ET', - 'ar', - 'ar_001', - 'ar_AE', - 'ar_BH', - 'ar_DJ', - 'ar_DZ', - 'ar_EG', - 'ar_EH', - 'ar_ER', - 'ar_IL', - 'ar_IQ', - 'ar_JO', - 'ar_KM', - 'ar_KW', - 'ar_LB', - 'ar_LY', - 'ar_MA', - 'ar_MR', - 'ar_OM', - 'ar_PS', - 'ar_QA', - 'ar_SA', - 'ar_SD', - 'ar_SO', - 'ar_SS', - 'ar_SY', - 'ar_TD', - 'ar_TN', - 'ar_YE', - 'as', - 'as_IN', - 'asa', - 'asa_TZ', - 'az', - 'az_AZ', - 'az_Cyrl', - 'az_Cyrl_AZ', - 'az_Latn', - 'az_Latn_AZ', - 'bas', - 'bas_CM', - 'be', - 'be_BY', - 'bem', - 'bem_ZM', - 'bez', - 'bez_TZ', - 'bg', - 'bg_BG', - 'bm', - 'bm_ML', - 'bn', - 'bn_BD', - 'bn_IN', - 'bo', - 'bo_CN', - 'bo_IN', - 'br', - 'br_FR', - 'brx', - 'brx_IN', - 'bs', - 'bs_BA', - 'bs_Cyrl', - 'bs_Cyrl_BA', - 'bs_Latn', - 'bs_Latn_BA', - 'ca', - 'ca_AD', - 'ca_ES', - 'ca_FR', - 'ca_IT', - 'cgg', - 'cgg_UG', - 'chr', - 'chr_US', - 'cs', - 'cs_CZ', - 'cy', - 'cy_GB', - 'da', - 'da_DK', - 'da_GL', - 'dav', - 'dav_KE', - 'de', - 'de_AT', - 'de_BE', - 'de_CH', - 'de_DE', - 'de_LI', - 'de_LU', - 'dje', - 'dje_NE', - 'dua', - 'dua_CM', - 'dyo', - 'dyo_SN', - 'dz', - 'dz_BT', - 'ebu', - 'ebu_KE', - 'ee', - 'ee_GH', - 'ee_TG', - 'el', - 'el_CY', - 'el_GR', - 'en', - 'en_001', - 'en_150', - 'en_AG', - 'en_AI', - 'en_AS', - 'en_AU', - 'en_BB', - 'en_BE', - 'en_BM', - 'en_BS', - 'en_BW', - 'en_BZ', - 'en_CA', - 'en_CC', - 'en_CK', - 'en_CM', - 'en_CX', - 'en_DG', - 'en_DM', - 'en_ER', - 'en_FJ', - 'en_FK', - 'en_FM', - 'en_GB', - 'en_GD', - 'en_GG', - 'en_GH', - 'en_GI', - 'en_GM', - 'en_GU', - 'en_GY', - 'en_HK', - 'en_IE', - 'en_IM', - 'en_IN', - 'en_IO', - 'en_JE', - 'en_JM', - 'en_KE', - 'en_KI', - 'en_KN', - 'en_KY', - 'en_LC', - 'en_LR', - 'en_LS', - 'en_MG', - 'en_MH', - 'en_MO', - 'en_MP', - 'en_MS', - 'en_MT', - 'en_MU', - 'en_MW', - 'en_NA', - 'en_NF', - 'en_NG', - 'en_NH', - 'en_NR', - 'en_NU', - 'en_NZ', - 'en_PG', - 'en_PH', - 'en_PK', - 'en_PN', - 'en_PR', - 'en_PW', - 'en_RH', - 'en_RW', - 'en_SB', - 'en_SC', - 'en_SD', - 'en_SG', - 'en_SH', - 'en_SL', - 'en_SS', - 'en_SX', - 'en_SZ', - 'en_TC', - 'en_TK', - 'en_TO', - 'en_TT', - 'en_TV', - 'en_TZ', - 'en_UG', - 'en_UM', - 'en_US', - 'en_US_POSIX', - 'en_VC', - 'en_VG', - 'en_VI', - 'en_VU', - 'en_WS', - 'en_ZA', - 'en_ZM', - 'en_ZW', - 'eo', - 'es', - 'es_419', - 'es_AR', - 'es_BO', - 'es_CL', - 'es_CO', - 'es_CR', - 'es_CU', - 'es_DO', - 'es_EA', - 'es_EC', - 'es_ES', - 'es_GQ', - 'es_GT', - 'es_HN', - 'es_IC', - 'es_MX', - 'es_NI', - 'es_PA', - 'es_PE', - 'es_PH', - 'es_PR', - 'es_PY', - 'es_SV', - 'es_US', - 'es_UY', - 'es_VE', - 'et', - 'et_EE', - 'eu', - 'eu_ES', - 'ewo', - 'ewo_CM', - 'fa', - 'fa_AF', - 'fa_IR', - 'ff', - 'ff_SN', - 'fi', - 'fi_FI', - 'fil', - 'fil_PH', - 'fo', - 'fo_FO', - 'fr', - 'fr_BE', - 'fr_BF', - 'fr_BI', - 'fr_BJ', - 'fr_BL', - 'fr_CA', - 'fr_CD', - 'fr_CF', - 'fr_CG', - 'fr_CH', - 'fr_CI', - 'fr_CM', - 'fr_DJ', - 'fr_DZ', - 'fr_FR', - 'fr_GA', - 'fr_GF', - 'fr_GN', - 'fr_GP', - 'fr_GQ', - 'fr_HT', - 'fr_KM', - 'fr_LU', - 'fr_MA', - 'fr_MC', - 'fr_MF', - 'fr_MG', - 'fr_ML', - 'fr_MQ', - 'fr_MR', - 'fr_MU', - 'fr_NC', - 'fr_NE', - 'fr_PF', - 'fr_PM', - 'fr_RE', - 'fr_RW', - 'fr_SC', - 'fr_SN', - 'fr_SY', - 'fr_TD', - 'fr_TG', - 'fr_TN', - 'fr_VU', - 'fr_WF', - 'fr_YT', - 'ga', - 'ga_IE', - 'gl', - 'gl_ES', - 'gsw', - 'gsw_CH', - 'gsw_LI', - 'gu', - 'gu_IN', - 'guz', - 'guz_KE', - 'gv', - 'gv_IM', - 'ha', - 'ha_GH', - 'ha_Latn', - 'ha_Latn_GH', - 'ha_Latn_NE', - 'ha_Latn_NG', - 'ha_NE', - 'ha_NG', - 'haw', - 'haw_US', - 'he', - 'he_IL', - 'hi', - 'hi_IN', - 'hr', - 'hr_BA', - 'hr_HR', - 'hu', - 'hu_HU', - 'hy', - 'hy_AM', - 'id', - 'id_ID', - 'ig', - 'ig_NG', - 'ii', - 'ii_CN', - 'in', - 'in_ID', - 'is', - 'is_IS', - 'it', - 'it_CH', - 'it_IT', - 'it_SM', - 'iw', - 'iw_IL', - 'ja', - 'ja_JP', - 'ja_JP_TRADITIONAL', - 'jgo', - 'jgo_CM', - 'jmc', - 'jmc_TZ', - 'ka', - 'ka_GE', - 'kab', - 'kab_DZ', - 'kam', - 'kam_KE', - 'kde', - 'kde_TZ', - 'kea', - 'kea_CV', - 'khq', - 'khq_ML', - 'ki', - 'ki_KE', - 'kk', - 'kk_Cyrl', - 'kk_Cyrl_KZ', - 'kk_KZ', - 'kkj', - 'kkj_CM', - 'kl', - 'kl_GL', - 'kln', - 'kln_KE', - 'km', - 'km_KH', - 'kn', - 'kn_IN', - 'ko', - 'ko_KP', - 'ko_KR', - 'kok', - 'kok_IN', - 'ks', - 'ks_Arab', - 'ks_Arab_IN', - 'ks_IN', - 'ksb', - 'ksb_TZ', - 'ksf', - 'ksf_CM', - 'kw', - 'kw_GB', - 'ky', - 'ky_Cyrl', - 'ky_Cyrl_KG', - 'ky_KG', - 'lag', - 'lag_TZ', - 'lg', - 'lg_UG', - 'lkt', - 'lkt_US', - 'ln', - 'ln_AO', - 'ln_CD', - 'ln_CF', - 'ln_CG', - 'lo', - 'lo_LA', - 'lt', - 'lt_LT', - 'lu', - 'lu_CD', - 'luo', - 'luo_KE', - 'luy', - 'luy_KE', - 'lv', - 'lv_LV', - 'mas', - 'mas_KE', - 'mas_TZ', - 'mer', - 'mer_KE', - 'mfe', - 'mfe_MU', - 'mg', - 'mg_MG', - 'mgh', - 'mgh_MZ', - 'mgo', - 'mgo_CM', - 'mk', - 'mk_MK', - 'ml', - 'ml_IN', - 'mn', - 'mn_Cyrl', - 'mn_Cyrl_MN', - 'mn_MN', - 'mo', - 'mr', - 'mr_IN', - 'ms', - 'ms_BN', - 'ms_Latn', - 'ms_Latn_BN', - 'ms_Latn_MY', - 'ms_Latn_SG', - 'ms_MY', - 'ms_SG', - 'mt', - 'mt_MT', - 'mua', - 'mua_CM', - 'my', - 'my_MM', - 'naq', - 'naq_NA', - 'nb', - 'nb_NO', - 'nb_SJ', - 'nd', - 'nd_ZW', - 'ne', - 'ne_IN', - 'ne_NP', - 'nl', - 'nl_AW', - 'nl_BE', - 'nl_BQ', - 'nl_CW', - 'nl_NL', - 'nl_SR', - 'nl_SX', - 'nmg', - 'nmg_CM', - 'nn', - 'nn_NO', - 'nnh', - 'nnh_CM', - 'no', - 'no_NO', - 'no_NO_NY', - 'nus', - 'nus_SD', - 'nyn', - 'nyn_UG', - 'om', - 'om_ET', - 'om_KE', - 'or', - 'or_IN', - 'pa', - 'pa_Arab', - 'pa_Arab_PK', - 'pa_Guru', - 'pa_Guru_IN', - 'pa_IN', - 'pa_PK', - 'pl', - 'pl_PL', - 'ps', - 'ps_AF', - 'pt', - 'pt_AO', - 'pt_BR', - 'pt_CV', - 'pt_GW', - 'pt_MO', - 'pt_MZ', - 'pt_PT', - 'pt_ST', - 'pt_TL', - 'rm', - 'rm_CH', - 'rn', - 'rn_BI', - 'ro', - 'ro_MD', - 'ro_RO', - 'rof', - 'rof_TZ', - 'ru', - 'ru_BY', - 'ru_KG', - 'ru_KZ', - 'ru_MD', - 'ru_RU', - 'ru_UA', - 'rw', - 'rw_RW', - 'rwk', - 'rwk_TZ', - 'saq', - 'saq_KE', - 'sbp', - 'sbp_TZ', - 'seh', - 'seh_MZ', - 'ses', - 'ses_ML', - 'sg', - 'sg_CF', - 'sh', - 'sh_BA', - 'sh_CS', - 'sh_YU', - 'shi', - 'shi_Latn', - 'shi_Latn_MA', - 'shi_MA', - 'shi_Tfng', - 'shi_Tfng_MA', - 'si', - 'si_LK', - 'sk', - 'sk_SK', - 'sl', - 'sl_SI', - 'sn', - 'sn_ZW', - 'so', - 'so_DJ', - 'so_ET', - 'so_KE', - 'so_SO', - 'sq', - 'sq_AL', - 'sq_MK', - 'sq_XK', - 'sr', - 'sr_BA', - 'sr_CS', - 'sr_Cyrl', - 'sr_Cyrl_BA', - 'sr_Cyrl_CS', - 'sr_Cyrl_ME', - 'sr_Cyrl_RS', - 'sr_Cyrl_XK', - 'sr_Cyrl_YU', - 'sr_Latn', - 'sr_Latn_BA', - 'sr_Latn_CS', - 'sr_Latn_ME', - 'sr_Latn_RS', - 'sr_Latn_XK', - 'sr_Latn_YU', - 'sr_ME', - 'sr_RS', - 'sr_XK', - 'sr_YU', - 'sv', - 'sv_AX', - 'sv_FI', - 'sv_SE', - 'sw', - 'sw_KE', - 'sw_TZ', - 'sw_UG', - 'swc', - 'swc_CD', - 'ta', - 'ta_IN', - 'ta_LK', - 'ta_MY', - 'ta_SG', - 'te', - 'te_IN', - 'teo', - 'teo_KE', - 'teo_UG', - 'th', - 'th_TH', - 'th_TH_TRADITIONAL', - 'ti', - 'ti_ER', - 'ti_ET', - 'tl', - 'tl_PH', - 'to', - 'to_TO', - 'tr', - 'tr_CY', - 'tr_TR', - 'twq', - 'twq_NE', - 'tzm', - 'tzm_Latn', - 'tzm_Latn_MA', - 'tzm_MA', - 'ug', - 'ug_Arab', - 'ug_Arab_CN', - 'ug_CN', - 'uk', - 'uk_UA', - 'ur', - 'ur_IN', - 'ur_PK', - 'uz', - 'uz_AF', - 'uz_Arab', - 'uz_Arab_AF', - 'uz_Cyrl', - 'uz_Cyrl_UZ', - 'uz_Latn', - 'uz_Latn_UZ', - 'uz_UZ', - 'vai', - 'vai_LR', - 'vai_Latn', - 'vai_Latn_LR', - 'vai_Vaii', - 'vai_Vaii_LR', - 'vi', - 'vi_VN', - 'vun', - 'vun_TZ', - 'xog', - 'xog_UG', - 'yav', - 'yav_CM', - 'yo', - 'yo_BJ', - 'yo_NG', - 'zgh', - 'zgh_MA', - 'zh', - 'zh_CN', - 'zh_HK', - 'zh_Hans', - 'zh_Hans_CN', - 'zh_Hans_HK', - 'zh_Hans_MO', - 'zh_Hans_SG', - 'zh_Hant', - 'zh_Hant_HK', - 'zh_Hant_MO', - 'zh_Hant_TW', - 'zh_MO', - 'zh_SG', - 'zh_TW', - 'zu', - 'zu_ZA', + 'af', + 'af_NA', + 'af_ZA', + 'ak', + 'ak_GH', + 'am', + 'am_ET', + 'ar', + 'ar_001', + 'ar_AE', + 'ar_BH', + 'ar_DJ', + 'ar_DZ', + 'ar_EG', + 'ar_EH', + 'ar_ER', + 'ar_IL', + 'ar_IQ', + 'ar_JO', + 'ar_KM', + 'ar_KW', + 'ar_LB', + 'ar_LY', + 'ar_MA', + 'ar_MR', + 'ar_OM', + 'ar_PS', + 'ar_QA', + 'ar_SA', + 'ar_SD', + 'ar_SO', + 'ar_SS', + 'ar_SY', + 'ar_TD', + 'ar_TN', + 'ar_YE', + 'as', + 'as_IN', + 'az', + 'az_AZ', + 'az_Cyrl', + 'az_Cyrl_AZ', + 'az_Latn', + 'az_Latn_AZ', + 'be', + 'be_BY', + 'bg', + 'bg_BG', + 'bm', + 'bm_ML', + 'bn', + 'bn_BD', + 'bn_IN', + 'bo', + 'bo_CN', + 'bo_IN', + 'br', + 'br_FR', + 'bs', + 'bs_BA', + 'bs_Cyrl', + 'bs_Cyrl_BA', + 'bs_Latn', + 'bs_Latn_BA', + 'ca', + 'ca_AD', + 'ca_ES', + 'ca_FR', + 'ca_IT', + 'ce', + 'ce_RU', + 'cs', + 'cs_CZ', + 'cy', + 'cy_GB', + 'da', + 'da_DK', + 'da_GL', + 'de', + 'de_AT', + 'de_BE', + 'de_CH', + 'de_DE', + 'de_IT', + 'de_LI', + 'de_LU', + 'dz', + 'dz_BT', + 'ee', + 'ee_GH', + 'ee_TG', + 'el', + 'el_CY', + 'el_GR', + 'en', + 'en_001', + 'en_150', + 'en_AG', + 'en_AI', + 'en_AS', + 'en_AT', + 'en_AU', + 'en_BB', + 'en_BE', + 'en_BI', + 'en_BM', + 'en_BS', + 'en_BW', + 'en_BZ', + 'en_CA', + 'en_CC', + 'en_CH', + 'en_CK', + 'en_CM', + 'en_CX', + 'en_CY', + 'en_DE', + 'en_DG', + 'en_DK', + 'en_DM', + 'en_ER', + 'en_FI', + 'en_FJ', + 'en_FK', + 'en_FM', + 'en_GB', + 'en_GD', + 'en_GG', + 'en_GH', + 'en_GI', + 'en_GM', + 'en_GU', + 'en_GY', + 'en_HK', + 'en_IE', + 'en_IL', + 'en_IM', + 'en_IN', + 'en_IO', + 'en_JE', + 'en_JM', + 'en_KE', + 'en_KI', + 'en_KN', + 'en_KY', + 'en_LC', + 'en_LR', + 'en_LS', + 'en_MG', + 'en_MH', + 'en_MO', + 'en_MP', + 'en_MS', + 'en_MT', + 'en_MU', + 'en_MW', + 'en_MY', + 'en_NA', + 'en_NF', + 'en_NG', + 'en_NH', + 'en_NL', + 'en_NR', + 'en_NU', + 'en_NZ', + 'en_PG', + 'en_PH', + 'en_PK', + 'en_PN', + 'en_PR', + 'en_PW', + 'en_RH', + 'en_RW', + 'en_SB', + 'en_SC', + 'en_SD', + 'en_SE', + 'en_SG', + 'en_SH', + 'en_SI', + 'en_SL', + 'en_SS', + 'en_SX', + 'en_SZ', + 'en_TC', + 'en_TK', + 'en_TO', + 'en_TT', + 'en_TV', + 'en_TZ', + 'en_UG', + 'en_UM', + 'en_US', + 'en_US_POSIX', + 'en_VC', + 'en_VG', + 'en_VI', + 'en_VU', + 'en_WS', + 'en_ZA', + 'en_ZM', + 'en_ZW', + 'eo', + 'es', + 'es_419', + 'es_AR', + 'es_BO', + 'es_BR', + 'es_BZ', + 'es_CL', + 'es_CO', + 'es_CR', + 'es_CU', + 'es_DO', + 'es_EA', + 'es_EC', + 'es_ES', + 'es_GQ', + 'es_GT', + 'es_HN', + 'es_IC', + 'es_MX', + 'es_NI', + 'es_PA', + 'es_PE', + 'es_PH', + 'es_PR', + 'es_PY', + 'es_SV', + 'es_US', + 'es_UY', + 'es_VE', + 'et', + 'et_EE', + 'eu', + 'eu_ES', + 'fa', + 'fa_AF', + 'fa_IR', + 'ff', + 'ff_CM', + 'ff_GN', + 'ff_MR', + 'ff_SN', + 'fi', + 'fi_FI', + 'fo', + 'fo_DK', + 'fo_FO', + 'fr', + 'fr_BE', + 'fr_BF', + 'fr_BI', + 'fr_BJ', + 'fr_BL', + 'fr_CA', + 'fr_CD', + 'fr_CF', + 'fr_CG', + 'fr_CH', + 'fr_CI', + 'fr_CM', + 'fr_DJ', + 'fr_DZ', + 'fr_FR', + 'fr_GA', + 'fr_GF', + 'fr_GN', + 'fr_GP', + 'fr_GQ', + 'fr_HT', + 'fr_KM', + 'fr_LU', + 'fr_MA', + 'fr_MC', + 'fr_MF', + 'fr_MG', + 'fr_ML', + 'fr_MQ', + 'fr_MR', + 'fr_MU', + 'fr_NC', + 'fr_NE', + 'fr_PF', + 'fr_PM', + 'fr_RE', + 'fr_RW', + 'fr_SC', + 'fr_SN', + 'fr_SY', + 'fr_TD', + 'fr_TG', + 'fr_TN', + 'fr_VU', + 'fr_WF', + 'fr_YT', + 'fy', + 'fy_NL', + 'ga', + 'ga_IE', + 'gd', + 'gd_GB', + 'gl', + 'gl_ES', + 'gu', + 'gu_IN', + 'gv', + 'gv_IM', + 'ha', + 'ha_GH', + 'ha_NE', + 'ha_NG', + 'he', + 'he_IL', + 'hi', + 'hi_IN', + 'hr', + 'hr_BA', + 'hr_HR', + 'hu', + 'hu_HU', + 'hy', + 'hy_AM', + 'id', + 'id_ID', + 'ig', + 'ig_NG', + 'ii', + 'ii_CN', + 'in', + 'in_ID', + 'is', + 'is_IS', + 'it', + 'it_CH', + 'it_IT', + 'it_SM', + 'it_VA', + 'iw', + 'iw_IL', + 'ja', + 'ja_JP', + 'ja_JP_TRADITIONAL', + 'ka', + 'ka_GE', + 'ki', + 'ki_KE', + 'kk', + 'kk_KZ', + 'kl', + 'kl_GL', + 'km', + 'km_KH', + 'kn', + 'kn_IN', + 'ko', + 'ko_KP', + 'ko_KR', + 'ks', + 'ks_IN', + 'kw', + 'kw_GB', + 'ky', + 'ky_KG', + 'lb', + 'lb_LU', + 'lg', + 'lg_UG', + 'ln', + 'ln_AO', + 'ln_CD', + 'ln_CF', + 'ln_CG', + 'lo', + 'lo_LA', + 'lt', + 'lt_LT', + 'lu', + 'lu_CD', + 'lv', + 'lv_LV', + 'mg', + 'mg_MG', + 'mk', + 'mk_MK', + 'ml', + 'ml_IN', + 'mn', + 'mn_MN', + 'mo', + 'mr', + 'mr_IN', + 'ms', + 'ms_BN', + 'ms_MY', + 'ms_SG', + 'mt', + 'mt_MT', + 'my', + 'my_MM', + 'nb', + 'nb_NO', + 'nb_SJ', + 'nd', + 'nd_ZW', + 'ne', + 'ne_IN', + 'ne_NP', + 'nl', + 'nl_AW', + 'nl_BE', + 'nl_BQ', + 'nl_CW', + 'nl_NL', + 'nl_SR', + 'nl_SX', + 'nn', + 'nn_NO', + 'no', + 'no_NO', + 'no_NO_NY', + 'om', + 'om_ET', + 'om_KE', + 'or', + 'or_IN', + 'os', + 'os_GE', + 'os_RU', + 'pa', + 'pa_Arab', + 'pa_Arab_PK', + 'pa_Guru', + 'pa_Guru_IN', + 'pa_IN', + 'pa_PK', + 'pl', + 'pl_PL', + 'ps', + 'ps_AF', + 'pt', + 'pt_AO', + 'pt_BR', + 'pt_CH', + 'pt_CV', + 'pt_GQ', + 'pt_GW', + 'pt_LU', + 'pt_MO', + 'pt_MZ', + 'pt_PT', + 'pt_ST', + 'pt_TL', + 'qu', + 'qu_BO', + 'qu_EC', + 'qu_PE', + 'rm', + 'rm_CH', + 'rn', + 'rn_BI', + 'ro', + 'ro_MD', + 'ro_RO', + 'ru', + 'ru_BY', + 'ru_KG', + 'ru_KZ', + 'ru_MD', + 'ru_RU', + 'ru_UA', + 'rw', + 'rw_RW', + 'se', + 'se_FI', + 'se_NO', + 'se_SE', + 'sg', + 'sg_CF', + 'sh', + 'sh_BA', + 'sh_CS', + 'sh_YU', + 'si', + 'si_LK', + 'sk', + 'sk_SK', + 'sl', + 'sl_SI', + 'sn', + 'sn_ZW', + 'so', + 'so_DJ', + 'so_ET', + 'so_KE', + 'so_SO', + 'sq', + 'sq_AL', + 'sq_MK', + 'sq_XK', + 'sr', + 'sr_BA', + 'sr_CS', + 'sr_Cyrl', + 'sr_Cyrl_BA', + 'sr_Cyrl_CS', + 'sr_Cyrl_ME', + 'sr_Cyrl_RS', + 'sr_Cyrl_XK', + 'sr_Cyrl_YU', + 'sr_Latn', + 'sr_Latn_BA', + 'sr_Latn_CS', + 'sr_Latn_ME', + 'sr_Latn_RS', + 'sr_Latn_XK', + 'sr_Latn_YU', + 'sr_ME', + 'sr_RS', + 'sr_XK', + 'sr_YU', + 'sv', + 'sv_AX', + 'sv_FI', + 'sv_SE', + 'sw', + 'sw_CD', + 'sw_KE', + 'sw_TZ', + 'sw_UG', + 'ta', + 'ta_IN', + 'ta_LK', + 'ta_MY', + 'ta_SG', + 'te', + 'te_IN', + 'th', + 'th_TH', + 'th_TH_TRADITIONAL', + 'ti', + 'ti_ER', + 'ti_ET', + 'tl', + 'tl_PH', + 'to', + 'to_TO', + 'tr', + 'tr_CY', + 'tr_TR', + 'ug', + 'ug_CN', + 'uk', + 'uk_UA', + 'ur', + 'ur_IN', + 'ur_PK', + 'uz', + 'uz_AF', + 'uz_Arab', + 'uz_Arab_AF', + 'uz_Cyrl', + 'uz_Cyrl_UZ', + 'uz_Latn', + 'uz_Latn_UZ', + 'uz_UZ', + 'vi', + 'vi_VN', + 'yi', + 'yi_001', + 'yo', + 'yo_BJ', + 'yo_NG', + 'zh', + 'zh_CN', + 'zh_HK', + 'zh_Hans', + 'zh_Hans_CN', + 'zh_Hans_HK', + 'zh_Hans_MO', + 'zh_Hans_SG', + 'zh_Hant', + 'zh_Hant_HK', + 'zh_Hant_MO', + 'zh_Hant_TW', + 'zh_MO', + 'zh_SG', + 'zh_TW', + 'zu', + 'zu_ZA', ); private static $localeAliases = array( @@ -732,21 +624,11 @@ abstract class AbstractDataProviderTest extends TestCase 'bs_BA' => 'bs_Latn_BA', 'en_NH' => 'en_VU', 'en_RH' => 'en_ZW', - 'ha_GH' => 'ha_Latn_GH', - 'ha_NE' => 'ha_Latn_NE', - 'ha_NG' => 'ha_Latn_NG', 'in' => 'id', 'in_ID' => 'id_ID', 'iw' => 'he', 'iw_IL' => 'he_IL', - 'kk_KZ' => 'kk_Cyrl_KZ', - 'ks_IN' => 'ks_Arab_IN', - 'ky_KG' => 'ky_Cyrl_KG', - 'mn_MN' => 'mn_Cyrl_MN', 'mo' => 'ro_MD', - 'ms_BN' => 'ms_Latn_BN', - 'ms_MY' => 'ms_Latn_MY', - 'ms_SG' => 'ms_Latn_SG', 'no' => 'nb', 'no_NO' => 'nb_NO', 'no_NO_NY' => 'nn_NO', @@ -756,7 +638,6 @@ abstract class AbstractDataProviderTest extends TestCase 'sh_BA' => 'sr_Latn_BA', 'sh_CS' => 'sr_Latn_RS', 'sh_YU' => 'sr_Latn_RS', - 'shi_MA' => 'shi_Tfng_MA', 'sr_BA' => 'sr_Cyrl_BA', 'sr_CS' => 'sr_Cyrl_RS', 'sr_Cyrl_CS' => 'sr_Cyrl_RS', @@ -769,11 +650,8 @@ abstract class AbstractDataProviderTest extends TestCase 'sr_YU' => 'sr_Cyrl_RS', 'tl' => 'fil', 'tl_PH' => 'fil_PH', - 'tzm_MA' => 'tzm_Latn_MA', - 'ug_CN' => 'ug_Arab_CN', 'uz_AF' => 'uz_Arab_AF', 'uz_UZ' => 'uz_Latn_UZ', - 'vai_LR' => 'vai_Vaii_LR', 'zh_CN' => 'zh_Hans_CN', 'zh_HK' => 'zh_Hant_HK', 'zh_MO' => 'zh_Hant_MO', diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php index b092ff6982abb..4a0d63b30d482 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLanguageDataProviderTest.php @@ -52,6 +52,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'aro', 'arp', 'arq', + 'ars', 'arw', 'ary', 'arz', @@ -64,7 +65,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'awa', 'ay', 'az', - 'azb', + 'az_Arab', 'ba', 'bal', 'ban', @@ -81,6 +82,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'bfd', 'bfq', 'bg', + 'bgn', 'bho', 'bi', 'bik', @@ -128,6 +130,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'cps', 'cr', 'crh', + 'crs', 'cs', 'csb', 'cu', @@ -180,6 +183,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'ewo', 'ext', 'fa', + 'fa_AF', 'fan', 'fat', 'ff', @@ -340,6 +344,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'lo', 'lol', 'loz', + 'lrc', 'lt', 'ltg', 'lu', @@ -401,6 +406,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'nb', 'nd', 'nds', + 'nds_NL', 'ne', 'new', 'ng', @@ -441,6 +447,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'pap', 'pau', 'pcd', + 'pcm', 'pdc', 'pdt', 'peo', @@ -494,6 +501,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'sco', 'sd', 'sdc', + 'sdh', 'se', 'see', 'seh', @@ -536,8 +544,8 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'sux', 'sv', 'sw', + 'sw_CD', 'swb', - 'swc', 'syc', 'syr', 'szl', @@ -604,6 +612,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'wal', 'war', 'was', + 'wbp', 'wo', 'wuu', 'xal', @@ -636,170 +645,170 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest protected static $alpha2ToAlpha3 = array( 'aa' => 'aar', 'ab' => 'abk', - 'ae' => 'ave', 'af' => 'afr', 'ak' => 'aka', + 'sq' => 'sqi', 'am' => 'amh', - 'an' => 'arg', 'ar' => 'ara', + 'an' => 'arg', + 'hy' => 'hye', 'as' => 'asm', 'av' => 'ava', + 'ae' => 'ave', 'ay' => 'aym', 'az' => 'aze', 'ba' => 'bak', - 'be' => 'bel', - 'bg' => 'bul', - 'bh' => 'bih', - 'bi' => 'bis', 'bm' => 'bam', + 'eu' => 'eus', + 'be' => 'bel', 'bn' => 'ben', + 'bi' => 'bis', 'bo' => 'bod', - 'br' => 'bre', 'bs' => 'bos', + 'br' => 'bre', + 'bg' => 'bul', + 'my' => 'mya', 'ca' => 'cat', - 'ce' => 'che', - 'ch' => 'cha', - 'co' => 'cos', - 'cr' => 'cre', 'cs' => 'ces', + 'ch' => 'cha', + 'ce' => 'che', + 'zh' => 'zho', 'cu' => 'chu', 'cv' => 'chv', + 'kw' => 'cor', + 'co' => 'cos', + 'cr' => 'cre', 'cy' => 'cym', 'da' => 'dan', 'de' => 'deu', 'dv' => 'div', + 'nl' => 'nld', 'dz' => 'dzo', - 'ee' => 'ewe', + 'et' => 'est', 'el' => 'ell', 'en' => 'eng', 'eo' => 'epo', - 'es' => 'spa', - 'et' => 'est', - 'eu' => 'eus', + 'ik' => 'ipk', + 'ee' => 'ewe', + 'fo' => 'fao', 'fa' => 'fas', - 'ff' => 'ful', - 'fi' => 'fin', 'fj' => 'fij', - 'fo' => 'fao', + 'fi' => 'fin', 'fr' => 'fra', 'fy' => 'fry', - 'ga' => 'gle', + 'ff' => 'ful', + 'om' => 'orm', + 'ka' => 'kat', 'gd' => 'gla', + 'ga' => 'gle', 'gl' => 'glg', + 'gv' => 'glv', 'gn' => 'grn', 'gu' => 'guj', - 'gv' => 'glv', + 'ht' => 'hat', 'ha' => 'hau', 'he' => 'heb', + 'hz' => 'her', 'hi' => 'hin', 'ho' => 'hmo', 'hr' => 'hrv', - 'ht' => 'hat', 'hu' => 'hun', - 'hy' => 'hye', - 'hz' => 'her', - 'ia' => 'ina', - 'id' => 'ind', - 'ie' => 'ile', 'ig' => 'ibo', - 'ii' => 'iii', - 'ik' => 'ipk', - 'io' => 'ido', 'is' => 'isl', - 'it' => 'ita', + 'io' => 'ido', + 'ii' => 'iii', 'iu' => 'iku', - 'ja' => 'jpn', + 'ie' => 'ile', + 'ia' => 'ina', + 'id' => 'ind', + 'it' => 'ita', 'jv' => 'jav', - 'ka' => 'kat', - 'kg' => 'kon', - 'ki' => 'kik', - 'kj' => 'kua', - 'kk' => 'kaz', + 'ja' => 'jpn', 'kl' => 'kal', - 'km' => 'khm', 'kn' => 'kan', - 'ko' => 'kor', - 'kr' => 'kau', 'ks' => 'kas', + 'kr' => 'kau', + 'kk' => 'kaz', + 'mn' => 'mon', + 'km' => 'khm', + 'ki' => 'kik', + 'rw' => 'kin', + 'ky' => 'kir', 'ku' => 'kur', + 'kg' => 'kon', 'kv' => 'kom', - 'kw' => 'cor', - 'ky' => 'kir', + 'ko' => 'kor', + 'kj' => 'kua', + 'lo' => 'lao', 'la' => 'lat', - 'lb' => 'ltz', - 'lg' => 'lug', + 'lv' => 'lav', 'li' => 'lim', 'ln' => 'lin', - 'lo' => 'lao', 'lt' => 'lit', + 'lb' => 'ltz', 'lu' => 'lub', - 'lv' => 'lav', - 'mg' => 'mlg', - 'mh' => 'mah', - 'mi' => 'mri', + 'lg' => 'lug', 'mk' => 'mkd', + 'mh' => 'mah', 'ml' => 'mal', - 'mn' => 'mon', + 'mi' => 'mri', 'mr' => 'mar', 'ms' => 'msa', + 'mg' => 'mlg', 'mt' => 'mlt', - 'my' => 'mya', 'na' => 'nau', - 'nb' => 'nob', + 'nv' => 'nav', + 'nr' => 'nbl', 'nd' => 'nde', - 'ne' => 'nep', 'ng' => 'ndo', - 'nl' => 'nld', + 'ne' => 'nep', 'nn' => 'nno', - 'nr' => 'nbl', - 'nv' => 'nav', + 'nb' => 'nob', 'ny' => 'nya', 'oc' => 'oci', 'oj' => 'oji', - 'om' => 'orm', 'or' => 'ori', 'os' => 'oss', 'pa' => 'pan', + 'ps' => 'pus', 'pi' => 'pli', 'pl' => 'pol', - 'ps' => 'pus', 'pt' => 'por', 'qu' => 'que', 'rm' => 'roh', - 'rn' => 'run', 'ro' => 'ron', + 'rn' => 'run', 'ru' => 'rus', - 'rw' => 'kin', - 'sa' => 'san', - 'sc' => 'srd', - 'sd' => 'snd', - 'se' => 'sme', 'sg' => 'sag', + 'sa' => 'san', + 'sr' => 'srp', 'si' => 'sin', 'sk' => 'slk', 'sl' => 'slv', + 'se' => 'sme', 'sm' => 'smo', 'sn' => 'sna', + 'sd' => 'snd', 'so' => 'som', - 'sq' => 'sqi', - 'sr' => 'srp', - 'ss' => 'ssw', 'st' => 'sot', + 'es' => 'spa', + 'sc' => 'srd', + 'ss' => 'ssw', 'su' => 'sun', - 'sv' => 'swe', 'sw' => 'swa', + 'sv' => 'swe', + 'ty' => 'tah', 'ta' => 'tam', + 'tt' => 'tat', 'te' => 'tel', 'tg' => 'tgk', 'th' => 'tha', 'ti' => 'tir', - 'tk' => 'tuk', - 'tn' => 'tsn', 'to' => 'ton', - 'tr' => 'tur', + 'tn' => 'tsn', 'ts' => 'tso', - 'tt' => 'tat', - 'ty' => 'tah', + 'tk' => 'tuk', + 'tr' => 'tur', 'ug' => 'uig', 'uk' => 'ukr', 'ur' => 'urd', @@ -813,7 +822,6 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest 'yi' => 'yid', 'yo' => 'yor', 'za' => 'zha', - 'zh' => 'zho', 'zu' => 'zul', ); @@ -848,7 +856,8 @@ public function testGetNames($displayLocale) sort($languages); - $this->assertEquals(static::$languages, $languages); + $this->assertNotEmpty($languages); + $this->assertEmpty(array_diff($languages, static::$languages)); } public function testGetNamesDefaultLocale() diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php index 6386bba97d141..aeca40cdbd6cd 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractLocaleDataProviderTest.php @@ -56,7 +56,10 @@ public function testGetNames($displayLocale) sort($locales); - $this->assertSame($this->getLocales(), $locales); + // We can't assert on exact list of locale, as there's too many variations. + // The best we can do is to make sure getNames() returns a subset of what getLocales() returns. + $this->assertNotEmpty($locales); + $this->assertEmpty(array_diff($locales, $this->getLocales())); } public function testGetNamesDefaultLocale() diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php index 21cc1789d2b34..1b790d41c9a73 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractRegionDataProviderTest.php @@ -31,7 +31,6 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'AI', 'AL', 'AM', - 'AN', 'AO', 'AQ', 'AR', @@ -58,7 +57,6 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'BR', 'BS', 'BT', - 'BV', 'BW', 'BY', 'BZ', @@ -74,7 +72,6 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'CM', 'CN', 'CO', - 'CP', 'CR', 'CU', 'CV', @@ -97,7 +94,7 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'ER', 'ES', 'ET', - 'EU', + 'EZ', 'FI', 'FJ', 'FK', @@ -124,7 +121,6 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'GW', 'GY', 'HK', - 'HM', 'HN', 'HR', 'HT', @@ -263,6 +259,7 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest 'UA', 'UG', 'UM', + 'UN', 'US', 'UY', 'UZ', diff --git a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php index 68304434c7ffd..b0acca3687411 100644 --- a/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php +++ b/src/Symfony/Component/Intl/Tests/Data/Provider/AbstractScriptDataProviderTest.php @@ -24,7 +24,10 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest // The below arrays document the state of the ICU data bundled with this package. protected static $scripts = array( + 'Adlm', 'Afak', + 'Aghb', + 'Ahom', 'Arab', 'Armi', 'Armn', @@ -34,6 +37,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Bass', 'Batk', 'Beng', + 'Bhks', 'Blis', 'Bopo', 'Brah', @@ -56,6 +60,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Egyd', 'Egyh', 'Egyp', + 'Elba', 'Ethi', 'Geok', 'Geor', @@ -65,11 +70,13 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Grek', 'Gujr', 'Guru', + 'Hanb', 'Hang', 'Hani', 'Hano', 'Hans', 'Hant', + 'Hatr', 'Hebr', 'Hira', 'Hluw', @@ -78,6 +85,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Hung', 'Inds', 'Ital', + 'Jamo', 'Java', 'Jpan', 'Jurc', @@ -103,20 +111,25 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Loma', 'Lyci', 'Lydi', + 'Mahj', 'Mand', 'Mani', + 'Marc', 'Maya', 'Mend', 'Merc', 'Mero', 'Mlym', + 'Modi', 'Mong', 'Moon', 'Mroo', 'Mtei', + 'Mult', 'Mymr', 'Narb', 'Nbat', + 'Newa', 'Nkgb', 'Nkoo', 'Nshu', @@ -124,8 +137,10 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Olck', 'Orkh', 'Orya', + 'Osge', 'Osma', 'Palm', + 'Pauc', 'Perm', 'Phag', 'Phli', @@ -134,6 +149,54 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Phnx', 'Plrd', 'Prti', + 'Qaaa', + 'Qaab', + 'Qaac', + 'Qaad', + 'Qaae', + 'Qaaf', + 'Qaag', + 'Qaah', + 'Qaak', + 'Qaal', + 'Qaam', + 'Qaan', + 'Qaao', + 'Qaap', + 'Qaaq', + 'Qaar', + 'Qaas', + 'Qaat', + 'Qaau', + 'Qaav', + 'Qaaw', + 'Qaax', + 'Qaay', + 'Qaaz', + 'Qaba', + 'Qabb', + 'Qabc', + 'Qabd', + 'Qabe', + 'Qabf', + 'Qabg', + 'Qabh', + 'Qabi', + 'Qabj', + 'Qabk', + 'Qabl', + 'Qabm', + 'Qabn', + 'Qabo', + 'Qabp', + 'Qabq', + 'Qabr', + 'Qabs', + 'Qabt', + 'Qabu', + 'Qabv', + 'Qabw', + 'Qabx', 'Rjng', 'Roro', 'Runr', @@ -144,6 +207,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Sgnw', 'Shaw', 'Shrd', + 'Sidd', 'Sind', 'Sinh', 'Sora', @@ -178,6 +242,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest 'Yiii', 'Zinh', 'Zmth', + 'Zsye', 'Zsym', 'Zxxx', 'Zyyy', @@ -215,7 +280,10 @@ public function testGetNames($displayLocale) sort($scripts); - $this->assertSame(static::$scripts, $scripts); + // We can't assert on exact list of scripts, as there's too many variations between locales. + // The best we can do is to make sure getNames() returns a subset of what getScripts() returns. + $this->assertNotEmpty($scripts); + $this->assertEmpty(array_diff($scripts, self::$scripts)); } public function testGetNamesDefaultLocale() diff --git a/src/Symfony/Component/Intl/Util/SvnCommit.php b/src/Symfony/Component/Intl/Util/SvnCommit.php index ef90b6f884e87..f83958fe38c88 100644 --- a/src/Symfony/Component/Intl/Util/SvnCommit.php +++ b/src/Symfony/Component/Intl/Util/SvnCommit.php @@ -18,16 +18,12 @@ */ class SvnCommit { - /** - * @var \SimpleXMLElement - */ private $svnInfo; /** * Creates a commit from the given "svn info" data. * - * @param \SimpleXMLElement $svnInfo the XML result from the "svn info" - * command + * @param \SimpleXMLElement $svnInfo the XML result from the "svn info" command */ public function __construct(\SimpleXMLElement $svnInfo) { diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php index fb1ec60980b62..f5b84f05b4d5c 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php @@ -28,29 +28,21 @@ class OptionsResolver implements Options { /** * The names of all defined options. - * - * @var array */ private $defined = array(); /** * The default option values. - * - * @var array */ private $defaults = array(); /** * The names of required options. - * - * @var array */ private $required = array(); /** * The resolved option values. - * - * @var array */ private $resolved = array(); @@ -63,22 +55,16 @@ class OptionsResolver implements Options /** * A list of accepted values for each option. - * - * @var array */ private $allowedValues = array(); /** * A list of accepted types for each option. - * - * @var array */ private $allowedTypes = array(); /** * A list of closures for evaluating lazy options. - * - * @var array */ private $lazy = array(); @@ -86,8 +72,6 @@ class OptionsResolver implements Options * A list of lazy options whose closure is currently being called. * * This list helps detecting circular dependencies between lazy options. - * - * @var array */ private $calling = array(); @@ -98,8 +82,6 @@ class OptionsResolver implements Options * necessary in order to avoid inconsistencies during the resolving * process. If any option is changed after being read, all evaluated * lazy options that depend on this option would become invalid. - * - * @var bool */ private $locked = false; diff --git a/src/Symfony/Component/Process/Pipes/AbstractPipes.php b/src/Symfony/Component/Process/Pipes/AbstractPipes.php index 4c67d5b82c31a..5fdd41d050e6c 100644 --- a/src/Symfony/Component/Process/Pipes/AbstractPipes.php +++ b/src/Symfony/Component/Process/Pipes/AbstractPipes.php @@ -20,16 +20,15 @@ */ abstract class AbstractPipes implements PipesInterface { - /** @var array */ public $pipes = array(); - /** @var string */ private $inputBuffer = ''; - /** @var resource|scalar|\Iterator|null */ private $input; - /** @var bool */ private $blocked = true; + /** + * @param resource|scalar|\Iterator|null $input + */ public function __construct($input) { if (is_resource($input) || $input instanceof \Iterator) { diff --git a/src/Symfony/Component/Process/Pipes/UnixPipes.php b/src/Symfony/Component/Process/Pipes/UnixPipes.php index 3185fe76ee03f..4e0e452b4a044 100644 --- a/src/Symfony/Component/Process/Pipes/UnixPipes.php +++ b/src/Symfony/Component/Process/Pipes/UnixPipes.php @@ -22,11 +22,8 @@ */ class UnixPipes extends AbstractPipes { - /** @var bool */ private $ttyMode; - /** @var bool */ private $ptyMode; - /** @var bool */ private $haveReadSupport; public function __construct($ttyMode, $ptyMode, $input, $haveReadSupport) diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index a1e3115519f35..d5fa2fdeef67c 100644 --- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -26,16 +26,12 @@ */ class WindowsPipes extends AbstractPipes { - /** @var array */ private $files = array(); - /** @var array */ private $fileHandles = array(); - /** @var array */ private $readBytes = array( Process::STDOUT => 0, Process::STDERR => 0, ); - /** @var bool */ private $haveReadSupport; public function __construct($input, $haveReadSupport) diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php index 93fb0d9176648..1db6a1dba23ed 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php @@ -20,14 +20,7 @@ */ class PropertyAccessorBuilder { - /** - * @var bool - */ private $magicCall = false; - - /** - * @var bool - */ private $throwExceptionOnInvalidIndex = false; /** diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index e020182c3479d..51b6599bf3609 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -24,8 +24,6 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface { /** * Character used for separating between plural and singular of an element. - * - * @var string */ const SINGULAR_SEPARATOR = '|'; diff --git a/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php b/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php index de80751ce28ca..cecf67300f5ef 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php @@ -38,9 +38,9 @@ public function __construct($path = null) * Appends a (sub-) path to the current path. * * @param PropertyPathInterface|string $path The path to append - * @param int $offset the offset where the appended + * @param int $offset The offset where the appended * piece starts in $path - * @param int $length the length of the appended piece + * @param int $length The length of the appended piece * If 0, the full path is appended */ public function append($path, $offset = 0, $length = 0) @@ -106,9 +106,9 @@ public function remove($offset, $length = 1) * @param int $offset The offset at which to replace * @param int $length The length of the piece to replace * @param PropertyPathInterface|string $path The path to insert - * @param int $pathOffset the offset where the inserted piece + * @param int $pathOffset The offset where the inserted piece * starts in $path - * @param int $pathLength the length of the inserted piece + * @param int $pathLength The length of the inserted piece * If 0, the full path is inserted * * @throws OutOfBoundsException If the offset is invalid diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php index 75e9834ae85c8..44822699a877f 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php @@ -20,9 +20,6 @@ */ class PropertyPathBuilderTest extends TestCase { - /** - * @var string - */ const PREFIX = 'old1[old2].old3[old4][old5].old6'; /** diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index a84b947b890a2..2ce31a0170669 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -38,34 +38,11 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property */ private $docBlocks = array(); - /** - * @var DocBlockFactory - */ private $docBlockFactory; - - /** - * @var ContextFactory - */ private $contextFactory; - - /** - * @var PhpDocTypeHelper - */ private $phpDocTypeHelper; - - /** - * @var string[] - */ private $mutatorPrefixes; - - /** - * @var string[] - */ private $accessorPrefixes; - - /** - * @var string[] - */ private $arrayMutatorPrefixes; /** diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index 772f975a89114..47081b1d77381 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -28,22 +28,16 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp { /** * @internal - * - * @var string[] */ public static $defaultMutatorPrefixes = array('add', 'remove', 'set'); /** * @internal - * - * @var string[] */ public static $defaultAccessorPrefixes = array('is', 'can', 'get'); /** * @internal - * - * @var string[] */ public static $defaultArrayMutatorPrefixes = array('add', 'remove'); diff --git a/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php index 973a7c8468da8..93ebb4364afed 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php @@ -23,9 +23,6 @@ */ class SerializerExtractor implements PropertyListExtractorInterface { - /** - * @var ClassMetadataFactoryInterface - */ private $classMetadataFactory; public function __construct(ClassMetadataFactoryInterface $classMetadataFactory) diff --git a/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php b/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php index ff04a3d6ee65c..c1010832df471 100644 --- a/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php +++ b/src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php @@ -22,19 +22,8 @@ */ class PropertyInfoCacheExtractor implements PropertyInfoExtractorInterface { - /** - * @var PropertyInfoExtractorInterface - */ private $propertyInfoExtractor; - - /** - * @var CacheItemPoolInterface - */ private $cacheItemPool; - - /** - * @var array - */ private $arrayCache = array(); public function __construct(PropertyInfoExtractorInterface $propertyInfoExtractor, CacheItemPoolInterface $cacheItemPool) diff --git a/src/Symfony/Component/PropertyInfo/Type.php b/src/Symfony/Component/PropertyInfo/Type.php index d7fc6869c7334..86bc2f7643db4 100644 --- a/src/Symfony/Component/PropertyInfo/Type.php +++ b/src/Symfony/Component/PropertyInfo/Type.php @@ -49,34 +49,11 @@ class Type self::BUILTIN_TYPE_ITERABLE, ); - /** - * @var string - */ private $builtinType; - - /** - * @var bool - */ private $nullable; - - /** - * @var string|null - */ private $class; - - /** - * @var bool - */ private $collection; - - /** - * @var Type|null - */ private $collectionKeyType; - - /** - * @var Type|null - */ private $collectionValueType; /** diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php index c2e2a116d12d0..c71989a3a1532 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php @@ -22,14 +22,7 @@ */ class DumperRoute { - /** - * @var string - */ private $name; - - /** - * @var Route - */ private $route; /** diff --git a/src/Symfony/Component/Security/Core/AuthenticationEvents.php b/src/Symfony/Component/Security/Core/AuthenticationEvents.php index dfbd903fe323b..6aad681ba308c 100644 --- a/src/Symfony/Component/Security/Core/AuthenticationEvents.php +++ b/src/Symfony/Component/Security/Core/AuthenticationEvents.php @@ -18,8 +18,6 @@ final class AuthenticationEvents * by one provider. * * @Event("Symfony\Component\Security\Core\Event\AuthenticationEvent") - * - * @var string */ const AUTHENTICATION_SUCCESS = 'security.authentication.success'; @@ -28,8 +26,6 @@ final class AuthenticationEvents * authenticated by any of the providers. * * @Event("Symfony\Component\Security\Core\Event\AuthenticationFailureEvent") - * - * @var string */ const AUTHENTICATION_FAILURE = 'security.authentication.failure'; } diff --git a/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php b/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php index 55c390645098d..d85afccd805b0 100644 --- a/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/BCryptPasswordEncoder.php @@ -21,9 +21,6 @@ class BCryptPasswordEncoder extends BasePasswordEncoder implements SelfSaltingEn { const MAX_PASSWORD_LENGTH = 72; - /** - * @var string - */ private $cost; /** diff --git a/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php b/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php index d86f26039a283..57daa66557a2b 100644 --- a/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php @@ -48,8 +48,8 @@ protected function demergePasswordAndSalt($mergedPasswordSalt) /** * Merges a password and a salt. * - * @param string $password the password to be used - * @param string $salt the salt to be used + * @param string $password The password to be used + * @param string $salt The salt to be used * * @return string a merged password and salt * diff --git a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php index ae1f228289909..22bed799fb5d0 100644 --- a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php @@ -24,7 +24,6 @@ abstract class UserPasswordValidatorTest extends ConstraintValidatorTestCase { const PASSWORD = 's3Cr3t'; - const SALT = '^S4lt$'; /** diff --git a/src/Symfony/Component/Security/Csrf/CsrfToken.php b/src/Symfony/Component/Security/Csrf/CsrfToken.php index 693f37be7d251..208fac3dba437 100644 --- a/src/Symfony/Component/Security/Csrf/CsrfToken.php +++ b/src/Symfony/Component/Security/Csrf/CsrfToken.php @@ -18,14 +18,7 @@ */ class CsrfToken { - /** - * @var string - */ private $id; - - /** - * @var string - */ private $value; /** diff --git a/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php b/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php index fb3f7e8339dcf..f1e9122219478 100644 --- a/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php +++ b/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php @@ -18,11 +18,6 @@ */ class UriSafeTokenGenerator implements TokenGeneratorInterface { - /** - * The amount of entropy collected for each token (in bits). - * - * @var int - */ private $entropy; /** diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php index d441ba6ed3d02..d4866fd955917 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php @@ -22,26 +22,16 @@ class NativeSessionTokenStorage implements TokenStorageInterface { /** * The namespace used to store values in the session. - * - * @var string */ const SESSION_NAMESPACE = '_csrf'; - /** - * @var bool - */ private $sessionStarted = false; - - /** - * @var string - */ private $namespace; /** * Initializes the storage with a session namespace. * - * @param string $namespace The namespace under which the token is stored - * in the session + * @param string $namespace The namespace under which the token is stored in the session */ public function __construct($namespace = self::SESSION_NAMESPACE) { diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php index 37b33e6f2161b..7b00e3231b45a 100644 --- a/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php +++ b/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php @@ -23,29 +23,17 @@ class SessionTokenStorage implements TokenStorageInterface { /** * The namespace used to store values in the session. - * - * @var string */ const SESSION_NAMESPACE = '_csrf'; - /** - * The user session from which the session ID is returned. - * - * @var SessionInterface - */ private $session; - - /** - * @var string - */ private $namespace; /** * Initializes the storage with a Session object and a session namespace. * - * @param SessionInterface $session The user session - * @param string $namespace The namespace under which the token - * is stored in the session + * @param SessionInterface $session The user session from which the session ID is returned + * @param string $namespace The namespace under which the token is stored in the session */ public function __construct(SessionInterface $session, $namespace = self::SESSION_NAMESPACE) { diff --git a/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php b/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php index 2084456c1117b..f942b21fdaf1e 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php +++ b/src/Symfony/Component/Security/Http/RememberMe/RememberMeServicesInterface.php @@ -30,8 +30,6 @@ interface RememberMeServicesInterface /** * This attribute name can be used by the implementation if it needs to set * a cookie on the Request when there is no actual Response, yet. - * - * @var string */ const COOKIE_ATTR_NAME = '_security_remember_me_cookie'; diff --git a/src/Symfony/Component/Security/Http/SecurityEvents.php b/src/Symfony/Component/Security/Http/SecurityEvents.php index e1adf1b59edc3..5c866f36555b4 100644 --- a/src/Symfony/Component/Security/Http/SecurityEvents.php +++ b/src/Symfony/Component/Security/Http/SecurityEvents.php @@ -21,8 +21,6 @@ final class SecurityEvents * - authentication using a HTTP basic or HTTP digest header. * * @Event("Symfony\Component\Security\Http\Event\InteractiveLoginEvent") - * - * @var string */ const INTERACTIVE_LOGIN = 'security.interactive_login'; @@ -31,8 +29,6 @@ final class SecurityEvents * before exit from an already switched user. * * @Event("Symfony\Component\Security\Http\Event\SwitchUserEvent") - * - * @var string */ const SWITCH_USER = 'security.switch_user'; } diff --git a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php index dd89e0faacd93..0fa578099f13f 100644 --- a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php +++ b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php @@ -25,7 +25,7 @@ interface DecoderInterface * * @param string $data Data to decode * @param string $format Format name - * @param array $context options that decoders have access to + * @param array $context Options that decoders have access to * * The format parameter specifies which format the data is in; valid values * depend on the specific implementation. Authors implementing this interface @@ -41,7 +41,7 @@ public function decode($data, $format, array $context = array()); /** * Checks whether the deserializer can decode from given format. * - * @param string $format format name + * @param string $format Format name * * @return bool */ diff --git a/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php b/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php index 05e9b2789b170..f31870e1bf9a2 100644 --- a/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php +++ b/src/Symfony/Component/Serializer/Encoder/EncoderInterface.php @@ -25,7 +25,7 @@ interface EncoderInterface * * @param mixed $data Data to encode * @param string $format Format name - * @param array $context options that normalizers/encoders have access to + * @param array $context Options that normalizers/encoders have access to * * @return scalar * @@ -36,7 +36,7 @@ public function encode($data, $format, array $context = array()); /** * Checks whether the serializer can encode to given format. * - * @param string $format format name + * @param string $format Format name * * @return bool */ diff --git a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php index bead1064b8a17..a533e703d523f 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php @@ -20,24 +20,12 @@ */ class JsonDecode implements DecoderInterface { - /** - * Specifies if the returned result should be an associative array or a nested stdClass object hierarchy. - * - * @var bool - */ - private $associative; + protected $serializer; - /** - * Specifies the recursion depth. - * - * @var int - */ + private $associative; private $recursionDepth; - private $lastError = JSON_ERROR_NONE; - protected $serializer; - /** * Constructs a new JsonDecode instance. * diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php index 44a086d60212f..f4950cb3b3f47 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php @@ -20,14 +20,7 @@ class JsonEncoder implements EncoderInterface, DecoderInterface { const FORMAT = 'json'; - /** - * @var JsonEncode - */ protected $encodingImpl; - - /** - * @var JsonDecode - */ protected $decodingImpl; public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodingImpl = null) diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index c3f9f31b994f2..951b38aa553d8 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -159,7 +159,7 @@ public function supportsDecoding($format) /** * Sets the root node name. * - * @param string $name root node name + * @param string $name Root node name */ public function setRootNodeName($name) { @@ -257,8 +257,6 @@ final protected function isElementNameValid($name) /** * Parse the input DOMNode into an array or a string. * - * @param \DOMNode $node xml to parse - * * @return array|string */ private function parseXml(\DOMNode $node, array $context = array()) @@ -293,8 +291,6 @@ private function parseXml(\DOMNode $node, array $context = array()) /** * Parse the input DOMNode attributes into an array. * - * @param \DOMNode $node xml to parse - * * @return array */ private function parseXmlAttributes(\DOMNode $node, array $context = array()) @@ -328,8 +324,6 @@ private function parseXmlAttributes(\DOMNode $node, array $context = array()) /** * Parse the input DOMNode value (content and children) into an array or a string. * - * @param \DOMNode $node xml to parse - * * @return array|string */ private function parseXmlValue(\DOMNode $node, array $context = array()) @@ -543,7 +537,7 @@ private function resolveXmlTypeCastAttributes(array $context = array()) /** * Create a DOM document, taking serializer options into account. * - * @param array $context options that the encoder has access to + * @param array $context Options that the encoder has access to * * @return \DOMDocument */ diff --git a/src/Symfony/Component/Serializer/Mapping/Loader/FileLoader.php b/src/Symfony/Component/Serializer/Mapping/Loader/FileLoader.php index 229111b6ff26b..d1b0dee93e9c0 100644 --- a/src/Symfony/Component/Serializer/Mapping/Loader/FileLoader.php +++ b/src/Symfony/Component/Serializer/Mapping/Loader/FileLoader.php @@ -20,9 +20,6 @@ */ abstract class FileLoader implements LoaderInterface { - /** - * @var string - */ protected $file; /** diff --git a/src/Symfony/Component/Serializer/Mapping/Loader/LoaderChain.php b/src/Symfony/Component/Serializer/Mapping/Loader/LoaderChain.php index 8bf1c17da9d92..3b0192b7e458c 100644 --- a/src/Symfony/Component/Serializer/Mapping/Loader/LoaderChain.php +++ b/src/Symfony/Component/Serializer/Mapping/Loader/LoaderChain.php @@ -27,9 +27,6 @@ */ class LoaderChain implements LoaderInterface { - /** - * @var LoaderInterface[] - */ private $loaders; /** diff --git a/src/Symfony/Component/Serializer/NameConverter/CamelCaseToSnakeCaseNameConverter.php b/src/Symfony/Component/Serializer/NameConverter/CamelCaseToSnakeCaseNameConverter.php index c7a75e78f8f61..8a974865b4b61 100644 --- a/src/Symfony/Component/Serializer/NameConverter/CamelCaseToSnakeCaseNameConverter.php +++ b/src/Symfony/Component/Serializer/NameConverter/CamelCaseToSnakeCaseNameConverter.php @@ -18,14 +18,7 @@ */ class CamelCaseToSnakeCaseNameConverter implements NameConverterInterface { - /** - * @var array|null - */ private $attributes; - - /** - * @var bool - */ private $lowerCamelCase; /** diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index e0f1ea1e252cb..0290dd9eef548 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -33,6 +33,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N const OBJECT_TO_POPULATE = 'object_to_populate'; const GROUPS = 'groups'; const ATTRIBUTES = 'attributes'; + const ALLOW_EXTRA_ATTRIBUTES = 'allow_extra_attributes'; /** * @var int @@ -81,7 +82,7 @@ public function __construct(ClassMetadataFactoryInterface $classMetadataFactory /** * Set circular reference limit. * - * @param int $circularReferenceLimit limit of iterations for the same object + * @param int $circularReferenceLimit Limit of iterations for the same object * * @return self */ @@ -109,7 +110,7 @@ public function setCircularReferenceHandler(callable $circularReferenceHandler) /** * Set normalization callbacks. * - * @param callable[] $callbacks help normalize the result + * @param callable[] $callbacks Help normalize the result * * @return self * @@ -203,7 +204,14 @@ protected function handleCircularReference($object) */ protected function getAllowedAttributes($classOrObject, array $context, $attributesAsString = false) { - if (!$this->classMetadataFactory || !isset($context[static::GROUPS]) || !is_array($context[static::GROUPS])) { + if (!$this->classMetadataFactory) { + return false; + } + + $groups = false; + if (isset($context[static::GROUPS]) && is_array($context[static::GROUPS])) { + $groups = $context[static::GROUPS]; + } elseif (!isset($context[static::ALLOW_EXTRA_ATTRIBUTES]) || $context[static::ALLOW_EXTRA_ATTRIBUTES]) { return false; } @@ -212,7 +220,7 @@ protected function getAllowedAttributes($classOrObject, array $context, $attribu $name = $attributeMetadata->getName(); if ( - count(array_intersect($attributeMetadata->getGroups(), $context[static::GROUPS])) && + (false === $groups || count(array_intersect($attributeMetadata->getGroups(), $groups))) && $this->isAllowedAttribute($classOrObject, $name, null, $context) ) { $allowedAttributes[] = $attributesAsString ? $name : $attributeMetadata; diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index c63f5dee5eae4..93e5f9bc5e126 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -110,7 +110,7 @@ public function normalize($object, $format = null, array $context = array()) * * @return string[] */ - protected function getAttributes($object, $format, array $context) + protected function getAttributes($object, $format = null, array $context) { $class = get_class($object); $key = $class.'-'.$context['cache_key']; diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php index 4fe7a313a1755..702b1bcb59d8c 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php @@ -32,7 +32,7 @@ interface DenormalizableInterface * @param array|scalar $data The data from which to re-create the object * @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 + * @param array $context Options for denormalizing * * @return object */ diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index 2b3b206287373..c3a2bb535632e 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -28,10 +28,10 @@ interface DenormalizerInterface /** * Denormalizes data back into an object of the given class. * - * @param mixed $data data to restore - * @param string $class the expected class to instantiate - * @param string $format format the given data was extracted from - * @param array $context options available to the denormalizer + * @param mixed $data Data to restore + * @param string $class The expected class to instantiate + * @param string $format Format the given data was extracted from + * @param array $context Options available to the denormalizer * * @return object * diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php index 48fb8b482ee44..b275228642e1b 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php @@ -27,11 +27,11 @@ interface NormalizableInterface * It is important to understand that the normalize() call should normalize * recursively all child objects of the implementor. * - * @param NormalizerInterface $normalizer the normalizer is given so that you + * @param NormalizerInterface $normalizer The normalizer is given so that you * can use it to normalize objects contained within this object - * @param string|null $format the format is optionally given to be able to normalize differently + * @param string|null $format The format is optionally given to be able to normalize differently * based on different output formats - * @param array $context options for normalizing this object + * @param array $context Options for normalizing this object * * @return array|scalar */ diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index 2779053f741e9..7f26c0404e5a6 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -25,8 +25,8 @@ interface NormalizerInterface /** * Normalizes an object into a set of arrays/scalars. * - * @param object $object object to normalize - * @param string $format format the normalization result will be encoded as + * @param object $object Object to normalize + * @param string $format Format the normalization result will be encoded as * @param array $context Context options for the normalizer * * @return array|scalar diff --git a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php index dac7f06218b2c..a92eb176d9c6f 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php @@ -26,9 +26,6 @@ */ class ObjectNormalizer extends AbstractObjectNormalizer { - /** - * @var PropertyAccessorInterface - */ protected $propertyAccessor; public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyAccessorInterface $propertyAccessor = null, PropertyTypeExtractorInterface $propertyTypeExtractor = null) diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index 9bcd44b4330ea..9571dac88ad33 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -230,9 +230,9 @@ public function supportsDenormalization($data, $type, $format = null/*, array $c /** * Returns a matching normalizer. * - * @param mixed $data data to get the serializer for - * @param string $format format name, present to give the option to normalizers to act differently based on formats - * @param array $context options available to the normalizer + * @param mixed $data Data to get the serializer for + * @param string $format Format name, present to give the option to normalizers to act differently based on formats + * @param array $context Options available to the normalizer * * @return NormalizerInterface|null */ @@ -248,10 +248,10 @@ private function getNormalizer($data, $format, array $context) /** * Returns a matching denormalizer. * - * @param mixed $data data to restore - * @param string $class the expected class to instantiate - * @param string $format format name, present to give the option to normalizers to act differently based on formats - * @param array $context options available to the denormalizer + * @param mixed $data Data to restore + * @param string $class The expected class to instantiate + * @param string $format Format name, present to give the option to normalizers to act differently based on formats + * @param array $context Options available to the denormalizer * * @return DenormalizerInterface|null */ diff --git a/src/Symfony/Component/Serializer/SerializerInterface.php b/src/Symfony/Component/Serializer/SerializerInterface.php index c79db91892075..196bff1a21c62 100644 --- a/src/Symfony/Component/Serializer/SerializerInterface.php +++ b/src/Symfony/Component/Serializer/SerializerInterface.php @@ -21,9 +21,9 @@ interface SerializerInterface /** * Serializes data in the appropriate format. * - * @param mixed $data any data - * @param string $format format name - * @param array $context options normalizers/encoders have access to + * @param mixed $data Any data + * @param string $format Format name + * @param array $context Options normalizers/encoders have access to * * @return string */ diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php index 1040111cfe620..3ca418d55ed6b 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php @@ -11,7 +11,10 @@ namespace Symfony\Component\Serializer\Tests\Normalizer; +use Doctrine\Common\Annotations\AnnotationReader; use PHPUnit\Framework\TestCase; +use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; +use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer; class AbstractObjectNormalizerTest extends TestCase @@ -51,6 +54,21 @@ public function testDenormalizeWithExtraAttributes() array('allow_extra_attributes' => false) ); } + + /** + * @expectedException \Symfony\Component\Serializer\Exception\ExtraAttributesException + * @expectedExceptionMessage Extra attributes are not allowed ("fooFoo", "fooBar" are unknown). + */ + public function testDenormalizeWithExtraAttributesAndNoGroupsWithMetadataFactory() + { + $normalizer = new AbstractObjectNormalizerWithMetadata(); + $normalizer->denormalize( + array('fooFoo' => 'foo', 'fooBar' => 'bar', 'bar' => 'bar'), + Dummy::class, + 'any', + array('allow_extra_attributes' => false) + ); + } } class AbstractObjectNormalizerDummy extends AbstractObjectNormalizer @@ -85,3 +103,24 @@ class Dummy public $bar; public $baz; } + +class AbstractObjectNormalizerWithMetadata extends AbstractObjectNormalizer +{ + public function __construct() + { + parent::__construct(new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()))); + } + + protected function extractAttributes($object, $format = null, array $context = array()) + { + } + + protected function getAttributeValue($object, $attribute, $format = null, array $context = array()) + { + } + + protected function setAttributeValue($object, $attribute, $value, $format = null, array $context = array()) + { + $object->$attribute = $value; + } +} diff --git a/src/Symfony/Component/Stopwatch/Section.php b/src/Symfony/Component/Stopwatch/Section.php index 9b131301fc861..0860dbe7fcdfd 100644 --- a/src/Symfony/Component/Stopwatch/Section.php +++ b/src/Symfony/Component/Stopwatch/Section.php @@ -72,7 +72,7 @@ public function get($id) /** * Creates or re-opens a child section. * - * @param string|null $id null to create a new section, the identifier to re-open an existing one + * @param string|null $id Null to create a new section, the identifier to re-open an existing one * * @return self */ diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index fb5fa48f5bc9b..ff1897ba3879e 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -424,7 +424,7 @@ protected function initializeEscapers() /** * Runs the PHP function htmlspecialchars on the value passed. * - * @param string $value the value to escape + * @param string $value The value to escape * * @return string the escaped value */ @@ -439,7 +439,7 @@ function ($value) use ($flags) { * A function that escape all non-alphanumeric characters * into their \xHH or \uHHHH representations. * - * @param string $value the value to escape + * @param string $value The value to escape * * @return string the escaped value */ diff --git a/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php b/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php index fe5dccb42a354..ebfa831dbd0ca 100644 --- a/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php @@ -44,8 +44,8 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti /** * Sets the delimiter and escape character for CSV. * - * @param string $delimiter delimiter character - * @param string $enclosure enclosure character + * @param string $delimiter Delimiter character + * @param string $enclosure Enclosure character */ public function setCsvControl($delimiter = ';', $enclosure = '"') { diff --git a/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php b/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php index 4b6b155df60a6..b9c524e820c03 100644 --- a/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php +++ b/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php @@ -21,7 +21,7 @@ abstract class AbstractFileExtractor { /** - * @param string|array $resource files, a file or a directory + * @param string|array $resource Files, a file or a directory * * @return array */ @@ -77,7 +77,7 @@ protected function isFile($file) abstract protected function canBeExtracted($file); /** - * @param string|array $resource files, a file or a directory + * @param string|array $resource Files, a file or a directory * * @return array files to be extracted */ diff --git a/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php b/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php index 438f80b32f053..b4534fae7e9ee 100644 --- a/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php +++ b/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php @@ -24,7 +24,7 @@ interface ExtractorInterface /** * Extracts translation messages from files, a file or a directory to the catalogue. * - * @param string|array $resource files, a file or a directory + * @param string|array $resource Files, a file or a directory * @param MessageCatalogue $catalogue The catalogue */ public function extract($resource, MessageCatalogue $catalogue); diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php index f1d3443f4c7ea..e454d16922ec4 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -52,9 +52,9 @@ protected function loadResource($resource) /** * Sets the delimiter, enclosure, and escape character for CSV. * - * @param string $delimiter delimiter character - * @param string $enclosure enclosure character - * @param string $escape escape character + * @param string $delimiter Delimiter character + * @param string $enclosure Enclosure character + * @param string $escape Escape character */ public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\') { diff --git a/src/Symfony/Component/Translation/Loader/IcuResFileLoader.php b/src/Symfony/Component/Translation/Loader/IcuResFileLoader.php index 2f8037fb164d8..6b5b5e125ff6f 100644 --- a/src/Symfony/Component/Translation/Loader/IcuResFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/IcuResFileLoader.php @@ -70,9 +70,9 @@ public function load($resource, $locale, $domain = 'messages') * * This function takes an array by reference and will modify it * - * @param \ResourceBundle $rb the ResourceBundle that will be flattened - * @param array $messages used internally for recursive calls - * @param string $path current path being parsed, used internally for recursive calls + * @param \ResourceBundle $rb The ResourceBundle that will be flattened + * @param array $messages Used internally for recursive calls + * @param string $path Current path being parsed, used internally for recursive calls * * @return array the flattened ResourceBundle */ diff --git a/src/Symfony/Component/Translation/Loader/MoFileLoader.php b/src/Symfony/Component/Translation/Loader/MoFileLoader.php index 702641fd655cb..aad2bba220437 100644 --- a/src/Symfony/Component/Translation/Loader/MoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/MoFileLoader.php @@ -21,23 +21,17 @@ class MoFileLoader extends FileLoader /** * Magic used for validating the format of a MO file as well as * detecting if the machine used to create that file was little endian. - * - * @var float */ const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; /** * Magic used for validating the format of a MO file as well as * detecting if the machine used to create that file was big endian. - * - * @var float */ const MO_BIG_ENDIAN_MAGIC = 0xde120495; /** * The size of the header of a MO file in bytes. - * - * @var int Number of bytes */ const MO_HEADER_SIZE = 28; diff --git a/src/Symfony/Component/Translation/LoggingTranslator.php b/src/Symfony/Component/Translation/LoggingTranslator.php index 194e554ad9106..337c114330bb8 100644 --- a/src/Symfony/Component/Translation/LoggingTranslator.php +++ b/src/Symfony/Component/Translation/LoggingTranslator.php @@ -24,9 +24,6 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface */ private $translator; - /** - * @var LoggerInterface - */ private $logger; /** diff --git a/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php b/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php index 8a6723ea9cb1a..a0624e297a62c 100644 --- a/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php +++ b/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php @@ -91,8 +91,8 @@ public function failingLangcodes() /** * We validate only on the plural coverage. Thus the real rules is not tested. * - * @param string $nplural plural expected - * @param array $matrix containing langcodes and their plural index values + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values * @param bool $expectSuccess */ protected function validateMatrix($nplural, $matrix, $expectSuccess = true) diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php index 9972e7027610c..faaa5fb4bcc5b 100644 --- a/src/Symfony/Component/Validator/Constraint.php +++ b/src/Symfony/Component/Validator/Constraint.php @@ -33,29 +33,21 @@ abstract class Constraint { /** * The name of the group given to all constraints with no explicit group. - * - * @var string */ const DEFAULT_GROUP = 'Default'; /** * Marks a constraint that can be put onto classes. - * - * @var string */ const CLASS_CONSTRAINT = 'class'; /** * Marks a constraint that can be put onto properties. - * - * @var string */ const PROPERTY_CONSTRAINT = 'property'; /** * Maps error codes to the names of their constants. - * - * @var array */ protected static $errorNames = array(); diff --git a/src/Symfony/Component/Validator/ConstraintValidator.php b/src/Symfony/Component/Validator/ConstraintValidator.php index ece4400065c6a..9a6b54a402d65 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -23,15 +23,11 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface /** * Whether to format {@link \DateTime} objects as RFC-3339 dates * ("Y-m-d H:i:s"). - * - * @var int */ const PRETTY_DATE = 1; /** * Whether to cast objects with a "__toString()" method to strings. - * - * @var int */ const OBJECT_TO_STRING = 2; diff --git a/src/Symfony/Component/Validator/Constraints/EmailValidator.php b/src/Symfony/Component/Validator/Constraints/EmailValidator.php index 25df180de0c21..b9537cab04843 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -23,11 +23,11 @@ */ class EmailValidator extends ConstraintValidator { - /** - * @var bool - */ private $isStrict; + /** + * @param bool $strict + */ public function __construct($strict = false) { $this->isStrict = $strict; diff --git a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php index e2f3139af73b8..be05f8f8a0af0 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php @@ -23,9 +23,6 @@ */ class ExpressionValidator extends ConstraintValidator { - /** - * @var ExpressionLanguage - */ private $expressionLanguage; public function __construct($propertyAccessor = null, ExpressionLanguage $expressionLanguage = null) diff --git a/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php index 32f004b5d0e9e..84c5a9c8cb8b8 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php @@ -23,14 +23,7 @@ */ class ExecutionContextFactory implements ExecutionContextFactoryInterface { - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var string|null - */ private $translationDomain; /** diff --git a/src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php b/src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php index aa8c61f96bff9..1b91600a49887 100644 --- a/src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php +++ b/src/Symfony/Component/Validator/DataCollector/ValidatorDataCollector.php @@ -45,7 +45,6 @@ public function collect(Request $request, Response $response, \Exception $except public function reset() { - $this->validator->reset(); $this->data = array( 'calls' => $this->cloneVar(array()), 'violations_count' => 0, diff --git a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php index 79ad1f228b79f..e36f0fcf543e8 100644 --- a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php +++ b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php @@ -38,18 +38,7 @@ */ class LazyLoadingMetadataFactory implements MetadataFactoryInterface { - /** - * The loader for loading the class metadata. - * - * @var LoaderInterface|null - */ protected $loader; - - /** - * The cache for caching class metadata. - * - * @var CacheInterface|null - */ protected $cache; /** diff --git a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php index b09f5a669bac0..b60e0afbef937 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php @@ -26,9 +26,6 @@ */ class AnnotationLoader implements LoaderInterface { - /** - * @var Reader - */ protected $reader; public function __construct(Reader $reader) diff --git a/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php index 326bbdfe75c72..b8f9490379aee 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php @@ -23,11 +23,6 @@ */ abstract class FileLoader extends AbstractLoader { - /** - * The file to load. - * - * @var string - */ protected $file; /** diff --git a/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php b/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php index 970d9068d8ff4..ead415e977c9e 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/LoaderChain.php @@ -25,9 +25,6 @@ */ class LoaderChain implements LoaderInterface { - /** - * @var LoaderInterface[] - */ protected $loaders; /** diff --git a/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php index 4ff22573acc37..95fc578eb4b5c 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/StaticMethodLoader.php @@ -21,11 +21,6 @@ */ class StaticMethodLoader implements LoaderInterface { - /** - * The name of the method to call. - * - * @var string - */ protected $methodName; /** diff --git a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php index a380e9698aa21..d71a13be71f03 100644 --- a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php @@ -29,8 +29,6 @@ abstract class MemberMetadata extends GenericMetadata implements PropertyMetadataInterface { /** - * @var string - * * @internal This property is public in order to reduce the size of the * class' serialized representation. Do not access it. Use * {@link getClassName()} instead. @@ -38,8 +36,6 @@ abstract class MemberMetadata extends GenericMetadata implements PropertyMetadat public $class; /** - * @var string - * * @internal This property is public in order to reduce the size of the * class' serialized representation. Do not access it. Use * {@link getName()} instead. @@ -47,8 +43,6 @@ abstract class MemberMetadata extends GenericMetadata implements PropertyMetadat public $name; /** - * @var string - * * @internal This property is public in order to reduce the size of the * class' serialized representation. Do not access it. Use * {@link getPropertyName()} instead. diff --git a/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php b/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php index c078d283509c6..b28650c30e1da 100644 --- a/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php +++ b/src/Symfony/Component/Validator/Tests/DataCollector/ValidatorDataCollectorTest.php @@ -70,11 +70,6 @@ public function testReset() $this->assertCount(0, $collector->getCalls()); $this->assertSame(0, $collector->getViolationsCount()); - - $collector->lateCollect(); - - $this->assertCount(0, $collector->getCalls()); - $this->assertSame(0, $collector->getViolationsCount()); } protected function createMock($classname) diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index 3b55ab3db1944..5ac343bfbc9af 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -38,34 +38,11 @@ */ class RecursiveContextualValidator implements ContextualValidatorInterface { - /** - * @var ExecutionContextInterface - */ private $context; - - /** - * @var string - */ private $defaultPropertyPath; - - /** - * @var array - */ private $defaultGroups; - - /** - * @var MetadataFactoryInterface - */ private $metadataFactory; - - /** - * @var ConstraintValidatorFactoryInterface - */ private $validatorFactory; - - /** - * @var ObjectInitializerInterface[] - */ private $objectInitializers; /** diff --git a/src/Symfony/Component/Validator/Validator/RecursiveValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveValidator.php index c79d0a77d4909..8763f2e668473 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveValidator.php @@ -24,24 +24,9 @@ */ class RecursiveValidator implements ValidatorInterface { - /** - * @var ExecutionContextFactoryInterface - */ protected $contextFactory; - - /** - * @var MetadataFactoryInterface - */ protected $metadataFactory; - - /** - * @var ConstraintValidatorFactoryInterface - */ protected $validatorFactory; - - /** - * @var ObjectInitializerInterface[] - */ protected $objectInitializers; /** diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 704d76baad0f0..4268570858b93 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -37,24 +37,9 @@ */ class ValidatorBuilder implements ValidatorBuilderInterface { - /** - * @var array - */ private $initializers = array(); - - /** - * @var array - */ private $xmlMappings = array(); - - /** - * @var array - */ private $yamlMappings = array(); - - /** - * @var array - */ private $methodMappings = array(); /** diff --git a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php index ff4d295cf31ae..0d96ffe894f84 100644 --- a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php +++ b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php @@ -26,59 +26,16 @@ */ class ConstraintViolationBuilder implements ConstraintViolationBuilderInterface { - /** - * @var ConstraintViolationList - */ private $violations; - - /** - * @var string - */ private $message; - - /** - * @var array - */ private $parameters; - - /** - * @var mixed - */ private $root; - - /** - * @var mixed - */ private $invalidValue; - - /** - * @var string - */ private $propertyPath; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var string|null - */ private $translationDomain; - - /** - * @var int|null - */ private $plural; - - /** - * @var Constraint - */ private $constraint; - - /** - * @var mixed - */ private $code; /** diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index da3a8bdc46daf..5bf89112e6f1e 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -12,6 +12,7 @@ namespace Symfony\Component\VarDumper\Dumper; use Symfony\Component\VarDumper\Cloner\Cursor; +use Symfony\Component\VarDumper\Cloner\Stub; /** * CliDumper dumps variables for command line output. @@ -525,10 +526,12 @@ protected function dumpLine($depth, $endOfValue = false) protected function endValue(Cursor $cursor) { - if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) { - $this->line .= ','; - } elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) { - $this->line .= ','; + if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) { + if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) { + $this->line .= ','; + } elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) { + $this->line .= ','; + } } $this->dumpLine($cursor->depth, true); diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index 37c1a1a468b1c..a4335d8a04973 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -165,6 +165,13 @@ function toggle(a, recursive) { return false; } + if (doc.createEvent && s.dispatchEvent) { + var event = doc.createEvent('Event'); + event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false); + + s.dispatchEvent(event); + } + a.lastChild.innerHTML = arrow; s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass); diff --git a/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php index a496a8c09ff20..88c7f3008e37e 100644 --- a/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php @@ -130,6 +130,36 @@ public function testDumpWithCommaFlag($expected, $flags) $this->assertSame($expected, $dump); } + public function testDumpWithCommaFlagsAndExceptionCodeExcerpt() + { + $dumper = new CliDumper(null, null, CliDumper::DUMP_TRAILING_COMMA); + $dumper->setColors(false); + $cloner = new VarCloner(); + + $ex = new \RuntimeException('foo'); + + $dump = $dumper->dump($cloner->cloneVar($ex)->withRefHandles(false), true); + + $this->assertStringMatchesFormat(<<<'EOTXT' +RuntimeException { + #message: "foo" + #code: 0 + #file: "%ACliDumperTest.php" + #line: %d + trace: { + %ACliDumperTest.php:%d { + › + › $ex = new \RuntimeException('foo'); + › + } + %A + } +} + +EOTXT + , $dump); + } + public function provideDumpWithCommaFlagTests() { $expected = <<<'EOTXT'