From b58c31f2aab39f657c3808aa84708d18de7c64d6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 28 Oct 2017 20:53:30 +0200 Subject: [PATCH 01/33] [PropertyInfo] Remove useless docblocks --- .../Extractor/ReflectionExtractor.php | 6 ----- .../Extractor/SerializerExtractor.php | 3 --- src/Symfony/Component/PropertyInfo/Type.php | 23 ------------------- 3 files changed, 32 deletions(-) diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index ecf0b287e2e26..3ec1d8d6eab08 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -25,22 +25,16 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp { /** * @internal - * - * @var string[] */ public static $mutatorPrefixes = array('add', 'remove', 'set'); /** * @internal - * - * @var string[] */ public static $accessorPrefixes = array('is', 'can', 'get'); /** * @internal - * - * @var string[] */ public static $arrayMutatorPrefixes = array('add', 'remove'); diff --git a/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php index 2c4699609e4c5..5acd1af22946f 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php @@ -21,9 +21,6 @@ */ class SerializerExtractor implements PropertyListExtractorInterface { - /** - * @var ClassMetadataFactoryInterface - */ private $classMetadataFactory; public function __construct(ClassMetadataFactoryInterface $classMetadataFactory) diff --git a/src/Symfony/Component/PropertyInfo/Type.php b/src/Symfony/Component/PropertyInfo/Type.php index 3dc7d785fe94f..188c5e8b4bed9 100644 --- a/src/Symfony/Component/PropertyInfo/Type.php +++ b/src/Symfony/Component/PropertyInfo/Type.php @@ -47,34 +47,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; /** From 3ebf6ac45b9863c29815e8dbdb17997c7ec52a73 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 28 Oct 2017 20:50:41 +0200 Subject: [PATCH 02/33] [FrameworkBundle] Fix docblocks --- .../Controller/ControllerTrait.php | 14 +-- .../Tests/Controller/ControllerTraitTest.php | 116 ++++-------------- .../Extractor/PhpDocExtractor.php | 11 -- .../PropertyInfoCacheExtractor.php | 11 -- 4 files changed, 28 insertions(+), 124 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php b/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php index 7d47d59585762..65350e40cc85b 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. @@ -43,7 +43,7 @@ trait ControllerTrait * 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 @@ -324,7 +324,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 */ protected function createForm($type, $data = null, array $options = array()) { @@ -337,7 +337,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 */ protected function createFormBuilder($data = null, array $options = array()) { @@ -347,7 +347,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/Tests/Controller/ControllerTraitTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php index e5688af00fbe3..a208775cf23d7 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/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index 3a59cc74cd9cc..600280bad5749 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -38,19 +38,8 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property */ private $docBlocks = array(); - /** - * @var DocBlockFactory - */ private $docBlockFactory; - - /** - * @var ContextFactory - */ private $contextFactory; - - /** - * @var PhpDocTypeHelper - */ private $phpDocTypeHelper; public function __construct(DocBlockFactoryInterface $docBlockFactory = null) 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) From dc9492eb6f1506360e5907c1b2c4044c8c9c5ed9 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sun, 29 Oct 2017 09:47:50 +0100 Subject: [PATCH 03/33] [FrameworkBundle][Routing] Remove unused logger argument --- src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml index 6b2f7c9688699..5cf865c3d63eb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml @@ -53,7 +53,6 @@ - %router.resource% @@ -69,7 +68,6 @@ %router.options.matcher.cache_class% - From 2443511324fd4795e82cff69170ebaab78638809 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 28 Oct 2017 20:51:46 +0200 Subject: [PATCH 04/33] Remove useless docblocks --- .../CompilerPass/DoctrineValidationPass.php | 6 +-- ...gisterEventListenersAndSubscribersPass.php | 3 -- .../CompilerPass/RegisterMappingsPass.php | 4 +- .../DoctrineParserCache.php | 3 -- .../Form/ChoiceList/DoctrineChoiceLoader.php | 28 ++--------- .../Doctrine/Form/ChoiceList/IdReader.php | 19 ------- .../Doctrine/Form/DoctrineOrmExtension.php | 7 --- .../Constraints/UniqueEntityValidator.php | 3 -- .../LazyProxy/PhpDumper/ProxyDumper.php | 11 ----- .../Twig/Extension/StopwatchExtension.php | 4 -- .../TranslationDefaultDomainNodeVisitor.php | 3 -- .../Bridge/Twig/Translation/TwigExtractor.php | 5 -- .../EventListener/SessionListener.php | 3 -- .../Translation/TranslationLoader.php | 4 +- .../Controller/ExceptionController.php | 6 +-- .../ClassLoader/XcacheClassLoader.php | 6 --- .../Component/Config/ConfigCacheFactory.php | 3 -- .../Component/Config/Definition/ArrayNode.php | 2 +- .../Builder/ArrayNodeDefinition.php | 4 +- .../Config/Definition/Builder/NodeBuilder.php | 6 +-- .../Component/Console/ConsoleEvents.php | 6 --- .../Console/Event/ConsoleCommandEvent.php | 2 - .../Component/Console/Helper/ProgressBar.php | 5 -- .../Component/Console/Helper/TableHelper.php | 3 -- .../Console/Input/InputDefinition.php | 2 +- .../Console/Output/BufferedOutput.php | 3 -- .../Console/Output/ConsoleOutput.php | 3 -- .../CssSelector/Node/ElementNode.php | 7 --- .../Component/CssSelector/Parser/Reader.php | 11 ----- .../Component/CssSelector/Parser/Token.php | 11 ----- .../Parser/Tokenizer/TokenizerPatterns.php | 47 ------------------ .../XPath/Extension/NodeExtension.php | 3 -- .../Component/CssSelector/XPath/XPathExpr.php | 11 ----- .../Compiler/RepeatedPass.php | 3 -- .../DependencyInjection/ContainerBuilder.php | 4 +- .../DependencyInjection/Dumper/PhpDumper.php | 4 -- .../Instantiator/InstantiatorInterface.php | 9 ++-- .../LazyProxy/PhpDumper/DumperInterface.php | 2 +- src/Symfony/Component/DomCrawler/Crawler.php | 15 +++--- .../RegisterListenersPass.php | 11 ----- .../EventDispatcherInterface.php | 2 +- .../EventDispatcher/GenericEvent.php | 11 +---- .../ExpressionLanguage/ExpressionLanguage.php | 3 -- .../Component/Filesystem/LockHandler.php | 2 +- .../Filesystem/Tests/FilesystemTestCase.php | 2 +- .../Finder/Adapter/AbstractFindAdapter.php | 3 -- .../Component/Finder/Expression/Glob.php | 3 -- .../Finder/Tests/Iterator/MockSplFileInfo.php | 6 +-- .../Component/Form/AbstractRendererEngine.php | 8 +-- .../Component/Form/CallbackTransformer.php | 11 ----- .../Form/ChoiceList/LazyChoiceList.php | 8 +-- .../Form/ChoiceList/View/ChoiceGroupView.php | 14 +----- .../Form/ChoiceList/View/ChoiceListView.php | 14 +----- .../Form/ChoiceList/View/ChoiceView.php | 17 ------- .../Extension/Core/ChoiceList/ChoiceList.php | 20 +++----- .../Core/ChoiceList/ObjectChoiceList.php | 2 +- .../Core/ChoiceList/SimpleChoiceList.php | 8 ++- .../Form/Extension/Core/CoreExtension.php | 7 --- .../BooleanToStringTransformer.php | 9 +--- .../ChoiceToBooleanArrayTransformer.php | 9 ++-- .../DateTimeToLocalizedStringTransformer.php | 2 +- .../PercentToLocalizedStringTransformer.php | 1 - .../EventListener/MergeCollectionListener.php | 19 +------ .../Core/EventListener/ResizeFormListener.php | 4 +- .../Form/Extension/Core/Type/ChoiceType.php | 5 -- .../Form/Extension/Core/Type/DateTimeType.php | 1 - .../Form/Extension/Core/Type/DateType.php | 1 - .../Form/Extension/Core/Type/FormType.php | 3 -- .../Form/Extension/Csrf/CsrfExtension.php | 11 ----- .../Csrf/CsrfProvider/CsrfProviderAdapter.php | 3 -- .../CsrfProvider/CsrfTokenManagerAdapter.php | 3 -- .../Csrf/CsrfProvider/DefaultCsrfProvider.php | 5 -- .../Csrf/CsrfProvider/SessionCsrfProvider.php | 7 +-- .../EventListener/CsrfValidationListener.php | 49 +++++-------------- .../Csrf/Type/FormTypeCsrfExtension.php | 25 +++------- .../DataCollector/DataCollectorExtension.php | 4 -- .../EventListener/DataCollectorListener.php | 3 -- .../Proxy/ResolvedTypeDataCollectorProxy.php | 7 --- .../ResolvedTypeFactoryDataCollectorProxy.php | 7 --- .../Type/DataCollectorTypeExtension.php | 2 +- .../HttpFoundationRequestHandler.php | 3 -- .../Templating/TemplatingRendererEngine.php | 3 -- .../Type/FormTypeValidatorExtension.php | 7 --- .../Validator/ValidatorTypeGuesser.php | 2 +- .../Validator/ViolationMapper/MappingRule.php | 14 ++---- .../ViolationMapper/RelativePath.php | 3 -- .../ViolationMapperInterface.php | 6 +-- .../ViolationMapper/ViolationPath.php | 3 +- .../Form/FormConfigBuilderInterface.php | 8 +-- .../Component/Form/FormErrorIterator.php | 13 +---- src/Symfony/Component/Form/FormFactory.php | 7 --- src/Symfony/Component/Form/FormInterface.php | 2 +- .../Form/FormRendererEngineInterface.php | 6 +-- src/Symfony/Component/Form/Guess/Guess.php | 8 --- .../Component/Form/PreloadedExtension.php | 11 ----- .../ViolationMapper/ViolationMapperTest.php | 3 -- .../Form/Util/OrderedHashMapIterator.php | 4 +- .../HttpFoundation/AcceptHeaderItem.php | 15 ------ .../HttpFoundation/File/UploadedFile.php | 36 ++------------ .../Component/HttpFoundation/Request.php | 6 +-- .../Attribute/NamespacedAttributeBag.php | 5 -- .../HttpFoundation/Session/Session.php | 12 ----- .../Handler/LegacyPdoSessionHandler.php | 3 -- .../Handler/MemcacheSessionHandler.php | 3 -- .../Handler/MemcachedSessionHandler.php | 3 -- .../Storage/Handler/MongoDbSessionHandler.php | 3 -- .../Handler/WriteCheckSessionHandler.php | 3 -- .../Storage/MockFileSessionStorage.php | 3 -- .../Session/Storage/Proxy/NativeProxy.php | 2 +- .../Storage/Proxy/SessionHandlerProxy.php | 3 -- .../Handler/MemcacheSessionHandlerTest.php | 1 + .../DataCollector/Util/ValueExporter.php | 4 +- .../HttpKernel/Event/KernelEvent.php | 22 ++------- .../HttpKernel/Event/PostResponseEvent.php | 7 --- .../EventListener/ProfilerListener.php | 4 +- .../HttpKernel/HttpCache/HttpCache.php | 4 +- .../Component/HttpKernel/KernelEvents.php | 14 ------ .../Component/HttpKernel/Profiler/Profile.php | 2 +- .../Data/Bundle/Compiler/GenrbCompiler.php | 6 +-- .../Bundle/Reader/BufferedBundleReader.php | 7 +-- .../Data/Bundle/Writer/TextBundleWriter.php | 9 ++-- .../Data/Generator/AbstractDataGenerator.php | 9 +--- .../Data/Generator/CurrencyDataGenerator.php | 12 ----- .../Intl/Data/Generator/GeneratorConfig.php | 11 ++--- .../Data/Generator/LocaleDataGenerator.php | 17 +------ .../Data/Generator/RegionDataGenerator.php | 6 --- .../Data/Provider/CurrencyDataProvider.php | 10 ---- .../Data/Provider/LanguageDataProvider.php | 13 +---- .../Intl/Data/Provider/LocaleDataProvider.php | 13 +---- .../Intl/Data/Provider/RegionDataProvider.php | 13 +---- .../Intl/Data/Provider/ScriptDataProvider.php | 13 +---- .../Intl/DateFormatter/IntlDateFormatter.php | 9 +--- .../Component/Intl/Globals/IntlGlobals.php | 12 ----- .../Intl/NumberFormatter/NumberFormatter.php | 24 ++------- .../Intl/ResourceBundle/CurrencyBundle.php | 3 -- .../Intl/ResourceBundle/LanguageBundle.php | 7 --- .../Intl/ResourceBundle/RegionBundle.php | 3 -- src/Symfony/Component/Intl/Util/SvnCommit.php | 6 +-- .../OptionsResolver/OptionsResolver.php | 18 ------- .../OptionsResolverInterface.php | 12 ++--- .../Component/Process/Pipes/AbstractPipes.php | 7 ++- .../Component/Process/Pipes/UnixPipes.php | 3 -- .../Component/Process/Pipes/WindowsPipes.php | 4 -- src/Symfony/Component/Process/Process.php | 2 +- .../PropertyAccessorBuilder.php | 7 --- .../Component/PropertyAccess/PropertyPath.php | 2 - .../PropertyAccess/PropertyPathBuilder.php | 8 +-- .../Tests/PropertyPathBuilderTest.php | 3 -- .../Routing/Loader/PhpFileLoader.php | 2 +- .../Routing/Matcher/Dumper/DumperRoute.php | 7 --- .../Security/Acl/Dbal/AclProvider.php | 7 --- .../Component/Security/Acl/Dbal/Schema.php | 2 +- .../Acl/Domain/AclCollectionCache.php | 4 +- .../Acl/Domain/RoleSecurityIdentity.php | 2 +- .../Acl/Domain/UserSecurityIdentity.php | 4 +- .../Security/Acl/Model/AclCacheInterface.php | 2 +- .../Security/Acl/Model/AclInterface.php | 2 +- .../Acl/Model/MutableAclInterface.php | 8 +-- .../Acl/Permission/AbstractMaskBuilder.php | 5 +- .../Security/Core/AuthenticationEvents.php | 4 -- .../Core/Encoder/BCryptPasswordEncoder.php | 3 -- .../Core/Encoder/BasePasswordEncoder.php | 4 +- .../Security/Core/SecurityContext.php | 2 +- .../Constraints/UserPasswordValidatorTest.php | 1 - .../Security/Core/Util/ClassUtils.php | 4 -- .../Component/Security/Csrf/CsrfToken.php | 7 --- .../TokenGenerator/UriSafeTokenGenerator.php | 17 +------ .../NativeSessionTokenStorage.php | 12 +---- .../Csrf/TokenStorage/SessionTokenStorage.php | 16 +----- .../RememberMeServicesInterface.php | 2 - .../Security/Http/SecurityEvents.php | 4 -- .../Serializer/Encoder/DecoderInterface.php | 4 +- .../Serializer/Encoder/EncoderInterface.php | 4 +- .../Serializer/Encoder/JsonDecode.php | 16 +----- .../Serializer/Encoder/JsonEncoder.php | 7 --- .../Serializer/Encoder/XmlEncoder.php | 10 +--- .../Serializer/Mapping/Loader/FileLoader.php | 3 -- .../Serializer/Mapping/Loader/LoaderChain.php | 3 -- .../CamelCaseToSnakeCaseNameConverter.php | 7 --- .../Normalizer/AbstractNormalizer.php | 4 +- .../Normalizer/DenormalizableInterface.php | 2 +- .../Normalizer/DenormalizerInterface.php | 8 +-- .../Normalizer/NormalizableInterface.php | 6 +-- .../Normalizer/NormalizerInterface.php | 4 +- .../Normalizer/ObjectNormalizer.php | 3 -- .../Component/Serializer/Serializer.php | 14 +++--- .../Serializer/SerializerInterface.php | 6 +-- src/Symfony/Component/Stopwatch/Section.php | 2 +- .../Component/Templating/PhpEngine.php | 4 +- .../Translation/Dumper/CsvFileDumper.php | 4 +- .../Extractor/AbstractFileExtractor.php | 4 +- .../Extractor/ExtractorInterface.php | 2 +- .../Translation/Loader/CsvFileLoader.php | 6 +-- .../Translation/Loader/IcuResFileLoader.php | 6 +-- .../Translation/Loader/MoFileLoader.php | 6 --- .../Translation/LoggingTranslator.php | 3 -- .../Tests/PluralizationRulesTest.php | 4 +- .../Component/Validator/Constraint.php | 8 --- .../Validator/ConstraintValidator.php | 4 -- .../Validator/Constraints/EmailValidator.php | 6 +-- .../Constraints/ExpressionValidator.php | 11 +---- .../Context/ExecutionContextFactory.php | 7 --- .../Context/LegacyExecutionContext.php | 3 -- .../Context/LegacyExecutionContextFactory.php | 11 ----- .../Component/Validator/ExecutionContext.php | 27 ---------- .../Validator/ExecutionContextInterface.php | 4 +- .../Factory/LazyLoadingMetadataFactory.php | 11 ----- .../Mapping/Loader/AnnotationLoader.php | 3 -- .../Validator/Mapping/Loader/FileLoader.php | 5 -- .../Validator/Mapping/Loader/LoaderChain.php | 3 -- .../Mapping/Loader/StaticMethodLoader.php | 5 -- .../Validator/Mapping/MemberMetadata.php | 6 --- .../Component/Validator/ValidationVisitor.php | 31 ------------ src/Symfony/Component/Validator/Validator.php | 19 ------- .../RecursiveContextualValidator.php | 23 --------- .../Validator/RecursiveValidator.php | 15 ------ .../Component/Validator/ValidatorBuilder.php | 15 ------ .../Validator/ValidatorInterface.php | 2 +- .../Violation/ConstraintViolationBuilder.php | 43 ---------------- src/Symfony/Component/Yaml/Dumper.php | 4 +- src/Symfony/Component/Yaml/Inline.php | 14 +++--- src/Symfony/Component/Yaml/Parser.php | 8 +-- src/Symfony/Component/Yaml/Yaml.php | 4 +- 223 files changed, 257 insertions(+), 1438 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php index f8382ed2ebfb8..82c1b7c811386 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php @@ -22,11 +22,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/RegisterEventListenersAndSubscribersPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php index cb4a4816db70a..b9f51144746d5 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -26,9 +26,6 @@ */ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface { - /** - * @var string|string[] - */ private $connections; private $eventManagers; private $managerTemplate; diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php index c1d505722aa5b..fff9767540826 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 1c0e8cdfee26e..0aac26dae3671 100644 --- a/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php +++ b/src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php @@ -20,9 +20,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 02280c4fe8785..bf5890c1e69f0 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php @@ -23,29 +23,10 @@ */ class DoctrineChoiceLoader implements ChoiceLoaderInterface { - /** - * @var ChoiceListFactoryInterface - */ private $factory; - - /** - * @var ObjectManager - */ private $manager; - - /** - * @var string - */ private $class; - - /** - * @var IdReader - */ private $idReader; - - /** - * @var null|EntityLoaderInterface - */ private $objectLoader; /** @@ -60,13 +41,10 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface * passed which optimizes the object loading for one of the Doctrine * mapper implementations. * - * @param ChoiceListFactoryInterface $factory The factory for creating - * the loaded choice list + * @param ChoiceListFactoryInterface $factory The factory for creating the loaded choice list * @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 */ public function __construct(ChoiceListFactoryInterface $factory, ObjectManager $manager, $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php index 0161adf3b4c0a..ee8ec2ddaba71 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/Form/DoctrineOrmExtension.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php index ed8e0a793444c..469cbea192fc8 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php @@ -25,14 +25,7 @@ class DoctrineOrmExtension extends AbstractExtension { protected $registry; - /** - * @var PropertyAccessorInterface - */ private $propertyAccessor; - - /** - * @var ChoiceListFactoryInterface - */ private $choiceListFactory; public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null) diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index b0d9534a0e98d..8c7876eae342d 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -25,9 +25,6 @@ */ class UniqueEntityValidator extends ConstraintValidator { - /** - * @var ManagerRegistry - */ private $registry; public function __construct(ManagerRegistry $registry) diff --git a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php index 629b556c4bc9e..9b44c5ed05388 100644 --- a/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php +++ b/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php @@ -25,19 +25,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/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/EventListener/SessionListener.php b/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php index 6c248d8a42880..20f0bbaba0a85 100644 --- a/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php +++ b/src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php @@ -21,9 +21,6 @@ */ class SessionListener extends BaseSessionListener { - /** - * @var ContainerInterface - */ private $container; public function __construct(ContainerInterface $container) diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php index b6377863afe48..16758d2209fe9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php @@ -43,8 +43,8 @@ public function addLoader($format, LoaderInterface $loader) /** * 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 8dd9cfee03abc..4a83c842a382b 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -31,12 +31,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/Component/ClassLoader/XcacheClassLoader.php b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php index 1dcfbaea6ec35..b7210343f21aa 100644 --- a/src/Symfony/Component/ClassLoader/XcacheClassLoader.php +++ b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php @@ -49,12 +49,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 5a8f4562388b0..945b155b409ff 100644 --- a/src/Symfony/Component/Config/ConfigCacheFactory.php +++ b/src/Symfony/Component/Config/ConfigCacheFactory.php @@ -19,9 +19,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 bd3984b8257c0..2c2738ac4c968 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -81,7 +81,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 c052c3df432a4..a0ad77edd0796 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -67,7 +67,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 */ @@ -97,7 +97,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/Console/ConsoleEvents.php b/src/Symfony/Component/Console/ConsoleEvents.php index 1ed41b7daa9c0..6dae6ce756f6c 100644 --- a/src/Symfony/Component/Console/ConsoleEvents.php +++ b/src/Symfony/Component/Console/ConsoleEvents.php @@ -27,8 +27,6 @@ final class ConsoleEvents * instance. * * @Event - * - * @var string */ const COMMAND = 'console.command'; @@ -40,8 +38,6 @@ final class ConsoleEvents * instance. * * @Event - * - * @var string */ const TERMINATE = 'console.terminate'; @@ -54,8 +50,6 @@ final class ConsoleEvents * instance. * * @Event - * - * @var string */ const EXCEPTION = 'console.exception'; } 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 c6aa1a920bd0f..9ce4525d2a3fe 100644 --- a/src/Symfony/Component/Console/Helper/ProgressBar.php +++ b/src/Symfony/Component/Console/Helper/ProgressBar.php @@ -22,7 +22,6 @@ */ class ProgressBar { - // options private $barWidth = 28; private $barChar; private $emptyBarChar = '-'; @@ -30,10 +29,6 @@ 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/Helper/TableHelper.php b/src/Symfony/Component/Console/Helper/TableHelper.php index fc29abb370d83..a6e660892ac7a 100644 --- a/src/Symfony/Component/Console/Helper/TableHelper.php +++ b/src/Symfony/Component/Console/Helper/TableHelper.php @@ -29,9 +29,6 @@ class TableHelper extends Helper const LAYOUT_BORDERLESS = 1; const LAYOUT_COMPACT = 2; - /** - * @var Table - */ private $table; public function __construct($triggerDeprecationError = true) diff --git a/src/Symfony/Component/Console/Input/InputDefinition.php b/src/Symfony/Component/Console/Input/InputDefinition.php index d7a1f2d0fdbc8..2f63e33cbac10 100644 --- a/src/Symfony/Component/Console/Input/InputDefinition.php +++ b/src/Symfony/Component/Console/Input/InputDefinition.php @@ -307,7 +307,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 80bea654da6f0..84efb981306f2 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutput.php @@ -28,9 +28,6 @@ */ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface { - /** - * @var StreamOutput - */ private $stderr; /** diff --git a/src/Symfony/Component/CssSelector/Node/ElementNode.php b/src/Symfony/Component/CssSelector/Node/ElementNode.php index 71ef121741eb1..1597e81a8e6a5 100644 --- a/src/Symfony/Component/CssSelector/Node/ElementNode.php +++ b/src/Symfony/Component/CssSelector/Node/ElementNode.php @@ -21,14 +21,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 0ba82b4ff63d4..2487867bab714 100644 --- a/src/Symfony/Component/CssSelector/Parser/Reader.php +++ b/src/Symfony/Component/CssSelector/Parser/Reader.php @@ -21,19 +21,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 bcc31a23c57ae..0104da570aef0 100644 --- a/src/Symfony/Component/CssSelector/Parser/Token.php +++ b/src/Symfony/Component/CssSelector/Parser/Token.php @@ -29,19 +29,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 2d0f26ac84f54..b548905fa29c8 100644 --- a/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php +++ b/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php @@ -21,64 +21,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 8a42d7f650402..8169d7a95a0e2 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php @@ -29,9 +29,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 f75214b6f77f8..c0d2bd55a5a03 100644 --- a/src/Symfony/Component/CssSelector/XPath/XPathExpr.php +++ b/src/Symfony/Component/CssSelector/XPath/XPathExpr.php @@ -21,19 +21,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 b180ad2ad8f83..65ea1c842c04f 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -104,7 +104,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) { @@ -114,7 +114,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() { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 67bfd053e7cfa..4527028ce05c8 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -38,15 +38,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_'; 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 95c1f038c0288..502c72abafc26 100644 --- a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php +++ b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php @@ -31,7 +31,7 @@ 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 $id Service identifier * * @return string */ diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index aa711bf1a45e7..cccea633dda3f 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -20,9 +20,6 @@ */ class Crawler extends \SplObjectStorage { - /** - * @var string The current URI - */ protected $uri; /** @@ -41,14 +38,14 @@ class Crawler extends \SplObjectStorage private $baseHref; /** - * @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 c51942c2cd2d2..764517693c01c 100644 --- a/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php +++ b/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php @@ -19,19 +19,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 f9be02edc77b1..60160a90e00ae 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 444b59a4941ee..fae922b739c43 100644 --- a/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php +++ b/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php @@ -21,9 +21,6 @@ */ class ExpressionLanguage { - /** - * @var ParserCacheInterface - */ private $cache; private $lexer; private $parser; diff --git a/src/Symfony/Component/Filesystem/LockHandler.php b/src/Symfony/Component/Filesystem/LockHandler.php index 3496faae21336..517b2f01e64b3 100644 --- a/src/Symfony/Component/Filesystem/LockHandler.php +++ b/src/Symfony/Component/Filesystem/LockHandler.php @@ -56,7 +56,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 5586a00547a68..0a1254818da2a 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTestCase.php @@ -66,7 +66,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/Adapter/AbstractFindAdapter.php b/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php index ca407b9ceab7b..c28f03ce5ff67 100644 --- a/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php +++ b/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php @@ -26,9 +26,6 @@ */ abstract class AbstractFindAdapter extends AbstractAdapter { - /** - * @var Shell - */ protected $shell; public function __construct() diff --git a/src/Symfony/Component/Finder/Expression/Glob.php b/src/Symfony/Component/Finder/Expression/Glob.php index 14e8bad4fa4f4..836fbb0acb17f 100644 --- a/src/Symfony/Component/Finder/Expression/Glob.php +++ b/src/Symfony/Component/Finder/Expression/Glob.php @@ -18,9 +18,6 @@ */ class Glob implements ValueInterface { - /** - * @var string - */ private $pattern; /** 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 452e24f1d1af5..970352ce9adaa 100644 --- a/src/Symfony/Component/Form/AbstractRendererEngine.php +++ b/src/Symfony/Component/Form/AbstractRendererEngine.php @@ -125,13 +125,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 6f61370d5e037..d80c2e9250dec 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 f691d71330715..ee00284bc4cf8 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; /** @@ -56,8 +51,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, $value = null) { diff --git a/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php b/src/Symfony/Component/Form/ChoiceList/View/ChoiceGroupView.php index 455fa68ac4ba1..10272be7a5791 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 5f32b5bbf44c5..a6f95db61895d 100644 --- a/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php +++ b/src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php @@ -21,25 +21,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/ChoiceList/ChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php index 14860a59f7567..f2037fba88bcd 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php @@ -74,7 +74,7 @@ class ChoiceList implements ChoiceListInterface * level of the hierarchy may also be a \Traversable. * @param array $labels The array of labels. The structure of this array * should match the structure of $choices. - * @param array $preferredChoices a flat array of choices that should be + * @param array $preferredChoices A flat array of choices that should be * presented to the user with priority * * @throws UnexpectedTypeException if the choices are not an array or \Traversable @@ -252,10 +252,8 @@ public function getIndicesForValues(array $values) /** * Recursively adds the given choices to the list. * - * @param array $bucketForPreferred the bucket where to store the preferred - * view objects - * @param array $bucketForRemaining the bucket where to store the - * non-preferred view objects + * @param array $bucketForPreferred The bucket where to store the preferred view objects + * @param array $bucketForRemaining The bucket where to store the non-preferred view objects * @param array|\Traversable $choices The list of choices * @param array $labels The labels corresponding to the choices * @param array $preferredChoices The preferred choices @@ -299,10 +297,8 @@ protected function addChoices(array &$bucketForPreferred, array &$bucketForRemai * Recursively adds a choice group. * * @param string $group The name of the group - * @param array $bucketForPreferred the bucket where to store the preferred - * view objects - * @param array $bucketForRemaining the bucket where to store the - * non-preferred view objects + * @param array $bucketForPreferred The bucket where to store the preferred view objects + * @param array $bucketForRemaining The bucket where to store the non-preferred view objects * @param array $choices The list of choices in the group * @param array $labels The labels corresponding to the choices in the group * @param array $preferredChoices The preferred choices @@ -336,10 +332,8 @@ protected function addChoiceGroup($group, array &$bucketForPreferred, array &$bu /** * Adds a new choice. * - * @param array $bucketForPreferred the bucket where to store the preferred - * view objects - * @param array $bucketForRemaining the bucket where to store the - * non-preferred view objects + * @param array $bucketForPreferred The bucket where to store the preferred view objects + * @param array $bucketForRemaining The bucket where to store the non-preferred view objects * @param mixed $choice The choice to add * @param string $label The label for the choice * @param array $preferredChoices The preferred choices diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php index 5e2b9a75a2909..26d491740a93f 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php @@ -80,7 +80,7 @@ class ObjectChoiceList extends ChoiceList * by calling the getter on the object. If the * path is NULL, the object's __toString() method * is used instead. - * @param array $preferredChoices a flat array of choices that should be + * @param array $preferredChoices A flat array of choices that should be * presented to the user with priority * @param string $groupPath A property path pointing to the property used * to group the choices. Only allowed if diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php index e5fd865d0dee1..bc2baa4c183d6 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php @@ -44,7 +44,7 @@ class SimpleChoiceList extends ChoiceList * as hierarchy of unlimited depth by creating nested * arrays. The title of the sub-hierarchy is stored * in the array key pointing to the nested array. - * @param array $preferredChoices a flat array of choices that should be + * @param array $preferredChoices A flat array of choices that should be * presented to the user with priority */ public function __construct(array $choices, array $preferredChoices = array()) @@ -83,10 +83,8 @@ public function getValuesForChoices(array $choices) * Takes care of splitting the single $choices array passed in the * constructor into choices and labels. * - * @param array $bucketForPreferred the bucket where to store the preferred - * view objects - * @param array $bucketForRemaining the bucket where to store the - * non-preferred view objects + * @param array $bucketForPreferred The bucket where to store the preferred view objects + * @param array $bucketForRemaining The bucket where to store the non-preferred view objects * @param array|\Traversable $choices The list of choices * @param array $labels Ignored * @param array $preferredChoices The preferred choices diff --git a/src/Symfony/Component/Form/Extension/Core/CoreExtension.php b/src/Symfony/Component/Form/Extension/Core/CoreExtension.php index 231994258e8d6..0c8eaf2344340 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/ChoiceToBooleanArrayTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php index b04d82fcd893e..39635b2bb77a9 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php @@ -47,8 +47,7 @@ public function __construct(ChoiceListInterface $choiceList, $placeholderPresent * depending on whether a given option is selected. If this field is rendered * as select tag, the value is not modified. * - * @param mixed $choice an array if "multiple" is set to true, a scalar - * value otherwise + * @param mixed $choice An array if "multiple" is set to true, a scalar value otherwise * * @return mixed An array * @@ -87,10 +86,8 @@ public function transform($choice) * * @return mixed A scalar value * - * @throws TransformationFailedException if the given value is not an array, - * if the recuperation of the choices - * fails or if some choice can't be - * found + * @throws TransformationFailedException if the given value is not an array, if the recuperation + * of the choices fails, or if some choice can't be found */ public function reverseTransform($values) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php index 597a141e65bdf..e2c553c507e4f 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php @@ -150,7 +150,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 db9c1e6ff9d2c..edd44108ffe62 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 e61ae5b8a3d8f..ef496b2c8ad57 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 $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 6c0c0b4295cde..a90e7d482eb66 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -44,11 +44,6 @@ class ChoiceType extends AbstractType */ const DEPRECATED_EMPTY_VALUE = '__deprecated_empty_value__'; - /** - * 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 c500d1552c7be..9cd25ed7789c2 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 d77cdc8e70335..f0a572861e280 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 1a1a3175e6e4b..35c7bc67b23bb 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 b5396669f6d27..d1e3bdb77abd8 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php @@ -25,19 +25,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/CsrfProvider/CsrfProviderAdapter.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php index 011d34a680111..069852345c4ca 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php @@ -27,9 +27,6 @@ */ class CsrfProviderAdapter implements CsrfTokenManagerInterface { - /** - * @var CsrfProviderInterface - */ private $csrfProvider; public function __construct(CsrfProviderInterface $csrfProvider) diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php index 93ed3147143d2..c0844da1b88f3 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php @@ -23,9 +23,6 @@ */ class CsrfTokenManagerAdapter implements CsrfProviderInterface { - /** - * @var CsrfTokenManagerInterface - */ private $tokenManager; public function __construct(CsrfTokenManagerInterface $tokenManager) diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php index 387f4ccf355cb..fb32fa3fba9ca 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php @@ -30,11 +30,6 @@ */ class DefaultCsrfProvider implements CsrfProviderInterface { - /** - * A secret value used for generating the CSRF token. - * - * @var string - */ protected $secret; /** diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php index 2bbbde4a302ff..3ea038fb40342 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php @@ -30,11 +30,6 @@ */ class SessionCsrfProvider extends DefaultCsrfProvider { - /** - * The user session from which the session ID is returned. - * - * @var Session - */ protected $session; /** @@ -43,7 +38,7 @@ class SessionCsrfProvider extends DefaultCsrfProvider * A recommended value for the secret is a generated value with at least * 32 characters and mixed letters, digits and special characters. * - * @param Session $session The user session + * @param Session $session The user session from which the session ID is returned * @param string $secret A secret value included in the CSRF token */ public function __construct(Session $session, $secret) diff --git a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php index b232e4f3b7de8..96c87d266fa0a 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php +++ b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -28,50 +28,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() @@ -81,6 +43,17 @@ public static function getSubscribedEvents() ); } + /** + * @param string $fieldName The name of the CSRF field + * @param CsrfTokenManagerInterface $tokenManager The generator for CSRF tokens + * @param string $tokenId 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 + * @param string $errorMessage The message displayed in case of an error + * @param TranslatorInterface $translator + * @param null|string $translationDomain + * @param ServerParams $serverParams + */ public function __construct($fieldName, $tokenManager, $tokenId, $errorMessage, TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null) { if ($tokenManager instanceof CsrfProviderInterface) { diff --git a/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php b/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php index 2a34ef0e9e203..646728bd1e1dd 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php +++ b/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php @@ -36,31 +36,20 @@ class FormTypeCsrfExtension extends AbstractTypeExtension */ 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|CsrfProviderInterface $defaultTokenManager + * @param bool $defaultEnabled + * @param string $defaultFieldName + * @param TranslatorInterface $translator + * @param null|string $translationDomain + * @param ServerParams $serverParams */ - private $serverParams; - public function __construct($defaultTokenManager, $defaultEnabled = true, $defaultFieldName = '_token', TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null) { if ($defaultTokenManager instanceof CsrfProviderInterface) { 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 4c1d6f0beac0d..2f02e70f08d22 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 6aa33b589efb4..4e07e11027c6b 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 72b0a4f3dfa3a..8e2ffa514d859 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 16030ae03ffb9..99213d61c81af 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php @@ -24,14 +24,7 @@ */ class FormTypeValidatorExtension extends BaseValidatorExtension { - /** - * @var ValidatorInterface - */ private $validator; - - /** - * @var ViolationMapper - */ private $violationMapper; /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index 9f06a75d90f46..90dadd08d951a 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -250,7 +250,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 f3958e77aeccf..45032e2407929 100644 --- a/src/Symfony/Component/Form/FormErrorIterator.php +++ b/src/Symfony/Component/Form/FormErrorIterator.php @@ -32,26 +32,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/FormFactory.php b/src/Symfony/Component/Form/FormFactory.php index e87e457a7baca..c0e9249203647 100644 --- a/src/Symfony/Component/Form/FormFactory.php +++ b/src/Symfony/Component/Form/FormFactory.php @@ -15,14 +15,7 @@ class FormFactory implements FormFactoryInterface { - /** - * @var FormRegistryInterface - */ private $registry; - - /** - * @var ResolvedFormTypeFactoryInterface - */ private $resolvedTypeFactory; public function __construct(FormRegistryInterface $registry, ResolvedFormTypeFactoryInterface $resolvedTypeFactory) diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index fcfbaaf96ceb0..1d94252ff40c6 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -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 9d116b8608846..e2300ef5a2dd2 100644 --- a/src/Symfony/Component/Form/FormRendererEngineInterface.php +++ b/src/Symfony/Component/Form/FormRendererEngineInterface.php @@ -40,7 +40,7 @@ public function setTheme(FormView $view, $themes); * 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 */ @@ -74,7 +74,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. @@ -114,7 +114,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 871e8b3791bc9..37b881e0bd8bb 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/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/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 b987c5b9027f1..83b62142c9c47 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -714,9 +714,9 @@ public static function getHttpMethodParameterOverride() * It is better to explicitly get request parameters from the appropriate * public property instead (query, attributes, request). * - * @param string $key the key - * @param mixed $default the default value if the parameter key does not exist - * @param bool $deep is parameter deep in multidimensional array + * @param string $key The key + * @param mixed $default The default value if the parameter key does not exist + * @param bool $deep Is parameter deep in multidimensional array * * @return mixed */ 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 5a765654c1dd9..d20a4daff90f3 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/LegacyPdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php index 900fb9f5f23e1..458bb73b3ff41 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php @@ -31,9 +31,6 @@ */ class LegacyPdoSessionHandler implements \SessionHandlerInterface { - /** - * @var \PDO PDO instance - */ private $pdo; /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php index d31aa7667e657..89b4dac2c65bc 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -16,9 +16,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 3bbde5420d16a..6e2c2ee306ac3 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 implements \SessionHandlerInterface { - /** - * @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 f140939dbd49a..29fc3f529b3c2 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -16,9 +16,6 @@ */ class MongoDbSessionHandler implements \SessionHandlerInterface { - /** - * @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 d49c36cae5876..7f4b6bc0342a4 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/WriteCheckSessionHandler.php @@ -18,9 +18,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/Proxy/NativeProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php index 21ed1ada04b4f..a0f48c1e27e54 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php @@ -12,7 +12,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; /** - * This proxy is built-in session handlers in PHP 5.3.x + * This proxy is built-in session handlers in PHP 5.3.x. * * @author Drak */ diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php index 8f91f06048718..6190d3ed1fd94 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; /** 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 06193c8befbeb..75be18befffa6 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php @@ -22,6 +22,7 @@ class MemcacheSessionHandlerTest extends TestCase { const PREFIX = 'prefix_'; const TTL = 1000; + /** * @var MemcacheSessionHandler */ diff --git a/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php b/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php index 71b090cf0b840..324e8d65d91f1 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php @@ -20,8 +20,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/Event/PostResponseEvent.php b/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php index 5d4450b357c5f..85f344749cce9 100644 --- a/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php @@ -23,15 +23,8 @@ */ class PostResponseEvent extends Event { - /** - * The kernel in which this event was thrown. - * - * @var HttpKernelInterface - */ private $kernel; - private $request; - private $response; public function __construct(HttpKernelInterface $kernel, Request $request, Response $response) diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index 66df1295fc131..16622091aafb8 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -41,8 +41,8 @@ class ProfilerListener implements EventSubscriberInterface /** * @param Profiler $profiler A Profiler 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 * @param RequestStack|null $requestStack A RequestStack instance */ public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false, RequestStack $requestStack = null) diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 7ca29d238aca6..0166331ff3535 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -309,7 +309,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 * @@ -426,7 +426,7 @@ protected function validate(Request $request, Response $entry, $catch = false) * This methods is triggered when the cache missed or a reload is required. * * @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/KernelEvents.php b/src/Symfony/Component/HttpKernel/KernelEvents.php index abbbfcc0048b9..8f86c566823a5 100644 --- a/src/Symfony/Component/HttpKernel/KernelEvents.php +++ b/src/Symfony/Component/HttpKernel/KernelEvents.php @@ -28,8 +28,6 @@ final class KernelEvents * instance. * * @Event - * - * @var string */ const REQUEST = 'kernel.request'; @@ -42,8 +40,6 @@ final class KernelEvents * instance. * * @Event - * - * @var string */ const EXCEPTION = 'kernel.exception'; @@ -57,8 +53,6 @@ final class KernelEvents * instance. * * @Event - * - * @var string */ const VIEW = 'kernel.view'; @@ -71,8 +65,6 @@ final class KernelEvents * Symfony\Component\HttpKernel\Event\FilterControllerEvent instance. * * @Event - * - * @var string */ const CONTROLLER = 'kernel.controller'; @@ -85,8 +77,6 @@ final class KernelEvents * Symfony\Component\HttpKernel\Event\FilterResponseEvent instance. * * @Event - * - * @var string */ const RESPONSE = 'kernel.response'; @@ -98,8 +88,6 @@ final class KernelEvents * Symfony\Component\HttpKernel\Event\PostResponseEvent instance. * * @Event - * - * @var string */ const TERMINATE = 'kernel.terminate'; @@ -112,8 +100,6 @@ final class KernelEvents * Symfony\Component\HttpKernel\Event\FinishRequestEvent instance. * * @Event - * - * @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 024ca28ac9bd8..5ebaae4f8d4ff 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/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/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 c4a69bb9a45c0..cf5870bc7971a 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -92,14 +92,7 @@ class IntlDateFormatter self::SHORT => 'h:mm a', ); - /** - * @var int - */ private $datetype; - - /** - * @var int - */ private $timetype; /** @@ -161,7 +154,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 2d5d4d36003ae..8b23fb08682d7 100644 --- a/src/Symfony/Component/Intl/Globals/IntlGlobals.php +++ b/src/Symfony/Component/Intl/Globals/IntlGlobals.php @@ -20,29 +20,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', @@ -52,15 +44,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 64b978d75288b..f68a60143a747 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -148,8 +148,6 @@ class NumberFormatter /** * Default values for the en locale. - * - * @var array */ private $attributes = array( self::FRACTION_DIGITS => 0, @@ -159,15 +157,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, @@ -176,8 +170,6 @@ class NumberFormatter /** * Supported attributes to the setAttribute() $attr argument. - * - * @var array */ private static $supportedAttributes = array( 'FRACTION_DIGITS' => self::FRACTION_DIGITS, @@ -189,8 +181,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, @@ -207,8 +197,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, @@ -220,8 +208,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, @@ -232,8 +218,6 @@ class NumberFormatter /** * The maximum value of the integer type in 32 bit platforms. - * - * @var int */ private static $int32Max = 2147483647; @@ -353,7 +337,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. * @@ -514,9 +498,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 * @@ -567,7 +551,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/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 cba98630533e0..656374c4d424a 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php @@ -35,29 +35,21 @@ class OptionsResolver implements Options, OptionsResolverInterface /** * 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(); @@ -70,22 +62,16 @@ class OptionsResolver implements Options, OptionsResolverInterface /** * 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(); @@ -93,8 +79,6 @@ class OptionsResolver implements Options, OptionsResolverInterface * 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(); @@ -105,8 +89,6 @@ class OptionsResolver implements Options, OptionsResolverInterface * 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/OptionsResolver/OptionsResolverInterface.php b/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php index 58e499e0ac8f4..24f343e026aa6 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php @@ -40,7 +40,7 @@ interface OptionsResolverInterface * * The closures should return the lazily created option value. * - * @param array $defaultValues a list of option names as keys and default + * @param array $defaultValues A list of option names as keys and default * values or closures as values * * @return $this @@ -55,7 +55,7 @@ public function setDefaults(array $defaultValues); * performance if the previous default value is calculated by an expensive * closure. * - * @param array $defaultValues a list of option names as keys and default + * @param array $defaultValues A list of option names as keys and default * values or closures as values * * @return $this @@ -92,7 +92,7 @@ public function setRequired($optionNames); /** * Sets allowed values for a list of options. * - * @param array $allowedValues a list of option names as keys and arrays + * @param array $allowedValues A list of option names as keys and arrays * with values acceptable for that option as * values * @@ -109,7 +109,7 @@ public function setAllowedValues($allowedValues); * * The values are merged with the allowed values defined previously. * - * @param array $allowedValues a list of option names as keys and arrays + * @param array $allowedValues A list of option names as keys and arrays * with values acceptable for that option as * values * @@ -124,7 +124,7 @@ public function addAllowedValues($allowedValues); /** * Sets allowed types for a list of options. * - * @param array $allowedTypes a list of option names as keys and type + * @param array $allowedTypes A list of option names as keys and type * names passed as string or array as values * * @return $this @@ -139,7 +139,7 @@ public function setAllowedTypes($allowedTypes); * * The types are merged with the allowed types defined previously. * - * @param array $allowedTypes a list of option names as keys and type + * @param array $allowedTypes A list of option names as keys and type * names passed as string or array as values * * @return $this diff --git a/src/Symfony/Component/Process/Pipes/AbstractPipes.php b/src/Symfony/Component/Process/Pipes/AbstractPipes.php index 1a94755bd71c1..d46a861388c9c 100644 --- a/src/Symfony/Component/Process/Pipes/AbstractPipes.php +++ b/src/Symfony/Component/Process/Pipes/AbstractPipes.php @@ -18,16 +18,15 @@ */ abstract class AbstractPipes implements PipesInterface { - /** @var array */ public $pipes = array(); - /** @var string */ private $inputBuffer = ''; - /** @var resource|null */ private $input; - /** @var bool */ private $blocked = true; + /** + * @param resource|null $input + */ public function __construct($input) { if (is_resource($input)) { diff --git a/src/Symfony/Component/Process/Pipes/UnixPipes.php b/src/Symfony/Component/Process/Pipes/UnixPipes.php index c4babcdf5c92c..b5b88358a40c6 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 $disableOutput; public function __construct($ttyMode, $ptyMode, $input, $disableOutput) diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index 87a781ea9204a..bcf1329f434ec 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 $disableOutput; public function __construct($disableOutput, $input) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 720e746b85ad4..05f7ecf833eac 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -1314,7 +1314,7 @@ protected function isSigchildEnabled() /** * Reads pipes for the freshest output. * - * @param $caller The name of the method that needs fresh outputs + * @param string $caller The name of the method that needs fresh outputs * * @throws LogicException in case output has been disabled or process is not started */ diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php index 11e67b091bb69..4b3ad6930b79a 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php @@ -18,14 +18,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/Routing/Loader/PhpFileLoader.php b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php index b4ba5fbc7f8ba..b77be26eada37 100644 --- a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -55,7 +55,7 @@ public function supports($resource, $type = null) * Safe include. Used for scope isolation. * * @param string $file File to include - * @param PhpFileLoader $loader the loader variable is exposed to the included file below + * @param PhpFileLoader $loader The loader variable is exposed to the included file below * * @return RouteCollection */ 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/Acl/Dbal/AclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php index 4a8d6b46394ce..cf65b6fb1d7b5 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php @@ -38,14 +38,7 @@ class AclProvider implements AclProviderInterface { const MAX_BATCH_SIZE = 30; - /** - * @var AclCacheInterface|null - */ protected $cache; - - /** - * @var Connection - */ protected $connection; protected $loadedAces = array(); protected $loadedAcls = array(); diff --git a/src/Symfony/Component/Security/Acl/Dbal/Schema.php b/src/Symfony/Component/Security/Acl/Dbal/Schema.php index a3d219a568d75..001670a422029 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/Schema.php +++ b/src/Symfony/Component/Security/Acl/Dbal/Schema.php @@ -24,7 +24,7 @@ final class Schema extends BaseSchema private $options; /** - * @param array $options the names for tables + * @param array $options The names for tables * @param Connection $connection */ public function __construct(array $options, Connection $connection = null) diff --git a/src/Symfony/Component/Security/Acl/Domain/AclCollectionCache.php b/src/Symfony/Component/Security/Acl/Domain/AclCollectionCache.php index 3041600c4bca1..afef90457b4eb 100644 --- a/src/Symfony/Component/Security/Acl/Domain/AclCollectionCache.php +++ b/src/Symfony/Component/Security/Acl/Domain/AclCollectionCache.php @@ -38,8 +38,8 @@ public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRet * Batch loads ACLs for an entire collection; thus, it reduces the number * of required queries considerably. * - * @param mixed $collection anything that can be passed to foreach() - * @param TokenInterface[] $tokens an array of TokenInterface implementations + * @param mixed $collection Anything that can be passed to foreach() + * @param TokenInterface[] $tokens An array of TokenInterface implementations */ public function cache($collection, array $tokens = array()) { diff --git a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php index 95d2887ead232..1b65259683280 100644 --- a/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/RoleSecurityIdentity.php @@ -24,7 +24,7 @@ final class RoleSecurityIdentity implements SecurityIdentityInterface private $role; /** - * @param mixed $role a Role instance, or its string representation + * @param mixed $role A Role instance, or its string representation */ public function __construct($role) { diff --git a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php index 96f3c9fe315a0..f4abc0bfbb517 100644 --- a/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php +++ b/src/Symfony/Component/Security/Acl/Domain/UserSecurityIdentity.php @@ -27,8 +27,8 @@ final class UserSecurityIdentity implements SecurityIdentityInterface private $class; /** - * @param string $username the username representation - * @param string $class the user's fully qualified class name + * @param string $username The username representation + * @param string $class The user's fully qualified class name * * @throws \InvalidArgumentException */ diff --git a/src/Symfony/Component/Security/Acl/Model/AclCacheInterface.php b/src/Symfony/Component/Security/Acl/Model/AclCacheInterface.php index e9ba0ec62cadb..0523420934665 100644 --- a/src/Symfony/Component/Security/Acl/Model/AclCacheInterface.php +++ b/src/Symfony/Component/Security/Acl/Model/AclCacheInterface.php @@ -21,7 +21,7 @@ interface AclCacheInterface /** * Removes an ACL from the cache. * - * @param string $primaryKey a serialized primary key + * @param string $primaryKey A serialized primary key */ public function evictFromCacheById($primaryKey); diff --git a/src/Symfony/Component/Security/Acl/Model/AclInterface.php b/src/Symfony/Component/Security/Acl/Model/AclInterface.php index 13a6cf8394e34..6226c08bb4638 100644 --- a/src/Symfony/Component/Security/Acl/Model/AclInterface.php +++ b/src/Symfony/Component/Security/Acl/Model/AclInterface.php @@ -106,7 +106,7 @@ public function isGranted(array $masks, array $securityIdentities, $administrati /** * Whether the ACL has loaded ACEs for all of the passed security identities. * - * @param mixed $securityIdentities an implementation of SecurityIdentityInterface, or an array thereof + * @param mixed $securityIdentities An implementation of SecurityIdentityInterface, or an array thereof * * @return bool */ diff --git a/src/Symfony/Component/Security/Acl/Model/MutableAclInterface.php b/src/Symfony/Component/Security/Acl/Model/MutableAclInterface.php index 2ba7bd5365ee4..40fdad3a9aa9d 100644 --- a/src/Symfony/Component/Security/Acl/Model/MutableAclInterface.php +++ b/src/Symfony/Component/Security/Acl/Model/MutableAclInterface.php @@ -123,7 +123,7 @@ public function setParentAcl(AclInterface $acl = null); * * @param int $index * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param string $strategy If null the strategy should not be changed */ public function updateClassAce($index, $mask, $strategy = null); @@ -133,7 +133,7 @@ public function updateClassAce($index, $mask, $strategy = null); * @param int $index * @param string $field * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param string $strategy If null the strategy should not be changed */ public function updateClassFieldAce($index, $field, $mask, $strategy = null); @@ -142,7 +142,7 @@ public function updateClassFieldAce($index, $field, $mask, $strategy = null); * * @param int $index * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param string $strategy If null the strategy should not be changed */ public function updateObjectAce($index, $mask, $strategy = null); @@ -152,7 +152,7 @@ public function updateObjectAce($index, $mask, $strategy = null); * @param int $index * @param string $field * @param int $mask - * @param string $strategy if null the strategy should not be changed + * @param string $strategy If null the strategy should not be changed */ public function updateObjectFieldAce($index, $field, $mask, $strategy = null); } diff --git a/src/Symfony/Component/Security/Acl/Permission/AbstractMaskBuilder.php b/src/Symfony/Component/Security/Acl/Permission/AbstractMaskBuilder.php index 5c50eb6bf6f99..0e4a4fd943572 100644 --- a/src/Symfony/Component/Security/Acl/Permission/AbstractMaskBuilder.php +++ b/src/Symfony/Component/Security/Acl/Permission/AbstractMaskBuilder.php @@ -16,13 +16,10 @@ */ abstract class AbstractMaskBuilder implements MaskBuilderInterface { - /** - * @var int - */ protected $mask; /** - * @param int $mask optional; defaults to 0 + * @param int $mask */ public function __construct($mask = 0) { diff --git a/src/Symfony/Component/Security/Core/AuthenticationEvents.php b/src/Symfony/Component/Security/Core/AuthenticationEvents.php index 13bce30768908..65d01f497b29f 100644 --- a/src/Symfony/Component/Security/Core/AuthenticationEvents.php +++ b/src/Symfony/Component/Security/Core/AuthenticationEvents.php @@ -21,8 +21,6 @@ final class AuthenticationEvents * Symfony\Component\Security\Core\Event\AuthenticationEvent instance. * * @Event - * - * @var string */ const AUTHENTICATION_SUCCESS = 'security.authentication.success'; @@ -35,8 +33,6 @@ final class AuthenticationEvents * instance. * * @Event - * - * @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 f65d1d9d5801b..bf419433cf944 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 { 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 fcf2e47088bf3..395c175faff80 100644 --- a/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php +++ b/src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php @@ -50,8 +50,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/SecurityContext.php b/src/Symfony/Component/Security/Core/SecurityContext.php index 027ff49480926..6d408373a6cdd 100644 --- a/src/Symfony/Component/Security/Core/SecurityContext.php +++ b/src/Symfony/Component/Security/Core/SecurityContext.php @@ -48,7 +48,7 @@ class SecurityContext implements SecurityContextInterface * * @param TokenStorageInterface|AuthenticationManagerInterface $tokenStorage * @param AuthorizationCheckerInterface|AccessDecisionManagerInterface $authorizationChecker - * @param bool $alwaysAuthenticate only applicable with old signature + * @param bool $alwaysAuthenticate Only applicable with old signature */ public function __construct($tokenStorage, $authorizationChecker, $alwaysAuthenticate = false) { 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 942a4a6350f27..b75bcdde2da25 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 AbstractConstraintValidatorTest { const PASSWORD = 's3Cr3t'; - const SALT = '^S4lt$'; /** diff --git a/src/Symfony/Component/Security/Core/Util/ClassUtils.php b/src/Symfony/Component/Security/Core/Util/ClassUtils.php index 6c8709668f248..6cceac27185b1 100644 --- a/src/Symfony/Component/Security/Core/Util/ClassUtils.php +++ b/src/Symfony/Component/Security/Core/Util/ClassUtils.php @@ -26,15 +26,11 @@ class ClassUtils { /** * Marker for Proxy class names. - * - * @var string */ const MARKER = '__CG__'; /** * Length of the proxy marker. - * - * @var int */ const MARKER_LENGTH = 6; 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 31e82ee5ecf62..5aa18d8e48fab 100644 --- a/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php +++ b/src/Symfony/Component/Security/Csrf/TokenGenerator/UriSafeTokenGenerator.php @@ -21,27 +21,14 @@ */ class UriSafeTokenGenerator implements TokenGeneratorInterface { - /** - * The generator for random values. - * - * @var SecureRandomInterface - */ private $random; - - /** - * The amount of entropy collected for each token (in bits). - * - * @var int - */ private $entropy; /** * Generates URI-safe CSRF tokens. * - * @param SecureRandomInterface|null $random The random value generator used for - * generating entropy - * @param int $entropy The amount of entropy collected for - * each token (in bits) + * @param SecureRandomInterface|null $random The random value generator used for generating entropy + * @param int $entropy The amount of entropy collected for each token (in bits) */ public function __construct(SecureRandomInterface $random = null, $entropy = 256) { diff --git a/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php b/src/Symfony/Component/Security/Csrf/TokenStorage/NativeSessionTokenStorage.php index 4923576e7c9b7..e817fdb902af8 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 e2f12d711dc00..9c0308b495d64 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 3bd80723d1ef5..0cbb0aebca20b 100644 --- a/src/Symfony/Component/Security/Http/SecurityEvents.php +++ b/src/Symfony/Component/Security/Http/SecurityEvents.php @@ -24,8 +24,6 @@ final class SecurityEvents * Symfony\Component\Security\Http\Event\InteractiveLoginEvent instance. * * @Event - * - * @var string */ const INTERACTIVE_LOGIN = 'security.interactive_login'; @@ -37,8 +35,6 @@ final class SecurityEvents * Symfony\Component\Security\Http\Event\SwitchUserEvent instance. * * @Event - * - * @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 4da7d288148d7..8858b42755f32 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 284f579a048ee..304a71b735ed1 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 19159f1d534fd..005b565d12113 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -154,7 +154,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) { @@ -252,8 +252,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) @@ -288,8 +286,6 @@ private function parseXml(\DOMNode $node) /** * Parse the input DOMNode attributes into an array. * - * @param \DOMNode $node xml to parse - * * @return array */ private function parseXmlAttributes(\DOMNode $node) @@ -322,8 +318,6 @@ private function parseXmlAttributes(\DOMNode $node) /** * 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) @@ -523,7 +517,7 @@ private function resolveXmlRootName(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 508881e84c2a7..ca2705cf2ac6c 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 d3a72caefb4cc..37ab24a075f51 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -78,7 +78,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 */ @@ -112,7 +112,7 @@ public function setCircularReferenceHandler($circularReferenceHandler) /** * Set normalization callbacks. * - * @param callable[] $callbacks help normalize the result + * @param callable[] $callbacks Help normalize the result * * @return self * 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 23df4829a8cbd..a739d4f2c0b14 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -21,10 +21,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 f7007840da1f4..b1e5bb8599a28 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -21,8 +21,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 2c5842d6a5484..5c64e156c34e6 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php @@ -27,9 +27,6 @@ */ class ObjectNormalizer extends AbstractNormalizer { - /** - * @var PropertyAccessorInterface - */ protected $propertyAccessor; public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyAccessorInterface $propertyAccessor = null) diff --git a/src/Symfony/Component/Serializer/Serializer.php b/src/Symfony/Component/Serializer/Serializer.php index 0259bfeda6441..37b49f3493b8b 100644 --- a/src/Symfony/Component/Serializer/Serializer.php +++ b/src/Symfony/Component/Serializer/Serializer.php @@ -180,7 +180,7 @@ public function supportsDenormalization($data, $type, $format = null) * 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 string $format Format name, present to give the option to normalizers to act differently based on formats * * @return NormalizerInterface|null */ @@ -196,9 +196,9 @@ private function getNormalizer($data, $format) /** * 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 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 * * @return DenormalizerInterface|null */ @@ -230,9 +230,9 @@ final public function decode($data, $format, array $context = array()) /** * 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 name, present to give the option to normalizers to act differently based on formats + * @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 The context data for this particular denormalization * * @return object 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/Stopwatch/Section.php b/src/Symfony/Component/Stopwatch/Section.php index f44ae17856620..7f3fd924c2206 100644 --- a/src/Symfony/Component/Stopwatch/Section.php +++ b/src/Symfony/Component/Stopwatch/Section.php @@ -65,7 +65,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 0828b78fc2784..25005bfcb0add 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -426,7 +426,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 */ @@ -441,7 +441,7 @@ function ($value) use ($that, $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 08005b097d54d..764281336493a 100644 --- a/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/CsvFileDumper.php @@ -44,8 +44,8 @@ public function format(MessageCatalogue $messages, $domain = 'messages') /** * 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 57fd4938d22cf..e138e64056cb0 100644 --- a/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php +++ b/src/Symfony/Component/Translation/Extractor/AbstractFileExtractor.php @@ -19,7 +19,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 */ @@ -75,7 +75,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 22401797acd6f..22596d8de6bef 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -68,9 +68,9 @@ public function load($resource, $locale, $domain = 'messages') /** * 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 50811d01aaf9f..70d5794981002 100644 --- a/src/Symfony/Component/Translation/Loader/MoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/MoFileLoader.php @@ -23,23 +23,17 @@ class MoFileLoader extends ArrayLoader /** * 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 85ab3c47f55c8..93237ed3a2508 100644 --- a/src/Symfony/Component/Translation/LoggingTranslator.php +++ b/src/Symfony/Component/Translation/LoggingTranslator.php @@ -23,9 +23,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 bac99dcfcf11f..673b12ac00b3e 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 b156c6dde9a16..d356594e167b1 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -25,15 +25,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 cdd162d816f98..4063c83ffe2e0 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -22,11 +22,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 15d51f9ff10c0..360ec5a8d9e8d 100644 --- a/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ExpressionValidator.php @@ -27,9 +27,6 @@ */ class ExpressionValidator extends ConstraintValidator { - /** - * @var PropertyAccessorInterface - */ private $propertyAccessor; /** @@ -38,16 +35,10 @@ class ExpressionValidator extends ConstraintValidator private $expressionLanguage; /** - * @param PropertyAccessorInterface|null $propertyAccessor Optional as of Symfony 2.5 - * * @throws UnexpectedTypeException If the property accessor is invalid */ - public function __construct($propertyAccessor = null) + public function __construct(PropertyAccessorInterface $propertyAccessor = null) { - if (null !== $propertyAccessor && !$propertyAccessor instanceof PropertyAccessorInterface) { - throw new UnexpectedTypeException($propertyAccessor, 'null or \Symfony\Component\PropertyAccess\PropertyAccessorInterface'); - } - $this->propertyAccessor = $propertyAccessor; } diff --git a/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php index 8182c41f8c1ca..cbd9935443209 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContextFactory.php @@ -24,14 +24,7 @@ */ class ExecutionContextFactory implements ExecutionContextFactoryInterface { - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var string|null - */ private $translationDomain; /** diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php index 37ca2a1d102b3..3d5181f09a6a0 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php @@ -26,9 +26,6 @@ */ class LegacyExecutionContext extends ExecutionContext { - /** - * @var MetadataFactoryInterface - */ private $metadataFactory; /** diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php index 757eb72a5bda2..5c541077bf169 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php @@ -28,19 +28,8 @@ */ class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface { - /** - * @var MetadataFactoryInterface - */ private $metadataFactory; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var string|null - */ private $translationDomain; /** diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index 52cccb2f68b7d..0603ffb62f937 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -28,39 +28,12 @@ */ class ExecutionContext implements ExecutionContextInterface { - /** - * @var GlobalExecutionContextInterface - */ private $globalContext; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; - - /** - * @var MetadataInterface - */ private $metadata; - - /** - * @var mixed - */ private $value; - - /** - * @var string - */ private $group; - - /** - * @var string - */ private $propertyPath; /** diff --git a/src/Symfony/Component/Validator/ExecutionContextInterface.php b/src/Symfony/Component/Validator/ExecutionContextInterface.php index d887124e33c0f..2f352fa6809dc 100644 --- a/src/Symfony/Component/Validator/ExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/ExecutionContextInterface.php @@ -150,9 +150,9 @@ public function addViolationAt($subPath, $message, array $parameters = array(), * @param null|string|string[] $groups The groups to validate in. If you don't pass any * groups here, the current group of the context * will be used. - * @param bool $traverse whether to traverse the value if it is an array + * @param bool $traverse Whether to traverse the value if it is an array * or an instance of \Traversable - * @param bool $deep whether to traverse the value recursively if + * @param bool $deep Whether to traverse the value recursively if * it is a collection of collections * * @deprecated since version 2.5, to be removed in 3.0. diff --git a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php index 82e1cf6bffd44..1a4f3074b6e4f 100644 --- a/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php +++ b/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php @@ -40,18 +40,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 a3b5f7ee8e973..c2d1bdf1cdb0c 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 af2060c2efe2b..612c45c06c8aa 100644 --- a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php @@ -30,8 +30,6 @@ abstract class MemberMetadata extends ElementMetadata 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. @@ -39,8 +37,6 @@ abstract class MemberMetadata extends ElementMetadata 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. @@ -48,8 +44,6 @@ abstract class MemberMetadata extends ElementMetadata 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/ValidationVisitor.php b/src/Symfony/Component/Validator/ValidationVisitor.php index 82af6a9e727de..8f1657083adf7 100644 --- a/src/Symfony/Component/Validator/ValidationVisitor.php +++ b/src/Symfony/Component/Validator/ValidationVisitor.php @@ -27,44 +27,13 @@ */ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionContextInterface { - /** - * @var mixed - */ private $root; - - /** - * @var MetadataFactoryInterface - */ private $metadataFactory; - - /** - * @var ConstraintValidatorFactoryInterface - */ private $validatorFactory; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; - - /** - * @var array - */ private $objectInitializers; - - /** - * @var ConstraintViolationList - */ private $violations; - - /** - * @var array - */ private $validatedObjects = array(); /** diff --git a/src/Symfony/Component/Validator/Validator.php b/src/Symfony/Component/Validator/Validator.php index c69c7a86b7927..27a2be8ad2506 100644 --- a/src/Symfony/Component/Validator/Validator.php +++ b/src/Symfony/Component/Validator/Validator.php @@ -28,29 +28,10 @@ */ class Validator implements ValidatorInterface, Mapping\Factory\MetadataFactoryInterface { - /** - * @var MetadataFactoryInterface - */ private $metadataFactory; - - /** - * @var ConstraintValidatorFactoryInterface - */ private $validatorFactory; - - /** - * @var TranslatorInterface - */ private $translator; - - /** - * @var null|string - */ private $translationDomain; - - /** - * @var array - */ private $objectInitializers; public function __construct( diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index a9e9f7f0e8a12..acb43283967ca 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 abd29087bc08a..7ab9527a3a9df 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveValidator.php @@ -28,24 +28,9 @@ */ class RecursiveValidator implements ValidatorInterface, LegacyValidatorInterface { - /** - * @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 4a69976ed2b11..05ccaac4fd435 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -39,24 +39,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/ValidatorInterface.php b/src/Symfony/Component/Validator/ValidatorInterface.php index fd7785b6ea24d..570ba99720dee 100644 --- a/src/Symfony/Component/Validator/ValidatorInterface.php +++ b/src/Symfony/Component/Validator/ValidatorInterface.php @@ -64,7 +64,7 @@ public function validateProperty($containingValue, $property, $groups = null); * * @param mixed $containingValue The value containing the property * @param string $property The name of the property to validate - * @param string $value the value to validate against the + * @param string $value The value to validate against the * constraints of the property * @param array|null $groups The validation groups to validate * diff --git a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php index bf887a08ec2b8..284841e2eb305 100644 --- a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php +++ b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php @@ -27,59 +27,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/Yaml/Dumper.php b/src/Symfony/Component/Yaml/Dumper.php index 05817f5d73063..96da91e551959 100644 --- a/src/Symfony/Component/Yaml/Dumper.php +++ b/src/Symfony/Component/Yaml/Dumper.php @@ -45,8 +45,8 @@ public function setIndentation($num) * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The level of indentation (used internally) - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string The YAML representation of the PHP value */ diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 1dd9761e970e6..9ff9b89c1c123 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -31,9 +31,9 @@ class Inline * Converts a YAML string to a PHP value. * * @param string $value A YAML string - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() * @param array $references Mapping of variable names to values * * @return mixed A PHP value @@ -87,8 +87,8 @@ public static function parse($value, $exceptionOnInvalidType = false, $objectSup * Dumps a given PHP variable to a YAML string. * * @param mixed $value The PHP variable to convert - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string The YAML string representing the PHP value * @@ -183,8 +183,8 @@ public static function isHash(array $value) * Dumps a PHP array to a YAML string. * * @param array $value The PHP array to dump - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string The YAML string representing the PHP array */ diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 6817e71ea8667..8ffa8ccf64940 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -49,9 +49,9 @@ public function __construct($offset = 0, $totalNumberOfLines = null, array $skip * Parses a YAML string to a PHP value. * * @param string $value A YAML string - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise + * @param bool $objectForMap True if maps should return a stdClass instead of array() * * @return mixed A PHP value * @@ -497,7 +497,7 @@ private function moveToPreviousLine() * @param string $value A YAML value * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types false otherwise * @param bool $objectSupport True if object support is enabled, false otherwise - * @param bool $objectForMap true if maps should return a stdClass instead of array() + * @param bool $objectForMap True if maps should return a stdClass instead of array() * * @return mixed A PHP value * diff --git a/src/Symfony/Component/Yaml/Yaml.php b/src/Symfony/Component/Yaml/Yaml.php index 62901ec075d32..7a579432ac09b 100644 --- a/src/Symfony/Component/Yaml/Yaml.php +++ b/src/Symfony/Component/Yaml/Yaml.php @@ -81,8 +81,8 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML * @param int $indent The amount of spaces to use for indentation of nested nodes - * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise - * @param bool $objectSupport true if object support is enabled, false otherwise + * @param bool $exceptionOnInvalidType True if an exception must be thrown on invalid types (a PHP resource or object), false otherwise + * @param bool $objectSupport True if object support is enabled, false otherwise * * @return string A YAML string representing the original PHP value */ From e664c81f127a5b7e15c2fc902618e0e28dddf34c Mon Sep 17 00:00:00 2001 From: Aaron Scherer Date: Mon, 30 Oct 2017 09:56:02 -0700 Subject: [PATCH 05/33] Throwing exception if redis and predis unavailable --- src/Symfony/Component/Cache/Traits/RedisTrait.php | 4 ++++ 1 file changed, 4 insertions(+) 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)) { From 996f6ef3cb4c95ccbcbb2aa87b5a345813325b5c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 30 Oct 2017 15:52:56 -0700 Subject: [PATCH 06/33] bumped Symfony version to 3.4.0 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 283b7227b316b..f4e4fb7a5171b 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-DEV'; const VERSION_ID = 30400; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 0; - const EXTRA_VERSION = 'BETA2'; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 71ad77aed354ca03494dffed6027dcec844d565c Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Tue, 31 Oct 2017 07:14:14 +0100 Subject: [PATCH 07/33] [HttpFoundation] add Early Hints in Reponse to fix test --- src/Symfony/Component/HttpFoundation/Response.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index a98a3772352ab..4aabc0da236b1 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', From 0d8edaec79f58a64891972dcd1da7a0b2c4b14da Mon Sep 17 00:00:00 2001 From: Kirk Madera Date: Mon, 30 Oct 2017 16:39:58 -0400 Subject: [PATCH 08/33] Removes \n or space when / are empty --- .../Monolog/Formatter/ConsoleFormatter.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php index ab474c1f58e3b..00da3bdac43f5 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']), From 30f3b91cadec8ef0586e7f0aba28fdf69b51af45 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 31 Oct 2017 08:12:41 -0700 Subject: [PATCH 09/33] removed extra whitespace --- src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php index 00da3bdac43f5..dbf43d51ff4c3 100644 --- a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php +++ b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php @@ -126,7 +126,7 @@ public function format(array $record) if ($context) { $context = $separator.$context; } - + $extra = $this->dumpData($record['extra']); if ($extra) { $extra = $separator.$extra; From f5855fb039f6a5854310f75813566eb40536ca1d Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Tue, 31 Oct 2017 13:23:23 +0100 Subject: [PATCH 10/33] [Validator] Fix TraceableValidator is reset on data collector instantiation --- .../FrameworkBundle/Resources/config/validator_debug.xml | 1 + .../Validator/DataCollector/ValidatorDataCollector.php | 1 - .../Tests/DataCollector/ValidatorDataCollectorTest.php | 5 ----- 3 files changed, 1 insertion(+), 6 deletions(-) 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/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/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) From fc3fe7f42ecdb4d0ba161a4216124848014a12ac Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Sat, 28 Oct 2017 21:55:36 +0200 Subject: [PATCH 11/33] [VarDumper] fix trailling comma when dumping an exception --- .../Component/VarDumper/Dumper/CliDumper.php | 11 ++++--- .../VarDumper/Tests/Dumper/CliDumperTest.php | 30 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 69e2c88e5ed25..cda6dbb31a974 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. @@ -494,10 +495,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/Tests/Dumper/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/Dumper/CliDumperTest.php index f9a208c6303bf..d736bd552a06b 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' From d56632a45fcf6fa04797dd1bf8c5b842082d0002 Mon Sep 17 00:00:00 2001 From: Valentin Date: Wed, 1 Nov 2017 12:36:38 +0300 Subject: [PATCH 12/33] FormInterface::getPropertyPath(): PropertyPathInterface|null --- src/Symfony/Component/Form/FormInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index fcfbaaf96ceb0..08e431ef1f50c 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(); From 95d0b7235f1d9c84d30c8a22146d0a2daced2cf8 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Tue, 31 Oct 2017 16:01:15 +0000 Subject: [PATCH 13/33] [HttpKernel] Let the storage manage the session starts --- .../DataCollector/RequestDataCollector.php | 4 ++-- .../DataCollector/RequestDataCollectorTest.php | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) 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/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 */ From 25e0117152f1297df26567e64e4dd4c7d9115c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Thu, 2 Nov 2017 16:55:00 +0100 Subject: [PATCH 14/33] [PhpUnitBridge] Fixed fatal error in CoverageListener when something goes wrong in Test::setUpBeforeClass --- src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php | 5 +++++ 1 file changed, 5 insertions(+) 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'); From 188eb34a71cd8cced2eb07a36076955c9c238acd Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Fri, 3 Nov 2017 11:31:11 +0100 Subject: [PATCH 15/33] Fix reference dump for deprecated nodes --- .../Config/Definition/Dumper/XmlReferenceDumper.php | 2 +- .../Definition/Dumper/YamlReferenceDumper.php | 13 +++++++------ .../Definition/Dumper/XmlReferenceDumperTest.php | 4 ++-- .../Definition/Dumper/YamlReferenceDumperTest.php | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) 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/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' - - + + Date: Fri, 3 Nov 2017 15:12:43 +0100 Subject: [PATCH 16/33] [Serializer] readd default argument value --- .../Serializer/Normalizer/AbstractObjectNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php index c1b2382a89996..a8c51de7ce1c9 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -108,7 +108,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']; From 5810983e30572b6ff53c1067097009b113822823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Fri, 3 Nov 2017 00:47:58 +0100 Subject: [PATCH 17/33] Fix displaying errors for bootstrap 4 --- .../views/Form/bootstrap_4_layout.html.twig | 57 ++++++++++++++++++- .../Form/bootstrap_base_layout.html.twig | 2 +- 2 files changed, 55 insertions(+), 4 deletions(-) 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 }}':''}) }} From 03c0254296f8b634a528b2c89d3ad453da9007e4 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sat, 4 Nov 2017 17:11:56 -0400 Subject: [PATCH 18/33] Only enabling validation if it is present --- .../DependencyInjection/FrameworkExtension.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index d7d0e16d56115..6824440524563 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'); From 44f6e6db2cc5d4d6e3a7ff2e0d864822046a7bfa Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sun, 5 Nov 2017 12:28:12 +0100 Subject: [PATCH 19/33] [Console] Fix CommandTester::setInputs() docblock --- src/Symfony/Component/Console/Tester/CommandTester.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ From beb4df712cf7413615dd8e9529154d2837e4503f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 4 Nov 2017 21:24:26 +0100 Subject: [PATCH 20/33] [DI] Fix "almost-circular" dependencies handling --- .../DependencyInjection/ContainerBuilder.php | 13 ++- .../DependencyInjection/Dumper/PhpDumper.php | 32 ++++-- .../Tests/ContainerBuilderTest.php | 9 ++ .../Tests/Dumper/PhpDumperTest.php | 16 +++ .../containers/container_almost_circular.php | 19 +++ .../Tests/Fixtures/includes/classes.php | 24 ++++ .../php/container_almost_circular.php | 108 ++++++++++++++++++ .../Tests/Fixtures/php/services9.php | 32 +++++- .../Tests/Fixtures/php/services9_as_files.txt | 36 +++++- .../Tests/Fixtures/php/services9_compiled.php | 36 +++++- .../Fixtures/php/services_legacy_privates.php | 8 +- .../Tests/Fixtures/php/services_locator.php | 14 ++- .../Fixtures/php/services_private_frozen.php | 16 ++- 13 files changed, 332 insertions(+), 31 deletions(-) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular.php diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 7018ca9b4a3bd..8e96e30c8574e 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) { @@ -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..9fd835fa00531 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -261,13 +261,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 +291,16 @@ private function addServiceLocalTempVariables($cId, Definition $definition, arra } if ('' !== $code) { + if ($isNonLazyShared) { + $code .= <<services['$cId'])) { + return \$this->services['$cId']; + } + +EOTXT; + } + $code .= "\n"; } @@ -495,7 +507,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 +515,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 +1408,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(); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 80c9eb4559809..dd6e19c5d837c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -1203,6 +1203,15 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } + public function testAlmostCircular() + { + $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..9268d5cf30093 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -764,6 +764,22 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } + public function testAlmostCircular() + { + $container = include self::$fixturesPath.'/containers/container_almost_circular.php'; + $container->compile(); + $dumper = new PhpDumper($container); + + $this->assertStringEqualsFile(self::$fixturesPath.'/php/container_almost_circular.php', $dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Almost_Circular'))); + + require self::$fixturesPath.'/php/container_almost_circular.php'; + + $container = new \Symfony_DI_PhpDumper_Test_Almost_Circular(); + $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..f4219187a5e85 --- /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) + ->addMethodCall('addFoobar', array(new Reference('foobar'))); + +$container->register('foobar', FoobarCircular::class) + ->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.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular.php new file mode 100644 index 0000000000000..b2913295f9941 --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular.php @@ -0,0 +1,108 @@ +services = array(); + $this->methodMap = array( + 'bar' => 'getBarService', + 'foo' => 'getFooService', + 'foobar' => 'getFoobarService', + ); + $this->privates = array( + 'bar' => true, + 'foobar' => true, + ); + + $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 '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 private '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 private '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); } /** From 645f7121901841699bee1dcdd9dda8aa48bbac97 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Sun, 5 Nov 2017 14:56:21 +0100 Subject: [PATCH 21/33] [FrameworkBundle][Config] fix: do not add resource checkers for debug=false --- .../DependencyInjection/FrameworkExtension.php | 5 +++++ .../DependencyInjection/FrameworkExtensionTest.php | 11 +++++++++++ .../Component/Config/ResourceCheckerConfigCache.php | 6 +++++- .../Config/Tests/ResourceCheckerConfigCacheTest.php | 8 +++++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index d7d0e16d56115..f7c55ce3f4b27 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -361,6 +361,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/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/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/ResourceCheckerConfigCacheTest.php b/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php index d39742ad88f8c..371c7baa1cc7d 100644 --- a/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php +++ b/src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php @@ -57,7 +57,7 @@ public function testCacheIsNotFreshIfEmpty() $this->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. */ From 661a4b60d083de3d64f8db0824137f383e102b10 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 27 Oct 2017 20:36:41 +0100 Subject: [PATCH 22/33] [Intl] Make intl-data tests pass and save language aliases again --- .../Data/Generator/LanguageDataGenerator.php | 12 +- .../Intl/Resources/data/languages/meta.json | 339 ++++- .../AbstractCurrencyDataProviderTest.php | 310 ++-- .../Provider/AbstractDataProviderTest.php | 1302 ++++++++--------- .../AbstractLanguageDataProviderTest.php | 161 +- .../AbstractLocaleDataProviderTest.php | 5 +- .../AbstractRegionDataProviderTest.php | 7 +- .../AbstractScriptDataProviderTest.php | 70 +- 8 files changed, 1250 insertions(+), 956 deletions(-) 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/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() From d1b343c015d4e13d669fda6a54efbf6d5a267c78 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Thu, 2 Nov 2017 19:07:23 +0100 Subject: [PATCH 23/33] [Serializer] Fix extra attributes when no group specified --- .../Normalizer/AbstractNormalizer.php | 12 +++++- .../Normalizer/AbstractObjectNormalizer.php | 1 - .../AbstractObjectNormalizerTest.php | 39 +++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index 6777889526b67..39a43d317114e 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -31,6 +31,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 @@ -201,7 +202,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; } @@ -210,7 +218,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 a8c51de7ce1c9..68e86da1f21e2 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php @@ -31,7 +31,6 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer { const ENABLE_MAX_DEPTH = 'enable_max_depth'; const DEPTH_KEY_PATTERN = 'depth_%s::%s'; - const ALLOW_EXTRA_ATTRIBUTES = 'allow_extra_attributes'; private $propertyTypeExtractor; private $attributesCache = array(); 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; + } +} From 79e8f57337113a8b5a8c56141a03c93ee53a9ca5 Mon Sep 17 00:00:00 2001 From: ReenExe Date: Sun, 29 Oct 2017 13:17:42 +0200 Subject: [PATCH 24/33] [HttpFoundation] refactoring: calculate when need --- src/Symfony/Component/HttpFoundation/Request.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 06144543d1a2e..a2ee7970b9110 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -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; From 2e0b263d9cc802a2a212cdaf4b87e6e9b8af525c Mon Sep 17 00:00:00 2001 From: Julien Falque Date: Mon, 23 Oct 2017 00:19:29 +0200 Subject: [PATCH 25/33] Fix dump panel hidden when closing a dump --- .../Resources/views/Profiler/toolbar_js.html.twig | 10 ++++++++++ src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | 7 +++++++ 2 files changed, 17 insertions(+) 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 2d3ab92e23d76..1b06d3445e8e4 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 @@ -58,6 +58,16 @@ } }; } + + 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/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index acc27b96d6ef1..85200b5a7b86d 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -142,6 +142,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); From 363d3a8cf26dd232df1654e13ca4cc18a992e86c Mon Sep 17 00:00:00 2001 From: Martin Hujer Date: Sun, 22 Oct 2017 20:54:24 +0200 Subject: [PATCH 26/33] [WebProfilerBundle] add missing tests --- .../WebDebugToolbarListenerTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php index 6f32b2101341d..b2efa6fae7d2c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php @@ -83,12 +83,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); From 51b15695f06a1a94de389c36661301a100c2aa43 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 5 Nov 2017 18:11:12 +0100 Subject: [PATCH 27/33] Fix merge --- src/Symfony/Component/Form/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index 30c2ce485a37b..17e912f86f903 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.11|~4.0", + "symfony/var-dumper": "~3.3.11|~3.4-beta3|~4.0", "symfony/console": "~3.4|~4.0" }, "conflict": { From e81005ed5e4ae2f4f53afda12cec49e8131df488 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 5 Nov 2017 18:23:26 +0100 Subject: [PATCH 28/33] [Form] Fix low deps --- src/Symfony/Component/Form/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json index 17e912f86f903..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.11|~3.4-beta3|~4.0", + "symfony/var-dumper": "~3.3.11|~3.4-beta3|~4.0-beta3", "symfony/console": "~3.4|~4.0" }, "conflict": { From db12a9872d05d7a1f4e1b044951d6d4e7b5fe53f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 5 Nov 2017 18:53:02 +0100 Subject: [PATCH 29/33] [DI] Fix the "almost-circular refs" fix --- .../DependencyInjection/Dumper/PhpDumper.php | 34 +++++---- .../Tests/ContainerBuilderTest.php | 13 +++- .../Tests/Dumper/PhpDumperTest.php | 26 ++++++- .../containers/container_almost_circular.php | 4 +- .../php/container_almost_circular_private.php | 75 +++++++++++++++++++ ...p => container_almost_circular_public.php} | 36 ++++----- 6 files changed, 148 insertions(+), 40 deletions(-) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_private.php rename src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/{container_almost_circular.php => container_almost_circular_public.php} (91%) diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 7f3a1984f6bf6..62d3e2bbd30b1 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1490,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/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index dd6e19c5d837c..ac73138a9dfd9 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -1203,8 +1203,19 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } - public function testAlmostCircular() + 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'); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 9268d5cf30093..3c330620c85a6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -764,17 +764,35 @@ public function testUninitializedReference() $this->assertEquals(array('foo1' => new \stdClass(), 'foo3' => new \stdClass()), iterator_to_array($bar->iter)); } - public function testAlmostCircular() + 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.php', $dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Almost_Circular'))); + $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.php'; + require self::$fixturesPath.'/php/container_almost_circular_private.php'; - $container = new \Symfony_DI_PhpDumper_Test_Almost_Circular(); + $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); 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 index f4219187a5e85..eaef674a3ec5b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php @@ -10,10 +10,10 @@ $container->register('foo', FooCircular::class)->setPublic(true) ->addArgument(new Reference('bar')); -$container->register('bar', BarCircular::class) +$container->register('bar', BarCircular::class)->setPublic($public) ->addMethodCall('addFoobar', array(new Reference('foobar'))); -$container->register('foobar', FoobarCircular::class) +$container->register('foobar', FoobarCircular::class)->setPublic($public) ->addArgument(new Reference('foo')); return $container; 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.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php similarity index 91% rename from src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular.php rename to src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php index b2913295f9941..5c4057d7fa1af 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_almost_circular_public.php @@ -14,7 +14,7 @@ * * @final since Symfony 3.3 */ -class Symfony_DI_PhpDumper_Test_Almost_Circular extends Container +class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container { private $parameters; private $targetDirs = array(); @@ -27,10 +27,6 @@ public function __construct() 'foo' => 'getFooService', 'foobar' => 'getFoobarService', ); - $this->privates = array( - 'bar' => true, - 'foobar' => true, - ); $this->aliases = array(); } @@ -61,37 +57,37 @@ public function isFrozen() } /** - * Gets the public 'foo' shared service. + * Gets the public 'bar' shared service. * - * @return \FooCircular + * @return \BarCircular */ - protected function getFooService() + protected function getBarService() { - $a = ${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->getBarService()) && false ?: '_'}; + $this->services['bar'] = $instance = new \BarCircular(); - if (isset($this->services['foo'])) { - return $this->services['foo']; - } + $instance->addFoobar(${($_ = isset($this->services['foobar']) ? $this->services['foobar'] : $this->getFoobarService()) && false ?: '_'}); - return $this->services['foo'] = new \FooCircular($a); + return $instance; } /** - * Gets the private 'bar' shared service. + * Gets the public 'foo' shared service. * - * @return \BarCircular + * @return \FooCircular */ - protected function getBarService() + protected function getFooService() { - $this->services['bar'] = $instance = new \BarCircular(); + $a = ${($_ = isset($this->services['bar']) ? $this->services['bar'] : $this->getBarService()) && false ?: '_'}; - $instance->addFoobar(${($_ = isset($this->services['foobar']) ? $this->services['foobar'] : $this->getFoobarService()) && false ?: '_'}); + if (isset($this->services['foo'])) { + return $this->services['foo']; + } - return $instance; + return $this->services['foo'] = new \FooCircular($a); } /** - * Gets the private 'foobar' shared service. + * Gets the public 'foobar' shared service. * * @return \FoobarCircular */ From e7cfaa9129eaa7c8be7318090041a4dcd009b8a0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 5 Nov 2017 19:13:53 +0100 Subject: [PATCH 30/33] Remove useless phpdoc --- .../PropertyInfo/Extractor/PhpDocExtractor.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php index a7bc0187665df..2ce31a0170669 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php @@ -41,20 +41,8 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property private $docBlockFactory; private $contextFactory; private $phpDocTypeHelper; - - /** - * @var string[] - */ private $mutatorPrefixes; - - /** - * @var string[] - */ private $accessorPrefixes; - - /** - * @var string[] - */ private $arrayMutatorPrefixes; /** From 00a1357d823bb55373dceb103699bdf448decbad Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Thu, 12 Oct 2017 11:48:23 +0100 Subject: [PATCH 31/33] [HttpFoundation] Fix forward-compat of NativeSessionStorage with PHP 7.2 --- .../Session/Storage/NativeSessionStorage.php | 7 ++++- .../Storage/NativeSessionStorageTest.php | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index 76654d26fd871..e35af4e291a70 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -102,6 +102,12 @@ class NativeSessionStorage implements SessionStorageInterface */ public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) { + $this->setMetadataBag($metaBag); + + if (\PHP_VERSION_ID >= 50400 && \PHP_SESSION_ACTIVE === session_status()) { + return; + } + $options += array( // disable by default because it's managed by HeaderBag (if used) 'cache_limiter' => '', @@ -114,7 +120,6 @@ public function __construct(array $options = array(), $handler = null, MetadataB register_shutdown_function('session_write_close'); } - $this->setMetadataBag($metaBag); $this->setOptions($options); $this->setSaveHandler($handler); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index 7eda5b3a3d275..673cd386bf6aa 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -270,4 +270,30 @@ public function testRestart() $this->assertSame($id, $storage->getId(), 'Same session ID after restarting'); $this->assertSame(7, $storage->getBag('attributes')->get('lucky'), 'Data still available'); } + + /** + * @requires PHP 5.4 + */ + public function testCanCreateNativeSessionStorageWhenSessionAlreadyStarted() + { + session_start(); + $this->getStorage(); + + // Assert no exception has been thrown by `getStorage()` + $this->addToAssertionCount(1); + } + + /** + * @requires PHP 5.4 + */ + public function testSetSessionOptionsOnceSessionStartedIsIgnored() + { + session_start(); + $this->getStorage(array( + 'name' => 'something-else', + )); + + // Assert no exception has been thrown by `getStorage()` + $this->addToAssertionCount(1); + } } From 76b2e1b84cbbcb1e91fb2e6817827f6cf1b0eadb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 5 Nov 2017 14:50:59 -0800 Subject: [PATCH 32/33] updated CHANGELOG for 3.4.0-BETA3 --- CHANGELOG-3.4.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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) From f317976fcf9e9bf03ea4528c4b58f0ff15917d41 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 5 Nov 2017 14:51:48 -0800 Subject: [PATCH 33/33] updated VERSION for 3.4.0-BETA3 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index f4e4fb7a5171b..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-DEV'; + 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 = 'DEV'; + const EXTRA_VERSION = 'BETA3'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021';