diff --git a/vendor/doctrine/common/.travis.yml b/vendor/doctrine/common/.travis.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/LICENSE b/vendor/doctrine/common/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/README.md b/vendor/doctrine/common/README.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/UPGRADE_TO_2_1 b/vendor/doctrine/common/UPGRADE_TO_2_1 old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/UPGRADE_TO_2_2 b/vendor/doctrine/common/UPGRADE_TO_2_2 old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/bin/travis-setup.php b/vendor/doctrine/common/bin/travis-setup.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/build.properties b/vendor/doctrine/common/build.properties old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/build.xml b/vendor/doctrine/common/build.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/composer.json b/vendor/doctrine/common/composer.json old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attribute.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Attributes.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Enum.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Required.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Annotation/Target.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocLexer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/FileCacheReader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/IndexedReader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/PhpParser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/Reader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Annotations/TokenParser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ApcCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ArrayCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/Cache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/CacheProvider.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/FileCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/FilesystemCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcacheCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/MemcachedCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/PhpFileCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/RedisCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/WinCacheCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/XcacheCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php b/vendor/doctrine/common/lib/Doctrine/Common/Cache/ZendDataCache.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php b/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Criteria.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ClosureExpressionVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Comparison.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/CompositeExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Expression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/ExpressionVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Expr/Value.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/ExpressionBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php b/vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php b/vendor/doctrine/common/lib/Doctrine/Common/CommonException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php b/vendor/doctrine/common/lib/Doctrine/Common/Comparable.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/EventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php b/vendor/doctrine/common/lib/Doctrine/Common/EventManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php b/vendor/doctrine/common/lib/Doctrine/Common/EventSubscriber.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php b/vendor/doctrine/common/lib/Doctrine/Common/Lexer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php b/vendor/doctrine/common/lib/Doctrine/Common/NotifyPropertyChanged.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ConnectionRegistry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ManagerRegistry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/PHPDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/StaticPHPDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/ReflectionService.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/StaticReflectionService.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectManagerAware.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/ObjectRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/PersistentObject.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php b/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Proxy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php b/vendor/doctrine/common/lib/Doctrine/Common/PropertyChangedListener.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ClassFinderInterface.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/Psr0FindFile.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/ReflectionProviderInterface.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionMethod.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionParser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php b/vendor/doctrine/common/lib/Doctrine/Common/Reflection/StaticReflectionProperty.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php b/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/lib/Doctrine/Common/Version.php b/vendor/doctrine/common/lib/Doctrine/Common/Version.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/phpunit.xml.dist b/vendor/doctrine/common/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DummyClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/DummyClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/FileCacheReaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/AnnotWithDefaultValue.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Autoload.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Autoload.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Route.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Route.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Template.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Version.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnum.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnum.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumInvalid.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumInvalid.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteral.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteral.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteralInvalid.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationEnumLiteralInvalid.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAll.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAll.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAnnotation.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetAnnotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetMethod.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetMethod.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetPropertyMethod.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationTargetPropertyMethod.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithAttributes.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithAttributes.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithConstants.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributes.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithRequiredAttributesWithoutContructor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithTargetSyntaxError.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithTargetSyntaxError.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithVarType.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/AnnotationWithVarType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Api.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassDDC1660.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationEnum.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationEnum.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithTargetSyntaxError.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithTargetSyntaxError.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithVarType.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithVarType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithClosure.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithClosure.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithConstants.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithFullyQualifiedUseStatements.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithFullyQualifiedUseStatements.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtMethod.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithInvalidAnnotationTargetAtProperty.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithRequire.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithRequire.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithValidAnnotationTarget.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/ClassWithValidAnnotationTarget.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsFirst.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsLast.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/DifferentNamespacesPerFileWithClassAsLast.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsFirst.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsFirst.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsLast.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/EqualNamespacesPerFileWithClassAsLast.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsFirst.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsFirst.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsLast.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/GlobalNamespacesPerFileWithClassAsLast.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/IntefaceWithConstants.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/IntefaceWithConstants.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageButIgnoredClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageButIgnoredClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/InvalidAnnotationUsageClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleClassesInFile.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleClassesInFile.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleImportsInUseStatement.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/MultipleImportsInUseStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceAndClassCommentedOut.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceAndClassCommentedOut.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClosureDeclaration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NoAnnotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NonNamespacedClass.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/NonNamespacedClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/TestInterface.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM55Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/TopLevelAnnotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ArrayCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/CacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/CacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/FilesystemCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/MemcachedCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/RedisCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/WinCacheCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/XcacheCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Cache/ZendDataCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassA.class.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassB.class.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassB.class.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassC.class.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassC.class.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassD.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/ClassLoaderTest/ClassD.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ClosureExpressionVisitorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CollectionTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/CriteriaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Collections/ExpressionBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/DoctrineExceptionTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/DoctrineExceptionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/EventManagerTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/EventManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticPHPDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/SymfonyFileLocatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/global.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/stdClass.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/DeeperNamespaceParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/DeeperNamespaceParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/Dummies/NoParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/Dummies/NoParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/FullyClassifiedParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/FullyClassifiedParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/NoParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/NoParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/SameNamespaceParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/StaticReflectionParserTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/StaticReflectionParserTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Reflection/UseParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php b/vendor/doctrine/common/tests/Doctrine/Tests/Common/Util/DebugTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/common/tests/Doctrine/Tests/DoctrineTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/common/tests/Doctrine/Tests/TestInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/NativePhpunitTask.php b/vendor/doctrine/common/tests/NativePhpunitTask.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/common/tests/README.markdown b/vendor/doctrine/common/tests/README.markdown old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/.travis.yml b/vendor/doctrine/dbal/.travis.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/LICENSE b/vendor/doctrine/dbal/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/README.md b/vendor/doctrine/dbal/README.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/UPGRADE b/vendor/doctrine/dbal/UPGRADE old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/bin/doctrine-dbal b/vendor/doctrine/dbal/bin/doctrine-dbal old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/bin/doctrine-dbal.php b/vendor/doctrine/dbal/bin/doctrine-dbal.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/bin/doctrine.php b/vendor/doctrine/dbal/bin/doctrine.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/build.properties b/vendor/doctrine/dbal/build.properties old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/build.xml b/vendor/doctrine/dbal/build.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/composer.json b/vendor/doctrine/dbal/composer.json old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/design/AZURE_FEDERATIONS.md b/vendor/doctrine/dbal/docs/design/AZURE_FEDERATIONS.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/design/SHARDING.md b/vendor/doctrine/dbal/docs/design/SHARDING.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/README.md b/vendor/doctrine/dbal/docs/examples/sharding/README.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/bootstrap.php b/vendor/doctrine/dbal/docs/examples/sharding/bootstrap.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/composer.json b/vendor/doctrine/dbal/docs/examples/sharding/composer.json old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/create_schema.php b/vendor/doctrine/dbal/docs/examples/sharding/create_schema.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/insert_data.php b/vendor/doctrine/dbal/docs/examples/sharding/insert_data.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/insert_data_aftersplit.php b/vendor/doctrine/dbal/docs/examples/sharding/insert_data_aftersplit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/query_filtering_off.php b/vendor/doctrine/dbal/docs/examples/sharding/query_filtering_off.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/query_filtering_on.php b/vendor/doctrine/dbal/docs/examples/sharding/query_filtering_on.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/split_federation.php b/vendor/doctrine/dbal/docs/examples/sharding/split_federation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/docs/examples/sharding/view_federation_members.php b/vendor/doctrine/dbal/docs/examples/sharding/view_federation_members.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOIbm/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ResultStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/Driver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/SQLSessionInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableAddColumnEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRemoveColumnEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaAlterTableRenameColumnEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaColumnDefinitionEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableColumnEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/SchemaIndexDefinitionEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Events.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGenerator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLAzurePlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown b/vendor/doctrine/dbal/lib/Doctrine/DBAL/README.markdown old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/SQLParserUtils.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractAsset.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Column.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ColumnDiff.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Comparator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Constraint.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Index.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Schema.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaConfig.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaDiff.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Sequence.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/SchemaSynchronizer.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/SchemaSynchronizer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizer.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Table.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/TableDiff.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/View.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/DropSchemaSqlCollector.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Graphviz.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/RemoveNamespacedAssets.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/Visitor/Visitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/PoolingShardConnection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/PoolingShardManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/SQLAzureShardManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/SQLAzure/Schema/MultiTenantVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardChoser/MultiTenantShardChoser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardChoser/ShardChoser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardManager.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardingException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Sharding/ShardingException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BlobType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BooleanType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeTzType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DecimalType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/FloatType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/GuidType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/GuidType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TextType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php b/vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/phpunit.xml.dist b/vendor/doctrine/dbal/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/ConnectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/DriverManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/MysqlSessionInitTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/OracleSessionInitTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Events/SQLSessionInitTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/BlobTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/LoggingTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/NamedParametersTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/Db2SchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SQLServerSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL168Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL202Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/WriteTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Logging/DebugStackTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Logging/DebugStackTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/IndexTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/MySqlSchemaManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaDiffTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SequenceTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/SequenceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Synchronizer/SingleDatabaseSynchronizerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/TableTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/RemoveNamespacedAssetsTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Schema/Visitor/SchemaSqlCollectorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/PoolingShardConnectionTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/PoolingShardConnectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/PoolingShardManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/PoolingShardManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/FunctionalTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/FunctionalTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/MultiTenantVisitorTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/MultiTenantVisitorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/SQLAzureFederationsSynchronizerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/SQLAzureShardManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/SQLAzureShardManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/ShardChoser/MultiTenantShardChoserTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Sharding/ShardChoser/MultiTenantShardChoserTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/StatementTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/StatementTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BlobTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/FloatTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/StringTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/TimeTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/UtilTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalFunctionalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DbalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DoctrineTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/ConnectionMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/DriverMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/Mocks/TaskMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/TestUtil.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/README.markdown b/vendor/doctrine/dbal/tests/README.markdown old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/travis/mysql.travis.xml b/vendor/doctrine/dbal/tests/travis/mysql.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/travis/mysqli.travis.xml b/vendor/doctrine/dbal/tests/travis/mysqli.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/travis/pgsql.travis.xml b/vendor/doctrine/dbal/tests/travis/pgsql.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/dbal/tests/travis/sqlite.travis.xml b/vendor/doctrine/dbal/tests/travis/sqlite.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/migrations/.travis.yml b/vendor/doctrine/migrations/.travis.yml new file mode 100755 index 0000000000..8680d05a74 --- /dev/null +++ b/vendor/doctrine/migrations/.travis.yml @@ -0,0 +1,7 @@ +language: php + +php: + - 5.3 + - 5.4 + +before_script: "composer install --dev" diff --git a/vendor/doctrine/migrations/LICENSE b/vendor/doctrine/migrations/LICENSE new file mode 100755 index 0000000000..feb7925e6f --- /dev/null +++ b/vendor/doctrine/migrations/LICENSE @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/vendor/doctrine/migrations/README.markdown b/vendor/doctrine/migrations/README.markdown new file mode 100755 index 0000000000..5ae0b94a9a --- /dev/null +++ b/vendor/doctrine/migrations/README.markdown @@ -0,0 +1,58 @@ +# Doctrine Database Migrations + +## Eric Clemmons' Modifications + +The latest official PHAR had path issues for me, so I made a couple of modifications and made +packaging a bit easier, especially when creating a custom PHAR for your own apps. + +[Download `doctrine-migrations.phar` with custom Input/Output CLI support](http://github.com/downloads/ericclemmons/migrations/doctrine-migrations.phar) + +### Modifications + +* Added `DiffCommand` for migrations. +* Support for custom `ArgvInput` in CLI instance +* Support for custom `ConsoleOutput` in CLI instance + +In the same way that Doctrine will attempt to load the return values from `migrations-db.php` as your +connection parameters, you can have `migrations-input.php` return: + + $input = new \Symfony\Component\Console\Input\ArgvInput; + ... make some changes ... + return $input; + +or have `migrations-output.php` return a customized `ConsoleOutput` with support for HTML tags in +your SQL statements: + + $output = new \Symfony\Component\Console\Output\ConsoleOutput; + $output->setStyle('p'); + return $output; + +This should give you the flexibility you need for customizing your input/output in the CLI. + +### Building Your Phar + +Simply run `php package.php`, which will create the file: `build/doctrine-migrations.phar` for you. +Done! :) This is a bit simpler than getting Phing/Ant going and running `phing build-migrations` and +hoping the rest of the build dependencies work. + +### Creating archive disabled by INI setting + +If you receive an error that looks like: + + creating archive "build/doctrine-migrations.phar" disabled by INI setting + +This can be fixed by setting the following in your php.ini: + + ; http://php.net/phar.readonly + phar.readonly = Off + +### Installing Dependencies + +To install dependencies issue the following commands: + + git submodule init + git submodule update + +## Official Documentation + +All available documentation can be found [here](http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/). diff --git a/vendor/doctrine/migrations/build.properties.dev b/vendor/doctrine/migrations/build.properties.dev new file mode 100755 index 0000000000..feda3a0670 --- /dev/null +++ b/vendor/doctrine/migrations/build.properties.dev @@ -0,0 +1,13 @@ +version=2.0.0ALPHA1 +stability=alpha +build.dir=build +dist.dir=dist +report.dir=reports +log.archive.dir=logs +test.phpunit_configuration_file= +test.phpunit_generate_coverage=0 +test.pmd_reports=0 +test.pdepend_exec= +test.phpmd_exec= +test.phpunit_configuration_option=phpunit-dest.xml +test.phpunit_coverage_option= \ No newline at end of file diff --git a/vendor/doctrine/migrations/build.xml b/vendor/doctrine/migrations/build.xml new file mode 100755 index 0000000000..b717e0006f --- /dev/null +++ b/vendor/doctrine/migrations/build.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DoctrineMigrations + Doctrine Database Migrations + pear.doctrine-project.org + The Doctrine migrations offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is easy to use and a very powerful tool! + + LGPL + + + - + + + + + + + + + \ No newline at end of file diff --git a/vendor/doctrine/migrations/composer.json b/vendor/doctrine/migrations/composer.json new file mode 100755 index 0000000000..427ef54cf2 --- /dev/null +++ b/vendor/doctrine/migrations/composer.json @@ -0,0 +1,28 @@ +{ + "name": "doctrine/migrations", + "type": "library", + "description": "Database Schema migrations using Doctrine DBAL", + "keywords": ["migrations", "database"], + "homepage": "http://www.doctrine-project.org", + "license": "LGPL", + "authors": [ + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"} + ], + "require": { + "php": ">=5.3.2", + "doctrine/dbal": ">=2.0,<2.5.x-dev" + }, + "require-dev": { + "symfony/console": "2.*", + "symfony/yaml": "2.*" + }, + "suggest": { + "symfony/console": "to run the migration from the console" + }, + "autoload": { + "psr-0": { + "Doctrine\\DBAL\\Migrations": "lib" + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/AbortMigrationException.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/AbortMigrationException.php new file mode 100755 index 0000000000..477c2159ab --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/AbortMigrationException.php @@ -0,0 +1,8 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +use Doctrine\DBAL\Schema\Schema, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Version; + +/** + * Abstract class for individual migrations to extend from. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +abstract class AbstractMigration +{ + /** + * The Migrations Configuration instance for this migration + * + * @var Configuration + */ + private $configuration; + + /** + * The OutputWriter object instance used for outputting information + * + * @var OutputWriter + */ + private $outputWriter; + + /** + * The Doctrine\DBAL\Connection instance we are migrating + * + * @var Connection + */ + protected $connection; + + /** + * Reference to the SchemaManager instance referened by $_connection + * + * @var \Doctrine\DBAL\Schema\AbstractSchemaManager + */ + protected $sm; + + /** + * Reference to the DatabasePlatform instance referenced by $_conection + * + * @var \Doctrine\DBAL\Platforms\AbstractPlatform + */ + protected $platform; + + /** + * Reference to the Version instance representing this migration + * + * @var Version + */ + protected $version; + + public function __construct(Version $version) + { + $this->configuration = $version->getConfiguration(); + $this->outputWriter = $this->configuration->getOutputWriter(); + $this->connection = $this->configuration->getConnection(); + $this->sm = $this->connection->getSchemaManager(); + $this->platform = $this->connection->getDatabasePlatform(); + $this->version = $version; + } + + /** + * Get custom migration name + * + * @return string + */ + public function getName() + { + } + + abstract public function up(Schema $schema); + abstract public function down(Schema $schema); + + protected function addSql($sql, array $params = array()) + { + return $this->version->addSql($sql, $params); + } + + protected function write($message) + { + $this->outputWriter->write($message); + } + + protected function throwIrreversibleMigrationException($message = null) + { + if ($message === null) { + $message = 'This migration is irreversible and cannot be reverted.'; + } + throw new IrreversibleMigrationException($message); + } + + /** + * Print a warning message if the condition evalutes to TRUE. + * + * @param bool $condition + * @param string $message + */ + public function warnIf($condition, $message = '') + { + $message = (strlen($message)) ? $message : 'Unknown Reason'; + + if ($condition === true) { + $this->outputWriter->write(' Warning during ' . $this->version->getExecutionState() . ': ' . $message . ''); + } + } + + /** + * Abort the migration if the condition evalutes to TRUE. + * + * @param bool $condition + * @param string $message + */ + public function abortIf($condition, $message = '') + { + $message = (strlen($message)) ? $message : 'Unknown Reason'; + + if ($condition === true) { + throw new AbortMigrationException($message); + } + } + + /** + * Skip this migration (but not the next ones) if condition evalutes to TRUE. + * + * @param bool $condition + * @param string $message + */ + public function skipIf($condition, $message = '') + { + $message = (strlen($message)) ? $message : 'Unknown Reason'; + + if ($condition === true) { + throw new SkipMigrationException($message); + } + } + + public function preUp(Schema $schema) + { + } + + public function postUp(Schema $schema) + { + } + + public function preDown(Schema $schema) + { + } + + public function postDown(Schema $schema) + { + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php new file mode 100755 index 0000000000..f64f8bda27 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php @@ -0,0 +1,93 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations\Configuration; + +use Doctrine\DBAL\Migrations\MigrationsException; + +/** + * Abstract Migration Configuration class for loading configuration information + * from a configuration file (xml or yml). + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +abstract class AbstractFileConfiguration extends Configuration +{ + /** + * The configuration file used to load configuration information + * + * @var string + */ + private $file; + + /** + * Whether or not the configuration file has been loaded yet or not + * + * @var bool + */ + private $loaded = false; + + /** + * Load the information from the passed configuration file + * + * @param string $file The path to the configuration file + * @return void + * @throws MigrationException $exception Throws exception if configuration file was already loaded + */ + public function load($file) + { + if ($this->loaded) { + throw MigrationsException::configurationFileAlreadyLoaded(); + } + if (file_exists($path = getcwd() . '/' . $file)) { + $file = $path; + } + $this->file = $file; + $this->doLoad($file); + $this->loaded = true; + } + + protected function getDirectoryRelativeToFile($file, $input) + { + $path = realpath(dirname($file) . '/' . $input); + if ($path !== false) { + $directory = $path; + } else { + $directory = $input; + } + return $directory; + } + + public function getFile() + { + return $this->file; + } + + /** + * Abstract method that each file configuration driver must implement to + * load the given configuration file whether it be xml, yaml, etc. or something + * else. + * + * @param string $file The path to a configuration file. + */ + abstract protected function doLoad($file); +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php new file mode 100755 index 0000000000..43caf650dc --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php @@ -0,0 +1,537 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations\Configuration; + +use Doctrine\DBAL\Connection, + Doctrine\DBAL\Migrations\MigrationException, + Doctrine\DBAL\Migrations\Version, + Doctrine\DBAL\Migrations\OutputWriter, + Doctrine\DBAL\Schema\Table, + Doctrine\DBAL\Schema\Column, + Doctrine\DBAL\Types\Type; + +/** + * Default Migration Configurtion object used for configuring an instance of + * the Migration class. Set the connection, version table name, register migration + * classes/versions, etc. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class Configuration +{ + /** + * Name of this set of migrations + * + * @var string + */ + private $name; + + /** + * Flag for whether or not the migration table has been created + * + * @var bool + */ + private $migrationTableCreated = false; + + /** + * Connection instance to use for migrations + * + * @var Connection + */ + private $connection; + + /** + * OutputWriter instance for writing output during migrations + * + * @var OutputWriter + */ + private $outputWriter; + + /** + * The migration table name to track versions in + * + * @var string + */ + private $migrationsTableName = 'doctrine_migration_versions'; + + /** + * The path to a directory where new migration classes will be written + * + * @var string + */ + private $migrationsDirectory; + + /** + * Namespace the migration classes live in + * + * @var string + */ + private $migrationsNamespace; + + /** + * Array of the registered migrations + * + * @var array + */ + private $migrations = array(); + + /** + * Construct a migration configuration object. + * + * @param Connection $connection A Connection instance + * @param OutputWriter $outputWriter A OutputWriter instance + */ + public function __construct(Connection $connection, OutputWriter $outputWriter = null) + { + $this->connection = $connection; + if ($outputWriter === null) { + $outputWriter = new OutputWriter(); + } + $this->outputWriter = $outputWriter; + } + + /** + * Validation that this instance has all the required properties configured + * + * @return void + * @throws MigrationException + */ + public function validate() + { + if ( ! $this->migrationsNamespace) { + throw MigrationException::migrationsNamespaceRequired(); + } + if ( ! $this->migrationsDirectory) { + throw MigrationException::migrationsDirectoryRequired(); + } + } + + /** + * Set the name of this set of migrations + * + * @param string $name The name of this set of migrations + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Returns the name of this set of migrations + * + * @return string $name The name of this set of migrations + */ + public function getName() + { + return $this->name; + } + + /** + * Returns the OutputWriter instance + * + * @return OutputWriter $outputWriter The OutputWriter instance + */ + public function getOutputWriter() + { + return $this->outputWriter; + } + + /** + * Returns a timestamp version as a formatted date + * + * @param string $version + * @return string $formattedVersion The formatted version + */ + public function formatVersion($version) + { + return sprintf('%s-%s-%s %s:%s:%s', + substr($version, 0, 4), + substr($version, 4, 2), + substr($version, 6, 2), + substr($version, 8, 2), + substr($version, 10, 2), + substr($version, 12, 2) + ); + } + + /** + * Returns the Connection instance + * + * @return Connection $connection The Connection instance + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Set the migration table name + * + * @param string $tableName The migration table name + */ + public function setMigrationsTableName($tableName) + { + $this->migrationsTableName = $tableName; + } + + /** + * Returns the migration table name + * + * @return string $migrationsTableName The migration table name + */ + public function getMigrationsTableName() + { + return $this->migrationsTableName; + } + + /** + * Set the new migrations directory where new migration classes are generated + * + * @param string $migrationsDirectory The new migrations directory + */ + public function setMigrationsDirectory($migrationsDirectory) + { + $this->migrationsDirectory = $migrationsDirectory; + } + + /** + * Returns the new migrations directory where new migration classes are generated + * + * @return string $migrationsDirectory The new migrations directory + */ + public function getMigrationsDirectory() + { + return $this->migrationsDirectory; + } + + /** + * Set the migrations namespace + * + * @param string $migrationsNamespace The migrations namespace + */ + public function setMigrationsNamespace($migrationsNamespace) + { + $this->migrationsNamespace = $migrationsNamespace; + } + + /** + * Returns the migrations namespace + * + * @return string $migrationsNamespace The migrations namespace + */ + public function getMigrationsNamespace() + { + return $this->migrationsNamespace; + } + + /** + * Register migrations from a given directory. Recursively finds all files + * with the pattern VersionYYYYMMDDHHMMSS.php as the filename and registers + * them as migrations. + * + * @param string $path The root directory to where some migration classes live. + * @return $migrations The array of migrations registered. + */ + public function registerMigrationsFromDirectory($path) + { + $path = realpath($path); + $path = rtrim($path, '/'); + $files = glob($path . '/Version*.php'); + $versions = array(); + if ($files) { + foreach ($files as $file) { + require_once($file); + $info = pathinfo($file); + $version = substr($info['filename'], 7); + $class = $this->migrationsNamespace . '\\' . $info['filename']; + $versions[] = $this->registerMigration($version, $class); + } + } + return $versions; + } + + /** + * Register a single migration version to be executed by a AbstractMigration + * class. + * + * @param string $version The version of the migration in the format YYYYMMDDHHMMSS. + * @param string $class The migration class to execute for the version. + */ + public function registerMigration($version, $class) + { + $version = (string) $version; + $class = (string) $class; + if (isset($this->migrations[$version])) { + throw MigrationException::duplicateMigrationVersion($version, get_class($this->migrations[$version])); + } + $version = new Version($this, $version, $class); + $this->migrations[$version->getVersion()] = $version; + ksort($this->migrations); + return $version; + } + + /** + * Register an array of migrations. Each key of the array is the version and + * the value is the migration class name. + * + * + * @param array $migrations + * @return void + */ + public function registerMigrations(array $migrations) + { + $versions = array(); + foreach ($migrations as $version => $class) { + $versions[] = $this->registerMigration($version, $class); + } + return $versions; + } + + /** + * Get the array of registered migration versions. + * + * @return array $migrations + */ + public function getMigrations() + { + return $this->migrations; + } + + /** + * Returns the Version instance for a given version in the format YYYYMMDDHHMMSS. + * + * @param string $version The version string in the format YYYYMMDDHHMMSS. + * @return Version $version + * @throws MigrationException $exception Throws exception if migration version does not exist. + */ + public function getVersion($version) + { + if ( ! isset($this->migrations[$version])) { + throw MigrationException::unknownMigrationVersion($version); + } + return $this->migrations[$version]; + } + + /** + * Check if a version exists. + * + * @param string $version + * @return bool $exists + */ + public function hasVersion($version) + { + return isset($this->migrations[$version]) ? true : false; + } + + /** + * Check if a version has been migrated or not yet + * + * @param Version $version + * @return bool $migrated + */ + public function hasVersionMigrated(Version $version) + { + $this->createMigrationTable(); + + $version = $this->connection->fetchColumn("SELECT version FROM " . $this->migrationsTableName . " WHERE version = ?", array($version->getVersion())); + return $version !== false ? true : false; + } + + /** + * Returns all migrated versions from the versions table, in an array. + * + * @return array $migrated + */ + public function getMigratedVersions() + { + $this->createMigrationTable(); + + $ret = $this->connection->fetchAll("SELECT version FROM " . $this->migrationsTableName); + $versions = array(); + foreach ($ret as $version) { + $versions[] = current($version); + } + + return $versions; + } + + /** + * Returns an array of available migration version numbers. + * + * @return array $availableVersions + */ + public function getAvailableVersions() + { + $availableVersions = array(); + foreach ($this->migrations as $migration) { + $availableVersions[] = $migration->getVersion(); + } + return $availableVersions; + } + + /** + * Returns the current migrated version from the versions table. + * + * @return bool $currentVersion + */ + public function getCurrentVersion() + { + $this->createMigrationTable(); + + $where = null; + if ($this->migrations) { + $migratedVersions = array(); + foreach ($this->migrations as $migration) { + $migratedVersions[] = sprintf("'%s'", $migration->getVersion()); + } + $where = " WHERE version IN (" . implode(', ', $migratedVersions) . ")"; + } + + $sql = sprintf("SELECT version FROM %s%s ORDER BY version DESC", + $this->migrationsTableName, $where + ); + + $sql = $this->connection->getDatabasePlatform()->modifyLimitQuery($sql, 1); + $result = $this->connection->fetchColumn($sql); + return $result !== false ? (string) $result : '0'; + } + + /** + * Returns the total number of executed migration versions + * + * @return integer $count + */ + public function getNumberOfExecutedMigrations() + { + $this->createMigrationTable(); + + $result = $this->connection->fetchColumn("SELECT COUNT(version) FROM " . $this->migrationsTableName); + return $result !== false ? $result : 0; + } + + /** + * Returns the total number of available migration versions + * + * @return integer $count + */ + public function getNumberOfAvailableMigrations() + { + return count($this->migrations); + } + + /** + * Returns the latest available migration version. + * + * @return string $version The version string in the format YYYYMMDDHHMMSS. + */ + public function getLatestVersion() + { + $versions = array_keys($this->migrations); + $latest = end($versions); + return $latest !== false ? (string) $latest : '0'; + } + + /** + * Create the migration table to track migrations with. + * + * @return bool $created Whether or not the table was created. + */ + public function createMigrationTable() + { + $this->validate(); + + if ($this->migrationTableCreated) { + return false; + } + + if ( ! $this->connection->getSchemaManager()->tablesExist(array($this->migrationsTableName))) { + $columns = array( + 'version' => new Column('version', Type::getType('string'), array('length' => 255)), + ); + $table = new Table($this->migrationsTableName, $columns); + $table->setPrimaryKey(array('version')); + $this->connection->getSchemaManager()->createTable($table); + + $this->migrationTableCreated = true; + + return true; + } + return false; + } + + /** + * Returns the array of migrations to executed based on the given direction + * and target version number. + * + * @param string $direction The direction we are migrating. + * @param string $to The version to migrate to. + * @return array $migrations The array of migrations we can execute. + */ + public function getMigrationsToExecute($direction, $to) + { + if ($direction === 'down') { + if (count($this->migrations)) { + $allVersions = array_reverse(array_keys($this->migrations)); + $classes = array_reverse(array_values($this->migrations)); + $allVersions = array_combine($allVersions, $classes); + } else { + $allVersions = array(); + } + } else { + $allVersions = $this->migrations; + } + $versions = array(); + $migrated = $this->getMigratedVersions(); + foreach ($allVersions as $version) { + if ($this->shouldExecuteMigration($direction, $version, $to, $migrated)) { + $versions[$version->getVersion()] = $version; + } + } + return $versions; + } + + /** + * Check if we should execute a migration for a given direction and target + * migration version. + * + * @param string $direction The direction we are migrating. + * @param Version $version The Version instance to check. + * @param string $to The version we are migrating to. + * @param array $migrated Migrated versions array. + * @return void + */ + private function shouldExecuteMigration($direction, Version $version, $to, $migrated) + { + if ($direction === 'down') { + if ( ! in_array($version->getVersion(), $migrated)) { + return false; + } + return $version->getVersion() > $to ? true : false; + } else if ($direction === 'up') { + if (in_array($version->getVersion(), $migrated)) { + return false; + } + return $version->getVersion() <= $to ? true : false; + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php new file mode 100755 index 0000000000..627f99c960 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php @@ -0,0 +1,58 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations\Configuration; + +/** + * Load migration configuration information from a XML configuration file. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class XmlConfiguration extends AbstractFileConfiguration +{ + /** + * @inheritdoc + */ + protected function doLoad($file) + { + $xml = simplexml_load_file($file); + if (isset($xml->name)) { + $this->setName((string) $xml->name); + } + if (isset($xml->table['name'])) { + $this->setMigrationsTableName((string) $xml->table['name']); + } + if (isset($xml->{'migrations-namespace'})) { + $this->setMigrationsNamespace((string) $xml->{'migrations-namespace'}); + } + if (isset($xml->{'migrations-directory'})) { + $migrationsDirectory = $this->getDirectoryRelativeToFile($file, (string) $xml->{'migrations-directory'}); + $this->setMigrationsDirectory($migrationsDirectory); + $this->registerMigrationsFromDirectory($migrationsDirectory); + } + if (isset($xml->migrations->migration)) { + foreach ($xml->migrations->migration as $migration) { + $this->registerMigration((string) $migration['version'], (string) $migration['class']); + } + } + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/YamlConfiguration.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/YamlConfiguration.php new file mode 100755 index 0000000000..7c16cb296c --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Configuration/YamlConfiguration.php @@ -0,0 +1,61 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations\Configuration; + +use Symfony\Component\Yaml\Yaml; + +/** + * Load migration configuration information from a YAML configuration file. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class YamlConfiguration extends AbstractFileConfiguration +{ + /** + * @inheritdoc + */ + protected function doLoad($file) + { + $array = Yaml::parse($file); + + if (isset($array['name'])) { + $this->setName($array['name']); + } + if (isset($array['table_name'])) { + $this->setMigrationsTableName($array['table_name']); + } + if (isset($array['migrations_namespace'])) { + $this->setMigrationsNamespace($array['migrations_namespace']); + } + if (isset($array['migrations_directory'])) { + $migrationsDirectory = $this->getDirectoryRelativeToFile($file, $array['migrations_directory']); + $this->setMigrationsDirectory($migrationsDirectory); + $this->registerMigrationsFromDirectory($migrationsDirectory); + } + if (isset($array['migrations']) && is_array($array['migrations'])) { + foreach ($array['migrations'] as $migration) { + $this->registerMigration($migration['version'], $migration['class']); + } + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/IrreversibleMigrationException.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/IrreversibleMigrationException.php new file mode 100755 index 0000000000..ae93cc3f37 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/IrreversibleMigrationException.php @@ -0,0 +1,33 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +/** + * Exception to be thrown in the down() methods of migrations that signifies it + * is an irreversible migration and stops execution. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class IrreversibleMigrationException extends \Exception +{ +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Migration.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Migration.php new file mode 100755 index 0000000000..5a68e2b156 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Migration.php @@ -0,0 +1,160 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +use Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Schema\Schema; + +/** + * Class for running migrations to the current version or a manually specified version. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class Migration +{ + /** + * The OutputWriter object instance used for outputting information + * + * @var OutputWriter + */ + private $outputWriter; + + /** + * @var Configuration + */ + private $configuration; + + /** + * Construct a Migration instance + * + * @param Configuration $configuration A migration Configuration instance + */ + public function __construct(Configuration $configuration) + { + $this->configuration = $configuration; + $this->outputWriter = $configuration->getOutputWriter(); + } + + /** + * Get the array of versions and SQL queries that would be executed for + * each version but do not execute anything. + * + * @param string $to The version to migrate to. + * @return array $sql The array of SQL queries. + */ + public function getSql($to = null) + { + return $this->migrate($to, true); + } + + /** + * Write a migration SQL file to the given path + * + * @param string $path The path to write the migration SQL file. + * @param string $to The version to migrate to. + * @return bool $written + */ + public function writeSqlFile($path, $to = null) + { + $sql = $this->getSql($to); + + $from = $this->configuration->getCurrentVersion(); + if ($to === null) { + $to = $this->configuration->getLatestVersion(); + } + + $string = sprintf("# Doctrine Migration File Generated on %s\n", date('Y-m-d H:m:s')); + $string .= sprintf("# Migrating from %s to %s\n", $from, $to); + + foreach ($sql as $version => $queries) { + $string .= "\n# Version " . $version . "\n"; + foreach ($queries as $query) { + $string .= $query . ";\n"; + } + } + if (is_dir($path)) { + $path = realpath($path); + $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql'; + } + + $this->outputWriter->write("\n".sprintf('Writing migration file to "%s"', $path)); + + return file_put_contents($path, $string); + } + + /** + * Run a migration to the current version or the given target version. + * + * @param string $to The version to migrate to. + * @param string $dryRun Whether or not to make this a dry run and not execute anything. + * @return array $sql The array of migration sql statements + * @throws MigrationException + */ + public function migrate($to = null, $dryRun = false) + { + if ($to === null) { + $to = $this->configuration->getLatestVersion(); + } + + $from = $this->configuration->getCurrentVersion(); + $from = (string) $from; + $to = (string) $to; + + $migrations = $this->configuration->getMigrations(); + if ( ! isset($migrations[$to]) && $to > 0) { + throw MigrationException::unknownMigrationVersion($to); + } + + $direction = $from > $to ? 'down' : 'up'; + $migrationsToExecute = $this->configuration->getMigrationsToExecute($direction, $to); + + if ($from === $to && empty($migrationsToExecute) && $migrations) { + return array(); + } + + if ($dryRun === false) { + $this->outputWriter->write(sprintf('Migrating %s to %s from %s', $direction, $to, $from)); + } else { + $this->outputWriter->write(sprintf('Executing dry run of migration %s to %s from %s', $direction, $to, $from)); + } + + if (empty($migrationsToExecute)) { + throw MigrationException::noMigrationsToExecute(); + } + + $sql = array(); + $time = 0; + foreach ($migrationsToExecute as $version) { + $versionSql = $version->execute($direction, $dryRun); + $sql[$version->getVersion()] = $versionSql; + $time += $version->getTime(); + } + + $this->outputWriter->write("\n ------------------------\n"); + $this->outputWriter->write(sprintf(" ++ finished in %s", $time)); + $this->outputWriter->write(sprintf(" ++ %s migrations executed", count($migrationsToExecute))); + $this->outputWriter->write(sprintf(" ++ %s sql queries", count($sql, true) - count($sql))); + + return $sql; + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationException.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationException.php new file mode 100755 index 0000000000..d7f8afc7fb --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationException.php @@ -0,0 +1,66 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +/** + * Class for Migrations specific exceptions + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class MigrationException extends \Exception +{ + public static function migrationsNamespaceRequired() + { + return new self('Migrations namespace must be configured in order to use Doctrine migrations.', 2); + } + + public static function migrationsDirectoryRequired() + { + return new self('Migrations directory must be configured in order to use Doctrine migrations.', 3); + } + + public static function noMigrationsToExecute() + { + return new self('Could not find any migrations to execute.', 4); + } + + public static function unknownMigrationVersion($version) + { + return new self(sprintf('Could not find migration version %s', $version), 5); + } + + public static function alreadyAtVersion($version) + { + return new self(sprintf('Database is already at version %s', $version), 6); + } + + public static function duplicateMigrationVersion($version, $class) + { + return new self(sprintf('Migration version %s already registered with class %s', $version, $class), 7); + } + + public static function configurationFileAlreadyLoaded() + { + return new self(sprintf('Migrations configuration file already loaded'), 8); + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationsVersion.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationsVersion.php new file mode 100755 index 0000000000..2c47932e46 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/MigrationsVersion.php @@ -0,0 +1,26 @@ +. + */ + + +namespace Doctrine\DBAL\Migrations; + +class MigrationsVersion +{ + const VERSION = '2.0.0-DEV'; +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/OutputWriter.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/OutputWriter.php new file mode 100755 index 0000000000..13f14a24d3 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/OutputWriter.php @@ -0,0 +1,52 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +/** + * Simple class for outputting information from migrations. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class OutputWriter +{ + private $closure; + + public function __construct(\Closure $closure = null) + { + if ($closure === null) { + $closure = function($message) {}; + } + $this->closure = $closure; + } + + /** + * Write output using the configured closure. + * + * @param string $message The message to write. + */ + public function write($message) + { + $closure = $this->closure; + $closure($message); + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/SkipMigrationException.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/SkipMigrationException.php new file mode 100755 index 0000000000..7f4dbe738b --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/SkipMigrationException.php @@ -0,0 +1,8 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Command\Command, + Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\Migration, + Doctrine\DBAL\Migrations\MigrationException, + Doctrine\DBAL\Migrations\OutputWriter, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Configuration\YamlConfiguration, + Doctrine\DBAL\Migrations\Configuration\XmlConfiguration; + +/** + * CLI Command for adding and deleting migration versions from the version table. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +abstract class AbstractCommand extends Command +{ + /** + * @var Configuration + */ + private $configuration; + + protected function configure() + { + $this->addOption('configuration', null, InputOption::VALUE_OPTIONAL, 'The path to a migrations configuration file.'); + $this->addOption('db-configuration', null, InputOption::VALUE_OPTIONAL, 'The path to a database connection configuration file.'); + } + + protected function outputHeader(Configuration $configuration, OutputInterface $output) + { + $name = $configuration->getName(); + $name = $name ? $name : 'Doctrine Database Migrations'; + $name = str_repeat(' ', 20) . $name . str_repeat(' ', 20); + $output->writeln('' . str_repeat(' ', strlen($name)) . ''); + $output->writeln('' . $name . ''); + $output->writeln('' . str_repeat(' ', strlen($name)) . ''); + $output->writeln(''); + } + + public function setMigrationConfiguration(Configuration $config) + { + $this->configuration = $config; + } + + /** + * @param InputInterface $input + * @param OutputInterface $output + * @return Configuration + */ + protected function getMigrationConfiguration(InputInterface $input, OutputInterface $output) + { + if ( ! $this->configuration) { + $outputWriter = new OutputWriter(function($message) use ($output) { + return $output->writeln($message); + }); + + if ($this->getApplication()->getHelperSet()->has('db')) { + $conn = $this->getHelper('db')->getConnection(); + } else if($input->getOption('db-configuration')) { + if (!file_exists($input->getOption('db-configuration'))) { + throw new \InvalidArgumentException("The specified connection file is not a valid file."); + } + + $params = include($input->getOption('db-configuration')); + if (!is_array($params)) { + throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.'); + } + $conn = \Doctrine\DBAL\DriverManager::getConnection($params); + } else if (file_exists('migrations-db.php')) { + $params = include("migrations-db.php"); + if (!is_array($params)) { + throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.'); + } + $conn = \Doctrine\DBAL\DriverManager::getConnection($params); + } else { + throw new \InvalidArgumentException('You have to specify a --db-configuration file or pass a Database Connection as a dependency to the Migrations.'); + } + + if ($input->getOption('configuration')) { + $info = pathinfo($input->getOption('configuration')); + $class = $info['extension'] === 'xml' ? 'Doctrine\DBAL\Migrations\Configuration\XmlConfiguration' : 'Doctrine\DBAL\Migrations\Configuration\YamlConfiguration'; + $configuration = new $class($conn, $outputWriter); + $configuration->load($input->getOption('configuration')); + } else if (file_exists('migrations.xml')) { + $configuration = new XmlConfiguration($conn, $outputWriter); + $configuration->load('migrations.xml'); + } else if (file_exists('migrations.yml')) { + $configuration = new YamlConfiguration($conn, $outputWriter); + $configuration->load('migrations.yml'); + } else { + $configuration = new Configuration($conn, $outputWriter); + } + $this->configuration = $configuration; + } + return $this->configuration; + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php new file mode 100755 index 0000000000..f41e6c3354 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php @@ -0,0 +1,129 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\ORM\Tools\SchemaTool, + Doctrine\DBAL\Version as DbalVersion, + Doctrine\DBAL\Migrations\Configuration\Configuration; + +/** + * Command for generate migration classes by comparing your current database schema + * to your mapping information. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class DiffCommand extends GenerateCommand +{ + protected function configure() + { + parent::configure(); + + $this + ->setName('migrations:diff') + ->setDescription('Generate a migration by comparing your current database to your mapping information.') + ->setHelp(<<%command.name% command generates a migration by comparing your current database to your mapping information: + + %command.full_name% + +You can optionally specify a --editor-cmd option to open the generated file in your favorite editor: + + %command.full_name% --editor-cmd=mate +EOT + ) + ->addOption('filter-expression', null, InputOption::VALUE_OPTIONAL, 'Tables which are filtered by Regular Expression.'); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $isDbalOld = (DbalVersion::compare('2.2.0') > 0); + $configuration = $this->getMigrationConfiguration($input, $output); + + $em = $this->getHelper('em')->getEntityManager(); + $conn = $em->getConnection(); + $platform = $conn->getDatabasePlatform(); + $metadata = $em->getMetadataFactory()->getAllMetadata(); + + if (empty($metadata)) { + $output->writeln('No mapping information to process.', 'ERROR'); + return; + } + + if ($filterExpr = $input->getOption('filter-expression')) { + if ($isDbalOld) { + throw new \InvalidArgumentException('The "--filter-expression" option can only be used as of Doctrine DBAL 2.2'); + } + + $conn->getConfiguration() + ->setFilterSchemaAssetsExpression($filterExpr); + } + + $tool = new SchemaTool($em); + + $fromSchema = $conn->getSchemaManager()->createSchema(); + $toSchema = $tool->getSchemaFromMetadata($metadata); + + //Not using value from options, because filters can be set from config.yml + if ( ! $isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) { + $tableNames = $toSchema->getTableNames(); + foreach ($tableNames as $tableName) { + $tableName = substr($tableName, strpos($tableName, '.') + 1); + if (!preg_match($filterExpr, $tableName)) { + $toSchema->dropTable($tableName); + } + } + } + + $up = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateToSql($toSchema, $platform)); + $down = $this->buildCodeFromSql($configuration, $fromSchema->getMigrateFromSql($toSchema, $platform)); + + if ( ! $up && ! $down) { + $output->writeln('No changes detected in your mapping information.', 'ERROR'); + return; + } + + $version = date('YmdHis'); + $path = $this->generateMigration($configuration, $input, $version, $up, $down); + + $output->writeln(sprintf('Generated new migration class to "%s" from schema differences.', $path)); + } + + private function buildCodeFromSql(Configuration $configuration, array $sql) + { + $currentPlatform = $configuration->getConnection()->getDatabasePlatform()->getName(); + $code = array( + "\$this->abortIf(\$this->connection->getDatabasePlatform()->getName() != \"$currentPlatform\");", "", + ); + foreach ($sql as $query) { + if (strpos($query, $configuration->getMigrationsTableName()) !== false) { + continue; + } + $code[] = "\$this->addSql(\"$query\");"; + } + return implode("\n", $code); + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php new file mode 100755 index 0000000000..d7b85a4b3b --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php @@ -0,0 +1,102 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\Migration, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Configuration\YamlConfiguration, + Doctrine\DBAL\Migrations\Configuration\XmlConfiguration; + +/** + * Command for executing single migrations up or down manually. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class ExecuteCommand extends AbstractCommand +{ + protected function configure() + { + $this + ->setName('migrations:execute') + ->setDescription('Execute a single migration version up or down manually.') + ->addArgument('version', InputArgument::REQUIRED, 'The version to execute.', null) + ->addOption('write-sql', null, InputOption::VALUE_NONE, 'The path to output the migration SQL file instead of executing it.') + ->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the migration as a dry run.') + ->addOption('up', null, InputOption::VALUE_NONE, 'Execute the migration up.') + ->addOption('down', null, InputOption::VALUE_NONE, 'Execute the migration down.') + ->setHelp(<<%command.name% command executes a single migration version up or down manually: + + %command.full_name% YYYYMMDDHHMMSS + +If no --up or --down option is specified it defaults to up: + + %command.full_name% YYYYMMDDHHMMSS --down + +You can also execute the migration as a --dry-run: + + %command.full_name% YYYYMMDDHHMMSS --dry-run + +You can output the would be executed SQL statements to a file with --write-sql: + + %command.full_name% YYYYMMDDHHMMSS --write-sql + +Or you can also execute the migration without a warning message wich you need to interact with: + + %command.full_name% --no-interaction +EOT + ); + + parent::configure(); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $version = $input->getArgument('version'); + $direction = $input->getOption('down') ? 'down' : 'up'; + + $configuration = $this->getMigrationConfiguration($input, $output); + $version = $configuration->getVersion($version); + + if ($path = $input->getOption('write-sql')) { + $path = is_bool($path) ? getcwd() : $path; + $version->writeSqlFile($path, $direction); + } else { + $noInteraction = $input->getOption('no-interaction') ? true : false; + if ($noInteraction === true) { + $version->execute($direction, $input->getOption('dry-run') ? true : false); + } else { + $confirmation = $this->getHelper('dialog')->askConfirmation($output, 'WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)', false); + if ($confirmation === true) { + $version->execute($direction, $input->getOption('dry-run') ? true : false); + } else { + $output->writeln('Migration cancelled!'); + } + } + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php new file mode 100755 index 0000000000..600118e0c0 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php @@ -0,0 +1,130 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\MigrationException, + Doctrine\DBAL\Migrations\Configuration\Configuration; + +/** + * Command for generating new blank migration classes + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class GenerateCommand extends AbstractCommand +{ + + private static $_template = + '; + +use Doctrine\DBAL\Migrations\AbstractMigration, + Doctrine\DBAL\Schema\Schema; + +/** + * Auto-generated Migration: Please modify to your need! + */ +class Version extends AbstractMigration +{ + public function up(Schema $schema) + { + // this up() migration is autogenerated, please modify it to your needs + + } + + public function down(Schema $schema) + { + // this down() migration is autogenerated, please modify it to your needs + + } +} +'; + + protected function configure() + { + $this + ->setName('migrations:generate') + ->setDescription('Generate a blank migration class.') + ->addOption('editor-cmd', null, InputOption::VALUE_OPTIONAL, 'Open file with this command upon creation.') + ->setHelp(<<%command.name% command generates a blank migration class: + + %command.full_name% + +You can optionally specify a --editor-cmd option to open the generated file in your favorite editor: + + %command.full_name% --editor-cmd=mate +EOT + ); + + parent::configure(); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $configuration = $this->getMigrationConfiguration($input, $output); + + $version = date('YmdHis'); + $path = $this->generateMigration($configuration, $input, $version); + + $output->writeln(sprintf('Generated new migration class to "%s"', $path)); + } + + protected function generateMigration(Configuration $configuration, InputInterface $input, $version, $up = null, $down = null) + { + $placeHolders = array( + '', + '', + '', + '' + ); + $replacements = array( + $configuration->getMigrationsNamespace(), + $version, + $up ? " " . implode("\n ", explode("\n", $up)) : null, + $down ? " " . implode("\n ", explode("\n", $down)) : null + ); + $code = str_replace($placeHolders, $replacements, self::$_template); + $dir = $configuration->getMigrationsDirectory(); + $dir = $dir ? $dir : getcwd(); + $dir = rtrim($dir, '/'); + $path = $dir . '/Version' . $version . '.php'; + + if (!file_exists($dir)) { + throw new \InvalidArgumentException(sprintf('Migrations directory "%s" does not exist.', $dir)); + } + + file_put_contents($path, $code); + + if ($editorCmd = $input->getOption('editor-cmd')) { + shell_exec($editorCmd . ' ' . escapeshellarg($path)); + } + + return $path; + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php new file mode 100755 index 0000000000..27f1366d6b --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/MigrateCommand.php @@ -0,0 +1,128 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\Migration, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Configuration\YamlConfiguration, + Doctrine\DBAL\Migrations\Configuration\XmlConfiguration; + +/** + * Command for executing a migration to a specified version or the latest available version. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class MigrateCommand extends AbstractCommand +{ + protected function configure() + { + $this + ->setName('migrations:migrate') + ->setDescription('Execute a migration to a specified version or the latest available version.') + ->addArgument('version', InputArgument::OPTIONAL, 'The version to migrate to.', null) + ->addOption('write-sql', null, InputOption::VALUE_NONE, 'The path to output the migration SQL file instead of executing it.') + ->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the migration as a dry run.') + ->setHelp(<<%command.name% command executes a migration to a specified version or the latest available version: + + %command.full_name% + +You can optionally manually specify the version you wish to migrate to: + + %command.full_name% YYYYMMDDHHMMSS + +You can also execute the migration as a --dry-run: + + %command.full_name% YYYYMMDDHHMMSS --dry-run + +You can output the would be executed SQL statements to a file with --write-sql: + + %command.full_name% YYYYMMDDHHMMSS --write-sql + +Or you can also execute the migration without a warning message which you need to interact with: + + %command.full_name% --no-interaction + +EOT + ); + + parent::configure(); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $version = $input->getArgument('version'); + + $configuration = $this->getMigrationConfiguration($input, $output); + $migration = new Migration($configuration); + + $this->outputHeader($configuration, $output); + + $noInteraction = $input->getOption('no-interaction') ? true : false; + + $executedMigrations = $configuration->getMigratedVersions(); + $availableMigrations = $configuration->getAvailableVersions(); + $executedUnavailableMigrations = array_diff($executedMigrations, $availableMigrations); + + if ($executedUnavailableMigrations) { + $output->writeln(sprintf('WARNING! You have %s previously executed migrations in the database that are not registered migrations.', count($executedUnavailableMigrations))); + foreach ($executedUnavailableMigrations as $executedUnavailableMigration) { + $output->writeln(' >> ' . $configuration->formatVersion($executedUnavailableMigration) . ' (' . $executedUnavailableMigration . ')'); + } + + if ( ! $noInteraction) { + $confirmation = $this->getHelper('dialog')->askConfirmation($output, 'Are you sure you wish to continue? (y/n)', false); + if ( ! $confirmation) { + $output->writeln('Migration cancelled!'); + return 1; + } + } + } + + if ($path = $input->getOption('write-sql')) { + $path = is_bool($path) ? getcwd() : $path; + $migration->writeSqlFile($path, $version); + } else { + $dryRun = $input->getOption('dry-run') ? true : false; + + // warn the user if no dry run and interaction is on + if ( ! $dryRun && ! $noInteraction) { + $confirmation = $this->getHelper('dialog')->askConfirmation($output, 'WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)', false); + if ( ! $confirmation) { + $output->writeln('Migration cancelled!'); + return 1; + } + } + + $sql = $migration->migrate($version, $dryRun); + + if ( ! $sql) { + $output->writeln('No migrations to execute.'); + } + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/StatusCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/StatusCommand.php new file mode 100755 index 0000000000..a2b07d8790 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/StatusCommand.php @@ -0,0 +1,126 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\Migration, + Doctrine\DBAL\Migrations\MigrationException, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Configuration\YamlConfiguration, + Doctrine\DBAL\Migrations\Configuration\XmlConfiguration; + +/** + * Command to view the status of a set of migrations. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class StatusCommand extends AbstractCommand +{ + protected function configure() + { + $this + ->setName('migrations:status') + ->setDescription('View the status of a set of migrations.') + ->addOption('show-versions', null, InputOption::VALUE_NONE, 'This will display a list of all available migrations and their status') + ->setHelp(<<%command.name% command outputs the status of a set of migrations: + + %command.full_name% + +You can output a list of all available migrations and their status with --show-versions: + + %command.full_name% --show-versions +EOT + ); + + parent::configure(); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $configuration = $this->getMigrationConfiguration($input, $output); + + $currentVersion = $configuration->getCurrentVersion(); + if ($currentVersion) { + $currentVersionFormatted = $configuration->formatVersion($currentVersion) . ' ('.$currentVersion.')'; + } else { + $currentVersionFormatted = 0; + } + $latestVersion = $configuration->getLatestVersion(); + if ($latestVersion) { + $latestVersionFormatted = $configuration->formatVersion($latestVersion) . ' ('.$latestVersion.')'; + } else { + $latestVersionFormatted = 0; + } + + $executedMigrations = $configuration->getMigratedVersions(); + $availableMigrations = $configuration->getAvailableVersions(); + $executedUnavailableMigrations = array_diff($executedMigrations, $availableMigrations); + $numExecutedUnavailableMigrations = count($executedUnavailableMigrations); + $newMigrations = count($availableMigrations) - count($executedMigrations); + + $output->writeln("\n == Configuration\n"); + + $info = array( + 'Name' => $configuration->getName() ? $configuration->getName() : 'Doctrine Database Migrations', + 'Database Driver' => $configuration->getConnection()->getDriver()->getName(), + 'Database Name' => $configuration->getConnection()->getDatabase(), + 'Configuration Source' => $configuration instanceof \Doctrine\DBAL\Migrations\Configuration\AbstractFileConfiguration ? $configuration->getFile() : 'manually configured', + 'Version Table Name' => $configuration->getMigrationsTableName(), + 'Migrations Namespace' => $configuration->getMigrationsNamespace(), + 'Migrations Directory' => $configuration->getMigrationsDirectory(), + 'Current Version' => $currentVersionFormatted, + 'Latest Version' => $latestVersionFormatted, + 'Executed Migrations' => count($executedMigrations), + 'Executed Unavailable Migrations' => $numExecutedUnavailableMigrations > 0 ? ''.$numExecutedUnavailableMigrations.'' : 0, + 'Available Migrations' => count($availableMigrations), + 'New Migrations' => $newMigrations > 0 ? '' . $newMigrations . '' : 0 + ); + foreach ($info as $name => $value) { + $output->writeln(' >> ' . $name . ': ' . str_repeat(' ', 50 - strlen($name)) . $value); + } + + $showVersions = $input->getOption('show-versions') ? true : false; + if ($showVersions === true) { + if ($migrations = $configuration->getMigrations()) { + $output->writeln("\n == Available Migration Versions\n"); + $migratedVersions = $configuration->getMigratedVersions(); + foreach ($migrations as $version) { + $isMigrated = in_array($version->getVersion(), $migratedVersions); + $status = $isMigrated ? 'migrated' : 'not migrated'; + $output->writeln(' >> ' . $configuration->formatVersion($version->getVersion()) . ' (' . $version->getVersion() . ')' . str_repeat(' ', 30 - strlen($name)) . $status); + } + } + + if ($executedUnavailableMigrations) { + $output->writeln("\n == Previously Executed Unavailable Migration Versions\n"); + foreach ($executedUnavailableMigrations as $executedUnavailableMigration) { + $output->writeln(' >> ' . $configuration->formatVersion($executedUnavailableMigration) . ' (' . $executedUnavailableMigration . ')'); + } + } + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/VersionCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/VersionCommand.php new file mode 100755 index 0000000000..1c2497bd06 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/VersionCommand.php @@ -0,0 +1,95 @@ +. + */ + +namespace Doctrine\DBAL\Migrations\Tools\Console\Command; + +use Symfony\Component\Console\Input\InputInterface, + Symfony\Component\Console\Output\OutputInterface, + Symfony\Component\Console\Input\InputArgument, + Symfony\Component\Console\Input\InputOption, + Doctrine\DBAL\Migrations\Migration, + Doctrine\DBAL\Migrations\MigrationException, + Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Migrations\Configuration\YamlConfiguration, + Doctrine\DBAL\Migrations\Configuration\XmlConfiguration; + +/** + * Command for manually adding and deleting migration versions from the version table. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan Wage + */ +class VersionCommand extends AbstractCommand +{ + protected function configure() + { + $this + ->setName('migrations:version') + ->setDescription('Manually add and delete migration versions from the version table.') + ->addArgument('version', InputArgument::REQUIRED, 'The version to add or delete.', null) + ->addOption('add', null, InputOption::VALUE_NONE, 'Add the specified version.') + ->addOption('delete', null, InputOption::VALUE_NONE, 'Delete the specified version.') + ->setHelp(<<%command.name% command allows you to manually add and delete migration versions from the version table: + + %command.full_name% YYYYMMDDHHMMSS --add + +If you want to delete a version you can use the --delete option: + + %command.full_name% YYYYMMDDHHMMSS --delete +EOT + ); + + parent::configure(); + } + + public function execute(InputInterface $input, OutputInterface $output) + { + $configuration = $this->getMigrationConfiguration($input, $output); + $migration = new Migration($configuration); + + if ($input->getOption('add') === false && $input->getOption('delete') === false) { + throw new \InvalidArgumentException('You must specify whether you want to --add or --delete the specified version.'); + } + + $version = $input->getArgument('version'); + $markMigrated = $input->getOption('add') ? true : false; + + if ( ! $configuration->hasVersion($version)) { + throw MigrationException::unknownMigrationVersion($version); + } + + $version = $configuration->getVersion($version); + if ($markMigrated && $configuration->hasVersionMigrated($version)) { + throw new \InvalidArgumentException(sprintf('The version "%s" already exists in the version table.', $version)); + } + + if ( ! $markMigrated && ! $configuration->hasVersionMigrated($version)) { + throw new \InvalidArgumentException(sprintf('The version "%s" does not exists in the version table.', $version)); + } + + if ($markMigrated) { + $version->markMigrated(); + } else { + $version->markNotMigrated(); + } + } +} diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Version.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Version.php new file mode 100755 index 0000000000..a0333de8f4 --- /dev/null +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Version.php @@ -0,0 +1,353 @@ +. +*/ + +namespace Doctrine\DBAL\Migrations; + +use Doctrine\DBAL\Migrations\Configuration\Configuration, + Doctrine\DBAL\Schema\Schema; + +/** + * Class which wraps a migration version and allows execution of the + * individual migration version up or down method. + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.org + * @since 2.0 + * @author Jonathan H. Wage + */ +class Version +{ + const STATE_NONE = 0; + const STATE_PRE = 1; + const STATE_EXEC = 2; + const STATE_POST = 3; + + /** + * The Migrations Configuration instance for this migration + * + * @var Configuration + */ + private $configuration; + + /** + * The OutputWriter object instance used for outputting information + * + * @var OutputWriter + */ + private $outputWriter; + + /** + * The version in timestamp format (YYYYMMDDHHMMSS) + * + * @param int + */ + private $version; + + /** + * @var AbstractSchemaManager + */ + private $sm; + + /** + * @var AbstractPlatform + */ + private $platform; + + /** + * The migration instance for this version + * + * @var AbstractMigration + */ + private $migration; + + /** + * @var Connection + */ + private $connection; + + /** + * @var string + */ + private $class; + + /** The array of collected SQL statements for this version */ + private $sql = array(); + + /** The array of collected parameters for SQL statements for this version */ + private $params = array(); + + /** The array of collected types for SQL statements for this version */ + private $types = array(); + + /** The time in seconds that this migration version took to execute */ + private $time; + + /** + * @var int + */ + private $state = self::STATE_NONE; + + public function __construct(Configuration $configuration, $version, $class) + { + $this->configuration = $configuration; + $this->outputWriter = $configuration->getOutputWriter(); + $this->class = $class; + $this->connection = $configuration->getConnection(); + $this->sm = $this->connection->getSchemaManager(); + $this->platform = $this->connection->getDatabasePlatform(); + $this->migration = new $class($this); + $this->version = $this->migration->getName() ?: $version; + } + + /** + * Returns the string version in the format YYYYMMDDHHMMSS + * + * @return string $version + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns the Migrations Configuration object instance + * + * @return Configuration $configuration + */ + public function getConfiguration() + { + return $this->configuration; + } + + /** + * Check if this version has been migrated or not. + * + * @param bool $bool + * @return mixed + */ + public function isMigrated() + { + return $this->configuration->hasVersionMigrated($this); + } + + public function markMigrated() + { + $this->configuration->createMigrationTable(); + $this->connection->executeQuery("INSERT INTO " . $this->configuration->getMigrationsTableName() . " (version) VALUES (?)", array($this->version)); + } + + public function markNotMigrated() + { + $this->configuration->createMigrationTable(); + $this->connection->executeQuery("DELETE FROM " . $this->configuration->getMigrationsTableName() . " WHERE version = ?", array($this->version)); + } + + /** + * Add some SQL queries to this versions migration + * + * @param mixed $sql + * @param array $params + * @param array $types + * @return void + */ + public function addSql($sql, array $params = array(), array $types = array()) + { + if (is_array($sql)) { + foreach ($sql as $key => $query) { + $this->sql[] = $query; + if (isset($params[$key])) { + $this->params[count($this->sql) - 1] = $params[$key]; + $this->types[count($this->sql) - 1] = isset($types[$key]) ? $types[$key] : array(); + } + } + } else { + $this->sql[] = $sql; + if ($params) { + $this->params[count($this->sql) - 1] = $params; + $this->types[count($this->sql) - 1] = $types ?: array(); + } + } + } + + /** + * Write a migration SQL file to the given path + * + * @param string $path The path to write the migration SQL file. + * @param string $direction The direction to execute. + * @return bool $written + */ + public function writeSqlFile($path, $direction = 'up') + { + $queries = $this->execute($direction, true); + + $string = sprintf("# Doctrine Migration File Generated on %s\n", date('Y-m-d H:m:s')); + + $string .= "\n# Version " . $this->version . "\n"; + foreach ($queries as $query) { + $string .= $query . ";\n"; + } + if (is_dir($path)) { + $path = realpath($path); + $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql'; + } + + $this->outputWriter->write("\n".sprintf('Writing migration file to "%s"', $path)); + + return file_put_contents($path, $string); + } + + /** + * @return AbstractMigration + */ + public function getMigration() + { + return $this->migration; + } + + /** + * Execute this migration version up or down and and return the SQL. + * + * @param string $direction The direction to execute the migration. + * @param string $dryRun Whether to not actually execute the migration SQL and just do a dry run. + * @return array $sql + * @throws Exception when migration fails + */ + public function execute($direction, $dryRun = false) + { + $this->sql = array(); + + $this->connection->beginTransaction(); + + try { + $start = microtime(true); + + $this->state = self::STATE_PRE; + $fromSchema = $this->sm->createSchema(); + $this->migration->{'pre' . ucfirst($direction)}($fromSchema); + + if ($direction === 'up') { + $this->outputWriter->write("\n" . sprintf(' ++ migrating %s', $this->version) . "\n"); + } else { + $this->outputWriter->write("\n" . sprintf(' -- reverting %s', $this->version) . "\n"); + } + + $this->state = self::STATE_EXEC; + + $toSchema = clone $fromSchema; + $this->migration->$direction($toSchema); + $this->addSql($fromSchema->getMigrateToSql($toSchema, $this->platform)); + + if ($dryRun === false) { + if ($this->sql) { + foreach ($this->sql as $key => $query) { + if ( ! isset($this->params[$key])) { + $this->outputWriter->write(' -> ' . $query); + $this->connection->executeQuery($query); + } else { + $this->outputWriter->write(sprintf(' - %s (with parameters)', $query)); + $this->connection->executeQuery($query, $this->params[$key], $this->types[$key]); + } + } + } else { + $this->outputWriter->write(sprintf('Migration %s was executed but did not result in any SQL statements.', $this->version)); + } + + if ($direction === 'up') { + $this->markMigrated(); + } else { + $this->markNotMigrated(); + } + + } else { + foreach ($this->sql as $query) { + $this->outputWriter->write(' -> ' . $query); + } + } + + $this->state = self::STATE_POST; + $this->migration->{'post' . ucfirst($direction)}($toSchema); + + $end = microtime(true); + $this->time = round($end - $start, 2); + if ($direction === 'up') { + $this->outputWriter->write(sprintf("\n ++ migrated (%ss)", $this->time)); + } else { + $this->outputWriter->write(sprintf("\n -- reverted (%ss)", $this->time)); + } + + $this->connection->commit(); + + return $this->sql; + } catch(SkipMigrationException $e) { + $this->connection->rollback(); + + if ($dryRun == false) { + // now mark it as migrated + if ($direction === 'up') { + $this->markMigrated(); + } else { + $this->markNotMigrated(); + } + } + + $this->outputWriter->write(sprintf("\n SS skipped (Reason: %s)", $e->getMessage())); + } catch (\Exception $e) { + + $this->outputWriter->write(sprintf( + 'Migration %s failed during %s. Error %s', + $this->version, $this->getExecutionState(), $e->getMessage() + )); + + $this->connection->rollback(); + + $this->state = self::STATE_NONE; + throw $e; + } + $this->state = self::STATE_NONE; + } + + public function getExecutionState() + { + switch($this->state) { + case self::STATE_PRE: + return 'Pre-Checks'; + case self::STATE_POST: + return 'Post-Checks'; + case self::STATE_EXEC: + return 'Execution'; + default: + return 'No State'; + } + } + + /** + * Returns the time this migration version took to execute + * + * @return integer $time The time this migration version took to execute + */ + public function getTime() + { + return $this->time; + } + + public function __toString() + { + return $this->version; + } +} diff --git a/vendor/doctrine/migrations/package.php b/vendor/doctrine/migrations/package.php new file mode 100755 index 0000000000..b970a72d25 --- /dev/null +++ b/vendor/doctrine/migrations/package.php @@ -0,0 +1,41 @@ + + */ + +$buildDir = realpath(dirname(__FILE__)) . '/build'; + +$pharName = "$buildDir/doctrine-migrations.phar"; + +if (!file_exists($buildDir)) { + mkdir($buildDir); +} + +if (file_exists($pharName)) { + unlink($pharName); +} + +$p = new Phar($pharName); +$p->CompressFiles(Phar::GZ); +$p->setSignatureAlgorithm(Phar::SHA1); + +$p->startBuffering(); + +$dirs = array( + './lib' => '/Doctrine\/DBAL\/Migrations/', + './lib/vendor/doctrine-dbal/lib' => '/Doctrine/', + './lib/vendor/doctrine-common/lib' => '/Doctrine/', + './lib/vendor' => '/Symfony/' +); + +foreach ($dirs as $dir => $filter) { + $p->buildFromDirectory($dir, $filter); +} + +$p->stopBuffering(); + +$p->setStub(file_get_contents('phar-cli-stub.php')); diff --git a/vendor/doctrine/migrations/phar-cli-stub.php b/vendor/doctrine/migrations/phar-cli-stub.php new file mode 100755 index 0000000000..69adbf6306 --- /dev/null +++ b/vendor/doctrine/migrations/phar-cli-stub.php @@ -0,0 +1,83 @@ +. + */ + + +Phar::mapPhar(); + +require_once 'phar://'.__FILE__.'/Doctrine/Common/ClassLoader.php'; + +$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', 'phar://'.__FILE__); +$classLoader->register(); + +$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', 'phar://'.__FILE__); +$classLoader->register(); + +$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'phar://'.__FILE__); +$classLoader->register(); + +// Support for using the Doctrine ORM convention of providing a `cli-config.php` file. +$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php'; + +$helperSet = null; +if (file_exists($configFile)) { + if ( ! is_readable($configFile)) { + trigger_error( + 'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR + ); + } + + require $configFile; + + foreach ($GLOBALS as $helperSetCandidate) { + if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) { + $helperSet = $helperSetCandidate; + break; + } + } +} + +$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet(); +$helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog'); + +$cli = new \Symfony\Component\Console\Application('Doctrine Migrations', \Doctrine\DBAL\Migrations\MigrationsVersion::VERSION); +$cli->setCatchExceptions(true); +$cli->setHelperSet($helperSet); +$cli->addCommands(array( + // Migrations Commands + new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), + new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), + new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), + new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), + new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand() +)); +if ($helperSet->has('em')) { + $cli->add(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand()); +} + +$input = file_exists('migrations-input.php') + ? include('migrations-input.php') + : null; + +$output = file_exists('migrations-output.php') + ? include('migrations-output.php') + : null; + +$cli->run($input, $output); + +__HALT_COMPILER(); \ No newline at end of file diff --git a/vendor/doctrine/migrations/phpunit.xml.dist b/vendor/doctrine/migrations/phpunit.xml.dist new file mode 100755 index 0000000000..59a641874e --- /dev/null +++ b/vendor/doctrine/migrations/phpunit.xml.dist @@ -0,0 +1,15 @@ + + + + + + ./tests/Doctrine/ + + + + + + ./lib/ + + + \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/AbstractConfigurationTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/AbstractConfigurationTest.php new file mode 100755 index 0000000000..244a85b8d4 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/AbstractConfigurationTest.php @@ -0,0 +1,35 @@ +loadConfiguration(); + $this->assertEquals("/path/to/migrations/classes/DoctrineMigrations", $config->getMigrationsDirectory()); + } + + public function testMigrationNamespace() + { + $config = $this->loadConfiguration(); + $this->assertEquals("DoctrineMigrationsTest", $config->getMigrationsNamespace()); + } + + public function testMigrationName() + { + $config = $this->loadConfiguration(); + $this->assertEquals("Doctrine Sandbox Migrations", $config->getName()); + } + + public function testMigrationsTable() + { + $config = $this->loadConfiguration(); + $this->assertEquals('doctrine_migration_versions_test', $config->getMigrationsTableName()); + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/XmlConfigurationTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/XmlConfigurationTest.php new file mode 100755 index 0000000000..0f0cffb343 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/XmlConfigurationTest.php @@ -0,0 +1,16 @@ +getSqliteConnection()); + $config->load(__DIR__ . "/_files/config.xml"); + + return $config; + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/YamlConfigurationTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/YamlConfigurationTest.php new file mode 100755 index 0000000000..ad4cbc48b8 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/YamlConfigurationTest.php @@ -0,0 +1,16 @@ +getSqliteConnection()); + $config->load(__DIR__ . "/_files/config.yml"); + + return $config; + } +} diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.xml b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.xml new file mode 100755 index 0000000000..39801d1ad7 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.xml @@ -0,0 +1,12 @@ + + + + Doctrine Sandbox Migrations + DoctrineMigrationsTest + + /path/to/migrations/classes/DoctrineMigrations + + diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.yml b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.yml new file mode 100755 index 0000000000..ab62aee8c8 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Configuration/_files/config.yml @@ -0,0 +1,5 @@ +--- +name: Doctrine Sandbox Migrations +migrations_namespace: DoctrineMigrationsTest +table_name: doctrine_migration_versions_test +migrations_directory: /path/to/migrations/classes/DoctrineMigrations diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php new file mode 100755 index 0000000000..e119074990 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php @@ -0,0 +1,151 @@ +getSqliteConnection(); + $config = new Configuration($conn); + + $this->assertSame($conn, $config->getConnection()); + } + + public function testValidateMigrationsNamespaceRequired() + { + $config = new Configuration($this->getSqliteConnection()); + + $this->setExpectedException("Doctrine\DBAL\Migrations\MigrationException", "Migrations namespace must be configured in order to use Doctrine migrations."); + $config->validate(); + } + + public function testValidateMigrationsDirectoryRequired() + { + $config = new Configuration($this->getSqliteConnection()); + $config->setMigrationsNamespace("DoctrineMigrations\\"); + + $this->setExpectedException("Doctrine\DBAL\Migrations\MigrationException", "Migrations directory must be configured in order to use Doctrine migrations."); + $config->validate(); + } + + public function testValidateMigrations() + { + $config = new Configuration($this->getSqliteConnection()); + $config->setMigrationsNamespace("DoctrineMigrations\\"); + $config->setMigrationsDirectory(sys_get_temp_dir()); + + $config->validate(); + } + + public function testSetGetName() + { + $config = new Configuration($this->getSqliteConnection()); + $config->setName('Test'); + + $this->assertEquals('Test', $config->getName()); + } + + public function testMigrationsTable() + { + $config = new Configuration($this->getSqliteConnection()); + + $this->assertEquals("doctrine_migration_versions", $config->getMigrationsTableName()); + } + + public function testEmptyProjectDefaults() + { + $config = $this->getSqliteConfiguration(); + $this->assertEquals(0, $config->getCurrentVersion(), "current version 0"); + $this->assertEquals(0, $config->getLatestVersion(), "latest version 0"); + $this->assertEquals(0, $config->getNumberOfAvailableMigrations(), "number of available migrations 0"); + $this->assertEquals(0, $config->getNumberOfExecutedMigrations(), "number of executed migrations 0"); + $this->assertEquals(array(), $config->getMigrations()); + } + + public function testGetUnknownVersion() + { + $config = $this->getSqliteConfiguration(); + + $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Could not find migration version 1234'); + $config->getVersion(1234); + } + + public function testRegisterMigration() + { + $config = $this->getSqliteConfiguration(); + $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration'); + + $this->assertEquals(1, count($config->getMigrations()), "One Migration registered."); + $this->assertTrue($config->hasVersion(1234)); + + $version = $config->getVersion(1234); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version); + $this->assertEquals(1234, $version->getVersion()); + $this->assertFalse($version->isMigrated()); + } + + public function testRegisterMigrations() + { + $config = $this->getSqliteConfiguration(); + $config->registerMigrations(array( + 1234 => 'Doctrine\DBAL\Migrations\Tests\ConfigMigration', + 1235 => 'Doctrine\DBAL\Migrations\Tests\Config2Migration', + )); + + $this->assertEquals(2, count($config->getMigrations()), "Two Migration registered."); + + $version = $config->getVersion(1234); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version); + + $version = $config->getVersion(1235); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Version', $version); + } + + public function testRegisterDuplicateVersion() + { + $config = $this->getSqliteConfiguration(); + + $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration'); + + $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Migration version 1234 already registered with class Doctrine\DBAL\Migrations\Version'); + $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration'); + } + + public function testGetAvailableVersions() + { + $config = $this->getSqliteConfiguration(); + + $config->registerMigration(1234, 'Doctrine\DBAL\Migrations\Tests\ConfigMigration'); + $this->assertEquals(array(1234), $config->getAvailableVersions()); + } +} + +class ConfigMigration extends \Doctrine\DBAL\Migrations\AbstractMigration +{ + public function down(Schema $schema) + { + + } + + public function up(Schema $schema) + { + + } +} + +class Config2Migration extends \Doctrine\DBAL\Migrations\AbstractMigration +{ + public function down(Schema $schema) + { + + } + + public function up(Schema $schema) + { + + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Functional/FunctionalTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Functional/FunctionalTest.php new file mode 100755 index 0000000000..87cba592f0 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/Functional/FunctionalTest.php @@ -0,0 +1,311 @@ +connection = $this->getSqliteConnection(); + $this->config = new Configuration($this->connection); + $this->config->setMigrationsNamespace('Doctrine\DBAL\Migrations\Tests\Functional'); + $this->config->setMigrationsDirectory('.'); + } + + public function testMigrateUp() + { + $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + + $this->assertFalse($this->config->hasVersionMigrated($version)); + $version->execute('up'); + + $schema = $this->connection->getSchemaManager()->createSchema(); + $this->assertTrue($schema->hasTable('foo')); + $this->assertTrue($schema->getTable('foo')->hasColumn('id')); + $this->assertTrue($this->config->hasVersionMigrated($version)); + } + + public function testMigrateDown() + { + $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + + $this->assertFalse($this->config->hasVersionMigrated($version)); + $version->execute('up'); + + $schema = $this->connection->getSchemaManager()->createSchema(); + $this->assertTrue($schema->hasTable('foo')); + $this->assertTrue($schema->getTable('foo')->hasColumn('id')); + $this->assertTrue($this->config->hasVersionMigrated($version)); + + $version->execute('down'); + $schema = $this->connection->getSchemaManager()->createSchema(); + $this->assertFalse($schema->hasTable('foo')); + $this->assertFalse($this->config->hasVersionMigrated($version)); + + } + + public function testSkipMigrateUp() + { + $version = new \Doctrine\DBAL\Migrations\Version($this->config, 1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration'); + + $this->assertFalse($this->config->hasVersionMigrated($version)); + $version->execute('up'); + + $schema = $this->connection->getSchemaManager()->createSchema(); + $this->assertFalse($schema->hasTable('foo')); + + $this->assertTrue($this->config->hasVersionMigrated($version)); + } + + public function testMigrateSeveralSteps() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration'); + $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $this->assertEquals(0, $this->config->getCurrentVersion()); + $migrations = $this->config->getMigrationsToExecute('up', 3); + + $this->assertEquals(3, count($migrations)); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp', $migrations[1]->getMigration()); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration', $migrations[2]->getMigration()); + $this->assertInstanceOf('Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther', $migrations[3]->getMigration()); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(3); + + $schema = $this->config->getConnection()->getSchemaManager()->createSchema(); + $this->assertTrue($schema->hasTable('foo')); + $this->assertTrue($schema->hasTable('bar')); + + $this->assertEquals(3, $this->config->getCurrentVersion()); + $this->assertTrue($migrations[1]->isMigrated()); + $this->assertTrue($migrations[2]->isMigrated()); + $this->assertTrue($migrations[3]->isMigrated()); + } + + public function testMigrateToLastVersion() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration'); + $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(); + + $this->assertEquals(3, $this->config->getCurrentVersion()); + $migrations = $this->config->getMigrations(); + $this->assertTrue($migrations[1]->isMigrated()); + $this->assertTrue($migrations[2]->isMigrated()); + $this->assertTrue($migrations[3]->isMigrated()); + } + + public function testDryRunMigration() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration'); + $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(3, true); + + $schema = $this->config->getConnection()->getSchemaManager()->createSchema(); + $this->assertFalse($schema->hasTable('foo')); + $this->assertFalse($schema->hasTable('bar')); + + $this->assertEquals(0, $this->config->getCurrentVersion()); + $migrations = $this->config->getMigrations(); + $this->assertFalse($migrations[1]->isMigrated()); + $this->assertFalse($migrations[2]->isMigrated()); + $this->assertFalse($migrations[3]->isMigrated()); + } + + public function testMigrateDownSeveralSteps() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationSkipMigration'); + $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(3); + $this->assertEquals(3, $this->config->getCurrentVersion()); + $migration->migrate(0); + + $schema = $this->config->getConnection()->getSchemaManager()->createSchema(); + $this->assertFalse($schema->hasTable('foo')); + $this->assertFalse($schema->hasTable('bar')); + + $this->assertEquals(0, $this->config->getCurrentVersion()); + $migrations = $this->config->getMigrations(); + $this->assertFalse($migrations[1]->isMigrated()); + $this->assertFalse($migrations[2]->isMigrated()); + $this->assertFalse($migrations[3]->isMigrated()); + } + + public function testAddSql() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(1); + + $migrations = $this->config->getMigrations(); + $this->assertTrue($migrations[1]->isMigrated()); + + $schema = $this->config->getConnection()->getSchemaManager()->createSchema(); + $this->assertTrue($schema->hasTable('test_add_sql_table')); + $check = $this->config->getConnection()->fetchAll('select * from test_add_sql_table'); + $this->assertNotEmpty($check); + $this->assertEquals('test', $check[0]['test']); + + $migration->migrate(0); + $this->assertFalse($migrations[1]->isMigrated()); + $schema = $this->config->getConnection()->getSchemaManager()->createSchema(); + $this->assertFalse($schema->hasTable('test_add_sql_table')); + } + + public function testVersionInDatabaseWithoutRegisteredMigrationStillMigrates() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + $this->config->registerMigration(10, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(); + + $config = new Configuration($this->connection); + $config->setMigrationsNamespace('Doctrine\DBAL\Migrations\Tests\Functional'); + $config->setMigrationsDirectory('.'); + $config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + $config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($config); + $migration->migrate(); + + $migrations = $config->getMigrations(); + $this->assertTrue($migrations[1]->isMigrated()); + $this->assertTrue($migrations[2]->isMigrated()); + + $this->assertEquals(2, $config->getCurrentVersion()); + } + + public function testInterweavedMigrationsAreExecuted() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + $this->config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(); + + $migrations = $this->config->getMigrations(); + $this->assertTrue($migrations[1]->isMigrated()); + $this->assertTrue($migrations[3]->isMigrated()); + $this->assertEquals(3, $this->config->getCurrentVersion()); + + $config = new Configuration($this->connection); + $config->setMigrationsNamespace('Doctrine\DBAL\Migrations\Tests\Functional'); + $config->setMigrationsDirectory('.'); + $config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + $config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateUp'); + $config->registerMigration(3, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $this->assertEquals(1, count($config->getMigrationsToExecute('up', 3))); + $migrations = $config->getMigrationsToExecute('up', 3); + $this->assertTrue(isset($migrations[2])); + $this->assertEquals(2, $migrations[2]->getVersion()); + + $migration = new \Doctrine\DBAL\Migrations\Migration($config); + $migration->migrate(); + + $migrations = $config->getMigrations(); + $this->assertTrue($migrations[1]->isMigrated()); + $this->assertTrue($migrations[2]->isMigrated()); + $this->assertTrue($migrations[3]->isMigrated()); + + $this->assertEquals(3, $config->getCurrentVersion()); + } + + public function testMigrateToCurrentVersionReturnsEmpty() + { + $this->config->registerMigration(1, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrateAddSqlTest'); + $this->config->registerMigration(2, 'Doctrine\DBAL\Migrations\Tests\Functional\MigrationMigrateFurther'); + + $migration = new \Doctrine\DBAL\Migrations\Migration($this->config); + $migration->migrate(); + + $sql = $migration->migrate(); + + $this->assertEquals(array(), $sql);; + } +} + +class MigrateAddSqlTest extends \Doctrine\DBAL\Migrations\AbstractMigration +{ + public function up(Schema $schema) + { + $this->addSql("CREATE TABLE test_add_sql_table (test varchar(255))"); + $this->addSql("INSERT INTO test_add_sql_table (test) values (?)", array('test')); + } + + public function down(Schema $schema) + { + $this->addSql("DROP TABLE test_add_sql_table"); + } +} + +class MigrationMigrateUp extends \Doctrine\DBAL\Migrations\AbstractMigration +{ + public function down(Schema $schema) + { + $schema->dropTable('foo'); + } + + public function up(Schema $schema) + { + $table = $schema->createTable('foo'); + $table->addColumn('id', 'integer'); + } +} + +class MigrationSkipMigration extends MigrationMigrateUp +{ + + public function preUp(Schema $schema) + { + $this->skipIf(true); + } + + public function preDown(Schema $schema) + { + $this->skipIf(true); + } +} + +class MigrationMigrateFurther extends \Doctrine\DBAL\Migrations\AbstractMigration +{ + + public function down(Schema $schema) + { + $schema->dropTable('bar'); + } + + public function up(Schema $schema) + { + $table = $schema->createTable('bar'); + $table->addColumn('id', 'integer'); + } + +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTest.php new file mode 100755 index 0000000000..c8e24166c7 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTest.php @@ -0,0 +1,36 @@ +config = new Configuration($this->getSqliteConnection()); + $this->config->setMigrationsDirectory(\sys_get_temp_dir()); + $this->config->setMigrationsNamespace('DoctrineMigrations\\'); + } + + public function testMigrateToUnknownVersionThrowsException() + { + $migration = new Migration($this->config); + + $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Could not find migration version 1234'); + $migration->migrate('1234'); + } + + /** + * @expectedException Doctrine\DBAL\Migrations\MigrationException + */ + public function testMigrateWithNoMigrationsThrowsException() + { + $migration = new Migration($this->config); + + $sql = $migration->migrate(); + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTestCase.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTestCase.php new file mode 100755 index 0000000000..1ebdbea6e5 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTestCase.php @@ -0,0 +1,26 @@ + 'pdo_sqlite', 'memory' => true); + return DriverManager::getConnection($params); + } + + /** + * @return \Doctrine\DBAL\Migrations\Configuration\Configuration + */ + public function getSqliteConfiguration() + { + $config = new \Doctrine\DBAL\Migrations\Configuration\Configuration($this->getSqliteConnection()); + $config->setMigrationsDirectory(\sys_get_temp_dir()); + $config->setMigrationsNamespace('DoctrineMigrations'); + return $config; + } +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php new file mode 100755 index 0000000000..c2f5be4cd1 --- /dev/null +++ b/vendor/doctrine/migrations/tests/Doctrine/DBAL/Migrations/Tests/VersionTest.php @@ -0,0 +1,58 @@ +getSqliteConnection()), $versionName = '003', + 'Doctrine\DBAL\Migrations\Tests\VersionTest_Migration'); + $this->assertEquals($versionName, $version->getVersion()); + } + + /** + * Create migration with custom name + */ + public function testCreateVersionWithCustomName() + { + $versionName = 'CustomVersionName'; + $version = new Version(new Configuration($this->getSqliteConnection()), '003', + 'Doctrine\DBAL\Migrations\Tests\VersionTest_MigrationCustom'); + $this->assertEquals($versionName, $version->getVersion()); + } +} + +/** + * Simple migration + */ +class VersionTest_Migration extends AbstractMigration +{ + public function down(Schema $schema) {} + public function up(Schema $schema) {} +} + +/** + * Migration with custom name + */ +class VersionTest_MigrationCustom extends AbstractMigration +{ + public function getName() + { + return 'CustomVersionName'; + } + public function down(Schema $schema) {} + public function up(Schema $schema) {} +} \ No newline at end of file diff --git a/vendor/doctrine/migrations/tests/bootstrap.php b/vendor/doctrine/migrations/tests/bootstrap.php new file mode 100755 index 0000000000..37cf05e169 --- /dev/null +++ b/vendor/doctrine/migrations/tests/bootstrap.php @@ -0,0 +1,4 @@ +add('Doctrine\DBAL\Migrations\Tests', __DIR__); diff --git a/vendor/doctrine/orm/.travis.yml b/vendor/doctrine/orm/.travis.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/CONTRIBUTING.md b/vendor/doctrine/orm/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/LICENSE b/vendor/doctrine/orm/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/README.markdown b/vendor/doctrine/orm/README.markdown old mode 100644 new mode 100755 index 54e9e8ecb4..64f7189a32 --- a/vendor/doctrine/orm/README.markdown +++ b/vendor/doctrine/orm/README.markdown @@ -1,6 +1,7 @@ # Doctrine 2 ORM Master: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=master)](http://travis-ci.org/doctrine/doctrine2) +2.3: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=2.3)](http://travis-ci.org/doctrine/doctrine2) 2.2: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=2.2)](http://travis-ci.org/doctrine/doctrine2) 2.1: [![Build Status](https://secure.travis-ci.org/doctrine/doctrine2.png?branch=2.1.x)](http://travis-ci.org/doctrine/doctrine2) diff --git a/vendor/doctrine/orm/UPGRADE.md b/vendor/doctrine/orm/UPGRADE.md old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/bin/doctrine-pear.php b/vendor/doctrine/orm/bin/doctrine-pear.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/bin/doctrine.bat b/vendor/doctrine/orm/bin/doctrine.bat old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/build.properties b/vendor/doctrine/orm/build.properties old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/build.properties.dev b/vendor/doctrine/orm/build.properties.dev old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/build.xml b/vendor/doctrine/orm/build.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/composer.json b/vendor/doctrine/orm/composer.json old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/doctrine-mapping.xsd b/vendor/doctrine/orm/doctrine-mapping.xsd old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityNotFoundException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php b/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LifecycleEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnClearEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/OnFlushEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PostFlushEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreFlushEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Event/PreUpdateEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Events.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Events.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AbstractIdGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/AssignedGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/SequenceGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/TableGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Id/UuidGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Id/UuidGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Annotation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AssociationOverride.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AssociationOverride.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AssociationOverrides.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AssociationOverrides.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AttributeOverride.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AttributeOverride.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AttributeOverrides.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/AttributeOverrides.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ChangeTrackingPolicy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadata.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Column.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ColumnResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ColumnResult.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DefaultNamingStrategy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DefaultNamingStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorColumn.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/DiscriminatorMap.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php old mode 100644 new mode 100755 index 2e9e944f27..bc0e79e709 --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -230,12 +230,21 @@ class XmlDriver extends FileDriver if (isset($xmlRoot->field)) { foreach ($xmlRoot->field as $fieldMapping) { $mapping = $this->columnToArray($fieldMapping); + + if (isset($mapping['version'])) { + $metadata->setVersionMapping($mapping); + } + $metadata->mapField($mapping); } } foreach ($mappings as $mapping) { - $metadata->mapField($mapping); + if (isset($mapping['version'])) { + $metadata->setVersionMapping($mapping); + } + + $metadata->mapField($mapping); } // Evaluate mappings diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php old mode 100644 new mode 100755 index ea53ef28b1..35631e7a1e --- a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -297,6 +297,10 @@ class YamlDriver extends FileDriver } } + if (isset($mapping['version'])) { + $metadata->setVersionMapping($mapping); + } + $metadata->mapField($mapping); } } diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ElementCollection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/EntityResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/EntityResult.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/FieldResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/FieldResult.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/GeneratedValue.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/HasLifecycleCallbacks.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Id.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Index.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/InheritanceType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumn.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinColumns.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/JoinTable.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToMany.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ManyToOne.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappedSuperclass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedNativeQueries.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedNativeQueries.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedNativeQuery.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQueries.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamedQuery.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamingStrategy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/NamingStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToMany.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OneToOne.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/OrderBy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostLoad.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostPersist.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostRemove.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PostUpdate.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreFlush.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PrePersist.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreRemove.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/PreUpdate.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/QuoteStrategy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/QuoteStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SequenceGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SqlResultSetMapping.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SqlResultSetMappings.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/SqlResultSetMappings.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Table.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/UniqueConstraint.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Version.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NativeQuery.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NoResultException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/NonUniqueResultException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/OptimisticLockException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/OneToManyPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SingleTablePersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/PessimisticLockException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/PessimisticLockException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Autoloader.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ASTException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/AggregateExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/AggregateExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/BetweenExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CoalesceExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/DeleteStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/ExistsExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/FromClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitAndFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/BitOrFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/CurrentTimestampFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateAddFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateDiffFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/DateSubFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GeneralCaseExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/GroupByClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/HavingClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/IndexBy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InputParameter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/InstanceOfExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Join.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationDeclaration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/JoinClassPathExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/LikeExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Literal.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NewObjectExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Node.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/NullIfExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/OrderByItem.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PartialObjectExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/PathExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SelectStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleCaseExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SimpleWhenClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Subselect.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/SubselectFromClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateItem.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/UpdateStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhenClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/WhereClause.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Andx.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Comparison.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Composite.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/From.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Func.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/GroupBy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Join.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Literal.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Math.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Math.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/OrderBy.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Orx.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Select.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Filter/SQLFilter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/FilterCollection.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Lexer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parameter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parameter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParameterTypeInferer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ParserResult.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Printer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMapping.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Query/TreeWalkerChain.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php b/vendor/doctrine/orm/lib/Doctrine/ORM/QueryBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/README.markdown b/vendor/doctrine/orm/lib/Doctrine/ORM/README.markdown old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/EnsureProductionSettingsCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/InfoCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/ValidateSchemaCommand.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Event/GenerateSchemaTableEventArgs.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Export/ExportException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaValidator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolEvents.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/TransactionRequiredException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/UnexpectedResultException.php b/vendor/doctrine/orm/lib/Doctrine/ORM/UnexpectedResultException.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php b/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/lib/Doctrine/ORM/Version.php b/vendor/doctrine/orm/lib/Doctrine/ORM/Version.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/phpunit.xml.dist b/vendor/doctrine/orm/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/DoctrineTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/DoctrineTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MockTreeWalker.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MockTreeWalker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SequenceMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SequenceMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/StatementMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/StatementMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeParent.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeParent.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleEntityWithOverride.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleEntityWithOverride.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleEntityWithoutOverride.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleEntityWithoutOverride.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1872/DDC1872ExampleTrait.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithDefaultCustomRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889Class.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Group.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Group.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC964/DDC964User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAvatar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAvatar.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumBoard.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumBoard.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumCategory.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumCategory.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DateTimeModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DateTimeModel.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DecimalModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DecimalModel.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/SerializationModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/SerializationModel.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyArticle.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyArticle.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavPointOfInterest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavTour.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavUser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Address.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Address.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Group.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Group.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Phone.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Phone.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/SimpleEntity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/SimpleEntity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRoute.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Bond.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Market.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/StockExchange/Stock.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/ConfigurationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/ConfigurationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Criteria/DqlGenerationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Entity/ConstructorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/EntityManagerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/PostgreSQLIdentityStrategyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/QueryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1151Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1360Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC142Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC142Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1757Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1843Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1843Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1885Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1885Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1925Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1925Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC192Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2182Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ArrayHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/CustomHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SingleScalarHydratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Id/SequenceGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php old mode 100644 new mode 100755 index fb8525e6e9..b994d4863d --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -139,14 +139,25 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase */ public function testFieldMappings($class) { - $this->assertEquals(3, count($class->fieldMappings)); + $this->assertEquals(4, count($class->fieldMappings)); $this->assertTrue(isset($class->fieldMappings['id'])); $this->assertTrue(isset($class->fieldMappings['name'])); $this->assertTrue(isset($class->fieldMappings['email'])); + $this->assertTrue(isset($class->fieldMappings['version'])); return $class; } + /** + * @depends testFieldMappings + * @param ClassMetadata $class + */ + public function testVersionedField($class) + { + $this->assertTrue($class->isVersioned); + $this->assertEquals("version", $class->versionField); + } + /** * @depends testEntityTableNameAndInheritance * @param ClassMetadata $class @@ -793,6 +804,12 @@ class User */ public $groups; + /** + * @Column(type="integer") + * @Version + */ + public $version; + /** * @PrePersist @@ -847,6 +864,9 @@ class User 'columnName' => 'user_email', 'columnDefinition' => 'CHAR(32) NOT NULL', )); + $mapping = array('fieldName' => 'version', 'type' => 'integer'); + $metadata->setVersionMapping($mapping); + $metadata->mapField($mapping); $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); $metadata->mapOneToOne(array( 'fieldName' => 'address', diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataLoadEventTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/NamingStrategyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/NamingStrategyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/XmlDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsAddress.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsAddress.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsUser.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CMS.CmsUser.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyPerson.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC869.DDC869Payment.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Class.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889SuperClass.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Admin.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Admin.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Guest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964Guest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC964.DDC964User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC1170Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.DDC807Entity.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php old mode 100644 new mode 100755 index df4dedda59..815523cc12 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php @@ -35,6 +35,9 @@ $metadata->mapField(array( 'columnName' => 'user_email', 'columnDefinition' => 'CHAR(32) NOT NULL', )); +$mapping = array('fieldName' => 'version', 'type' => 'integer'); +$metadata->setVersionMapping($mapping); +$metadata->mapField($mapping); $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); $metadata->mapOneToOne(array( 'fieldName' => 'address', @@ -121,4 +124,4 @@ $metadata->setSequenceGeneratorDefinition(array( 'sequenceName' => 'tablename_seq', 'allocationSize' => 100, 'initialValue' => 1, - )); \ No newline at end of file + )); diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/CatNoId.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsUser.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Animal.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml old mode 100644 new mode 100755 index 18f4d58193..f2ef7d8141 --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.User.dcm.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - + @@ -36,7 +36,7 @@ - + @@ -46,12 +46,14 @@ - + + + - + @@ -60,7 +62,7 @@ - + @@ -74,7 +76,7 @@ - + diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CMS.CmsUser.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CMS.CmsUser.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.AbstractContentItem.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.Directory.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DirectoryTree.File.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Animal.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC2069Entity.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC2069Entity.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml old mode 100644 new mode 100755 index 5c10185608..3655db20ff --- a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.User.dcm.yml @@ -30,6 +30,9 @@ Doctrine\Tests\ORM\Mapping\User: type: string column: user_email columnDefinition: CHAR(32) NOT NULL + version: + type: integer + version: true oneToOne: address: targetEntity: Address @@ -73,4 +76,4 @@ Doctrine\Tests\ORM\Mapping\User: name_idx: columns: name 0: - columns: user_email \ No newline at end of file + columns: user_email diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/HydrationPerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InheritancePersisterPerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/InsertPerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/PersisterPerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Performance/UnitOfWorkPerformanceTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/AutoloaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Proxy/fixtures/NonNamespacedProxies.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/LexerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParameterTypeInfererTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParameterTypeInfererTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/QueryTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/QueryBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/AnnotationClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/ClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/PhpClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/PhpClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/XmlClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/YamlClassMetadataExporterTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/YamlClassMetadataExporterTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/php/Doctrine.Tests.ORM.Tools.Export.User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/xml/Doctrine.Tests.ORM.Tools.Export.User.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Export/yaml/Doctrine.Tests.ORM.Tools.Export.User.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/SetupTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php b/vendor/doctrine/orm/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmFunctionalTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmPerformanceTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php b/vendor/doctrine/orm/tests/Doctrine/Tests/OrmTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php b/vendor/doctrine/orm/tests/Doctrine/Tests/TestInit.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php b/vendor/doctrine/orm/tests/Doctrine/Tests/TestUtil.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/NativePhpunitTask.php b/vendor/doctrine/orm/tests/NativePhpunitTask.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/README.markdown b/vendor/doctrine/orm/tests/README.markdown old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/dbproperties.xml.dev b/vendor/doctrine/orm/tests/dbproperties.xml.dev old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/travis/mysql.travis.xml b/vendor/doctrine/orm/tests/travis/mysql.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/travis/pgsql.travis.xml b/vendor/doctrine/orm/tests/travis/pgsql.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tests/travis/sqlite.travis.xml b/vendor/doctrine/orm/tests/travis/sqlite.travis.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/Entities/Address.php b/vendor/doctrine/orm/tools/sandbox/Entities/Address.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/Entities/User.php b/vendor/doctrine/orm/tools/sandbox/Entities/User.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/cli-config.php b/vendor/doctrine/orm/tools/sandbox/cli-config.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/doctrine.php b/vendor/doctrine/orm/tools/sandbox/doctrine.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/index.php b/vendor/doctrine/orm/tools/sandbox/index.php old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml b/vendor/doctrine/orm/tools/sandbox/xml/Entities.Address.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml b/vendor/doctrine/orm/tools/sandbox/xml/Entities.User.dcm.xml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml b/vendor/doctrine/orm/tools/sandbox/yaml/Entities.Address.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml b/vendor/doctrine/orm/tools/sandbox/yaml/Entities.User.dcm.yml old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/.travis.yml b/vendor/monolog/monolog/.travis.yml old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/CHANGELOG.mdown b/vendor/monolog/monolog/CHANGELOG.mdown old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/README.mdown b/vendor/monolog/monolog/README.mdown old mode 100644 new mode 100755 index c051eb1980..7c22378b6d --- a/vendor/monolog/monolog/README.mdown +++ b/vendor/monolog/monolog/README.mdown @@ -147,6 +147,7 @@ Formatters - _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler. - _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler. - _GelfFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler. +- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/1.1.5/). Processors ---------- diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/doc/extending.md b/vendor/monolog/monolog/doc/extending.md old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/doc/sockets.md b/vendor/monolog/monolog/doc/sockets.md old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/doc/usage.md b/vendor/monolog/monolog/doc/usage.md old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/phpunit.xml.dist b/vendor/monolog/monolog/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php new file mode 100755 index 0000000000..5092e064c4 --- /dev/null +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Serializes a log message to Logstash Event Format + * + * @see http://logstash.net/ + * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb + * + * @author Tim Mower + */ +class LogstashFormatter extends NormalizerFormatter +{ + /** + * @var string the name of the system for the Logstash log message, used to fill the @source field + */ + protected $systemName; + + /** + * @var string an application name for the Logstash log message, used to fill the @type field + */ + protected $applicationName; + + /** + * @var string a prefix for 'extra' fields from the Monolog record (optional) + */ + protected $extraPrefix; + + /** + * @var string a prefix for 'context' fields from the Monolog record (optional) + */ + protected $contextPrefix; + + /** + * @param string $applicationName the application that sends the data, used as the "type" field of logstash + * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine + * @param string $extraPrefix prefix for extra keys inside logstash "fields" + * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_ + */ + public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_') + { + //log stash requires a ISO 8601 format date + parent::__construct('c'); + + $this->systemName = $systemName ?: gethostname(); + $this->applicationName = $applicationName; + + $this->extraPrefix = $extraPrefix; + $this->contextPrefix = $contextPrefix; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + $message = array( + '@timestamp' => $record['datetime'], + '@message' => $record['message'], + '@tags' => array($record['channel']), + '@source' => $this->systemName + ); + + if ($this->applicationName) { + $message['@type'] = $this->applicationName; + } + $message['@fields'] = array(); + $message['@fields']['channel'] = $record['channel']; + $message['@fields']['level'] = $record['level']; + + if (isset($record['extra']['server'])) { + $message['@source_host'] = $record['extra']['server']; + } + if (isset($record['extra']['url'])) { + $message['@source_path'] = $record['extra']['url']; + } + foreach ($record['extra'] as $key => $val) { + $message['@fields'][$this->extraPrefix . $key] = $val; + } + + foreach ($record['context'] as $key => $val) { + $message['@fields'][$this->contextPrefix . $key] = $val; + } + + return json_encode($message); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php old mode 100644 new mode 100755 index 133524ffd6..0ae96625db --- a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -67,6 +67,7 @@ class BufferHandler extends AbstractHandler $this->buffer[] = $record; $this->bufferSize++; + return false === $this->bubble; } diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php old mode 100644 new mode 100755 index 023b8811db..6d6504d695 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php @@ -14,7 +14,6 @@ namespace Monolog\Handler; use Monolog\Logger; use Monolog\Formatter\LineFormatter; - /** * Logs to syslog service. * diff --git a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php new file mode 100755 index 0000000000..6b012deaa7 --- /dev/null +++ b/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; +use Monolog\Formatter\LogstashFormatter; + +class LogstashFormatterTest extends \PHPUnit_Framework_TestCase +{ + + /** + * @covers Monolog\Formatter\LogstashFormatter::format + */ + public function testDefaultFormatter() + { + $formatter = new LogstashFormatter('test', 'hostname'); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array(), + 'datetime' => new \DateTime("@0"), + 'extra' => array(), + 'message' => 'log', + ); + + $message = json_decode($formatter->format($record), true); + + $this->assertEquals("1970-01-01T00:00:00+00:00", $message['@timestamp']); + $this->assertEquals('log', $message['@message']); + $this->assertEquals('meh', $message['@fields']['channel']); + $this->assertContains('meh', $message['@tags']); + $this->assertEquals(Logger::ERROR, $message['@fields']['level']); + $this->assertEquals('test', $message['@type']); + $this->assertEquals('hostname', $message['@source']); + + $formatter = new LogstashFormatter('mysystem'); + + $message = json_decode($formatter->format($record), true); + + $this->assertEquals('mysystem', $message['@type']); + } + + /** + * @covers Monolog\Formatter\LogstashFormatter::format + */ + public function testFormatWithFileAndLine() + { + $formatter = new LogstashFormatter('test'); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array('from' => 'logger'), + 'datetime' => new \DateTime("@0"), + 'extra' => array('file' => 'test', 'line' => 14), + 'message' => 'log', + ); + + $message = json_decode($formatter->format($record), true); + + $this->assertEquals('test', $message['@fields']['file']); + $this->assertEquals(14, $message['@fields']['line']); + } + + /** + * @covers Monolog\Formatter\LogstashFormatter::format + */ + public function testFormatWithContext() + { + $formatter = new LogstashFormatter('test'); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array('from' => 'logger'), + 'datetime' => new \DateTime("@0"), + 'extra' => array('key' => 'pair'), + 'message' => 'log' + ); + + $message = json_decode($formatter->format($record), true); + + $message_array = $message['@fields']; + + $this->assertArrayHasKey('ctxt_from', $message_array); + $this->assertEquals('logger', $message_array['ctxt_from']); + + // Test with extraPrefix + $formatter = new LogstashFormatter('test', null, null, 'CTX'); + $message = json_decode($formatter->format($record), true); + + $message_array = $message['@fields']; + + $this->assertArrayHasKey('CTXfrom', $message_array); + $this->assertEquals('logger', $message_array['CTXfrom']); + + } + + /** + * @covers Monolog\Formatter\LogstashFormatter::format + */ + public function testFormatWithExtra() + { + $formatter = new LogstashFormatter('test'); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array('from' => 'logger'), + 'datetime' => new \DateTime("@0"), + 'extra' => array('key' => 'pair'), + 'message' => 'log' + ); + + $message = json_decode($formatter->format($record), true); + + $message_array = $message['@fields']; + + $this->assertArrayHasKey('key', $message_array); + $this->assertEquals('pair', $message_array['key']); + + // Test with extraPrefix + $formatter = new LogstashFormatter('test', null, 'EXT'); + $message = json_decode($formatter->format($record), true); + + $message_array = $message['@fields']; + + $this->assertArrayHasKey('EXTkey', $message_array); + $this->assertEquals('pair', $message_array['EXTkey']); + } + + public function testFormatWithApplicationName() + { + $formatter = new LogstashFormatter('app', 'test'); + $record = array( + 'level' => Logger::ERROR, + 'level_name' => 'ERROR', + 'channel' => 'meh', + 'context' => array('from' => 'logger'), + 'datetime' => new \DateTime("@0"), + 'extra' => array('key' => 'pair'), + 'message' => 'log' + ); + + $message = json_decode($formatter->format($record), true); + + $this->assertArrayHasKey('@type', $message); + $this->assertEquals('app', $message['@type']); + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php old mode 100644 new mode 100755 index d36132fad3..3485bdf34a --- a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php @@ -69,7 +69,7 @@ class AbstractProcessingHandlerTest extends TestCase $handledRecord = null; $handler->expects($this->once()) ->method('write') - ->will($this->returnCallback(function($record) use (&$handledRecord){ + ->will($this->returnCallback(function($record) use (&$handledRecord) { $handledRecord = $record; })) ; diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AmqpExchangeMock.php b/vendor/monolog/monolog/tests/Monolog/Handler/AmqpExchangeMock.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfMocks.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfMocks.php old mode 100644 new mode 100755 index 18515f9669..dda8711406 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfMocks.php +++ b/vendor/monolog/monolog/tests/Monolog/Handler/GelfMocks.php @@ -23,4 +23,3 @@ class MockMessagePublisher extends MessagePublisher public $lastMessage = null; } - diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php b/vendor/monolog/monolog/tests/Monolog/LoggerTest.php old mode 100644 new mode 100755 index 86e267ada8..fafe951fbc --- a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php +++ b/vendor/monolog/monolog/tests/Monolog/LoggerTest.php @@ -196,7 +196,7 @@ class LoggerTest extends \PHPUnit_Framework_TestCase ; $logger->pushHandler($handler); $that = $this; - $logger->pushProcessor(function($record) use ($that){ + $logger->pushProcessor(function($record) use ($that) { $that->fail('The processor should not be called'); }); $logger->addAlert('test'); diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/Monolog/TestCase.php b/vendor/monolog/monolog/tests/Monolog/TestCase.php old mode 100644 new mode 100755 diff --git a/vendor/monolog/monolog/tests/bootstrap.php b/vendor/monolog/monolog/tests/bootstrap.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/LICENSE b/vendor/pimple/pimple/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/README.rst b/vendor/pimple/pimple/README.rst old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/composer.json b/vendor/pimple/pimple/composer.json old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/lib/Pimple.php b/vendor/pimple/pimple/lib/Pimple.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/phpunit.xml.dist b/vendor/pimple/pimple/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/tests/Pimple/Tests/Invokable.php b/vendor/pimple/pimple/tests/Pimple/Tests/Invokable.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/tests/Pimple/Tests/NonInvokable.php b/vendor/pimple/pimple/tests/Pimple/Tests/NonInvokable.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/tests/Pimple/Tests/PimpleTest.php b/vendor/pimple/pimple/tests/Pimple/Tests/PimpleTest.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/tests/Pimple/Tests/Service.php b/vendor/pimple/pimple/tests/Pimple/Tests/Service.php old mode 100644 new mode 100755 diff --git a/vendor/pimple/pimple/tests/bootstrap.php b/vendor/pimple/pimple/tests/bootstrap.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/.travis.yml b/vendor/silex/silex/.travis.yml old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/LICENSE b/vendor/silex/silex/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/README.md b/vendor/silex/silex/README.md old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/bin/skeleton/fat_composer.json b/vendor/silex/silex/bin/skeleton/fat_composer.json old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/bin/skeleton/index.php b/vendor/silex/silex/bin/skeleton/index.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/bin/skeleton/slim_composer.json b/vendor/silex/silex/bin/skeleton/slim_composer.json old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/composer.json b/vendor/silex/silex/composer.json old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/changelog.rst b/vendor/silex/silex/doc/changelog.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/conf.py b/vendor/silex/silex/doc/conf.py old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/contributing.rst b/vendor/silex/silex/doc/contributing.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/form_no_csrf.rst b/vendor/silex/silex/doc/cookbook/form_no_csrf.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/index.rst b/vendor/silex/silex/doc/cookbook/index.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/json_request_body.rst b/vendor/silex/silex/doc/cookbook/json_request_body.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/session_storage.rst b/vendor/silex/silex/doc/cookbook/session_storage.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/sub_requests.rst b/vendor/silex/silex/doc/cookbook/sub_requests.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/translating_validation_messages.rst b/vendor/silex/silex/doc/cookbook/translating_validation_messages.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/cookbook/validator_yaml.rst b/vendor/silex/silex/doc/cookbook/validator_yaml.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/index.rst b/vendor/silex/silex/doc/index.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/internals.rst b/vendor/silex/silex/doc/internals.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/intro.rst b/vendor/silex/silex/doc/intro.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/middlewares.rst b/vendor/silex/silex/doc/middlewares.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/modularity.rst b/vendor/silex/silex/doc/modularity.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/phar.rst b/vendor/silex/silex/doc/phar.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers.rst b/vendor/silex/silex/doc/providers.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/doctrine.rst b/vendor/silex/silex/doc/providers/doctrine.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/form.rst b/vendor/silex/silex/doc/providers/form.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/http_cache.rst b/vendor/silex/silex/doc/providers/http_cache.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/index.rst b/vendor/silex/silex/doc/providers/index.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/monolog.rst b/vendor/silex/silex/doc/providers/monolog.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/security.rst b/vendor/silex/silex/doc/providers/security.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/serializer.rst b/vendor/silex/silex/doc/providers/serializer.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/session.rst b/vendor/silex/silex/doc/providers/session.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/swiftmailer.rst b/vendor/silex/silex/doc/providers/swiftmailer.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/translation.rst b/vendor/silex/silex/doc/providers/translation.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/twig.rst b/vendor/silex/silex/doc/providers/twig.rst old mode 100644 new mode 100755 index 967df732da..6a413118ce --- a/vendor/silex/silex/doc/providers/twig.rst +++ b/vendor/silex/silex/doc/providers/twig.rst @@ -135,19 +135,19 @@ Traits .. code-block:: php - return $app->render('index.html', ['name': 'Fabien']); + return $app->render('index.html', ['name' => 'Fabien']); $response = new Response(); $response->setTtl(10); - return $app->render('index.html', ['name': 'Fabien'], $response); + return $app->render('index.html', ['name' => 'Fabien'], $response); .. code-block:: php // stream a view use Symfony\Component\HttpFoundation\StreamedResponse; - return $app->render('index.html', ['name': 'Fabien'], new StreamedResponse()); + return $app->render('index.html', ['name' => 'Fabien'], new StreamedResponse()); Customization ------------- diff --git a/vendor/silex/silex/doc/providers/url_generator.rst b/vendor/silex/silex/doc/providers/url_generator.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/providers/validator.rst b/vendor/silex/silex/doc/providers/validator.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/services.rst b/vendor/silex/silex/doc/services.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/testing.rst b/vendor/silex/silex/doc/testing.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/usage.rst b/vendor/silex/silex/doc/usage.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/doc/web_servers.rst b/vendor/silex/silex/doc/web_servers.rst old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/phpunit.xml.dist b/vendor/silex/silex/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application.php b/vendor/silex/silex/src/Silex/Application.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/FormTrait.php b/vendor/silex/silex/src/Silex/Application/FormTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/MonologTrait.php b/vendor/silex/silex/src/Silex/Application/MonologTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/SecurityTrait.php b/vendor/silex/silex/src/Silex/Application/SecurityTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/SwiftmailerTrait.php b/vendor/silex/silex/src/Silex/Application/SwiftmailerTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/TranslationTrait.php b/vendor/silex/silex/src/Silex/Application/TranslationTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/TwigTrait.php b/vendor/silex/silex/src/Silex/Application/TwigTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Application/UrlGeneratorTrait.php b/vendor/silex/silex/src/Silex/Application/UrlGeneratorTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Controller.php b/vendor/silex/silex/src/Silex/Controller.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ControllerCollection.php b/vendor/silex/silex/src/Silex/ControllerCollection.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ControllerProviderInterface.php b/vendor/silex/silex/src/Silex/ControllerProviderInterface.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ControllerResolver.php b/vendor/silex/silex/src/Silex/ControllerResolver.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/EventListener/ConverterListener.php b/vendor/silex/silex/src/Silex/EventListener/ConverterListener.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/EventListener/LocaleListener.php b/vendor/silex/silex/src/Silex/EventListener/LocaleListener.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/EventListener/MiddlewareListener.php b/vendor/silex/silex/src/Silex/EventListener/MiddlewareListener.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/EventListener/StringToResponseListener.php b/vendor/silex/silex/src/Silex/EventListener/StringToResponseListener.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Exception/ControllerFrozenException.php b/vendor/silex/silex/src/Silex/Exception/ControllerFrozenException.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ExceptionHandler.php b/vendor/silex/silex/src/Silex/ExceptionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ExceptionListenerWrapper.php b/vendor/silex/silex/src/Silex/ExceptionListenerWrapper.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/HttpCache.php b/vendor/silex/silex/src/Silex/HttpCache.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/LazyUrlMatcher.php b/vendor/silex/silex/src/Silex/LazyUrlMatcher.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/DoctrineServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/DoctrineServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/FormServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/FormServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/HttpCacheServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/HttpCacheServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/MonologServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/MonologServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/SecurityServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/SecurityServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/SerializerServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/SerializerServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/SessionServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/SessionServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/SwiftmailerServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/SwiftmailerServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/SymfonyBridgesServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/SymfonyBridgesServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/TranslationServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/TranslationServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/TwigCoreExtension.php b/vendor/silex/silex/src/Silex/Provider/TwigCoreExtension.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/TwigServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/TwigServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/UrlGeneratorServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/UrlGeneratorServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Provider/ValidatorServiceProvider.php b/vendor/silex/silex/src/Silex/Provider/ValidatorServiceProvider.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/RedirectableUrlMatcher.php b/vendor/silex/silex/src/Silex/RedirectableUrlMatcher.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Route.php b/vendor/silex/silex/src/Silex/Route.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Route/SecurityTrait.php b/vendor/silex/silex/src/Silex/Route/SecurityTrait.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/ServiceProviderInterface.php b/vendor/silex/silex/src/Silex/ServiceProviderInterface.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/Util/Compiler.php b/vendor/silex/silex/src/Silex/Util/Compiler.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/src/Silex/WebTestCase.php b/vendor/silex/silex/src/Silex/WebTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/FormApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/FormApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/FormTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/FormTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/MonologApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/MonologApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/MonologTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/MonologTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/SecurityApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/SecurityApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/SecurityTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/SecurityTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/SwiftmailerApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/SwiftmailerApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/SwiftmailerTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/SwiftmailerTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/TranslationApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/TranslationApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/TranslationTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/TranslationTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/TwigApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/TwigApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/TwigTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/TwigTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/UrlGeneratorApplication.php b/vendor/silex/silex/tests/Silex/Tests/Application/UrlGeneratorApplication.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Application/UrlGeneratorTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Application/UrlGeneratorTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/ApplicationTest.php b/vendor/silex/silex/tests/Silex/Tests/ApplicationTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/ControllerCollectionTest.php b/vendor/silex/silex/tests/Silex/Tests/ControllerCollectionTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/ControllerResolverTest.php b/vendor/silex/silex/tests/Silex/Tests/ControllerResolverTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/ControllerTest.php b/vendor/silex/silex/tests/Silex/Tests/ControllerTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/ExceptionHandlerTest.php b/vendor/silex/silex/tests/Silex/Tests/ExceptionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/FunctionalTest.php b/vendor/silex/silex/tests/Silex/Tests/FunctionalTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/JsonTest.php b/vendor/silex/silex/tests/Silex/Tests/JsonTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/LazyUrlMatcherTest.php b/vendor/silex/silex/tests/Silex/Tests/LazyUrlMatcherTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/LocaleTest.php b/vendor/silex/silex/tests/Silex/Tests/LocaleTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/MiddlewareTest.php b/vendor/silex/silex/tests/Silex/Tests/MiddlewareTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/DoctrineServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/DoctrineServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/HttpCacheServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/HttpCacheServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/MonologServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/MonologServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/SecurityServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/SecurityServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/SerializerServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/SerializerServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/SessionServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/SessionServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/SpoolStub.php b/vendor/silex/silex/tests/Silex/Tests/Provider/SpoolStub.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/SwiftmailerServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/TwigServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/TwigServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/UrlGeneratorServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/UrlGeneratorServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php b/vendor/silex/silex/tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Route/SecurityRoute.php b/vendor/silex/silex/tests/Silex/Tests/Route/SecurityRoute.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/Route/SecurityTraitTest.php b/vendor/silex/silex/tests/Silex/Tests/Route/SecurityTraitTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/RouterTest.php b/vendor/silex/silex/tests/Silex/Tests/RouterTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/StreamTest.php b/vendor/silex/silex/tests/Silex/Tests/StreamTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/Silex/Tests/WebTestCaseTest.php b/vendor/silex/silex/tests/Silex/Tests/WebTestCaseTest.php old mode 100644 new mode 100755 diff --git a/vendor/silex/silex/tests/bootstrap.php b/vendor/silex/silex/tests/bootstrap.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md b/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md old mode 100644 new mode 100755 index 27dd93111e..1478ca1403 --- a/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md +++ b/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md @@ -1,6 +1,14 @@ CHANGELOG ========= +2.2.0 +----- + + * added a `normalizeKeys()` method for array nodes (to avoid key normalization) + * added numerical type handling for config definitions + * added convenience methods for optional configuration sections to ArrayNodeDefinition + * added a utils class for XML manipulations + 2.1.0 ----- diff --git a/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php b/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php old mode 100644 new mode 100755 index 1a96bddd3c..e3ce58adf2 --- a/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php +++ b/vendor/symfony/config/Symfony/Component/Config/ConfigCache.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Config; +use Symfony\Component\Config\Resource\ResourceInterface; + /** * ConfigCache manages PHP cache files. * @@ -83,8 +85,8 @@ class ConfigCache /** * Writes cache. * - * @param string $content The content to write in the cache - * @param array $metadata An array of ResourceInterface instances + * @param string $content The content to write in the cache + * @param ResourceInterface[] $metadata An array of ResourceInterface instances * * @throws \RuntimeException When cache file can't be wrote */ @@ -99,7 +101,7 @@ class ConfigCache throw new \RuntimeException(sprintf('Unable to write in the %s directory', $dir)); } - $tmpFile = tempnam(dirname($this->file), basename($this->file)); + $tmpFile = tempnam($dir, basename($this->file)); if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $this->file)) { @chmod($this->file, 0666 & ~umask()); } else { @@ -108,7 +110,7 @@ class ConfigCache if (null !== $metadata && true === $this->debug) { $file = $this->file.'.meta'; - $tmpFile = tempnam(dirname($file), basename($file)); + $tmpFile = tempnam($dir, basename($file)); if (false !== @file_put_contents($tmpFile, serialize($metadata)) && @rename($tmpFile, $file)) { @chmod($file, 0666 & ~umask()); } diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php old mode 100644 new mode 100755 index 170a9033dd..1af4acf420 --- a/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/ArrayNode.php @@ -29,6 +29,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface protected $addIfNotSet; protected $performDeepMerging; protected $ignoreExtraKeys; + protected $normalizeKeys; /** * Constructor. @@ -47,6 +48,41 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface $this->addIfNotSet = false; $this->allowNewKeys = true; $this->performDeepMerging = true; + $this->normalizeKeys = true; + } + + public function setNormalizeKeys($normalizeKeys) + { + $this->normalizeKeys = (Boolean) $normalizeKeys; + } + + /** + * Normalizes keys between the different configuration formats. + * + * Namely, you mostly have foo_bar in YAML while you have foo-bar in XML. + * After running this method, all keys are normalized to foo_bar. + * + * If you have a mixed key like foo-bar_moo, it will not be altered. + * The key will also not be altered if the target key already exists. + * + * @param mixed $value + * + * @return array The value with normalized keys + */ + protected function preNormalize($value) + { + if (!$this->normalizeKeys || !is_array($value)) { + return $value; + } + + foreach ($value as $k => $v) { + if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) { + $value[$normalizedKey] = $v; + unset($value[$k]); + } + } + + return $value; } /** diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php old mode 100644 new mode 100755 index 099da4b398..0a97a5203c --- a/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/BaseNode.php @@ -158,7 +158,7 @@ abstract class BaseNode implements NodeInterface /** * Sets the closures used for normalization. * - * @param array $closures An array of Closures used for normalization + * @param \Closure[] $closures An array of Closures used for normalization */ public function setNormalizationClosures(array $closures) { @@ -168,7 +168,7 @@ abstract class BaseNode implements NodeInterface /** * Sets the closures used for final validation. * - * @param array $closures An array of Closures used for final validation + * @param \Closure[] $closures An array of Closures used for final validation */ public function setFinalValidationClosures(array $closures) { @@ -247,6 +247,8 @@ abstract class BaseNode implements NodeInterface */ final public function normalize($value) { + $value = $this->preNormalize($value); + // run custom normalization closures foreach ($this->normalizationClosures as $closure) { $value = $closure($value); @@ -266,6 +268,18 @@ abstract class BaseNode implements NodeInterface return $this->normalizeValue($value); } + /** + * Normalizes the value before any other normalization is applied. + * + * @param $value + * + * @return $value The normalized array value + */ + protected function preNormalize($value) + { + return $value; + } + /** * Finalizes a value, applying all finalization closures. * diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/BooleanNode.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php old mode 100644 new mode 100755 index b4378845f9..d0d97ff02c --- a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -34,6 +34,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition protected $addDefaults; protected $addDefaultChildren; protected $nodeBuilder; + protected $normalizeKeys; /** * {@inheritDoc} @@ -51,6 +52,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition $this->performDeepMerging = true; $this->nullEquivalent = array(); $this->trueEquivalent = array(); + $this->normalizeKeys = true; } /** @@ -210,6 +212,48 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition return $this; } + /** + * Adds an "enabled" boolean to enable the current section. + * + * By default, the section is disabled. + * + * @return ArrayNodeDefinition + */ + public function canBeEnabled() + { + $this + ->treatFalseLike(array('enabled' => false)) + ->treatTrueLike(array('enabled' => true)) + ->treatNullLike(array('enabled' => true)) + ->children() + ->booleanNode('enabled') + ->defaultFalse() + ; + + return $this; + } + + /** + * Adds an "enabled" boolean to enable the current section. + * + * By default, the section is enabled. + * + * @return ArrayNodeDefinition + */ + public function canBeDisabled() + { + $this + ->treatFalseLike(array('enabled' => false)) + ->treatTrueLike(array('enabled' => true)) + ->treatNullLike(array('enabled' => true)) + ->children() + ->booleanNode('enabled') + ->defaultTrue() + ; + + return $this; + } + /** * Disables the deep merging of the node. * @@ -239,6 +283,20 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition return $this; } + /** + * Sets key normalization. + * + * @param Boolean $bool Whether to enable key normalization + * + * @return ArrayNodeDefinition + */ + public function normalizeKeys($bool) + { + $this->normalizeKeys = (Boolean) $bool; + + return $this; + } + /** * Appends a node definition. * @@ -326,6 +384,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition $node->setPerformDeepMerging($this->performDeepMerging); $node->setRequired($this->required); $node->setIgnoreExtraKeys($this->ignoreExtraKeys); + $node->setNormalizeKeys($this->normalizeKeys); if (null !== $this->normalization) { $node->setNormalizationClosures($this->normalization->before); diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php old mode 100644 new mode 100755 index 10d2e00dbb..da4ba13e44 --- a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ExprBuilder.php @@ -210,7 +210,7 @@ class ExprBuilder /** * Builds the expressions. * - * @param array $expressions An array of ExprBuilder instances to build + * @param ExprBuilder[] $expressions An array of ExprBuilder instances to build * * @return array */ diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php new file mode 100755 index 0000000000..c0bed462bf --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/FloatNodeDefinition.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\FloatNode; + +/** + * This class provides a fluent interface for defining a float node. + * + * @author Jeanmonod David + */ +class FloatNodeDefinition extends NumericNodeDefinition +{ + /** + * Instantiates a Node. + * + * @return FloatNode The node + */ + protected function instantiateNode() + { + return new FloatNode($this->name, $this->parent, $this->min, $this->max); + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php new file mode 100755 index 0000000000..f6c3c147f3 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/IntegerNodeDefinition.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +use Symfony\Component\Config\Definition\IntegerNode; + +/** + * This class provides a fluent interface for defining an integer node. + * + * @author Jeanmonod David + */ +class IntegerNodeDefinition extends NumericNodeDefinition +{ + /** + * Instantiates a Node. + * + * @return IntegerNode The node + */ + protected function instantiateNode() + { + return new IntegerNode($this->name, $this->parent, $this->min, $this->max); + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/MergeBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php old mode 100644 new mode 100755 index c960ac43a6..a53685a22e --- a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeBuilder.php @@ -31,6 +31,8 @@ class NodeBuilder implements NodeParentInterface 'variable' => __NAMESPACE__.'\\VariableNodeDefinition', 'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition', 'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition', + 'integer' => __NAMESPACE__.'\\IntegerNodeDefinition', + 'float' => __NAMESPACE__.'\\FloatNodeDefinition', 'array' => __NAMESPACE__.'\\ArrayNodeDefinition', 'enum' => __NAMESPACE__.'\\EnumNodeDefinition', ); @@ -86,6 +88,30 @@ class NodeBuilder implements NodeParentInterface return $this->node($name, 'boolean'); } + /** + * Creates a child integer node. + * + * @param string $name the name of the node + * + * @return IntegerNodeDefinition The child node + */ + public function integerNode($name) + { + return $this->node($name, 'integer'); + } + + /** + * Creates a child float node. + * + * @param string $name the name of the node + * + * @return FloatNodeDefinition The child node + */ + public function floatNode($name) + { + return $this->node($name, 'float'); + } + /** * Creates a child EnumNode. * diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php new file mode 100755 index 0000000000..5b6e9550bf --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * Abstract class that contain common code of integer and float node definition. + * + * @author David Jeanmonod + */ +abstract class NumericNodeDefinition extends ScalarNodeDefinition +{ + protected $min; + protected $max; + + /** + * Ensures that the value is smaller than the given reference. + * + * @param mixed $max + * + * @return NumericNodeDefinition + * + * @throws \InvalidArgumentException when the constraint is inconsistent + */ + public function max($max) + { + if (isset($this->min) && $this->min > $max) { + throw new \InvalidArgumentException(sprintf('You cannot define a max(%s) as you already have a min(%s)', $max, $this->min)); + } + $this->max = $max; + + return $this; + } + + /** + * Ensures that the value is bigger than the given reference. + * + * @param mixed $min + * + * @return NumericNodeDefinition + * + * @throws \InvalidArgumentException when the constraint is inconsistent + */ + public function min($min) + { + if (isset($this->max) && $this->max < $min) { + throw new \InvalidArgumentException(sprintf('You cannot define a min(%s) as you already have a max(%s)', $min, $this->max)); + } + $this->min = $min; + + return $this; + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/TreeBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php b/vendor/symfony/config/Symfony/Component/Config/Definition/ConfigurationInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/DuplicateKeyException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/Exception.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/ForbiddenOverwriteException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidConfigurationException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidDefinitionException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/InvalidTypeException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Exception/UnsetKeyException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php new file mode 100755 index 0000000000..17c570acaa --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/FloatNode.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents a float value in the config tree. + * + * @author Jeanmonod David + */ +class FloatNode extends NumericNode +{ + /** + * {@inheritDoc} + */ + protected function validateType($value) + { + // Integers are also accepted, we just cast them + if (is_int($value)) { + $value = (float) $value; + } + + if (!is_float($value)) { + $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected float, but got %s.', $this->getPath(), gettype($value))); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php new file mode 100755 index 0000000000..dbc04122fa --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/IntegerNode.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +/** + * This node represents an integer value in the config tree. + * + * @author Jeanmonod David + */ +class IntegerNode extends NumericNode +{ + /** + * {@inheritDoc} + */ + protected function validateType($value) + { + if (!is_int($value)) { + $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected int, but got %s.', $this->getPath(), gettype($value))); + $ex->setPath($this->getPath()); + + throw $ex; + } + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php b/vendor/symfony/config/Symfony/Component/Config/Definition/NodeInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php new file mode 100755 index 0000000000..df45f2ebef --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/NumericNode.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; + +/** + * This node represents a numeric value in the config tree + * + * @author David Jeanmonod + */ +class NumericNode extends ScalarNode +{ + protected $min; + protected $max; + + public function __construct($name, NodeInterface $parent = null, $min = null, $max = null) + { + parent::__construct($name, $parent); + $this->min = $min; + $this->max = $max; + } + + /** + * {@inheritDoc} + */ + protected function finalizeValue($value) + { + $value = parent::finalizeValue($value); + + $errorMsg = null; + if (isset($this->min) && $value < $this->min) { + $errorMsg = sprintf('The value %s is too small for path "%s". Should be greater than: %s', $value, $this->getPath(), $this->min); + } + if (isset($this->max) && $value > $this->max) { + $errorMsg = sprintf('The value %s is too big for path "%s". Should be less than: %s', $value, $this->getPath(), $this->max); + } + if (isset($errorMsg)) { + $ex = new InvalidConfigurationException($errorMsg); + $ex->setPath($this->getPath()); + throw $ex; + } + + return $value; + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php b/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php old mode 100644 new mode 100755 index 3b00c7e4c0..058c3bed34 --- a/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/Processor.php @@ -28,8 +28,6 @@ class Processor */ public function process(NodeInterface $configTree, array $configs) { - $configs = self::normalizeKeys($configs); - $currentConfig = array(); foreach ($configs as $config) { $config = $configTree->normalize($config); @@ -52,35 +50,6 @@ class Processor return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs); } - /** - * This method normalizes keys between the different configuration formats - * - * Namely, you mostly have foo_bar in YAML while you have foo-bar in XML. - * After running this method, all keys are normalized to foo_bar. - * - * If you have a mixed key like foo-bar_moo, it will not be altered. - * The key will also not be altered if the target key already exists. - * - * @param array $config - * - * @return array the config with normalized keys - */ - public static function normalizeKeys(array $config) - { - foreach ($config as $key => $value) { - if (is_array($value)) { - $config[$key] = self::normalizeKeys($value); - } - - if (false !== strpos($key, '-') && false === strpos($key, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $key), $config)) { - $config[$normalizedKey] = $config[$key]; - unset($config[$key]); - } - } - - return $config; - } - /** * Normalizes a configuration entry. * diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php b/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypeNodeInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/PrototypedArrayNode.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php b/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php new file mode 100755 index 0000000000..3230c01931 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Definition/ReferenceDumper.php @@ -0,0 +1,191 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +/** + * Dumps a reference configuration for the given configuration/node instance. + * + * Currently, only YML format is supported. + * + * @author Kevin Bond + */ +class ReferenceDumper +{ + private $reference; + + public function dump(ConfigurationInterface $configuration) + { + return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree()); + } + + public function dumpNode(NodeInterface $node) + { + $this->reference = ''; + $this->writeNode($node); + $ref = $this->reference; + $this->reference = null; + + return $ref; + } + + /** + * @param NodeInterface $node + * @param integer $depth + */ + private function writeNode(NodeInterface $node, $depth = 0) + { + $comments = array(); + $default = ''; + $defaultArray = null; + $children = null; + $example = $node->getExample(); + + // defaults + if ($node instanceof ArrayNode) { + $children = $node->getChildren(); + + if ($node instanceof PrototypedArrayNode) { + $prototype = $node->getPrototype(); + + if ($prototype instanceof ArrayNode) { + $children = $prototype->getChildren(); + } + + // check for attribute as key + if ($key = $node->getKeyAttribute()) { + $keyNode = new ArrayNode($key, $node); + $keyNode->setInfo('Prototype'); + + // add children + foreach ($children as $childNode) { + $keyNode->addChild($childNode); + } + $children = array($key => $keyNode); + } + } + + if (!$children) { + if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) { + $default = ''; + } elseif (!is_array($example)) { + $default = '[]'; + } + } + } else { + $default = '~'; + + if ($node->hasDefaultValue()) { + $default = $node->getDefaultValue(); + + if (true === $default) { + $default = 'true'; + } elseif (false === $default) { + $default = 'false'; + } elseif (null === $default) { + $default = '~'; + } elseif (is_array($default)) { + if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) { + $default = ''; + } elseif (!is_array($example)) { + $default = '[]'; + } + } + } + } + + // required? + if ($node->isRequired()) { + $comments[] = 'Required'; + } + + // example + if ($example && !is_array($example)) { + $comments[] = 'Example: '.$example; + } + + $default = (string) $default != '' ? ' '.$default : ''; + $comments = count($comments) ? '# '.implode(', ', $comments) : ''; + + $text = sprintf('%-20s %s %s', $node->getName().':', $default, $comments); + + if ($info = $node->getInfo()) { + $this->writeLine(''); + $this->writeLine('# '.$info, $depth * 4); + } + + $this->writeLine($text, $depth * 4); + + // output defaults + if ($defaultArray) { + $this->writeLine(''); + + $message = count($defaultArray) > 1 ? 'Defaults' : 'Default'; + + $this->writeLine('# '.$message.':', $depth * 4 + 4); + + $this->writeArray($defaultArray, $depth + 1); + } + + if (is_array($example)) { + $this->writeLine(''); + + $message = count($example) > 1 ? 'Examples' : 'Example'; + + $this->writeLine('# '.$message.':', $depth * 4 + 4); + + $this->writeArray($example, $depth + 1); + } + + if ($children) { + foreach ($children as $childNode) { + $this->writeNode($childNode, $depth + 1); + } + } + } + + /** + * Outputs a single config reference line + * + * @param string $text + * @param int $indent + */ + private function writeLine($text, $indent = 0) + { + $indent = strlen($text) + $indent; + $format = '%'.$indent.'s'; + + $this->reference .= sprintf($format, $text)."\n"; + } + + private function writeArray(array $array, $depth) + { + $isIndexed = array_values($array) === $array; + + foreach ($array as $key => $value) { + if (is_array($value)) { + $val = ''; + } else { + $val = $value; + } + + if ($isIndexed) { + $this->writeLine('- '.$val, $depth * 4); + } else { + $this->writeLine(sprintf('%-20s %s', $key.':', $val), $depth * 4); + } + + if (is_array($value)) { + $this->writeArray($value, $depth + 1); + } + } + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/ScalarNode.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php b/vendor/symfony/config/Symfony/Component/Config/Definition/VariableNode.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php b/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php b/vendor/symfony/config/Symfony/Component/Config/Exception/FileLoaderLoadException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/FileLocator.php b/vendor/symfony/config/Symfony/Component/Config/FileLocator.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php b/vendor/symfony/config/Symfony/Component/Config/FileLocatorInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/LICENSE b/vendor/symfony/config/Symfony/Component/Config/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php b/vendor/symfony/config/Symfony/Component/Config/Loader/DelegatingLoader.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php b/vendor/symfony/config/Symfony/Component/Config/Loader/FileLoader.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php b/vendor/symfony/config/Symfony/Component/Config/Loader/Loader.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php b/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php b/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolver.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php b/vendor/symfony/config/Symfony/Component/Config/Loader/LoaderResolverInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/README.md b/vendor/symfony/config/Symfony/Component/Config/README.md old mode 100644 new mode 100755 index e87363df2d..c7865b3815 --- a/vendor/symfony/config/Symfony/Component/Config/README.md +++ b/vendor/symfony/config/Symfony/Component/Config/README.md @@ -11,4 +11,7 @@ Resources You can run the unit tests with the following command: - phpunit + $ cd path/to/Symfony/Component/Config/ + $ composer.phar install --dev + $ phpunit + diff --git a/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php b/vendor/symfony/config/Symfony/Component/Config/Resource/DirectoryResource.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php b/vendor/symfony/config/Symfony/Component/Config/Resource/FileResource.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php b/vendor/symfony/config/Symfony/Component/Config/Resource/ResourceInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php old mode 100644 new mode 100755 index ef45ba8137..605bc69367 --- a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Config\Tests\Definition; use Symfony\Component\Config\Definition\ArrayNode; +use Symfony\Component\Config\Definition\PrototypedArrayNode; class ArrayNodeTest extends \PHPUnit_Framework_TestCase { @@ -54,4 +55,35 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase $node->normalize(array('foo' => 'bar')); $this->assertTrue(true, 'No exception was thrown when setIgnoreExtraKeys is true'); } + + /** + * @dataProvider getPreNormalizationTests + */ + public function testPreNormalize($denormalized, $normalized) + { + $node = new ArrayNode('foo'); + + $r = new \ReflectionMethod($node, 'preNormalize'); + $r->setAccessible(true); + + $this->assertSame($normalized, $r->invoke($node, $denormalized)); + } + + public function getPreNormalizationTests() + { + return array( + array( + array('foo-bar' => 'foo'), + array('foo_bar' => 'foo'), + ), + array( + array('foo-bar_moo' => 'foo'), + array('foo-bar_moo' => 'foo'), + ), + array( + array('foo-bar' => null, 'foo_bar' => 'foo'), + array('foo-bar' => null, 'foo_bar' => 'foo'), + ) + ); + } } diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/BooleanNodeTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php old mode 100644 new mode 100755 index 11d20a4536..d30f3f3ff7 --- a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php @@ -171,11 +171,11 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase /** * Close the validation process and finalize with the given config * @param TreeBuilder $testBuilder The tree builder to finalize - * @param array $config The config you want to use for the finalization, if nothing provided + * @param array $config The config you want to use for the finalization, if nothing provided * a simple array('key'=>'value') will be used * @return array The finalized config values */ - protected function finalizeTestBuilder($testBuilder, $config=null) + protected function finalizeTestBuilder($testBuilder, $config = null) { return $testBuilder ->end() @@ -200,11 +200,12 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase /** * Assert that the given test builder, will return the given value + * * @param mixed $value The value to test * @param TreeBuilder $treeBuilder The tree builder to finalize * @param mixed $config The config values that new to be finalized */ - protected function assertFinalizedValueIs($value, $treeBuilder, $config=null) + protected function assertFinalizedValueIs($value, $treeBuilder, $config = null) { $this->assertEquals(array('key'=>$value), $this->finalizeTestBuilder($treeBuilder, $config)); } diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php old mode 100644 new mode 100755 index c829591690..8d0a845309 --- a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php @@ -76,6 +76,17 @@ class NodeBuilderTest extends \PHPUnit_Framework_TestCase $this->assertEquals(get_class($node1), get_class($node2)); } + + public function testNumericNodeCreation() + { + $builder = new NodeBuilder(); + + $node = $builder->integerNode('foo')->min(3)->max(5); + $this->assertEquals('Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition', get_class($node)); + + $node = $builder->floatNode('bar')->min(3.0)->max(5.0); + $this->assertEquals('Symfony\Component\Config\Definition\Builder\FloatNodeDefinition', get_class($node)); + } } class SomeNodeDefinition extends BaseVariableNodeDefinition diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NumericNodeDefinitionTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NumericNodeDefinitionTest.php new file mode 100755 index 0000000000..51af2d71a2 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/NumericNodeDefinitionTest.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Tests\Definition\Builder; + +use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition as NumericNodeDefinition; +use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition; +use Symfony\Component\Config\Definition\Builder\FloatNodeDefinition; + +class NumericNodeDefinitionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage You cannot define a min(4) as you already have a max(3) + */ + public function testIncoherentMinAssertion() + { + $def = new NumericNodeDefinition('foo'); + $def->max(3)->min(4); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage You cannot define a max(2) as you already have a min(3) + */ + public function testIncoherentMaxAssertion() + { + $node = new NumericNodeDefinition('foo'); + $node->min(3)->max(2); + } + + /** + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException + * @expectedExceptionMessage The value 4 is too small for path "foo". Should be greater than: 5 + */ + public function testIntegerMinAssertion() + { + $def = new IntegerNodeDefinition('foo'); + $def->min(5)->getNode()->finalize(4); + } + + /** + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException + * @expectedExceptionMessage The value 4 is too big for path "foo". Should be less than: 3 + */ + public function testIntegerMaxAssertion() + { + $def = new IntegerNodeDefinition('foo'); + $def->max(3)->getNode()->finalize(4); + } + + public function testIntegerValidMinMaxAssertion() + { + $def = new IntegerNodeDefinition('foo'); + $node = $def->min(3)->max(7)->getNode(); + $this->assertEquals(4, $node->finalize(4)); + } + + /** + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException + * @expectedExceptionMessage The value 400 is too small for path "foo". Should be greater than: 500 + */ + public function testFloatMinAssertion() + { + $def = new FloatNodeDefinition('foo'); + $def->min(5E2)->getNode()->finalize(4e2); + } + + /** + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidConfigurationException + * @expectedExceptionMessage The value 4.3 is too big for path "foo". Should be less than: 0.3 + */ + public function testFloatMaxAssertion() + { + $def = new FloatNodeDefinition('foo'); + $def->max(0.3)->getNode()->finalize(4.3); + } + + public function testFloatValidMinMaxAssertion() + { + $def = new FloatNodeDefinition('foo'); + $node = $def->min(3.0)->max(7e2)->getNode(); + $this->assertEquals(4.5, $node->finalize(4.5)); + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/FinalizationTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/FinalizationTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php new file mode 100755 index 0000000000..b91446e1c8 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Tests\Definition; + +use Symfony\Component\Config\Definition\FloatNode; + +class FloatNodeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getValidValues + */ + public function testNormalize($value) + { + $node = new FloatNode('test'); + $this->assertSame($value, $node->normalize($value)); + } + + public function getValidValues() + { + return array( + array(1798.0), + array(-678.987), + array(12.56E45), + array(0.0), + // Integer are accepted too, they will be cast + array(17), + array(-10), + array(0) + ); + } + + /** + * @dataProvider getInvalidValues + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException + */ + public function testNormalizeThrowsExceptionOnInvalidValues($value) + { + $node = new FloatNode('test'); + $node->normalize($value); + } + + public function getInvalidValues() + { + return array( + array(null), + array(''), + array('foo'), + array(true), + array(false), + array(array()), + array(array('foo' => 'bar')), + array(new \stdClass()), + ); + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php new file mode 100755 index 0000000000..11d5315306 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/IntegerNodeTest.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Tests\Definition; + +use Symfony\Component\Config\Definition\IntegerNode; + +class IntegerNodeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @dataProvider getValidValues + */ + public function testNormalize($value) + { + $node = new IntegerNode('test'); + $this->assertSame($value, $node->normalize($value)); + } + + public function getValidValues() + { + return array( + array(1798), + array(-678), + array(0), + ); + } + + /** + * @dataProvider getInvalidValues + * @expectedException Symfony\Component\Config\Definition\Exception\InvalidTypeException + */ + public function testNormalizeThrowsExceptionOnInvalidValues($value) + { + $node = new IntegerNode('test'); + $node->normalize($value); + } + + public function getInvalidValues() + { + return array( + array(null), + array(''), + array('foo'), + array(true), + array(false), + array(0.0), + array(0.1), + array(array()), + array(array('foo' => 'bar')), + array(new \stdClass()), + ); + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/MergeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/MergeTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/NormalizationTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/NormalizationTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php old mode 100644 new mode 100755 index 31d3c89f5c..d200574ecd --- a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/PrototypedArrayNodeTest.php @@ -17,7 +17,6 @@ use Symfony\Component\Config\Definition\ScalarNode; class PrototypedArrayNodeTest extends \PHPUnit_Framework_TestCase { - public function testGetDefaultValueReturnsAnEmptyArrayForPrototypes() { $node = new PrototypedArrayNode('root'); @@ -31,8 +30,8 @@ class PrototypedArrayNodeTest extends \PHPUnit_Framework_TestCase $node = new PrototypedArrayNode('root'); $prototype = new ArrayNode(null, $node); $node->setPrototype($prototype); - $node->setDefaultValue(array ('test')); - $this->assertEquals(array ('test'), $node->getDefaultValue()); + $node->setDefaultValue(array('test')); + $this->assertEquals(array('test'), $node->getDefaultValue()); } // a remapped key (e.g. "mapping" -> "mappings") should be unset after being used diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Definition/ScalarNodeTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/FileLocatorTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/FileLocatorTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Again/foo.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Again/foo.xml old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/BarNodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/NodeBuilder.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Builder/VariableNodeDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/document_type.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/document_type.xml new file mode 100755 index 0000000000..4c25228263 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/document_type.xml @@ -0,0 +1,3 @@ + +]> + diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid.xml new file mode 100755 index 0000000000..a07af9fd85 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid_schema.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid_schema.xml new file mode 100755 index 0000000000..e2725a2c2a --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/invalid_schema.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/schema.xsd b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/schema.xsd new file mode 100755 index 0000000000..e56820f691 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/schema.xsd @@ -0,0 +1,9 @@ + + + + + + diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/valid.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/valid.xml new file mode 100755 index 0000000000..a96bb38267 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/Util/valid.xml @@ -0,0 +1,3 @@ + + + diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/foo.xml b/vendor/symfony/config/Symfony/Component/Config/Tests/Fixtures/foo.xml old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/DelegatingLoaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/LoaderResolverTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/LoaderTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Loader/LoaderTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Resource/FileResourceTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Resource/FileResourceTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/config/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/vendor/symfony/config/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php new file mode 100755 index 0000000000..a3d264e189 --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Tests\Loader; + +use Symfony\Component\Config\Util\XmlUtils; + +class XmlUtilsTest extends \PHPUnit_Framework_TestCase +{ + public function testLoadFile() + { + $fixtures = __DIR__.'/../Fixtures/Util/'; + + try { + XmlUtils::loadFile($fixtures.'invalid.xml'); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertContains('ERROR 77', $e->getMessage()); + } + + try { + XmlUtils::loadFile($fixtures.'document_type.xml'); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertContains('Document types are not allowed', $e->getMessage()); + } + + try { + XmlUtils::loadFile($fixtures.'invalid_schema.xml', $fixtures.'schema.xsd'); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertContains('ERROR 1845', $e->getMessage()); + } + + try { + XmlUtils::loadFile($fixtures.'invalid_schema.xml', 'invalid_callback_or_file'); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertContains('XSD file or callable', $e->getMessage()); + } + + $mock = $this->getMock(__NAMESPACE__.'\Validator'); + $mock->expects($this->exactly(2))->method('validate')->will($this->onConsecutiveCalls(false, true)); + + try { + XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertContains('is not valid', $e->getMessage()); + } + + $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'))); + } + + /** + * @dataProvider getDataForConvertDomToArray + */ + public function testConvertDomToArray($expected, $xml, $root = false, $checkPrefix = true) + { + $dom = new \DOMDocument(); + $dom->loadXML($root ? $xml : ''.$xml.''); + + $this->assertSame($expected, XmlUtils::convertDomElementToArray($dom->documentElement, $checkPrefix)); + } + + public function getDataForConvertDomToArray() + { + return array( + array(null, ''), + array('bar', 'bar'), + array(array('bar' => 'foobar'), '', true), + array(array('foo' => null), ''), + array(array('foo' => 'bar'), 'bar'), + array(array('foo' => array('foo' => 'bar')), ''), + array(array('foo' => array('foo' => 'bar')), 'bar'), + array(array('foo' => array('foo' => 'bar', 'value' => 'text')), 'text'), + array(array('foo' => array('attr' => 'bar', 'foo' => 'text')), 'text'), + array(array('foo' => array('bar', 'text')), 'bartext'), + array(array('foo' => array(array('foo' => 'bar'), array('foo' => 'text'))), ''), + array(array('foo' => array('foo' => array('bar', 'text'))), 'text'), + array(array('foo' => 'bar'), 'bar'), + array(array('foo' => 'text'), 'text'), + array(array('foo' => array('bar' => 'bar', 'value' => 'text')), 'text', false, false), + array(array('attr' => 1, 'b' => 'hello'), 'hello2', true), + ); + } + + /** + * @dataProvider getDataForPhpize + */ + public function testPhpize($expected, $value) + { + $this->assertSame($expected, XmlUtils::phpize($value)); + } + + public function getDataForPhpize() + { + return array( + array(null, 'null'), + array(true, 'true'), + array(false, 'false'), + array(null, 'Null'), + array(true, 'True'), + array(false, 'False'), + array(0, '0'), + array(1, '1'), + array(0777, '0777'), + array(255, '0xFF'), + array(100.0, '1e2'), + array(-120.0, '-1.2E2'), + array(-10100.1, '-10100.1'), + array(-10100.1, '-10,100.1'), + array('foo', 'foo'), + ); + } +} + +interface Validator +{ + public function validate(); +} diff --git a/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php b/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php new file mode 100755 index 0000000000..9317e15e7c --- /dev/null +++ b/vendor/symfony/config/Symfony/Component/Config/Util/XmlUtils.php @@ -0,0 +1,222 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Util; + +/** + * XMLUtils is a bunch of utility methods to XML operations. + * + * This class contains static methods only and is not meant to be instantiated. + * + * @author Fabien Potencier + * @author Martin Hasoň + */ +class XmlUtils +{ + /** + * This class should not be instantiated + */ + private function __construct() + { + } + + /** + * Loads an XML file. + * + * @param string $file An XML file path + * @param string|callable $schemaOrCallable An XSD schema file path or callable + * + * @return \DOMDocument + * + * @throws \InvalidArgumentException When loading of XML file returns error + */ + public static function loadFile($file, $schemaOrCallable = null) + { + $internalErrors = libxml_use_internal_errors(true); + $disableEntities = libxml_disable_entity_loader(true); + libxml_clear_errors(); + + $dom = new \DOMDocument(); + $dom->validateOnParse = true; + if (!$dom->loadXML(file_get_contents($file), LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) { + libxml_disable_entity_loader($disableEntities); + + throw new \InvalidArgumentException(implode("\n", static::getXmlErrors($internalErrors))); + } + + $dom->normalizeDocument(); + + libxml_use_internal_errors($internalErrors); + libxml_disable_entity_loader($disableEntities); + + foreach ($dom->childNodes as $child) { + if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) { + throw new \InvalidArgumentException('Document types are not allowed.'); + } + } + + if (null !== $schemaOrCallable) { + $internalErrors = libxml_use_internal_errors(true); + libxml_clear_errors(); + + $e = null; + if (is_callable($schemaOrCallable)) { + try { + $valid = call_user_func($schemaOrCallable, $dom, $internalErrors); + } catch (\Exception $e) { + $valid = false; + } + } elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) { + $valid = @$dom->schemaValidate($schemaOrCallable); + } else { + libxml_use_internal_errors($internalErrors); + + throw new \InvalidArgumentException('The schemaOrCallable argument has to be a valid path to XSD file or callable.'); + } + + if (!$valid) { + $messages = static::getXmlErrors($internalErrors); + if (empty($messages)) { + $messages = array(sprintf('The XML file "%s" is not valid.', $file)); + } + throw new \InvalidArgumentException(implode("\n", $messages), 0, $e); + } + + libxml_use_internal_errors($internalErrors); + } + + return $dom; + } + + /** + * Converts a \DomElement object to a PHP array. + * + * The following rules applies during the conversion: + * + * * Each tag is converted to a key value or an array + * if there is more than one "value" + * + * * The content of a tag is set under a "value" key (bar) + * if the tag also has some nested tags + * + * * The attributes are converted to keys () + * + * * The nested-tags are converted to keys (bar) + * + * @param \DomElement $element A \DomElement instance + * @param Boolean $checkPrefix Check prefix in an element or an attribute name + * + * @return array A PHP array + */ + public static function convertDomElementToArray(\DomElement $element, $checkPrefix = true) + { + $prefix = (string) $element->prefix; + $empty = true; + $config = array(); + foreach ($element->attributes as $name => $node) { + if ($checkPrefix && !in_array((string) $node->prefix, array('', $prefix), true)) { + continue; + } + $config[$name] = static::phpize($node->value); + $empty = false; + } + + $nodeValue = false; + foreach ($element->childNodes as $node) { + if ($node instanceof \DOMText) { + if (trim($node->nodeValue)) { + $nodeValue = trim($node->nodeValue); + $empty = false; + } + } elseif ($checkPrefix && $prefix != (string) $node->prefix) { + continue; + } elseif (!$node instanceof \DOMComment) { + $value = static::convertDomElementToArray($node, $checkPrefix); + + $key = $node->localName; + if (isset($config[$key])) { + if (!is_array($config[$key]) || !is_int(key($config[$key]))) { + $config[$key] = array($config[$key]); + } + $config[$key][] = $value; + } else { + $config[$key] = $value; + } + + $empty = false; + } + } + + if (false !== $nodeValue) { + $value = static::phpize($nodeValue); + if (count($config)) { + $config['value'] = $value; + } else { + $config = $value; + } + } + + return !$empty ? $config : null; + } + + /** + * Converts an xml value to a php type. + * + * @param mixed $value + * + * @return mixed + */ + public static function phpize($value) + { + $value = (string) $value; + $lowercaseValue = strtolower($value); + + switch (true) { + case 'null' === $lowercaseValue: + return null; + case ctype_digit($value): + $raw = $value; + $cast = intval($value); + + return '0' == $value[0] ? octdec($value) : (((string) $raw == (string) $cast) ? $cast : $raw); + case 'true' === $lowercaseValue: + return true; + case 'false' === $lowercaseValue: + return false; + case is_numeric($value): + return '0x' == $value[0].$value[1] ? hexdec($value) : floatval($value); + case preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $value): + return floatval(str_replace(',', '', $value)); + default: + return $value; + } + } + + protected static function getXmlErrors($internalErrors) + { + $errors = array(); + foreach (libxml_get_errors() as $error) { + $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', + LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', + $error->code, + trim($error->message), + $error->file ? $error->file : 'n/a', + $error->line, + $error->column + ); + } + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return $errors; + } +} diff --git a/vendor/symfony/config/Symfony/Component/Config/composer.json b/vendor/symfony/config/Symfony/Component/Config/composer.json old mode 100644 new mode 100755 index f76ca99ff7..e148c27c09 --- a/vendor/symfony/config/Symfony/Component/Config/composer.json +++ b/vendor/symfony/config/Symfony/Component/Config/composer.json @@ -19,8 +19,13 @@ "php": ">=5.3.3" }, "autoload": { - "psr-0": { "Symfony\\Component\\Config": "" } + "psr-0": { "Symfony\\Component\\Config\\": "" } }, "target-dir": "Symfony/Component/Config", - "minimum-stability": "dev" + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + } } diff --git a/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist b/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist old mode 100644 new mode 100755 index e0195190ea..7ba6e55234 --- a/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist +++ b/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist @@ -9,7 +9,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="Tests/bootstrap.php" + bootstrap="vendor/autoload.php" > diff --git a/vendor/symfony/console/Symfony/Component/Console/Application.php b/vendor/symfony/console/Symfony/Component/Console/Application.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md b/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md old mode 100644 new mode 100755 index a5f1722bae..ee0459e13d --- a/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md +++ b/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md @@ -6,6 +6,7 @@ CHANGELOG * added support for colorization on Windows via ConEmu * add a method to Dialog Helper to ask for a question and hide the response + * added support for interactive selections in console (DialogHelper::select()) 2.1.0 ----- diff --git a/vendor/symfony/console/Symfony/Component/Console/Command/Command.php b/vendor/symfony/console/Symfony/Component/Console/Command/Command.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php b/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php b/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php old mode 100644 new mode 100755 index 232343454e..baeeefc591 --- a/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php +++ b/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php @@ -24,6 +24,40 @@ class DialogHelper extends Helper private static $shell; private static $stty; + /** + * Asks the user to select a value. + * + * @param OutputInterface $output An Output instance + * @param string|array $question The question to ask + * @param array $choices List of choices to pick from + * @param Boolean $default The default answer if the user enters nothing + * @param integer|false $attempts Max number of times to ask before giving up (false by default, which means infinite) + * @param string $errorMessage Message which will be shown if invalid value from choice list would be picked + * + * @return integer|string The selected value (the key of the choices array) + */ + public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid') + { + $width = max(array_map('strlen', array_keys($choices))); + + $messages = (array) $question; + foreach ($choices as $key => $value) { + $messages[] = sprintf(" [%-${width}s] %s", $key, $value); + } + + $output->writeln($messages); + + $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage) { + if (empty($choices[$picked])) { + throw new \InvalidArgumentException(sprintf($errorMessage, $picked)); + } + + return $picked; + }, $attempts, $default); + + return $result; + } + /** * Asks a question to the user. * diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php b/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php b/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php b/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php b/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php b/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/Input.php b/vendor/symfony/console/Symfony/Component/Console/Input/Input.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php b/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php b/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php b/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php b/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php b/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/LICENSE b/vendor/symfony/console/Symfony/Component/Console/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php b/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/Output.php b/vendor/symfony/console/Symfony/Component/Console/Output/Output.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php b/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php b/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/README.md b/vendor/symfony/console/Symfony/Component/Console/README.md old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe b/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Shell.php b/vendor/symfony/console/Symfony/Component/Console/Shell.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php b/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php b/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php old mode 100644 new mode 100755 index 658ab69b4c..d0da968a15 --- a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php @@ -18,6 +18,31 @@ use Symfony\Component\Console\Output\StreamOutput; class DialogHelperTest extends \PHPUnit_Framework_TestCase { + public function testSelect() + { + $dialog = new DialogHelper(); + + $helperSet = new HelperSet(array(new FormatterHelper())); + $dialog->setHelperSet($helperSet); + + $heroes = array('Superman', 'Batman', 'Spiderman'); + + $dialog->setInputStream($this->getInputStream("\n1\nFabien\n1\nFabien\nFabien\n")); + $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2')); + $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes)); + $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!')); + + rewind($output->getStream()); + $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream())); + + try { + $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1)); + $this->fail(); + } catch (\InvalidArgumentException $e) { + $this->assertEquals('Value "Fabien" is invalid', $e->getMessage()); + } + } + public function testAsk() { $dialog = new DialogHelper(); diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/NullOutputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Output/OutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/OutputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/StreamOutputTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/composer.json b/vendor/symfony/console/Symfony/Component/Console/composer.json old mode 100644 new mode 100755 diff --git a/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist b/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist old mode 100644 new mode 100755 diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php new file mode 100755 index 0000000000..fd75578cdb --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Alias.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * @api + */ +class Alias +{ + private $id; + private $public; + + /** + * Constructor. + * + * @param string $id Alias identifier + * @param Boolean $public If this alias is public + * + * @api + */ + public function __construct($id, $public = true) + { + $this->id = strtolower($id); + $this->public = $public; + } + + /** + * Checks if this DI Alias should be public or not. + * + * @return Boolean + * + * @api + */ + public function isPublic() + { + return $this->public; + } + + /** + * Sets if this Alias is public. + * + * @param Boolean $boolean If this Alias should be public + * + * @api + */ + public function setPublic($boolean) + { + $this->public = (Boolean) $boolean; + } + + /** + * Returns the Id of this alias. + * + * @return string The alias id + * + * @api + */ + public function __toString() + { + return $this->id; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md new file mode 100755 index 0000000000..686bd5656f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md @@ -0,0 +1,22 @@ +CHANGELOG +========= + +2.2.0 +----- + + * added an Extension base class with sensible defaults to be used in conjunction + with the Config component. + * added PrependExtensionInterface (to be able to allow extensions to prepend + application configuration settings for any Bundle) + +2.1.0 +----- + + * added IntrospectableContainerInterface (to be able to check if a service + has been initialized or not) + * added ConfigurationExtensionInterface + * added Definition::clearTag() + * component exceptions that inherit base SPL classes are now used exclusively + (this includes dumped containers) + * [BC BREAK] fixed unescaping of class arguments, method + ParameterBag::unescapeValue() was made public diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php new file mode 100755 index 0000000000..f7aa471dd8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Run this pass before passes that need to know more about the relation of + * your services. + * + * This class will populate the ServiceReferenceGraph with information. You can + * retrieve the graph in other passes from the compiler. + * + * @author Johannes M. Schmitt + */ +class AnalyzeServiceReferencesPass implements RepeatablePassInterface +{ + private $graph; + private $container; + private $currentId; + private $currentDefinition; + private $repeatedPass; + private $onlyConstructorArguments; + + /** + * Constructor. + * + * @param Boolean $onlyConstructorArguments Sets this Service Reference pass to ignore method calls + */ + public function __construct($onlyConstructorArguments = false) + { + $this->onlyConstructorArguments = (Boolean) $onlyConstructorArguments; + } + + /** + * {@inheritDoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes a ContainerBuilder object to populate the service reference graph. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + $this->graph = $container->getCompiler()->getServiceReferenceGraph(); + $this->graph->clear(); + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $this->currentId = $id; + $this->currentDefinition = $definition; + $this->processArguments($definition->getArguments()); + + if (!$this->onlyConstructorArguments) { + $this->processArguments($definition->getMethodCalls()); + $this->processArguments($definition->getProperties()); + if ($definition->getConfigurator()) { + $this->processArguments(array($definition->getConfigurator())); + } + } + } + + foreach ($container->getAliases() as $id => $alias) { + $this->graph->connect($id, $alias, (string) $alias, $this->getDefinition((string) $alias), null); + } + } + + /** + * Processes service definitions for arguments to find relationships for the service graph. + * + * @param array $arguments An array of Reference or Definition objects relating to service definitions + */ + private function processArguments(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->processArguments($argument); + } elseif ($argument instanceof Reference) { + $this->graph->connect( + $this->currentId, + $this->currentDefinition, + $this->getDefinitionId((string) $argument), + $this->getDefinition((string) $argument), + $argument + ); + } elseif ($argument instanceof Definition) { + $this->processArguments($argument->getArguments()); + $this->processArguments($argument->getMethodCalls()); + $this->processArguments($argument->getProperties()); + } + } + } + + /** + * Returns a service definition given the full name or an alias. + * + * @param string $id A full id or alias for a service definition. + * + * @return Definition|null The definition related to the supplied id + */ + private function getDefinition($id) + { + $id = $this->getDefinitionId($id); + + return null === $id ? null : $this->container->getDefinition($id); + } + + private function getDefinitionId($id) + { + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + if (!$this->container->hasDefinition($id)) { + return null; + } + + return $id; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php new file mode 100755 index 0000000000..e24b5b0202 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Checks your services for circular references + * + * References from method calls are ignored since we might be able to resolve + * these references depending on the order in which services are called. + * + * Circular reference from method calls will only be detected at run-time. + * + * @author Johannes M. Schmitt + */ +class CheckCircularReferencesPass implements CompilerPassInterface +{ + private $currentId; + private $currentPath; + + /** + * Checks the ContainerBuilder object for circular references. + * + * @param ContainerBuilder $container The ContainerBuilder instances + */ + public function process(ContainerBuilder $container) + { + $graph = $container->getCompiler()->getServiceReferenceGraph(); + + foreach ($graph->getNodes() as $id => $node) { + $this->currentId = $id; + $this->currentPath = array($id); + + $this->checkOutEdges($node->getOutEdges()); + } + } + + /** + * Checks for circular references. + * + * @param ServiceReferenceGraphEdge[] $edges An array of Edges + * + * @throws ServiceCircularReferenceException When a circular reference is found. + */ + private function checkOutEdges(array $edges) + { + foreach ($edges as $edge) { + $node = $edge->getDestNode(); + $this->currentPath[] = $id = $node->getId(); + + if ($this->currentId === $id) { + throw new ServiceCircularReferenceException($this->currentId, $this->currentPath); + } + + $this->checkOutEdges($node->getOutEdges()); + array_pop($this->currentPath); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php new file mode 100755 index 0000000000..e536331c6e --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * This pass validates each definition individually only taking the information + * into account which is contained in the definition itself. + * + * Later passes can rely on the following, and specifically do not need to + * perform these checks themselves: + * + * - non synthetic, non abstract services always have a class set + * - synthetic services are always public + * - synthetic services are always of non-prototype scope + * + * @author Johannes M. Schmitt + */ +class CheckDefinitionValidityPass implements CompilerPassInterface +{ + /** + * Processes the ContainerBuilder to validate the Definition. + * + * @param ContainerBuilder $container + * + * @throws RuntimeException When the Definition is invalid + */ + public function process(ContainerBuilder $container) + { + foreach ($container->getDefinitions() as $id => $definition) { + // synthetic service is public + if ($definition->isSynthetic() && !$definition->isPublic()) { + throw new RuntimeException(sprintf( + 'A synthetic service ("%s") must be public.', + $id + )); + } + + // synthetic service has non-prototype scope + if ($definition->isSynthetic() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { + throw new RuntimeException(sprintf( + 'A synthetic service ("%s") cannot be of scope "prototype".', + $id + )); + } + + // non-synthetic, non-abstract service has class + if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) { + if ($definition->getFactoryClass() || $definition->getFactoryService()) { + throw new RuntimeException(sprintf( + 'Please add the class to service "%s" even if it is constructed by a factory ' + .'since we might need to add method calls based on compile-time checks.', + $id + )); + } + + throw new RuntimeException(sprintf( + 'The definition for "%s" has no class. If you intend to inject ' + .'this service dynamically at runtime, please mark it as synthetic=true. ' + .'If this is an abstract definition solely used by child definitions, ' + .'please add abstract=true, otherwise specify a class to get rid of this error.', + $id + )); + } + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php new file mode 100755 index 0000000000..2cd548052d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; + +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Checks that all references are pointing to a valid service. + * + * @author Johannes M. Schmitt + */ +class CheckExceptionOnInvalidReferenceBehaviorPass implements CompilerPassInterface +{ + private $container; + private $sourceId; + + public function process(ContainerBuilder $container) + { + $this->container = $container; + + foreach ($container->getDefinitions() as $id => $definition) { + $this->sourceId = $id; + $this->processDefinition($definition); + } + } + + private function processDefinition(Definition $definition) + { + $this->processReferences($definition->getArguments()); + $this->processReferences($definition->getMethodCalls()); + $this->processReferences($definition->getProperties()); + } + + private function processReferences(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->processReferences($argument); + } elseif ($argument instanceof Definition) { + $this->processDefinition($argument); + } elseif ($argument instanceof Reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $argument->getInvalidBehavior()) { + $destId = (string) $argument; + + if (!$this->container->has($destId)) { + throw new ServiceNotFoundException($destId, $this->sourceId); + } + } + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php new file mode 100755 index 0000000000..436dc74adb --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -0,0 +1,167 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ScopeCrossingInjectionException; +use Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException; + +/** + * Checks the validity of references + * + * The following checks are performed by this pass: + * - target definitions are not abstract + * - target definitions are of equal or wider scope + * - target definitions are in the same scope hierarchy + * + * @author Johannes M. Schmitt + */ +class CheckReferenceValidityPass implements CompilerPassInterface +{ + private $container; + private $currentId; + private $currentDefinition; + private $currentScope; + private $currentScopeAncestors; + private $currentScopeChildren; + + /** + * Processes the ContainerBuilder to validate References. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + + $children = $this->container->getScopeChildren(); + $ancestors = array(); + + $scopes = $this->container->getScopes(); + foreach ($scopes as $name => $parent) { + $ancestors[$name] = array($parent); + + while (isset($scopes[$parent])) { + $ancestors[$name][] = $parent = $scopes[$parent]; + } + } + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $this->currentId = $id; + $this->currentDefinition = $definition; + $this->currentScope = $scope = $definition->getScope(); + + if (ContainerInterface::SCOPE_CONTAINER === $scope) { + $this->currentScopeChildren = array_keys($scopes); + $this->currentScopeAncestors = array(); + } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope) { + $this->currentScopeChildren = $children[$scope]; + $this->currentScopeAncestors = $ancestors[$scope]; + } + + $this->validateReferences($definition->getArguments()); + $this->validateReferences($definition->getMethodCalls()); + $this->validateReferences($definition->getProperties()); + } + } + + /** + * Validates an array of References. + * + * @param array $arguments An array of Reference objects + * + * @throws RuntimeException when there is a reference to an abstract definition. + */ + private function validateReferences(array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->validateReferences($argument); + } elseif ($argument instanceof Reference) { + $targetDefinition = $this->getDefinition((string) $argument); + + if (null !== $targetDefinition && $targetDefinition->isAbstract()) { + throw new RuntimeException(sprintf( + 'The definition "%s" has a reference to an abstract definition "%s". ' + .'Abstract definitions cannot be the target of references.', + $this->currentId, + $argument + )); + } + + $this->validateScope($argument, $targetDefinition); + } + } + } + + /** + * Validates the scope of a single Reference. + * + * @param Reference $reference + * @param Definition $definition + * + * @throws ScopeWideningInjectionException when the definition references a service of a narrower scope + * @throws ScopeCrossingInjectionException when the definition references a service of another scope hierarchy + */ + private function validateScope(Reference $reference, Definition $definition = null) + { + if (ContainerInterface::SCOPE_PROTOTYPE === $this->currentScope) { + return; + } + + if (!$reference->isStrict()) { + return; + } + + if (null === $definition) { + return; + } + + if ($this->currentScope === $scope = $definition->getScope()) { + return; + } + + $id = (string) $reference; + + if (in_array($scope, $this->currentScopeChildren, true)) { + throw new ScopeWideningInjectionException($this->currentId, $this->currentScope, $id, $scope); + } + + if (!in_array($scope, $this->currentScopeAncestors, true)) { + throw new ScopeCrossingInjectionException($this->currentId, $this->currentScope, $id, $scope); + } + } + + /** + * Returns the Definition given an id. + * + * @param string $id Definition identifier + * + * @return Definition + */ + private function getDefinition($id) + { + if (!$this->container->hasDefinition($id)) { + return null; + } + + return $this->container->getDefinition($id); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php new file mode 100755 index 0000000000..01f224b823 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; + +/** + * This class is used to remove circular dependencies between individual passes. + * + * @author Johannes M. Schmitt + * + * @api + */ +class Compiler +{ + private $passConfig; + private $log; + private $loggingFormatter; + private $serviceReferenceGraph; + + /** + * Constructor. + */ + public function __construct() + { + $this->passConfig = new PassConfig(); + $this->serviceReferenceGraph = new ServiceReferenceGraph(); + $this->loggingFormatter = new LoggingFormatter(); + $this->log = array(); + } + + /** + * Returns the PassConfig. + * + * @return PassConfig The PassConfig instance + * + * @api + */ + public function getPassConfig() + { + return $this->passConfig; + } + + /** + * Returns the ServiceReferenceGraph. + * + * @return ServiceReferenceGraph The ServiceReferenceGraph instance + * + * @api + */ + public function getServiceReferenceGraph() + { + return $this->serviceReferenceGraph; + } + + /** + * Returns the logging formatter which can be used by compilation passes. + * + * @return LoggingFormatter + */ + public function getLoggingFormatter() + { + return $this->loggingFormatter; + } + + /** + * Adds a pass to the PassConfig. + * + * @param CompilerPassInterface $pass A compiler pass + * @param string $type The type of the pass + * + * @api + */ + public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) + { + $this->passConfig->addPass($pass, $type); + } + + /** + * Adds a log message. + * + * @param string $string The log message + */ + public function addLogMessage($string) + { + $this->log[] = $string; + } + + /** + * Returns the log. + * + * @return array Log array + */ + public function getLog() + { + return $this->log; + } + + /** + * Run the Compiler and process all Passes. + * + * @param ContainerBuilder $container + * + * @api + */ + public function compile(ContainerBuilder $container) + { + foreach ($this->passConfig->getPasses() as $pass) { + $pass->process($container); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php new file mode 100755 index 0000000000..beacda9dc7 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Interface that must be implemented by compilation passes + * + * @author Johannes M. Schmitt + * + * @api + */ +interface CompilerPassInterface +{ + /** + * You can modify the container here before it is dumped to PHP code. + * + * @param ContainerBuilder $container + * + * @api + */ + public function process(ContainerBuilder $container); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php new file mode 100755 index 0000000000..ab8895a8c9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php @@ -0,0 +1,139 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Inline service definitions where this is possible. + * + * @author Johannes M. Schmitt + */ +class InlineServiceDefinitionsPass implements RepeatablePassInterface +{ + private $repeatedPass; + private $graph; + private $compiler; + private $formatter; + private $currentId; + + /** + * {@inheritDoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes the ContainerBuilder for inline service definitions. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + $this->graph = $this->compiler->getServiceReferenceGraph(); + + foreach ($container->getDefinitions() as $id => $definition) { + $this->currentId = $id; + + $definition->setArguments( + $this->inlineArguments($container, $definition->getArguments()) + ); + + $definition->setMethodCalls( + $this->inlineArguments($container, $definition->getMethodCalls()) + ); + + $definition->setProperties( + $this->inlineArguments($container, $definition->getProperties()) + ); + } + } + + /** + * Processes inline arguments. + * + * @param ContainerBuilder $container The ContainerBuilder + * @param array $arguments An array of arguments + * + * @return array + */ + private function inlineArguments(ContainerBuilder $container, array $arguments) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->inlineArguments($container, $argument); + } elseif ($argument instanceof Reference) { + if (!$container->hasDefinition($id = (string) $argument)) { + continue; + } + + if ($this->isInlineableDefinition($container, $id, $definition = $container->getDefinition($id))) { + $this->compiler->addLogMessage($this->formatter->formatInlineService($this, $id, $this->currentId)); + + if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) { + $arguments[$k] = $definition; + } else { + $arguments[$k] = clone $definition; + } + } + } elseif ($argument instanceof Definition) { + $argument->setArguments($this->inlineArguments($container, $argument->getArguments())); + $argument->setMethodCalls($this->inlineArguments($container, $argument->getMethodCalls())); + $argument->setProperties($this->inlineArguments($container, $argument->getProperties())); + } + } + + return $arguments; + } + + /** + * Checks if the definition is inlineable. + * + * @param ContainerBuilder $container + * @param string $id + * @param Definition $definition + * + * @return Boolean If the definition is inlineable + */ + private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition) + { + if (ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { + return true; + } + + if ($definition->isPublic()) { + return false; + } + + if (!$this->graph->hasNode($id)) { + return true; + } + + $ids = array(); + foreach ($this->graph->getNode($id)->getInEdges() as $edge) { + $ids[] = $edge->getSourceNode()->getId(); + } + + if (count(array_unique($ids)) > 1) { + return false; + } + + return $container->getDefinition(reset($ids))->getScope() === $definition->getScope(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php new file mode 100755 index 0000000000..6bd6161ceb --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/LoggingFormatter.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Used to format logging messages during the compilation. + * + * @author Johannes M. Schmitt + */ +class LoggingFormatter +{ + public function formatRemoveService(CompilerPassInterface $pass, $id, $reason) + { + return $this->format($pass, sprintf('Removed service "%s"; reason: %s', $id, $reason)); + } + + public function formatInlineService(CompilerPassInterface $pass, $id, $target) + { + return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target)); + } + + public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId) + { + return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId)); + } + + public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId) + { + return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId)); + } + + public function format(CompilerPassInterface $pass, $message) + { + return sprintf('%s: %s', get_class($pass), $message); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php new file mode 100755 index 0000000000..d2c98314e2 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Merges extension configs into the container builder + * + * @author Fabien Potencier + */ +class MergeExtensionConfigurationPass implements CompilerPassInterface +{ + /** + * {@inheritDoc} + */ + public function process(ContainerBuilder $container) + { + $parameters = $container->getParameterBag()->all(); + $definitions = $container->getDefinitions(); + $aliases = $container->getAliases(); + + foreach ($container->getExtensions() as $extension) { + if ($extension instanceof PrependExtensionInterface) { + $extension->prepend($container); + } + } + + foreach ($container->getExtensions() as $name => $extension) { + if (!$config = $container->getExtensionConfig($name)) { + // this extension was not called + continue; + } + $config = $container->getParameterBag()->resolveValue($config); + + $tmpContainer = new ContainerBuilder($container->getParameterBag()); + $tmpContainer->addObjectResource($extension); + + $extension->load($config, $tmpContainer); + + $container->merge($tmpContainer); + } + + $container->addDefinitions($definitions); + $container->addAliases($aliases); + $container->getParameterBag()->add($parameters); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php new file mode 100755 index 0000000000..e863f75640 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PassConfig.php @@ -0,0 +1,259 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * Compiler Pass Configuration + * + * This class has a default configuration embedded. + * + * @author Johannes M. Schmitt + * + * @api + */ +class PassConfig +{ + const TYPE_AFTER_REMOVING = 'afterRemoving'; + const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization'; + const TYPE_BEFORE_REMOVING = 'beforeRemoving'; + const TYPE_OPTIMIZE = 'optimization'; + const TYPE_REMOVE = 'removing'; + + private $mergePass; + private $afterRemovingPasses; + private $beforeOptimizationPasses; + private $beforeRemovingPasses; + private $optimizationPasses; + private $removingPasses; + + /** + * Constructor. + */ + public function __construct() + { + $this->mergePass = new MergeExtensionConfigurationPass(); + + $this->afterRemovingPasses = array(); + $this->beforeOptimizationPasses = array(); + $this->beforeRemovingPasses = array(); + + $this->optimizationPasses = array( + new ResolveDefinitionTemplatesPass(), + new ResolveParameterPlaceHoldersPass(), + new CheckDefinitionValidityPass(), + new ResolveReferencesToAliasesPass(), + new ResolveInvalidReferencesPass(), + new AnalyzeServiceReferencesPass(true), + new CheckCircularReferencesPass(), + new CheckReferenceValidityPass(), + ); + + $this->removingPasses = array( + new RemovePrivateAliasesPass(), + new RemoveAbstractDefinitionsPass(), + new ReplaceAliasByActualDefinitionPass(), + new RepeatedPass(array( + new AnalyzeServiceReferencesPass(), + new InlineServiceDefinitionsPass(), + new AnalyzeServiceReferencesPass(), + new RemoveUnusedDefinitionsPass(), + )), + new CheckExceptionOnInvalidReferenceBehaviorPass(), + ); + } + + /** + * Returns all passes in order to be processed. + * + * @return array An array of all passes to process + * + * @api + */ + public function getPasses() + { + return array_merge( + array($this->mergePass), + $this->beforeOptimizationPasses, + $this->optimizationPasses, + $this->beforeRemovingPasses, + $this->removingPasses, + $this->afterRemovingPasses + ); + } + + /** + * Adds a pass. + * + * @param CompilerPassInterface $pass A Compiler pass + * @param string $type The pass type + * + * @throws InvalidArgumentException when a pass type doesn't exist + * + * @api + */ + public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION) + { + $property = $type.'Passes'; + if (!isset($this->$property)) { + throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type)); + } + + $passes = &$this->$property; + $passes[] = $pass; + } + + /** + * Gets all passes for the AfterRemoving pass. + * + * @return array An array of passes + * + * @api + */ + public function getAfterRemovingPasses() + { + return $this->afterRemovingPasses; + } + + /** + * Gets all passes for the BeforeOptimization pass. + * + * @return array An array of passes + * + * @api + */ + public function getBeforeOptimizationPasses() + { + return $this->beforeOptimizationPasses; + } + + /** + * Gets all passes for the BeforeRemoving pass. + * + * @return array An array of passes + * + * @api + */ + public function getBeforeRemovingPasses() + { + return $this->beforeRemovingPasses; + } + + /** + * Gets all passes for the Optimization pass. + * + * @return array An array of passes + * + * @api + */ + public function getOptimizationPasses() + { + return $this->optimizationPasses; + } + + /** + * Gets all passes for the Removing pass. + * + * @return array An array of passes + * + * @api + */ + public function getRemovingPasses() + { + return $this->removingPasses; + } + + /** + * Gets all passes for the Merge pass. + * + * @return array An array of passes + * + * @api + */ + public function getMergePass() + { + return $this->mergePass; + } + + /** + * Sets the Merge Pass. + * + * @param CompilerPassInterface $pass The merge pass + * + * @api + */ + public function setMergePass(CompilerPassInterface $pass) + { + $this->mergePass = $pass; + } + + /** + * Sets the AfterRemoving passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setAfterRemovingPasses(array $passes) + { + $this->afterRemovingPasses = $passes; + } + + /** + * Sets the BeforeOptimization passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setBeforeOptimizationPasses(array $passes) + { + $this->beforeOptimizationPasses = $passes; + } + + /** + * Sets the BeforeRemoving passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setBeforeRemovingPasses(array $passes) + { + $this->beforeRemovingPasses = $passes; + } + + /** + * Sets the Optimization passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setOptimizationPasses(array $passes) + { + $this->optimizationPasses = $passes; + } + + /** + * Sets the Removing passes. + * + * @param array $passes An array of passes + * + * @api + */ + public function setRemovingPasses(array $passes) + { + $this->removingPasses = $passes; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PrependExtensionInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PrependExtensionInterface.php new file mode 100755 index 0000000000..bba1b6cd46 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/PrependExtensionInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +interface PrependExtensionInterface +{ + /** + * Allow an extension to prepend the extension configurations. + * + * @param ContainerBuilder $container + */ + public function prepend(ContainerBuilder $container); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php new file mode 100755 index 0000000000..d97d923c78 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Removes abstract Definitions + * + */ +class RemoveAbstractDefinitionsPass implements CompilerPassInterface +{ + /** + * Removes abstract definitions from the ContainerBuilder + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isAbstract()) { + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract')); + } + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php new file mode 100755 index 0000000000..48423372c9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Remove private aliases from the container. They were only used to establish + * dependencies between services, and these dependencies have been resolved in + * one of the previous passes. + * + * @author Johannes M. Schmitt + */ +class RemovePrivateAliasesPass implements CompilerPassInterface +{ + /** + * Removes private aliases from the ContainerBuilder + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + + foreach ($container->getAliases() as $id => $alias) { + if ($alias->isPublic()) { + continue; + } + + $container->removeAlias($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'private alias')); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php new file mode 100755 index 0000000000..0c7be667a1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RemoveUnusedDefinitionsPass.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Removes unused service definitions from the container. + * + * @author Johannes M. Schmitt + */ +class RemoveUnusedDefinitionsPass implements RepeatablePassInterface +{ + private $repeatedPass; + + /** + * {@inheritDoc} + */ + public function setRepeatedPass(RepeatedPass $repeatedPass) + { + $this->repeatedPass = $repeatedPass; + } + + /** + * Processes the ContainerBuilder to remove unused definitions. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $compiler = $container->getCompiler(); + $formatter = $compiler->getLoggingFormatter(); + $graph = $compiler->getServiceReferenceGraph(); + + $hasChanged = false; + foreach ($container->getDefinitions() as $id => $definition) { + if ($definition->isPublic()) { + continue; + } + + if ($graph->hasNode($id)) { + $edges = $graph->getNode($id)->getInEdges(); + $referencingAliases = array(); + $sourceIds = array(); + foreach ($edges as $edge) { + $node = $edge->getSourceNode(); + $sourceIds[] = $node->getId(); + + if ($node->isAlias()) { + $referencingAliases[] = $node->getValue(); + } + } + $isReferenced = (count(array_unique($sourceIds)) - count($referencingAliases)) > 0; + } else { + $referencingAliases = array(); + $isReferenced = false; + } + + if (1 === count($referencingAliases) && false === $isReferenced) { + $container->setDefinition((string) reset($referencingAliases), $definition); + $definition->setPublic(true); + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'replaces alias '.reset($referencingAliases))); + } elseif (0 === count($referencingAliases) && false === $isReferenced) { + $container->removeDefinition($id); + $compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'unused')); + $hasChanged = true; + } + } + + if ($hasChanged) { + $this->repeatedPass->setRepeat(); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php new file mode 100755 index 0000000000..d60ae35bc8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatablePassInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Interface that must be implemented by passes that are run as part of an + * RepeatedPass. + * + * @author Johannes M. Schmitt + */ +interface RepeatablePassInterface extends CompilerPassInterface +{ + /** + * Sets the RepeatedPass interface. + * + * @param RepeatedPass $repeatedPass + */ + public function setRepeatedPass(RepeatedPass $repeatedPass); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php new file mode 100755 index 0000000000..6073abe69d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * A pass that might be run repeatedly. + * + * @author Johannes M. Schmitt + */ +class RepeatedPass implements CompilerPassInterface +{ + /** + * @var Boolean + */ + private $repeat = false; + + /** + * @var RepeatablePassInterface[] + */ + private $passes; + + /** + * Constructor. + * + * @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects + * + * @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface + */ + public function __construct(array $passes) + { + foreach ($passes as $pass) { + if (!$pass instanceof RepeatablePassInterface) { + throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.'); + } + + $pass->setRepeatedPass($this); + } + + $this->passes = $passes; + } + + /** + * Process the repeatable passes that run more than once. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->repeat = false; + foreach ($this->passes as $pass) { + $pass->process($container); + } + + if ($this->repeat) { + $this->process($container); + } + } + + /** + * Sets if the pass should repeat + */ + public function setRepeat() + { + $this->repeat = true; + } + + /** + * Returns the passes + * + * @return RepeatablePassInterface[] An array of RepeatablePassInterface objects + */ + public function getPasses() + { + return $this->passes; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php new file mode 100755 index 0000000000..1964184955 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Replaces aliases with actual service definitions, effectively removing these + * aliases. + * + * @author Johannes M. Schmitt + */ +class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface +{ + private $compiler; + private $formatter; + private $sourceId; + + /** + * Process the Container to replace aliases with service definitions. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + + foreach ($container->getAliases() as $id => $alias) { + $aliasId = (string) $alias; + + $definition = $container->getDefinition($aliasId); + + if ($definition->isPublic()) { + continue; + } + + $definition->setPublic(true); + $container->setDefinition($id, $definition); + $container->removeDefinition($aliasId); + + $this->updateReferences($container, $aliasId, $id); + + // we have to restart the process due to concurrent modification of + // the container + $this->process($container); + + break; + } + } + + /** + * Updates references to remove aliases. + * + * @param ContainerBuilder $container The container + * @param string $currentId The alias identifier being replaced + * @param string $newId The id of the service the alias points to + */ + private function updateReferences($container, $currentId, $newId) + { + foreach ($container->getAliases() as $id => $alias) { + if ($currentId === (string) $alias) { + $container->setAlias($id, $newId); + } + } + + foreach ($container->getDefinitions() as $id => $definition) { + $this->sourceId = $id; + + $definition->setArguments( + $this->updateArgumentReferences($definition->getArguments(), $currentId, $newId) + ); + + $definition->setMethodCalls( + $this->updateArgumentReferences($definition->getMethodCalls(), $currentId, $newId) + ); + + $definition->setProperties( + $this->updateArgumentReferences($definition->getProperties(), $currentId, $newId) + ); + } + } + + /** + * Updates argument references. + * + * @param array $arguments An array of Arguments + * @param string $currentId The alias identifier + * @param string $newId The identifier the alias points to + * + * @return array + */ + private function updateArgumentReferences(array $arguments, $currentId, $newId) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->updateArgumentReferences($argument, $currentId, $newId); + } elseif ($argument instanceof Reference) { + if ($currentId === (string) $argument) { + $arguments[$k] = new Reference($newId, $argument->getInvalidBehavior()); + $this->compiler->addLogMessage($this->formatter->formatUpdateReference($this, $this->sourceId, $currentId, $newId)); + } + } + } + + return $arguments; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php new file mode 100755 index 0000000000..4fb5b0d3bf --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php @@ -0,0 +1,150 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * This replaces all DefinitionDecorator instances with their equivalent fully + * merged Definition instance. + * + * @author Johannes M. Schmitt + */ +class ResolveDefinitionTemplatesPass implements CompilerPassInterface +{ + private $container; + private $compiler; + private $formatter; + + /** + * Process the ContainerBuilder to replace DefinitionDecorator instances with their real Definition instances. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + $this->compiler = $container->getCompiler(); + $this->formatter = $this->compiler->getLoggingFormatter(); + + foreach (array_keys($container->getDefinitions()) as $id) { + // yes, we are specifically fetching the definition from the + // container to ensure we are not operating on stale data + $definition = $container->getDefinition($id); + if (!$definition instanceof DefinitionDecorator || $definition->isAbstract()) { + continue; + } + + $this->resolveDefinition($id, $definition); + } + } + + /** + * Resolves the definition + * + * @param string $id The definition identifier + * @param DefinitionDecorator $definition + * + * @return Definition + * + * @throws \RuntimeException When the definition is invalid + */ + private function resolveDefinition($id, DefinitionDecorator $definition) + { + if (!$this->container->hasDefinition($parent = $definition->getParent())) { + throw new RuntimeException(sprintf('The parent definition "%s" defined for definition "%s" does not exist.', $parent, $id)); + } + + $parentDef = $this->container->getDefinition($parent); + if ($parentDef instanceof DefinitionDecorator) { + $parentDef = $this->resolveDefinition($parent, $parentDef); + } + + $this->compiler->addLogMessage($this->formatter->formatResolveInheritance($this, $id, $parent)); + $def = new Definition(); + + // merge in parent definition + // purposely ignored attributes: scope, abstract, tags + $def->setClass($parentDef->getClass()); + $def->setArguments($parentDef->getArguments()); + $def->setMethodCalls($parentDef->getMethodCalls()); + $def->setProperties($parentDef->getProperties()); + $def->setFactoryClass($parentDef->getFactoryClass()); + $def->setFactoryMethod($parentDef->getFactoryMethod()); + $def->setFactoryService($parentDef->getFactoryService()); + $def->setConfigurator($parentDef->getConfigurator()); + $def->setFile($parentDef->getFile()); + $def->setPublic($parentDef->isPublic()); + + // overwrite with values specified in the decorator + $changes = $definition->getChanges(); + if (isset($changes['class'])) { + $def->setClass($definition->getClass()); + } + if (isset($changes['factory_class'])) { + $def->setFactoryClass($definition->getFactoryClass()); + } + if (isset($changes['factory_method'])) { + $def->setFactoryMethod($definition->getFactoryMethod()); + } + if (isset($changes['factory_service'])) { + $def->setFactoryService($definition->getFactoryService()); + } + if (isset($changes['configurator'])) { + $def->setConfigurator($definition->getConfigurator()); + } + if (isset($changes['file'])) { + $def->setFile($definition->getFile()); + } + if (isset($changes['public'])) { + $def->setPublic($definition->isPublic()); + } + + // merge arguments + foreach ($definition->getArguments() as $k => $v) { + if (is_numeric($k)) { + $def->addArgument($v); + continue; + } + + if (0 !== strpos($k, 'index_')) { + throw new RuntimeException(sprintf('Invalid argument key "%s" found.', $k)); + } + + $index = (integer) substr($k, strlen('index_')); + $def->replaceArgument($index, $v); + } + + // merge properties + foreach ($definition->getProperties() as $k => $v) { + $def->setProperty($k, $v); + } + + // append method calls + if (count($calls = $definition->getMethodCalls()) > 0) { + $def->setMethodCalls(array_merge($def->getMethodCalls(), $calls)); + } + + // these attributes are always taken from the child + $def->setAbstract($definition->isAbstract()); + $def->setScope($definition->getScope()); + $def->setTags($definition->getTags()); + + // set new definition on container + $this->container->setDefinition($id, $def); + + return $def; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php new file mode 100755 index 0000000000..0674ad4fef --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * Emulates the invalid behavior if the reference is not found within the + * container. + * + * @author Johannes M. Schmitt + */ +class ResolveInvalidReferencesPass implements CompilerPassInterface +{ + private $container; + + /** + * Process the ContainerBuilder to resolve invalid references. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + foreach ($container->getDefinitions() as $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $definition->setArguments( + $this->processArguments($definition->getArguments()) + ); + + $calls = array(); + foreach ($definition->getMethodCalls() as $call) { + try { + $calls[] = array($call[0], $this->processArguments($call[1], true)); + } catch (RuntimeException $ignore) { + // this call is simply removed + } + } + $definition->setMethodCalls($calls); + + $properties = array(); + foreach ($definition->getProperties() as $name => $value) { + try { + $value = $this->processArguments(array($value), true); + $properties[$name] = reset($value); + } catch (RuntimeException $ignore) { + // ignore property + } + } + $definition->setProperties($properties); + } + } + + /** + * Processes arguments to determine invalid references. + * + * @param array $arguments An array of Reference objects + * @param Boolean $inMethodCall + * + * @return array + * + * @throws \RuntimeException When the config is invalid + */ + private function processArguments(array $arguments, $inMethodCall = false) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->processArguments($argument, $inMethodCall); + } elseif ($argument instanceof Reference) { + $id = (string) $argument; + + $invalidBehavior = $argument->getInvalidBehavior(); + $exists = $this->container->has($id); + + // resolve invalid behavior + if ($exists && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { + $arguments[$k] = new Reference($id); + } elseif (!$exists && ContainerInterface::NULL_ON_INVALID_REFERENCE === $invalidBehavior) { + $arguments[$k] = null; + } elseif (!$exists && ContainerInterface::IGNORE_ON_INVALID_REFERENCE === $invalidBehavior) { + if ($inMethodCall) { + throw new RuntimeException('Method shouldn\'t be called.'); + } + + $arguments[$k] = null; + } + } + } + + return $arguments; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php new file mode 100755 index 0000000000..0d9ed164e6 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveParameterPlaceHoldersPass.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; + +/** + * Resolves all parameter placeholders "%somevalue%" to their real values. + * + * @author Johannes M. Schmitt + */ +class ResolveParameterPlaceHoldersPass implements CompilerPassInterface +{ + /** + * Processes the ContainerBuilder to resolve parameter placeholders. + * + * @param ContainerBuilder $container + * + * @throws ParameterNotFoundException When an invalid parameter is referenced + */ + public function process(ContainerBuilder $container) + { + $parameterBag = $container->getParameterBag(); + + foreach ($container->getDefinitions() as $id => $definition) { + try { + $definition->setClass($parameterBag->resolveValue($definition->getClass())); + $definition->setFile($parameterBag->resolveValue($definition->getFile())); + $definition->setArguments($parameterBag->resolveValue($definition->getArguments())); + + $calls = array(); + foreach ($definition->getMethodCalls() as $name => $arguments) { + $calls[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($arguments); + } + $definition->setMethodCalls($calls); + + $definition->setProperties($parameterBag->resolveValue($definition->getProperties())); + } catch (ParameterNotFoundException $e) { + $e->setSourceId($id); + + throw $e; + } + } + + $aliases = array(); + foreach ($container->getAliases() as $name => $target) { + $aliases[$parameterBag->resolveValue($name)] = $parameterBag->resolveValue($target); + } + $container->setAliases($aliases); + + $parameterBag->resolve(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php new file mode 100755 index 0000000000..015bdebc8b --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Replaces all references to aliases with references to the actual service. + * + * @author Johannes M. Schmitt + */ +class ResolveReferencesToAliasesPass implements CompilerPassInterface +{ + private $container; + + /** + * Processes the ContainerBuilder to replace references to aliases with actual service references. + * + * @param ContainerBuilder $container + */ + public function process(ContainerBuilder $container) + { + $this->container = $container; + + foreach ($container->getDefinitions() as $definition) { + if ($definition->isSynthetic() || $definition->isAbstract()) { + continue; + } + + $definition->setArguments($this->processArguments($definition->getArguments())); + $definition->setMethodCalls($this->processArguments($definition->getMethodCalls())); + $definition->setProperties($this->processArguments($definition->getProperties())); + } + + foreach ($container->getAliases() as $id => $alias) { + $aliasId = (string) $alias; + if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) { + $container->setAlias($id, new Alias($defId, $alias->isPublic())); + } + } + } + + /** + * Processes the arguments to replace aliases. + * + * @param array $arguments An array of References + * + * @return array An array of References + */ + private function processArguments(array $arguments) + { + foreach ($arguments as $k => $argument) { + if (is_array($argument)) { + $arguments[$k] = $this->processArguments($argument); + } elseif ($argument instanceof Reference) { + $defId = $this->getDefinitionId($id = (string) $argument); + + if ($defId !== $id) { + $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior(), $argument->isStrict()); + } + } + } + + return $arguments; + } + + /** + * Resolves an alias into a definition id. + * + * @param string $id The definition or alias id to resolve + * + * @return string The definition id with aliases resolved + */ + private function getDefinitionId($id) + { + while ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + return $id; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php new file mode 100755 index 0000000000..fbd33eeee1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * This is a directed graph of your services. + * + * This information can be used by your compiler passes instead of collecting + * it themselves which improves performance quite a lot. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraph +{ + /** + * @var ServiceReferenceGraphNode[] + */ + private $nodes; + + /** + * Constructor. + */ + public function __construct() + { + $this->nodes = array(); + } + + /** + * Checks if the graph has a specific node. + * + * @param string $id Id to check + * + * @return Boolean + */ + public function hasNode($id) + { + return isset($this->nodes[$id]); + } + + /** + * Gets a node by identifier. + * + * @param string $id The id to retrieve + * + * @return ServiceReferenceGraphNode The node matching the supplied identifier + * + * @throws InvalidArgumentException if no node matches the supplied identifier + */ + public function getNode($id) + { + if (!isset($this->nodes[$id])) { + throw new InvalidArgumentException(sprintf('There is no node with id "%s".', $id)); + } + + return $this->nodes[$id]; + } + + /** + * Returns all nodes. + * + * @return ServiceReferenceGraphNode[] An array of all ServiceReferenceGraphNode objects + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Clears all nodes. + */ + public function clear() + { + $this->nodes = array(); + } + + /** + * Connects 2 nodes together in the Graph. + * + * @param string $sourceId + * @param string $sourceValue + * @param string $destId + * @param string $destValue + * @param string $reference + */ + public function connect($sourceId, $sourceValue, $destId, $destValue = null, $reference = null) + { + $sourceNode = $this->createNode($sourceId, $sourceValue); + $destNode = $this->createNode($destId, $destValue); + $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference); + + $sourceNode->addOutEdge($edge); + $destNode->addInEdge($edge); + } + + /** + * Creates a graph node. + * + * @param string $id + * @param string $value + * + * @return ServiceReferenceGraphNode + */ + private function createNode($id, $value) + { + if (isset($this->nodes[$id]) && $this->nodes[$id]->getValue() === $value) { + return $this->nodes[$id]; + } + + return $this->nodes[$id] = new ServiceReferenceGraphNode($id, $value); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php new file mode 100755 index 0000000000..19da234ece --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +/** + * Represents an edge in your service graph. + * + * Value is typically a reference. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraphEdge +{ + private $sourceNode; + private $destNode; + private $value; + + /** + * Constructor. + * + * @param ServiceReferenceGraphNode $sourceNode + * @param ServiceReferenceGraphNode $destNode + * @param string $value + */ + public function __construct(ServiceReferenceGraphNode $sourceNode, ServiceReferenceGraphNode $destNode, $value = null) + { + $this->sourceNode = $sourceNode; + $this->destNode = $destNode; + $this->value = $value; + } + + /** + * Returns the value of the edge + * + * @return ServiceReferenceGraphNode + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the source node + * + * @return ServiceReferenceGraphNode + */ + public function getSourceNode() + { + return $this->sourceNode; + } + + /** + * Returns the destination node + * + * @return ServiceReferenceGraphNode + */ + public function getDestNode() + { + return $this->destNode; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php new file mode 100755 index 0000000000..3fd50771d5 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Alias; + +/** + * Represents a node in your service graph. + * + * Value is typically a definition, or an alias. + * + * @author Johannes M. Schmitt + */ +class ServiceReferenceGraphNode +{ + private $id; + private $inEdges; + private $outEdges; + private $value; + + /** + * Constructor. + * + * @param string $id The node identifier + * @param mixed $value The node value + */ + public function __construct($id, $value) + { + $this->id = $id; + $this->value = $value; + $this->inEdges = array(); + $this->outEdges = array(); + } + + /** + * Adds an in edge to this node. + * + * @param ServiceReferenceGraphEdge $edge + */ + public function addInEdge(ServiceReferenceGraphEdge $edge) + { + $this->inEdges[] = $edge; + } + + /** + * Adds an out edge to this node. + * + * @param ServiceReferenceGraphEdge $edge + */ + public function addOutEdge(ServiceReferenceGraphEdge $edge) + { + $this->outEdges[] = $edge; + } + + /** + * Checks if the value of this node is an Alias. + * + * @return Boolean True if the value is an Alias instance + */ + public function isAlias() + { + return $this->value instanceof Alias; + } + + /** + * Checks if the value of this node is a Definition. + * + * @return Boolean True if the value is a Definition instance + */ + public function isDefinition() + { + return $this->value instanceof Definition; + } + + /** + * Returns the identifier. + * + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Returns the in edges. + * + * @return array The in ServiceReferenceGraphEdge array + */ + public function getInEdges() + { + return $this->inEdges; + } + + /** + * Returns the out edges. + * + * @return array The out ServiceReferenceGraphEdge array + */ + public function getOutEdges() + { + return $this->outEdges; + } + + /** + * Returns the value of this Node + * + * @return mixed The value + */ + public function getValue() + { + return $this->value; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php new file mode 100755 index 0000000000..15e54209da --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php @@ -0,0 +1,486 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; + +/** + * Container is a dependency injection container. + * + * It gives access to object instances (services). + * + * Services and parameters are simple key/pair stores. + * + * Parameter and service keys are case insensitive. + * + * A service id can contain lowercased letters, digits, underscores, and dots. + * Underscores are used to separate words, and dots to group services + * under namespaces: + * + *
    + *
  • request
  • + *
  • mysql_session_storage
  • + *
  • symfony.mysql_session_storage
  • + *
+ * + * A service can also be defined by creating a method named + * getXXXService(), where XXX is the camelized version of the id: + * + *
    + *
  • request -> getRequestService()
  • + *
  • mysql_session_storage -> getMysqlSessionStorageService()
  • + *
  • symfony.mysql_session_storage -> getSymfony_MysqlSessionStorageService()
  • + *
+ * + * The container can have three possible behaviors when a service does not exist: + * + * * EXCEPTION_ON_INVALID_REFERENCE: Throws an exception (the default) + * * NULL_ON_INVALID_REFERENCE: Returns null + * * IGNORE_ON_INVALID_REFERENCE: Ignores the wrapping command asking for the reference + * (for instance, ignore a setter if the service does not exist) + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +class Container implements IntrospectableContainerInterface +{ + /** + * @var ParameterBagInterface + */ + protected $parameterBag; + + protected $services; + protected $scopes; + protected $scopeChildren; + protected $scopedServices; + protected $scopeStacks; + protected $loading = array(); + + /** + * Constructor. + * + * @param ParameterBagInterface $parameterBag A ParameterBagInterface instance + * + * @api + */ + public function __construct(ParameterBagInterface $parameterBag = null) + { + $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag; + + $this->services = array(); + $this->scopes = array(); + $this->scopeChildren = array(); + $this->scopedServices = array(); + $this->scopeStacks = array(); + + $this->set('service_container', $this); + } + + /** + * Compiles the container. + * + * This method does two things: + * + * * Parameter values are resolved; + * * The parameter bag is frozen. + * + * @api + */ + public function compile() + { + $this->parameterBag->resolve(); + + $this->parameterBag = new FrozenParameterBag($this->parameterBag->all()); + } + + /** + * Returns true if the container parameter bag are frozen. + * + * @return Boolean true if the container parameter bag are frozen, false otherwise + * + * @api + */ + public function isFrozen() + { + return $this->parameterBag instanceof FrozenParameterBag; + } + + /** + * Gets the service container parameter bag. + * + * @return ParameterBagInterface A ParameterBagInterface instance + * + * @api + */ + public function getParameterBag() + { + return $this->parameterBag; + } + + /** + * Gets a parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws InvalidArgumentException if the parameter is not defined + * + * @api + */ + public function getParameter($name) + { + return $this->parameterBag->get($name); + } + + /** + * Checks if a parameter exists. + * + * @param string $name The parameter name + * + * @return Boolean The presence of parameter in container + * + * @api + */ + public function hasParameter($name) + { + return $this->parameterBag->has($name); + } + + /** + * Sets a parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function setParameter($name, $value) + { + $this->parameterBag->set($name, $value); + } + + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope of the service + * + * @throws \RuntimeException When trying to set a service in an inactive scope + * @throws \InvalidArgumentException When trying to set a service in the prototype scope + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER) + { + if (self::SCOPE_PROTOTYPE === $scope) { + throw new InvalidArgumentException('You cannot set services of scope "prototype".'); + } + + $id = strtolower($id); + + if (self::SCOPE_CONTAINER !== $scope) { + if (!isset($this->scopedServices[$scope])) { + throw new RuntimeException('You cannot set services of inactive scopes.'); + } + + $this->scopedServices[$scope][$id] = $service; + } + + $this->services[$id] = $service; + } + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return Boolean true if the service is defined, false otherwise + * + * @api + */ + public function has($id) + { + $id = strtolower($id); + + return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service'); + } + + /** + * Gets a service. + * + * If a service is defined both through a set() method and + * with a get{$id}Service() method, the former has always precedence. + * + * @param string $id The service identifier + * @param integer $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws ServiceCircularReferenceException When a circular reference is detected + * @throws ServiceNotFoundException When the service is not defined + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) + { + $id = strtolower($id); + + if (isset($this->services[$id])) { + return $this->services[$id]; + } + + if (isset($this->loading[$id])) { + throw new ServiceCircularReferenceException($id, array_keys($this->loading)); + } + + if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) { + $this->loading[$id] = true; + + try { + $service = $this->$method(); + } catch (\Exception $e) { + unset($this->loading[$id]); + + if (isset($this->services[$id])) { + unset($this->services[$id]); + } + + throw $e; + } + + unset($this->loading[$id]); + + return $service; + } + + if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) { + throw new ServiceNotFoundException($id); + } + } + + /** + * Returns true if the given service has actually been initialized + * + * @param string $id The service identifier + * + * @return Boolean true if service has already been initialized, false otherwise + */ + public function initialized($id) + { + return isset($this->services[strtolower($id)]); + } + + /** + * Gets all service ids. + * + * @return array An array of all defined service ids + */ + public function getServiceIds() + { + $ids = array(); + $r = new \ReflectionClass($this); + foreach ($r->getMethods() as $method) { + if (preg_match('/^get(.+)Service$/', $method->name, $match)) { + $ids[] = self::underscore($match[1]); + } + } + + return array_unique(array_merge($ids, array_keys($this->services))); + } + + /** + * This is called when you enter a scope + * + * @param string $name + * + * @throws RuntimeException When the parent scope is inactive + * @throws InvalidArgumentException When the scope does not exist + * + * @api + */ + public function enterScope($name) + { + if (!isset($this->scopes[$name])) { + throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name)); + } + + if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) { + throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name])); + } + + // check if a scope of this name is already active, if so we need to + // remove all services of this scope, and those of any of its child + // scopes from the global services map + if (isset($this->scopedServices[$name])) { + $services = array($this->services, $name => $this->scopedServices[$name]); + unset($this->scopedServices[$name]); + + foreach ($this->scopeChildren[$name] as $child) { + $services[$child] = $this->scopedServices[$child]; + unset($this->scopedServices[$child]); + } + + // update global map + $this->services = call_user_func_array('array_diff_key', $services); + array_shift($services); + + // add stack entry for this scope so we can restore the removed services later + if (!isset($this->scopeStacks[$name])) { + $this->scopeStacks[$name] = new \SplStack(); + } + $this->scopeStacks[$name]->push($services); + } + + $this->scopedServices[$name] = array(); + } + + /** + * This is called to leave the current scope, and move back to the parent + * scope. + * + * @param string $name The name of the scope to leave + * + * @throws InvalidArgumentException if the scope is not active + * + * @api + */ + public function leaveScope($name) + { + if (!isset($this->scopedServices[$name])) { + throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name)); + } + + // remove all services of this scope, or any of its child scopes from + // the global service map + $services = array($this->services, $this->scopedServices[$name]); + unset($this->scopedServices[$name]); + foreach ($this->scopeChildren[$name] as $child) { + if (!isset($this->scopedServices[$child])) { + continue; + } + + $services[] = $this->scopedServices[$child]; + unset($this->scopedServices[$child]); + } + $this->services = call_user_func_array('array_diff_key', $services); + + // check if we need to restore services of a previous scope of this type + if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) { + $services = $this->scopeStacks[$name]->pop(); + $this->scopedServices += $services; + + array_unshift($services, $this->services); + $this->services = call_user_func_array('array_merge', $services); + } + } + + /** + * Adds a scope to the container. + * + * @param ScopeInterface $scope + * + * @throws \InvalidArgumentException When the scope is invalid + * + * @api + */ + public function addScope(ScopeInterface $scope) + { + $name = $scope->getName(); + $parentScope = $scope->getParentName(); + + if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) { + throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name)); + } + if (isset($this->scopes[$name])) { + throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name)); + } + if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) { + throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope)); + } + + $this->scopes[$name] = $parentScope; + $this->scopeChildren[$name] = array(); + + // normalize the child relations + while ($parentScope !== self::SCOPE_CONTAINER) { + $this->scopeChildren[$parentScope][] = $name; + $parentScope = $this->scopes[$parentScope]; + } + } + + /** + * Returns whether this container has a certain scope + * + * @param string $name The name of the scope + * + * @return Boolean + * + * @api + */ + public function hasScope($name) + { + return isset($this->scopes[$name]); + } + + /** + * Returns whether this scope is currently active + * + * This does not actually check if the passed scope actually exists. + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function isScopeActive($name) + { + return isset($this->scopedServices[$name]); + } + + /** + * Camelizes a string. + * + * @param string $id A string to camelize + * + * @return string The camelized string + */ + public static function camelize($id) + { + return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id); + } + + /** + * A string to underscore. + * + * @param string $id The string to underscore + * + * @return string The underscored string + */ + public static function underscore($id) + { + return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.'))); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php new file mode 100755 index 0000000000..4096915311 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAware.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * A simple implementation of ContainerAwareInterface. + * + * @author Fabien Potencier + * + * @api + */ +abstract class ContainerAware implements ContainerAwareInterface +{ + /** + * @var ContainerInterface + * + * @api + */ + protected $container; + + /** + * Sets the Container associated with this Controller. + * + * @param ContainerInterface $container A ContainerInterface instance + * + * @api + */ + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php new file mode 100755 index 0000000000..eb96632c66 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerAwareInterface.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * ContainerAwareInterface should be implemented by classes that depends on a Container. + * + * @author Fabien Potencier + * + * @api + */ +interface ContainerAwareInterface +{ + /** + * Sets the Container. + * + * @param ContainerInterface $container A ContainerInterface instance + * + * @api + */ + public function setContainer(ContainerInterface $container = null); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php new file mode 100755 index 0000000000..99d49eded9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -0,0 +1,950 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\Compiler; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; +use Symfony\Component\DependencyInjection\Exception\BadMethodCallException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\LogicException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Resource\ResourceInterface; + +/** + * ContainerBuilder is a DI container that provides an API to easily describe services. + * + * @author Fabien Potencier + * + * @api + */ +class ContainerBuilder extends Container implements TaggedContainerInterface +{ + /** + * @var ExtensionInterface[] + */ + private $extensions = array(); + + /** + * @var ExtensionInterface[] + */ + private $extensionsByNs = array(); + + /** + * @var Definition[] + */ + private $definitions = array(); + + /** + * @var Alias[] + */ + private $aliases = array(); + + /** + * @var ResourceInterface[] + */ + private $resources = array(); + + private $extensionConfigs = array(); + + /** + * @var Compiler + */ + private $compiler; + + /** + * Registers an extension. + * + * @param ExtensionInterface $extension An extension instance + * + * @api + */ + public function registerExtension(ExtensionInterface $extension) + { + $this->extensions[$extension->getAlias()] = $extension; + + if (false !== $extension->getNamespace()) { + $this->extensionsByNs[$extension->getNamespace()] = $extension; + } + } + + /** + * Returns an extension by alias or namespace. + * + * @param string $name An alias or a namespace + * + * @return ExtensionInterface An extension instance + * + * @throws \LogicException if the extension is not registered + * + * @api + */ + public function getExtension($name) + { + if (isset($this->extensions[$name])) { + return $this->extensions[$name]; + } + + if (isset($this->extensionsByNs[$name])) { + return $this->extensionsByNs[$name]; + } + + throw new LogicException(sprintf('Container extension "%s" is not registered', $name)); + } + + /** + * Returns all registered extensions. + * + * @return ExtensionInterface[] An array of ExtensionInterface + * + * @api + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Checks if we have an extension. + * + * @param string $name The name of the extension + * + * @return Boolean If the extension exists + * + * @api + */ + public function hasExtension($name) + { + return isset($this->extensions[$name]) || isset($this->extensionsByNs[$name]); + } + + /** + * Returns an array of resources loaded to build this configuration. + * + * @return ResourceInterface[] An array of resources + * + * @api + */ + public function getResources() + { + return array_unique($this->resources); + } + + /** + * Adds a resource for this configuration. + * + * @param ResourceInterface $resource A resource instance + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addResource(ResourceInterface $resource) + { + $this->resources[] = $resource; + + return $this; + } + + /** + * Sets the resources for this configuration. + * + * @param ResourceInterface[] $resources An array of resources + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function setResources(array $resources) + { + $this->resources = $resources; + + return $this; + } + + /** + * Adds the object class hierarchy as resources. + * + * @param object $object An object instance + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addObjectResource($object) + { + $parent = new \ReflectionObject($object); + do { + $this->addResource(new FileResource($parent->getFileName())); + } while ($parent = $parent->getParentClass()); + + return $this; + } + + /** + * Loads the configuration for an extension. + * + * @param string $extension The extension alias or namespace + * @param array $values An array of values that customizes the extension + * + * @return ContainerBuilder The current instance + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @throws \LogicException if the container is frozen + * + * @api + */ + public function loadFromExtension($extension, array $values = array()) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Cannot load from an extension on a frozen container.'); + } + + $namespace = $this->getExtension($extension)->getAlias(); + + $this->extensionConfigs[$namespace][] = $values; + + return $this; + } + + /** + * Adds a compiler pass. + * + * @param CompilerPassInterface $pass A compiler pass + * @param string $type The type of compiler pass + * + * @return ContainerBuilder The current instance + * + * @api + */ + public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION) + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + $this->compiler->addPass($pass, $type); + + $this->addObjectResource($pass); + + return $this; + } + + /** + * Returns the compiler pass config which can then be modified. + * + * @return PassConfig The compiler pass config + * + * @api + */ + public function getCompilerPassConfig() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + return $this->compiler->getPassConfig(); + } + + /** + * Returns the compiler. + * + * @return Compiler The compiler + * + * @api + */ + public function getCompiler() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + return $this->compiler; + } + + /** + * Returns all Scopes. + * + * @return array An array of scopes + * + * @api + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Returns all Scope children. + * + * @return array An array of scope children. + * + * @api + */ + public function getScopeChildren() + { + return $this->scopeChildren; + } + + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Setting service on a frozen container is not allowed'); + } + + $id = strtolower($id); + + unset($this->definitions[$id], $this->aliases[$id]); + + parent::set($id, $service, $scope); + } + + /** + * Removes a service definition. + * + * @param string $id The service identifier + * + * @api + */ + public function removeDefinition($id) + { + unset($this->definitions[strtolower($id)]); + } + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return Boolean true if the service is defined, false otherwise + * + * @api + */ + public function has($id) + { + $id = strtolower($id); + + return isset($this->definitions[$id]) || isset($this->aliases[$id]) || parent::has($id); + } + + /** + * Gets a service. + * + * @param string $id The service identifier + * @param integer $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws LogicException if the service has a circular reference to itself + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) + { + $id = strtolower($id); + + try { + return parent::get($id, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE); + } catch (InvalidArgumentException $e) { + if (isset($this->loading[$id])) { + throw new LogicException(sprintf('The service "%s" has a circular reference to itself.', $id), 0, $e); + } + + if (!$this->hasDefinition($id) && isset($this->aliases[$id])) { + return $this->get($this->aliases[$id]); + } + + try { + $definition = $this->getDefinition($id); + } catch (InvalidArgumentException $e) { + if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { + return null; + } + + throw $e; + } + + $this->loading[$id] = true; + + $service = $this->createService($definition, $id); + + unset($this->loading[$id]); + + return $service; + } + } + + /** + * Merges a ContainerBuilder with the current ContainerBuilder configuration. + * + * Service definitions overrides the current defined ones. + * + * But for parameters, they are overridden by the current ones. It allows + * the parameters passed to the container constructor to have precedence + * over the loaded ones. + * + * $container = new ContainerBuilder(array('foo' => 'bar')); + * $loader = new LoaderXXX($container); + * $loader->load('resource_name'); + * $container->register('foo', new stdClass()); + * + * In the above example, even if the loaded resource defines a foo + * parameter, the value will still be 'bar' as defined in the ContainerBuilder + * constructor. + * + * @param ContainerBuilder $container The ContainerBuilder instance to merge. + * + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function merge(ContainerBuilder $container) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Cannot merge on a frozen container.'); + } + + $this->addDefinitions($container->getDefinitions()); + $this->addAliases($container->getAliases()); + $this->getParameterBag()->add($container->getParameterBag()->all()); + + foreach ($container->getResources() as $resource) { + $this->addResource($resource); + } + + foreach ($this->extensions as $name => $extension) { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + $this->extensionConfigs[$name] = array_merge($this->extensionConfigs[$name], $container->getExtensionConfig($name)); + } + } + + /** + * Returns the configuration array for the given extension. + * + * @param string $name The name of the extension + * + * @return array An array of configuration + * + * @api + */ + public function getExtensionConfig($name) + { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + return $this->extensionConfigs[$name]; + } + + /** + * Prepends a config array to the configs of the given extension. + * + * @param string $name The name of the extension + * @param array $config The config to set + */ + public function prependExtensionConfig($name, array $config) + { + if (!isset($this->extensionConfigs[$name])) { + $this->extensionConfigs[$name] = array(); + } + + array_unshift($this->extensionConfigs[$name], $config); + } + + /** + * Compiles the container. + * + * This method passes the container to compiler + * passes whose job is to manipulate and optimize + * the container. + * + * The main compiler passes roughly do four things: + * + * * The extension configurations are merged; + * * Parameter values are resolved; + * * The parameter bag is frozen; + * * Extension loading is disabled. + * + * @api + */ + public function compile() + { + if (null === $this->compiler) { + $this->compiler = new Compiler(); + } + + foreach ($this->compiler->getPassConfig()->getPasses() as $pass) { + $this->addObjectResource($pass); + } + + $this->compiler->compile($this); + + $this->extensionConfigs = array(); + + parent::compile(); + } + + /** + * Gets all service ids. + * + * @return array An array of all defined service ids + */ + public function getServiceIds() + { + return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliases), parent::getServiceIds())); + } + + /** + * Adds the service aliases. + * + * @param array $aliases An array of aliases + * + * @api + */ + public function addAliases(array $aliases) + { + foreach ($aliases as $alias => $id) { + $this->setAlias($alias, $id); + } + } + + /** + * Sets the service aliases. + * + * @param array $aliases An array of aliases + * + * @api + */ + public function setAliases(array $aliases) + { + $this->aliases = array(); + $this->addAliases($aliases); + } + + /** + * Sets an alias for an existing service. + * + * @param string $alias The alias to create + * @param string|Alias $id The service to alias + * + * @throws \InvalidArgumentException if the id is not a string or an Alias + * @throws \InvalidArgumentException if the alias is for itself + * + * @api + */ + public function setAlias($alias, $id) + { + $alias = strtolower($alias); + + if (is_string($id)) { + $id = new Alias($id); + } elseif (!$id instanceof Alias) { + throw new InvalidArgumentException('$id must be a string, or an Alias object.'); + } + + if ($alias === strtolower($id)) { + throw new InvalidArgumentException('An alias can not reference itself, got a circular reference on "'.$alias.'".'); + } + + unset($this->definitions[$alias]); + + $this->aliases[$alias] = $id; + } + + /** + * Removes an alias. + * + * @param string $alias The alias to remove + * + * @api + */ + public function removeAlias($alias) + { + unset($this->aliases[strtolower($alias)]); + } + + /** + * Returns true if an alias exists under the given identifier. + * + * @param string $id The service identifier + * + * @return Boolean true if the alias exists, false otherwise + * + * @api + */ + public function hasAlias($id) + { + return isset($this->aliases[strtolower($id)]); + } + + /** + * Gets all defined aliases. + * + * @return Alias[] An array of aliases + * + * @api + */ + public function getAliases() + { + return $this->aliases; + } + + /** + * Gets an alias. + * + * @param string $id The service identifier + * + * @return Alias An Alias instance + * + * @throws InvalidArgumentException if the alias does not exist + * + * @api + */ + public function getAlias($id) + { + $id = strtolower($id); + + if (!$this->hasAlias($id)) { + throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id)); + } + + return $this->aliases[$id]; + } + + /** + * Registers a service definition. + * + * This methods allows for simple registration of service definition + * with a fluid interface. + * + * @param string $id The service identifier + * @param string $class The service class + * + * @return Definition A Definition instance + * + * @api + */ + public function register($id, $class = null) + { + return $this->setDefinition(strtolower($id), new Definition($class)); + } + + /** + * Adds the service definitions. + * + * @param Definition[] $definitions An array of service definitions + * + * @api + */ + public function addDefinitions(array $definitions) + { + foreach ($definitions as $id => $definition) { + $this->setDefinition($id, $definition); + } + } + + /** + * Sets the service definitions. + * + * @param Definition[] $definitions An array of service definitions + * + * @api + */ + public function setDefinitions(array $definitions) + { + $this->definitions = array(); + $this->addDefinitions($definitions); + } + + /** + * Gets all service definitions. + * + * @return Definition[] An array of Definition instances + * + * @api + */ + public function getDefinitions() + { + return $this->definitions; + } + + /** + * Sets a service definition. + * + * @param string $id The service identifier + * @param Definition $definition A Definition instance + * + * @return Definition the service definition + * + * @throws BadMethodCallException When this ContainerBuilder is frozen + * + * @api + */ + public function setDefinition($id, Definition $definition) + { + if ($this->isFrozen()) { + throw new BadMethodCallException('Adding definition to a frozen container is not allowed'); + } + + $id = strtolower($id); + + unset($this->aliases[$id]); + + return $this->definitions[$id] = $definition; + } + + /** + * Returns true if a service definition exists under the given identifier. + * + * @param string $id The service identifier + * + * @return Boolean true if the service definition exists, false otherwise + * + * @api + */ + public function hasDefinition($id) + { + return array_key_exists(strtolower($id), $this->definitions); + } + + /** + * Gets a service definition. + * + * @param string $id The service identifier + * + * @return Definition A Definition instance + * + * @throws InvalidArgumentException if the service definition does not exist + * + * @api + */ + public function getDefinition($id) + { + $id = strtolower($id); + + if (!$this->hasDefinition($id)) { + throw new InvalidArgumentException(sprintf('The service definition "%s" does not exist.', $id)); + } + + return $this->definitions[$id]; + } + + /** + * Gets a service definition by id or alias. + * + * The method "unaliases" recursively to return a Definition instance. + * + * @param string $id The service identifier or alias + * + * @return Definition A Definition instance + * + * @throws InvalidArgumentException if the service definition does not exist + * + * @api + */ + public function findDefinition($id) + { + while ($this->hasAlias($id)) { + $id = (string) $this->getAlias($id); + } + + return $this->getDefinition($id); + } + + /** + * Creates a service for a service definition. + * + * @param Definition $definition A service definition instance + * @param string $id The service identifier + * + * @return object The service described by the service definition + * + * @throws RuntimeException When the scope is inactive + * @throws RuntimeException When the factory definition is incomplete + * @throws InvalidArgumentException When configure callable is not callable + */ + private function createService(Definition $definition, $id) + { + $parameterBag = $this->getParameterBag(); + + if (null !== $definition->getFile()) { + require_once $parameterBag->resolveValue($definition->getFile()); + } + + $arguments = $this->resolveServices( + $parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments())) + ); + + if (null !== $definition->getFactoryMethod()) { + if (null !== $definition->getFactoryClass()) { + $factory = $parameterBag->resolveValue($definition->getFactoryClass()); + } elseif (null !== $definition->getFactoryService()) { + $factory = $this->get($parameterBag->resolveValue($definition->getFactoryService())); + } else { + throw new RuntimeException('Cannot create service from factory method without a factory service or factory class.'); + } + + $service = call_user_func_array(array($factory, $definition->getFactoryMethod()), $arguments); + } else { + $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass())); + + $service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments); + } + + if (self::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { + if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) { + throw new RuntimeException('You tried to create a service of an inactive scope.'); + } + + $this->services[$lowerId = strtolower($id)] = $service; + + if (self::SCOPE_CONTAINER !== $scope) { + $this->scopedServices[$scope][$lowerId] = $service; + } + } + + foreach ($definition->getMethodCalls() as $call) { + $services = self::getServiceConditionals($call[1]); + + $ok = true; + foreach ($services as $s) { + if (!$this->has($s)) { + $ok = false; + break; + } + } + + if ($ok) { + call_user_func_array(array($service, $call[0]), $this->resolveServices($parameterBag->resolveValue($call[1]))); + } + } + + $properties = $this->resolveServices($parameterBag->resolveValue($definition->getProperties())); + foreach ($properties as $name => $value) { + $service->$name = $value; + } + + if ($callable = $definition->getConfigurator()) { + if (is_array($callable)) { + $callable[0] = $callable[0] instanceof Reference ? $this->get((string) $callable[0]) : $parameterBag->resolveValue($callable[0]); + } + + if (!is_callable($callable)) { + throw new InvalidArgumentException(sprintf('The configure callable for class "%s" is not a callable.', get_class($service))); + } + + call_user_func($callable, $service); + } + + return $service; + } + + /** + * Replaces service references by the real service instance. + * + * @param mixed $value A value + * + * @return mixed The same value with all service references replaced by the real service instances + */ + public function resolveServices($value) + { + if (is_array($value)) { + foreach ($value as &$v) { + $v = $this->resolveServices($v); + } + } elseif ($value instanceof Reference) { + $value = $this->get((string) $value, $value->getInvalidBehavior()); + } elseif ($value instanceof Definition) { + $value = $this->createService($value, null); + } + + return $value; + } + + /** + * Returns service ids for a given tag. + * + * @param string $name The tag name + * + * @return array An array of tags + * + * @api + */ + public function findTaggedServiceIds($name) + { + $tags = array(); + foreach ($this->getDefinitions() as $id => $definition) { + if ($definition->getTag($name)) { + $tags[$id] = $definition->getTag($name); + } + } + + return $tags; + } + + /** + * Returns all tags the defined services use. + * + * @return array An array of tags + */ + public function findTags() + { + $tags = array(); + foreach ($this->getDefinitions() as $id => $definition) { + $tags = array_merge(array_keys($definition->getTags()), $tags); + } + + return array_unique($tags); + } + + /** + * Returns the Service Conditionals. + * + * @param mixed $value An array of conditionals to return. + * + * @return array An array of Service conditionals + */ + public static function getServiceConditionals($value) + { + $services = array(); + + if (is_array($value)) { + foreach ($value as $v) { + $services = array_unique(array_merge($services, self::getServiceConditionals($v))); + } + } elseif ($value instanceof Reference && $value->getInvalidBehavior() === ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { + $services[] = (string) $value; + } + + return $services; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php new file mode 100755 index 0000000000..1951ae7b93 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerInterface.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; + +/** + * ContainerInterface is the interface implemented by service container classes. + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +interface ContainerInterface +{ + const EXCEPTION_ON_INVALID_REFERENCE = 1; + const NULL_ON_INVALID_REFERENCE = 2; + const IGNORE_ON_INVALID_REFERENCE = 3; + const SCOPE_CONTAINER = 'container'; + const SCOPE_PROTOTYPE = 'prototype'; + + /** + * Sets a service. + * + * @param string $id The service identifier + * @param object $service The service instance + * @param string $scope The scope of the service + * + * @api + */ + public function set($id, $service, $scope = self::SCOPE_CONTAINER); + + /** + * Gets a service. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * + * @return object The associated service + * + * @throws InvalidArgumentException if the service is not defined + * @throws ServiceCircularReferenceException When a circular reference is detected + * @throws ServiceNotFoundException When the service is not defined + * + * @see Reference + * + * @api + */ + public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE); + + /** + * Returns true if the given service is defined. + * + * @param string $id The service identifier + * + * @return Boolean true if the service is defined, false otherwise + * + * @api + */ + public function has($id); + + /** + * Gets a parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws InvalidArgumentException if the parameter is not defined + * + * @api + */ + public function getParameter($name); + + /** + * Checks if a parameter exists. + * + * @param string $name The parameter name + * + * @return Boolean The presence of parameter in container + * + * @api + */ + public function hasParameter($name); + + /** + * Sets a parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function setParameter($name, $value); + + /** + * Enters the given scope + * + * @param string $name + * + * @api + */ + public function enterScope($name); + + /** + * Leaves the current scope, and re-enters the parent scope + * + * @param string $name + * + * @api + */ + public function leaveScope($name); + + /** + * Adds a scope to the container + * + * @param ScopeInterface $scope + * + * @api + */ + public function addScope(ScopeInterface $scope); + + /** + * Whether this container has the given scope + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function hasScope($name); + + /** + * Determines whether the given scope is currently active. + * + * It does however not check if the scope actually exists. + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function isScopeActive($name); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php new file mode 100755 index 0000000000..3fb5938d9c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Definition.php @@ -0,0 +1,659 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; + +/** + * Definition represents a service definition. + * + * @author Fabien Potencier + * + * @api + */ +class Definition +{ + private $class; + private $file; + private $factoryClass; + private $factoryMethod; + private $factoryService; + private $scope; + private $properties; + private $calls; + private $configurator; + private $tags; + private $public; + private $synthetic; + private $abstract; + + protected $arguments; + + /** + * Constructor. + * + * @param string $class The service class + * @param array $arguments An array of arguments to pass to the service constructor + * + * @api + */ + public function __construct($class = null, array $arguments = array()) + { + $this->class = $class; + $this->arguments = $arguments; + $this->calls = array(); + $this->scope = ContainerInterface::SCOPE_CONTAINER; + $this->tags = array(); + $this->public = true; + $this->synthetic = false; + $this->abstract = false; + $this->properties = array(); + } + + /** + * Sets the name of the class that acts as a factory using the factory method, + * which will be invoked statically. + * + * @param string $factoryClass The factory class name + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryClass($factoryClass) + { + $this->factoryClass = $factoryClass; + + return $this; + } + + /** + * Gets the factory class. + * + * @return string The factory class name + * + * @api + */ + public function getFactoryClass() + { + return $this->factoryClass; + } + + /** + * Sets the factory method able to create an instance of this class. + * + * @param string $factoryMethod The factory method name + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryMethod($factoryMethod) + { + $this->factoryMethod = $factoryMethod; + + return $this; + } + + /** + * Gets the factory method. + * + * @return string The factory method name + * + * @api + */ + public function getFactoryMethod() + { + return $this->factoryMethod; + } + + /** + * Sets the name of the service that acts as a factory using the factory method. + * + * @param string $factoryService The factory service id + * + * @return Definition The current instance + * + * @api + */ + public function setFactoryService($factoryService) + { + $this->factoryService = $factoryService; + + return $this; + } + + /** + * Gets the factory service id. + * + * @return string The factory service id + * + * @api + */ + public function getFactoryService() + { + return $this->factoryService; + } + + /** + * Sets the service class. + * + * @param string $class The service class + * + * @return Definition The current instance + * + * @api + */ + public function setClass($class) + { + $this->class = $class; + + return $this; + } + + /** + * Gets the service class. + * + * @return string The service class + * + * @api + */ + public function getClass() + { + return $this->class; + } + + /** + * Sets the arguments to pass to the service constructor/factory method. + * + * @param array $arguments An array of arguments + * + * @return Definition The current instance + * + * @api + */ + public function setArguments(array $arguments) + { + $this->arguments = $arguments; + + return $this; + } + + /** + * @api + */ + public function setProperties(array $properties) + { + $this->properties = $properties; + + return $this; + } + + /** + * @api + */ + public function getProperties() + { + return $this->properties; + } + + /** + * @api + */ + public function setProperty($name, $value) + { + $this->properties[$name] = $value; + + return $this; + } + + /** + * Adds an argument to pass to the service constructor/factory method. + * + * @param mixed $argument An argument + * + * @return Definition The current instance + * + * @api + */ + public function addArgument($argument) + { + $this->arguments[] = $argument; + + return $this; + } + + /** + * Sets a specific argument + * + * @param integer $index + * @param mixed $argument + * + * @return Definition The current instance + * + * @throws \OutOfBoundsException When the replaced argument does not exist + * + * @api + */ + public function replaceArgument($index, $argument) + { + if ($index < 0 || $index > count($this->arguments) - 1) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); + } + + $this->arguments[$index] = $argument; + + return $this; + } + + /** + * Gets the arguments to pass to the service constructor/factory method. + * + * @return array The array of arguments + * + * @api + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Gets an argument to pass to the service constructor/factory method. + * + * @param integer $index + * + * @return mixed The argument value + * + * @throws \OutOfBoundsException When the argument does not exist + * + * @api + */ + public function getArgument($index) + { + if ($index < 0 || $index > count($this->arguments) - 1) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, count($this->arguments) - 1)); + } + + return $this->arguments[$index]; + } + + /** + * Sets the methods to call after service initialization. + * + * @param array $calls An array of method calls + * + * @return Definition The current instance + * + * @api + */ + public function setMethodCalls(array $calls = array()) + { + $this->calls = array(); + foreach ($calls as $call) { + $this->addMethodCall($call[0], $call[1]); + } + + return $this; + } + + /** + * Adds a method to call after service initialization. + * + * @param string $method The method name to call + * @param array $arguments An array of arguments to pass to the method call + * + * @return Definition The current instance + * + * @throws InvalidArgumentException on empty $method param + * + * @api + */ + public function addMethodCall($method, array $arguments = array()) + { + if (empty($method)) { + throw new InvalidArgumentException(sprintf('Method name cannot be empty.')); + } + $this->calls[] = array($method, $arguments); + + return $this; + } + + /** + * Removes a method to call after service initialization. + * + * @param string $method The method name to remove + * + * @return Definition The current instance + * + * @api + */ + public function removeMethodCall($method) + { + foreach ($this->calls as $i => $call) { + if ($call[0] === $method) { + unset($this->calls[$i]); + break; + } + } + + return $this; + } + + /** + * Check if the current definition has a given method to call after service initialization. + * + * @param string $method The method name to search for + * + * @return Boolean + * + * @api + */ + public function hasMethodCall($method) + { + foreach ($this->calls as $call) { + if ($call[0] === $method) { + return true; + } + } + + return false; + } + + /** + * Gets the methods to call after service initialization. + * + * @return array An array of method calls + * + * @api + */ + public function getMethodCalls() + { + return $this->calls; + } + + /** + * Sets tags for this definition + * + * @param array $tags + * + * @return Definition the current instance + * + * @api + */ + public function setTags(array $tags) + { + $this->tags = $tags; + + return $this; + } + + /** + * Returns all tags. + * + * @return array An array of tags + * + * @api + */ + public function getTags() + { + return $this->tags; + } + + /** + * Gets a tag by name. + * + * @param string $name The tag name + * + * @return array An array of attributes + * + * @api + */ + public function getTag($name) + { + return isset($this->tags[$name]) ? $this->tags[$name] : array(); + } + + /** + * Adds a tag for this definition. + * + * @param string $name The tag name + * @param array $attributes An array of attributes + * + * @return Definition The current instance + * + * @api + */ + public function addTag($name, array $attributes = array()) + { + $this->tags[$name][] = $attributes; + + return $this; + } + + /** + * Whether this definition has a tag with the given name + * + * @param string $name + * + * @return Boolean + * + * @api + */ + public function hasTag($name) + { + return isset($this->tags[$name]); + } + + /** + * Clears all tags for a given name. + * + * @param string $name The tag name + * + * @return Definition + */ + public function clearTag($name) + { + if (isset($this->tags[$name])) { + unset($this->tags[$name]); + } + + return $this; + } + + /** + * Clears the tags for this definition. + * + * @return Definition The current instance + * + * @api + */ + public function clearTags() + { + $this->tags = array(); + + return $this; + } + + /** + * Sets a file to require before creating the service. + * + * @param string $file A full pathname to include + * + * @return Definition The current instance + * + * @api + */ + public function setFile($file) + { + $this->file = $file; + + return $this; + } + + /** + * Gets the file to require before creating the service. + * + * @return string The full pathname to include + * + * @api + */ + public function getFile() + { + return $this->file; + } + + /** + * Sets the scope of the service + * + * @param string $scope Whether the service must be shared or not + * + * @return Definition The current instance + * + * @api + */ + public function setScope($scope) + { + $this->scope = $scope; + + return $this; + } + + /** + * Returns the scope of the service + * + * @return string + * + * @api + */ + public function getScope() + { + return $this->scope; + } + + /** + * Sets the visibility of this service. + * + * @param Boolean $boolean + * + * @return Definition The current instance + * + * @api + */ + public function setPublic($boolean) + { + $this->public = (Boolean) $boolean; + + return $this; + } + + /** + * Whether this service is public facing + * + * @return Boolean + * + * @api + */ + public function isPublic() + { + return $this->public; + } + + /** + * Sets whether this definition is synthetic, that is not constructed by the + * container, but dynamically injected. + * + * @param Boolean $boolean + * + * @return Definition the current instance + * + * @api + */ + public function setSynthetic($boolean) + { + $this->synthetic = (Boolean) $boolean; + + return $this; + } + + /** + * Whether this definition is synthetic, that is not constructed by the + * container, but dynamically injected. + * + * @return Boolean + * + * @api + */ + public function isSynthetic() + { + return $this->synthetic; + } + + /** + * Whether this definition is abstract, that means it merely serves as a + * template for other definitions. + * + * @param Boolean $boolean + * + * @return Definition the current instance + * + * @api + */ + public function setAbstract($boolean) + { + $this->abstract = (Boolean) $boolean; + + return $this; + } + + /** + * Whether this definition is abstract, that means it merely serves as a + * template for other definitions. + * + * @return Boolean + * + * @api + */ + public function isAbstract() + { + return $this->abstract; + } + + /** + * Sets a configurator to call after the service is fully initialized. + * + * @param callable $callable A PHP callable + * + * @return Definition The current instance + * + * @api + */ + public function setConfigurator($callable) + { + $this->configurator = $callable; + + return $this; + } + + /** + * Gets the configurator to call after the service is fully initialized. + * + * @return callable The PHP callable to call + * + * @api + */ + public function getConfigurator() + { + return $this->configurator; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php new file mode 100755 index 0000000000..3ac561a442 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/DefinitionDecorator.php @@ -0,0 +1,207 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; + +/** + * This definition decorates another definition. + * + * @author Johannes M. Schmitt + * + * @api + */ +class DefinitionDecorator extends Definition +{ + private $parent; + private $changes; + + /** + * Constructor. + * + * @param string $parent The id of Definition instance to decorate. + * + * @api + */ + public function __construct($parent) + { + parent::__construct(); + + $this->parent = $parent; + $this->changes = array(); + } + + /** + * Returns the Definition being decorated. + * + * @return string + * + * @api + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns all changes tracked for the Definition object. + * + * @return array An array of changes for this Definition + * + * @api + */ + public function getChanges() + { + return $this->changes; + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setClass($class) + { + $this->changes['class'] = true; + + return parent::setClass($class); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setFactoryClass($class) + { + $this->changes['factory_class'] = true; + + return parent::setFactoryClass($class); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setFactoryMethod($method) + { + $this->changes['factory_method'] = true; + + return parent::setFactoryMethod($method); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setFactoryService($service) + { + $this->changes['factory_service'] = true; + + return parent::setFactoryService($service); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setConfigurator($callable) + { + $this->changes['configurator'] = true; + + return parent::setConfigurator($callable); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setFile($file) + { + $this->changes['file'] = true; + + return parent::setFile($file); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function setPublic($boolean) + { + $this->changes['public'] = true; + + return parent::setPublic($boolean); + } + + /** + * Gets an argument to pass to the service constructor/factory method. + * + * If replaceArgument() has been used to replace an argument, this method + * will return the replacement value. + * + * @param integer $index + * + * @return mixed The argument value + * + * @throws \OutOfBoundsException When the argument does not exist + * + * @api + */ + public function getArgument($index) + { + if (array_key_exists('index_'.$index, $this->arguments)) { + return $this->arguments['index_'.$index]; + } + + $lastIndex = count(array_filter(array_keys($this->arguments), 'is_int')) - 1; + + if ($index < 0 || $index > $lastIndex) { + throw new OutOfBoundsException(sprintf('The index "%d" is not in the range [0, %d].', $index, $lastIndex)); + } + + return $this->arguments[$index]; + } + + /** + * You should always use this method when overwriting existing arguments + * of the parent definition. + * + * If you directly call setArguments() keep in mind that you must follow + * certain conventions when you want to overwrite the arguments of the + * parent definition, otherwise your arguments will only be appended. + * + * @param integer $index + * @param mixed $value + * + * @return DefinitionDecorator the current instance + * @throws InvalidArgumentException when $index isn't an integer + * + * @api + */ + public function replaceArgument($index, $value) + { + if (!is_int($index)) { + throw new InvalidArgumentException('$index must be an integer.'); + } + + $this->arguments['index_'.$index] = $value; + + return $this; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php new file mode 100755 index 0000000000..98924014ad --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/Dumper.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * Dumper is the abstract class for all built-in dumpers. + * + * @author Fabien Potencier + * + * @api + */ +abstract class Dumper implements DumperInterface +{ + protected $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container The service container to dump + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + $this->container = $container; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php new file mode 100755 index 0000000000..ba146f61c0 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/DumperInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +/** + * DumperInterface is the interface implemented by service container dumper classes. + * + * @author Fabien Potencier + * + * @api + */ +interface DumperInterface +{ + /** + * Dumps the service container. + * + * @param array $options An array of options + * + * @return string The representation of the service container + * + * @api + */ + public function dump(array $options = array()); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php new file mode 100755 index 0000000000..00b212a1b4 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * GraphvizDumper dumps a service container as a graphviz file. + * + * You can convert the generated dot file with the dot utility (http://www.graphviz.org/): + * + * dot -Tpng container.dot > foo.png + * + * @author Fabien Potencier + */ +class GraphvizDumper extends Dumper +{ + private $nodes; + private $edges; + private $options = array( + 'graph' => array('ratio' => 'compress'), + 'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'), + 'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5), + 'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'), + 'node.definition' => array('fillcolor' => '#eeeeee'), + 'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'), + ); + + /** + * Dumps the service container as a graphviz graph. + * + * Available options: + * + * * graph: The default options for the whole graph + * * node: The default options for nodes + * * edge: The default options for edges + * * node.instance: The default options for services that are defined directly by object instances + * * node.definition: The default options for services that are defined via service definition instances + * * node.missing: The default options for missing services + * + * @param array $options An array of options + * + * @return string The dot representation of the service container + */ + public function dump(array $options = array()) + { + foreach (array('graph', 'node', 'edge', 'node.instance', 'node.definition', 'node.missing') as $key) { + if (isset($options[$key])) { + $this->options[$key] = array_merge($this->options[$key], $options[$key]); + } + } + + $this->nodes = $this->findNodes(); + + $this->edges = array(); + foreach ($this->container->getDefinitions() as $id => $definition) { + $this->edges[$id] = array_merge( + $this->findEdges($id, $definition->getArguments(), true, ''), + $this->findEdges($id, $definition->getProperties(), false, '') + ); + + foreach ($definition->getMethodCalls() as $call) { + $this->edges[$id] = array_merge( + $this->edges[$id], + $this->findEdges($id, $call[1], false, $call[0].'()') + ); + } + } + + return $this->startDot().$this->addNodes().$this->addEdges().$this->endDot(); + } + + /** + * Returns all nodes. + * + * @return string A string representation of all nodes + */ + private function addNodes() + { + $code = ''; + foreach ($this->nodes as $id => $node) { + $aliases = $this->getAliases($id); + + $code .= sprintf(" node_%s [label=\"%s\\n%s\\n\", shape=%s%s];\n", $this->dotize($id), $id.($aliases ? ' ('.implode(', ', $aliases).')' : ''), $node['class'], $this->options['node']['shape'], $this->addAttributes($node['attributes'])); + } + + return $code; + } + + /** + * Returns all edges. + * + * @return string A string representation of all edges + */ + private function addEdges() + { + $code = ''; + foreach ($this->edges as $id => $edges) { + foreach ($edges as $edge) { + $code .= sprintf(" node_%s -> node_%s [label=\"%s\" style=\"%s\"];\n", $this->dotize($id), $this->dotize($edge['to']), $edge['name'], $edge['required'] ? 'filled' : 'dashed'); + } + } + + return $code; + } + + /** + * Finds all edges belonging to a specific service id. + * + * @param string $id The service id used to find edges + * @param array $arguments An array of arguments + * @param Boolean $required + * @param string $name + * + * @return array An array of edges + */ + private function findEdges($id, $arguments, $required, $name) + { + $edges = array(); + foreach ($arguments as $argument) { + if ($argument instanceof Parameter) { + $argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null; + } elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) { + $argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null; + } + + if ($argument instanceof Reference) { + if (!$this->container->has((string) $argument)) { + $this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']); + } + + $edges[] = array('name' => $name, 'required' => $required, 'to' => $argument); + } elseif (is_array($argument)) { + $edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name)); + } + } + + return $edges; + } + + /** + * Finds all nodes. + * + * @return array An array of all nodes + */ + private function findNodes() + { + $nodes = array(); + + $container = clone $this->container; + + foreach ($container->getDefinitions() as $id => $definition) { + $nodes[$id] = array('class' => str_replace('\\', '\\\\', $this->container->getParameterBag()->resolveValue($definition->getClass())), 'attributes' => array_merge($this->options['node.definition'], array('style' => ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope() ? 'filled' : 'dotted'))); + + $container->setDefinition($id, new Definition('stdClass')); + } + + foreach ($container->getServiceIds() as $id) { + $service = $container->get($id); + + if (in_array($id, array_keys($container->getAliases()))) { + continue; + } + + if (!$container->hasDefinition($id)) { + $nodes[$id] = array('class' => str_replace('\\', '\\\\', get_class($service)), 'attributes' => $this->options['node.instance']); + } + } + + return $nodes; + } + + /** + * Returns the start dot. + * + * @return string The string representation of a start dot + */ + private function startDot() + { + return sprintf("digraph sc {\n %s\n node [%s];\n edge [%s];\n\n", + $this->addOptions($this->options['graph']), + $this->addOptions($this->options['node']), + $this->addOptions($this->options['edge']) + ); + } + + /** + * Returns the end dot. + * + * @return string + */ + private function endDot() + { + return "}\n"; + } + + /** + * Adds attributes + * + * @param array $attributes An array of attributes + * + * @return string A comma separated list of attributes + */ + private function addAttributes($attributes) + { + $code = array(); + foreach ($attributes as $k => $v) { + $code[] = sprintf('%s="%s"', $k, $v); + } + + return $code ? ', '.implode(', ', $code) : ''; + } + + /** + * Adds options + * + * @param array $options An array of options + * + * @return string A space separated list of options + */ + private function addOptions($options) + { + $code = array(); + foreach ($options as $k => $v) { + $code[] = sprintf('%s="%s"', $k, $v); + } + + return implode(' ', $code); + } + + /** + * Dotizes an identifier. + * + * @param string $id The identifier to dotize + * + * @return string A dotized string + */ + private function dotize($id) + { + return strtolower(preg_replace('/[^\w]/i', '_', $id)); + } + + /** + * Compiles an array of aliases for a specified service id. + * + * @param string $id A service id + * + * @return array An array of aliases + */ + private function getAliases($id) + { + $aliases = array(); + foreach ($this->container->getAliases() as $alias => $origin) { + if ($id == $origin) { + $aliases[] = $alias; + } + } + + return $aliases; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php new file mode 100755 index 0000000000..36ad24a159 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -0,0 +1,1142 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\Variable; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; + +/** + * PhpDumper dumps a service container as a PHP class. + * + * @author Fabien Potencier + * @author Johannes M. Schmitt + * + * @api + */ +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_'; + + private $inlinedDefinitions; + private $definitionVariables; + private $referenceVariables; + private $variableCount; + private $reservedVariables = array('instance', 'class'); + + /** + * {@inheritDoc} + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + parent::__construct($container); + + $this->inlinedDefinitions = new \SplObjectStorage; + } + + /** + * Dumps the service container as a PHP class. + * + * Available options: + * + * * class: The class name + * * base_class: The base class name + * + * @param array $options An array of options + * + * @return string A PHP class representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + $options = array_merge(array( + 'class' => 'ProjectServiceContainer', + 'base_class' => 'Container', + ), $options); + + $code = $this->startClass($options['class'], $options['base_class']); + + if ($this->container->isFrozen()) { + $code .= $this->addFrozenConstructor(); + } else { + $code .= $this->addConstructor(); + } + + $code .= + $this->addServices(). + $this->addDefaultParametersMethod(). + $this->endClass() + ; + + return $code; + } + + /** + * Generates Service local temp variables. + * + * @param string $cId + * @param string $definition + * + * @return string + */ + private function addServiceLocalTempVariables($cId, $definition) + { + static $template = " \$%s = %s;\n"; + + $localDefinitions = array_merge( + array($definition), + $this->getInlinedDefinitions($definition) + ); + + $calls = $behavior = array(); + foreach ($localDefinitions as $iDefinition) { + $this->getServiceCallsFromArguments($iDefinition->getArguments(), $calls, $behavior); + $this->getServiceCallsFromArguments($iDefinition->getMethodCalls(), $calls, $behavior); + $this->getServiceCallsFromArguments($iDefinition->getProperties(), $calls, $behavior); + } + + $code = ''; + foreach ($calls as $id => $callCount) { + if ('service_container' === $id || $id === $cId) { + continue; + } + + if ($callCount > 1) { + $name = $this->getNextVariableName(); + $this->referenceVariables[$id] = new Variable($name); + + if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE === $behavior[$id]) { + $code .= sprintf($template, $name, $this->getServiceCall($id)); + } else { + $code .= sprintf($template, $name, $this->getServiceCall($id, new Reference($id, ContainerInterface::NULL_ON_INVALID_REFERENCE))); + } + } + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Generates the require_once statement for service includes. + * + * @param string $id The service id + * @param Definition $definition + * + * @return string + */ + private function addServiceInclude($id, $definition) + { + $template = " require_once %s;\n"; + $code = ''; + + if (null !== $file = $definition->getFile()) { + $code .= sprintf($template, $this->dumpValue($file)); + } + + foreach ($this->getInlinedDefinitions($definition) as $definition) { + if (null !== $file = $definition->getFile()) { + $code .= sprintf($template, $this->dumpValue($file)); + } + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Generates the inline definition of a service. + * + * @param string $id + * @param Definition $definition + * + * @return string + * + * @throws \RuntimeException When the factory definition is incomplete + * @throws ServiceCircularReferenceException When a circular reference is detected + */ + private function addServiceInlinedDefinitions($id, $definition) + { + $code = ''; + $variableMap = $this->definitionVariables; + $nbOccurrences = new \SplObjectStorage(); + $processed = new \SplObjectStorage(); + $inlinedDefinitions = $this->getInlinedDefinitions($definition); + + foreach ($inlinedDefinitions as $definition) { + if (false === $nbOccurrences->contains($definition)) { + $nbOccurrences->offsetSet($definition, 1); + } else { + $i = $nbOccurrences->offsetGet($definition); + $nbOccurrences->offsetSet($definition, $i+1); + } + } + + foreach ($inlinedDefinitions as $sDefinition) { + if ($processed->contains($sDefinition)) { + continue; + } + $processed->offsetSet($sDefinition); + + $class = $this->dumpValue($sDefinition->getClass()); + if ($nbOccurrences->offsetGet($sDefinition) > 1 || count($sDefinition->getMethodCalls()) > 0 || $sDefinition->getProperties() || null !== $sDefinition->getConfigurator() || false !== strpos($class, '$')) { + $name = $this->getNextVariableName(); + $variableMap->offsetSet($sDefinition, new Variable($name)); + + // a construct like: + // $a = new ServiceA(ServiceB $b); $b = new ServiceB(ServiceA $a); + // this is an indication for a wrong implementation, you can circumvent this problem + // by setting up your service structure like this: + // $b = new ServiceB(); + // $a = new ServiceA(ServiceB $b); + // $b->setServiceA(ServiceA $a); + if ($this->hasReference($id, $sDefinition->getArguments())) { + throw new ServiceCircularReferenceException($id, array($id)); + } + + $arguments = array(); + foreach ($sDefinition->getArguments() as $argument) { + $arguments[] = $this->dumpValue($argument); + } + + if (null !== $sDefinition->getFactoryMethod()) { + if (null !== $sDefinition->getFactoryClass()) { + $code .= sprintf(" \$%s = call_user_func(array(%s, '%s')%s);\n", $name, $this->dumpValue($sDefinition->getFactoryClass()), $sDefinition->getFactoryMethod(), count($arguments) > 0 ? ', '.implode(', ', $arguments) : ''); + } elseif (null !== $sDefinition->getFactoryService()) { + $code .= sprintf(" \$%s = %s->%s(%s);\n", $name, $this->getServiceCall($sDefinition->getFactoryService()), $sDefinition->getFactoryMethod(), implode(', ', $arguments)); + } else { + throw new RuntimeException('Factory service or factory class must be defined in service definition for '.$id); + } + } elseif (false !== strpos($class, '$')) { + $code .= sprintf(" \$class = %s;\n \$%s = new \$class(%s);\n", $class, $name, implode(', ', $arguments)); + } else { + $code .= sprintf(" \$%s = new \\%s(%s);\n", $name, substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); + } + + if (!$this->hasReference($id, $sDefinition->getMethodCalls()) && !$this->hasReference($id, $sDefinition->getProperties())) { + $code .= $this->addServiceMethodCalls(null, $sDefinition, $name); + $code .= $this->addServiceProperties(null, $sDefinition, $name); + $code .= $this->addServiceConfigurator(null, $sDefinition, $name); + } + + $code .= "\n"; + } + } + + return $code; + } + + /** + * Adds the service return statement. + * + * @param string $id Service id + * @param Definition $definition + * + * @return string + */ + private function addServiceReturn($id, $definition) + { + if ($this->isSimpleInstance($id, $definition)) { + return " }\n"; + } + + return "\n return \$instance;\n }\n"; + } + + /** + * Generates the service instance. + * + * @param string $id + * @param Definition $definition + * + * @return string + * + * @throws InvalidArgumentException + * @throws RuntimeException + */ + private function addServiceInstance($id, $definition) + { + $class = $this->dumpValue($definition->getClass()); + + if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) { + throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id)); + } + + $arguments = array(); + foreach ($definition->getArguments() as $value) { + $arguments[] = $this->dumpValue($value); + } + + $simple = $this->isSimpleInstance($id, $definition); + + $instantiation = ''; + if (ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) { + $instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance'); + } elseif (ContainerInterface::SCOPE_PROTOTYPE !== $scope = $definition->getScope()) { + $instantiation = "\$this->services['$id'] = \$this->scopedServices['$scope']['$id'] = ".($simple ? '' : '$instance'); + } elseif (!$simple) { + $instantiation = '$instance'; + } + + $return = ''; + if ($simple) { + $return = 'return '; + } else { + $instantiation .= ' = '; + } + + if (null !== $definition->getFactoryMethod()) { + if (null !== $definition->getFactoryClass()) { + $code = sprintf(" $return{$instantiation}call_user_func(array(%s, '%s')%s);\n", $this->dumpValue($definition->getFactoryClass()), $definition->getFactoryMethod(), $arguments ? ', '.implode(', ', $arguments) : ''); + } elseif (null !== $definition->getFactoryService()) { + $code = sprintf(" $return{$instantiation}%s->%s(%s);\n", $this->getServiceCall($definition->getFactoryService()), $definition->getFactoryMethod(), implode(', ', $arguments)); + } else { + throw new RuntimeException('Factory method requires a factory service or factory class in service definition for '.$id); + } + } elseif (false !== strpos($class, '$')) { + $code = sprintf(" \$class = %s;\n\n $return{$instantiation}new \$class(%s);\n", $class, implode(', ', $arguments)); + } else { + $code = sprintf(" $return{$instantiation}new \\%s(%s);\n", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); + } + + if (!$simple) { + $code .= "\n"; + } + + return $code; + } + + /** + * Checks if the definition is a simple instance. + * + * @param string $id + * @param Definition $definition + * + * @return Boolean + */ + private function isSimpleInstance($id, $definition) + { + foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) { + if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) { + continue; + } + + if ($sDefinition->getMethodCalls() || $sDefinition->getProperties() || $sDefinition->getConfigurator()) { + return false; + } + } + + return true; + } + + /** + * Adds method calls to a service definition. + * + * @param string $id + * @param Definition $definition + * @param string $variableName + * + * @return string + */ + private function addServiceMethodCalls($id, $definition, $variableName = 'instance') + { + $calls = ''; + foreach ($definition->getMethodCalls() as $call) { + $arguments = array(); + foreach ($call[1] as $value) { + $arguments[] = $this->dumpValue($value); + } + + $calls .= $this->wrapServiceConditionals($call[1], sprintf(" \$%s->%s(%s);\n", $variableName, $call[0], implode(', ', $arguments))); + } + + return $calls; + } + + private function addServiceProperties($id, $definition, $variableName = 'instance') + { + $code = ''; + foreach ($definition->getProperties() as $name => $value) { + $code .= sprintf(" \$%s->%s = %s;\n", $variableName, $name, $this->dumpValue($value)); + } + + return $code; + } + + /** + * Generates the inline definition setup. + * + * @param string $id + * @param Definition $definition + * @return string + */ + private function addServiceInlinedDefinitionsSetup($id, $definition) + { + $this->referenceVariables[$id] = new Variable('instance'); + + $code = ''; + $processed = new \SplObjectStorage(); + foreach ($this->getInlinedDefinitions($definition) as $iDefinition) { + if ($processed->contains($iDefinition)) { + continue; + } + $processed->offsetSet($iDefinition); + + if (!$this->hasReference($id, $iDefinition->getMethodCalls())) { + continue; + } + + if ($iDefinition->getMethodCalls()) { + $code .= $this->addServiceMethodCalls(null, $iDefinition, (string) $this->definitionVariables->offsetGet($iDefinition)); + } + if ($iDefinition->getConfigurator()) { + $code .= $this->addServiceConfigurator(null, $iDefinition, (string) $this->definitionVariables->offsetGet($iDefinition)); + } + } + + if ('' !== $code) { + $code .= "\n"; + } + + return $code; + } + + /** + * Adds configurator definition + * + * @param string $id + * @param Definition $definition + * @param string $variableName + * + * @return string + */ + private function addServiceConfigurator($id, $definition, $variableName = 'instance') + { + if (!$callable = $definition->getConfigurator()) { + return ''; + } + + if (is_array($callable)) { + if ($callable[0] instanceof Reference) { + return sprintf(" %s->%s(\$%s);\n", $this->getServiceCall((string) $callable[0]), $callable[1], $variableName); + } + + return sprintf(" call_user_func(array(%s, '%s'), \$%s);\n", $this->dumpValue($callable[0]), $callable[1], $variableName); + } + + return sprintf(" %s(\$%s);\n", $callable, $variableName); + } + + /** + * Adds a service + * + * @param string $id + * @param Definition $definition + * + * @return string + */ + private function addService($id, $definition) + { + $name = Container::camelize($id); + $this->definitionVariables = new \SplObjectStorage(); + $this->referenceVariables = array(); + $this->variableCount = 0; + + $return = ''; + if ($definition->isSynthetic()) { + $return = sprintf('@throws RuntimeException always since this service is expected to be injected dynamically'); + } elseif ($class = $definition->getClass()) { + $return = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'Object' : $class, $class); + } elseif ($definition->getFactoryClass()) { + $return = sprintf('@return Object An instance returned by %s::%s().', $definition->getFactoryClass(), $definition->getFactoryMethod()); + } elseif ($definition->getFactoryService()) { + $return = sprintf('@return Object An instance returned by %s::%s().', $definition->getFactoryService(), $definition->getFactoryMethod()); + } + + $doc = ''; + if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) { + $doc .= <<isPublic()) { + $doc .= <<getScope(); + if (ContainerInterface::SCOPE_CONTAINER !== $scope && ContainerInterface::SCOPE_PROTOTYPE !== $scope) { + $code .= <<scopedServices['$scope'])) { + throw new InactiveScopeException('$id', '$scope'); + } + + +EOF; + } + + if ($definition->isSynthetic()) { + $code .= sprintf(" throw new RuntimeException('You have requested a synthetic service (\"%s\"). The DIC does not know how to construct this service.');\n }\n", $id); + } else { + $code .= + $this->addServiceInclude($id, $definition). + $this->addServiceLocalTempVariables($id, $definition). + $this->addServiceInlinedDefinitions($id, $definition). + $this->addServiceInstance($id, $definition). + $this->addServiceInlinedDefinitionsSetup($id, $definition). + $this->addServiceMethodCalls($id, $definition). + $this->addServiceProperties($id, $definition). + $this->addServiceConfigurator($id, $definition). + $this->addServiceReturn($id, $definition) + ; + } + + $this->definitionVariables = null; + $this->referenceVariables = null; + + return $code; + } + + /** + * Adds a service alias. + * + * @param string $alias + * @param string $id + * + * @return string + */ + private function addServiceAlias($alias, $id) + { + $name = Container::camelize($alias); + $type = 'Object'; + + if ($this->container->hasDefinition($id)) { + $class = $this->container->getDefinition($id)->getClass(); + $type = 0 === strpos($class, '%') ? 'Object' : $class; + } + + return <<getServiceCall($id)}; + } + +EOF; + } + + /** + * Adds multiple services + * + * @return string + */ + private function addServices() + { + $publicServices = $privateServices = $aliasServices = ''; + $definitions = $this->container->getDefinitions(); + ksort($definitions); + foreach ($definitions as $id => $definition) { + if ($definition->isPublic()) { + $publicServices .= $this->addService($id, $definition); + } else { + $privateServices .= $this->addService($id, $definition); + } + } + + $aliases = $this->container->getAliases(); + ksort($aliases); + foreach ($aliases as $alias => $id) { + $aliasServices .= $this->addServiceAlias($alias, $id); + } + + return $publicServices.$aliasServices.$privateServices; + } + + /** + * Adds the class headers. + * + * @param string $class Class name + * @param string $baseClass The name of the base class + * + * @return string + */ + private function startClass($class, $baseClass) + { + $bagClass = $this->container->isFrozen() ? 'use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;' : 'use Symfony\Component\DependencyInjection\ParameterBag\\ParameterBag;'; + + return <<container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null; + + $code = <<container->getScopes()) > 0) { + $code .= "\n"; + $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; + $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + } + + $code .= <<container->getParameterBag()->all()) { + $code .= "\n \$this->parameters = \$this->getDefaultParameters();\n"; + } + + $code .= <<services = + \$this->scopedServices = + \$this->scopeStacks = array(); + + \$this->set('service_container', \$this); + +EOF; + + $code .= "\n"; + if (count($scopes = $this->container->getScopes()) > 0) { + $code .= " \$this->scopes = ".$this->dumpValue($scopes).";\n"; + $code .= " \$this->scopeChildren = ".$this->dumpValue($this->container->getScopeChildren()).";\n"; + } else { + $code .= " \$this->scopes = array();\n"; + $code .= " \$this->scopeChildren = array();\n"; + } + + $code .= <<container->getParameterBag()->all()) { + return ''; + } + + $parameters = $this->exportParameters($this->container->getParameterBag()->all()); + + $code = ''; + if ($this->container->isFrozen()) { + $code .= <<parameters)) { + throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', \$name)); + } + + return \$this->parameters[\$name]; + } + + /** + * {@inheritdoc} + */ + public function hasParameter(\$name) + { + return array_key_exists(strtolower(\$name), \$this->parameters); + } + + /** + * {@inheritdoc} + */ + public function setParameter(\$name, \$value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } + + /** + * {@inheritDoc} + */ + public function getParameterBag() + { + if (null === \$this->parameterBag) { + \$this->parameterBag = new FrozenParameterBag(\$this->parameters); + } + + return \$this->parameterBag; + } +EOF; + } + + $code .= << $value) { + if (is_array($value)) { + $value = $this->exportParameters($value, $path.'/'.$key, $indent + 4); + } elseif ($value instanceof Variable) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain variable references. Variable "%s" found in "%s".', $value, $path.'/'.$key)); + } elseif ($value instanceof Definition) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain service definitions. Definition for "%s" found in "%s".', $value->getClass(), $path.'/'.$key)); + } elseif ($value instanceof Reference) { + throw new InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service "%s" found in "%s").', $value, $path.'/'.$key)); + } else { + $value = var_export($value, true); + } + + $php[] = sprintf('%s%s => %s,', str_repeat(' ', $indent), var_export($key, true), $value); + } + + return sprintf("array(\n%s\n%s)", implode("\n", $php), str_repeat(' ', $indent - 4)); + } + + /** + * Ends the class definition. + * + * @return string + */ + private function endClass() + { + return <<has('%s')", $service); + } + + // re-indent the wrapped code + $code = implode("\n", array_map(function ($line) { return $line ? ' '.$line : $line; }, explode("\n", $code))); + + return sprintf(" if (%s) {\n%s }\n", implode(' && ', $conditions), $code); + } + + /** + * Builds service calls from arguments + * + * @param array $arguments + * @param array &$calls By reference + * @param array &$behavior By reference + */ + private function getServiceCallsFromArguments(array $arguments, array &$calls, array &$behavior) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + $this->getServiceCallsFromArguments($argument, $calls, $behavior); + } elseif ($argument instanceof Reference) { + $id = (string) $argument; + + if (!isset($calls[$id])) { + $calls[$id] = 0; + } + if (!isset($behavior[$id])) { + $behavior[$id] = $argument->getInvalidBehavior(); + } elseif (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $behavior[$id]) { + $behavior[$id] = $argument->getInvalidBehavior(); + } + + $calls[$id] += 1; + } + } + } + + /** + * Returns the inline definition + * + * @param Definition $definition + * + * @return array + */ + private function getInlinedDefinitions(Definition $definition) + { + if (false === $this->inlinedDefinitions->contains($definition)) { + $definitions = array_merge( + $this->getDefinitionsFromArguments($definition->getArguments()), + $this->getDefinitionsFromArguments($definition->getMethodCalls()), + $this->getDefinitionsFromArguments($definition->getProperties()) + ); + + $this->inlinedDefinitions->offsetSet($definition, $definitions); + + return $definitions; + } + + return $this->inlinedDefinitions->offsetGet($definition); + } + + /** + * Gets the definition from arguments + * + * @param array $arguments + * + * @return array + */ + private function getDefinitionsFromArguments(array $arguments) + { + $definitions = array(); + foreach ($arguments as $argument) { + if (is_array($argument)) { + $definitions = array_merge($definitions, $this->getDefinitionsFromArguments($argument)); + } elseif ($argument instanceof Definition) { + $definitions = array_merge( + $definitions, + $this->getInlinedDefinitions($argument), + array($argument) + ); + } + } + + return $definitions; + } + + /** + * Checks if a service id has a reference + * + * @param string $id + * @param array $arguments + * + * @return Boolean + */ + private function hasReference($id, array $arguments) + { + foreach ($arguments as $argument) { + if (is_array($argument)) { + if ($this->hasReference($id, $argument)) { + return true; + } + } elseif ($argument instanceof Reference) { + if ($id === (string) $argument) { + return true; + } + } + } + + return false; + } + + /** + * Dumps values. + * + * @param array $value + * @param Boolean $interpolate + * + * @return string + */ + private function dumpValue($value, $interpolate = true) + { + if (is_array($value)) { + $code = array(); + foreach ($value as $k => $v) { + $code[] = sprintf('%s => %s', $this->dumpValue($k, $interpolate), $this->dumpValue($v, $interpolate)); + } + + return sprintf('array(%s)', implode(', ', $code)); + } elseif ($value instanceof Definition) { + if (null !== $this->definitionVariables && $this->definitionVariables->contains($value)) { + return $this->dumpValue($this->definitionVariables->offsetGet($value), $interpolate); + } + if (count($value->getMethodCalls()) > 0) { + throw new RuntimeException('Cannot dump definitions which have method calls.'); + } + if (null !== $value->getConfigurator()) { + throw new RuntimeException('Cannot dump definitions which have a configurator.'); + } + + $arguments = array(); + foreach ($value->getArguments() as $argument) { + $arguments[] = $this->dumpValue($argument); + } + $class = $this->dumpValue($value->getClass()); + + if (false !== strpos($class, '$')) { + throw new RuntimeException('Cannot dump definitions which have a variable class name.'); + } + + if (null !== $value->getFactoryMethod()) { + if (null !== $value->getFactoryClass()) { + return sprintf("call_user_func(array(%s, '%s')%s)", $this->dumpValue($value->getFactoryClass()), $value->getFactoryMethod(), count($arguments) > 0 ? ', '.implode(', ', $arguments) : ''); + } elseif (null !== $value->getFactoryService()) { + return sprintf("%s->%s(%s)", $this->getServiceCall($value->getFactoryService()), $value->getFactoryMethod(), implode(', ', $arguments)); + } else { + throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.'); + } + } + + return sprintf("new \\%s(%s)", substr(str_replace('\\\\', '\\', $class), 1, -1), implode(', ', $arguments)); + } elseif ($value instanceof Variable) { + return '$'.$value; + } elseif ($value instanceof Reference) { + if (null !== $this->referenceVariables && isset($this->referenceVariables[$id = (string) $value])) { + return $this->dumpValue($this->referenceVariables[$id], $interpolate); + } + + return $this->getServiceCall((string) $value, $value); + } elseif ($value instanceof Parameter) { + return $this->dumpParameter($value); + } elseif (true === $interpolate && is_string($value)) { + if (preg_match('/^%([^%]+)%$/', $value, $match)) { + // we do this to deal with non string values (Boolean, integer, ...) + // the preg_replace_callback converts them to strings + return $this->dumpParameter(strtolower($match[1])); + } else { + $that = $this; + $replaceParameters = function ($match) use ($that) { + return "'.".$that->dumpParameter(strtolower($match[2])).".'"; + }; + + $code = str_replace('%%', '%', preg_replace_callback('/(?container->isFrozen() && $this->container->hasParameter($name)) { + return $this->dumpValue($this->container->getParameter($name), false); + } + + return sprintf("\$this->getParameter('%s')", strtolower($name)); + } + + /** + * Gets a service call + * + * @param string $id + * @param Reference $reference + * + * @return string + */ + private function getServiceCall($id, Reference $reference = null) + { + if ('service_container' === $id) { + return '$this'; + } + + if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { + return sprintf('$this->get(\'%s\', ContainerInterface::NULL_ON_INVALID_REFERENCE)', $id); + } else { + if ($this->container->hasAlias($id)) { + $id = (string) $this->container->getAlias($id); + } + + return sprintf('$this->get(\'%s\')', $id); + } + } + + /** + * Returns the next name to use + * + * @return string + */ + private function getNextVariableName() + { + $firstChars = self::FIRST_CHARS; + $firstCharsLength = strlen($firstChars); + $nonFirstChars = self::NON_FIRST_CHARS; + $nonFirstCharsLength = strlen($nonFirstChars); + + while (true) { + $name = ''; + $i = $this->variableCount; + + if ('' === $name) { + $name .= $firstChars[$i%$firstCharsLength]; + $i = intval($i/$firstCharsLength); + } + + while ($i > 0) { + $i -= 1; + $name .= $nonFirstChars[$i%$nonFirstCharsLength]; + $i = intval($i/$nonFirstCharsLength); + } + + $this->variableCount += 1; + + // check that the name is not reserved + if (in_array($name, $this->reservedVariables, true)) { + continue; + } + + return $name; + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php new file mode 100755 index 0000000000..38025ff3ea --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php @@ -0,0 +1,305 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * XmlDumper dumps a service container as an XML string. + * + * @author Fabien Potencier + * @author Martin Hasoň + * + * @api + */ +class XmlDumper extends Dumper +{ + /** + * @var \DOMDocument + */ + private $document; + + /** + * Dumps the service container as an XML string. + * + * @param array $options An array of options + * + * @return string An xml string representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + $this->document = new \DOMDocument('1.0', 'utf-8'); + $this->document->formatOutput = true; + + $container = $this->document->createElementNS('http://symfony.com/schema/dic/services', 'container'); + $container->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); + $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd'); + + $this->addParameters($container); + $this->addServices($container); + + $this->document->appendChild($container); + $xml = $this->document->saveXML(); + $this->document = null; + + return $xml; + } + + /** + * Adds parameters. + * + * @param \DOMElement $parent + */ + private function addParameters(\DOMElement $parent) + { + $data = $this->container->getParameterBag()->all(); + if (!$data) { + return; + } + + if ($this->container->isFrozen()) { + $data = $this->escape($data); + } + + $parameters = $this->document->createElement('parameters'); + $parent->appendChild($parameters); + $this->convertParameters($data, 'parameter', $parameters); + } + + /** + * Adds method calls. + * + * @param array $methodcalls + * @param \DOMElement $parent + */ + private function addMethodCalls(array $methodcalls, \DOMElement $parent) + { + foreach ($methodcalls as $methodcall) { + $call = $this->document->createElement('call'); + $call->setAttribute('method', $methodcall[0]); + if (count($methodcall[1])) { + $this->convertParameters($methodcall[1], 'argument', $call); + } + $parent->appendChild($call); + } + } + + /** + * Adds a service. + * + * @param Definition $definition + * @param string $id + * @param \DOMElement $parent + */ + private function addService($definition, $id, \DOMElement $parent) + { + $service = $this->document->createElement('service'); + if (null !== $id) { + $service->setAttribute('id', $id); + } + if ($definition->getClass()) { + $service->setAttribute('class', $definition->getClass()); + } + if ($definition->getFactoryMethod()) { + $service->setAttribute('factory-method', $definition->getFactoryMethod()); + } + if ($definition->getFactoryService()) { + $service->setAttribute('factory-service', $definition->getFactoryService()); + } + if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { + $service->setAttribute('scope', $scope); + } + if (!$definition->isPublic()) { + $service->setAttribute('public', 'false'); + } + + foreach ($definition->getTags() as $name => $tags) { + foreach ($tags as $attributes) { + $tag = $this->document->createElement('tag'); + $tag->setAttribute('name', $name); + foreach ($attributes as $key => $value) { + $tag->setAttribute($key, $value); + } + $service->appendChild($tag); + } + } + + if ($definition->getFile()) { + $file = $this->document->createElement('file'); + $file->appendChild($this->document->createTextNode($definition->getFile())); + $service->appendChild($file); + } + + if ($parameters = $definition->getArguments()) { + $this->convertParameters($parameters, 'argument', $service); + } + + if ($parameters = $definition->getProperties()) { + $this->convertParameters($parameters, 'property', $service, 'name'); + } + + $this->addMethodCalls($definition->getMethodCalls(), $service); + + if ($callable = $definition->getConfigurator()) { + $configurator = $this->document->createElement('configurator'); + if (is_array($callable)) { + $configurator->setAttribute($callable[0] instanceof Reference ? 'service' : 'class', $callable[0]); + $configurator->setAttribute('method', $callable[1]); + } else { + $configurator->setAttribute('function', $callable); + } + $service->appendChild($configurator); + } + + $parent->appendChild($service); + } + + /** + * Adds a service alias. + * + * @param string $alias + * @param string $id + * @param \DOMElement $parent + */ + private function addServiceAlias($alias, $id, \DOMElement $parent) + { + $service = $this->document->createElement('service'); + $service->setAttribute('id', $alias); + $service->setAttribute('alias', $id); + if (!$id->isPublic()) { + $service->setAttribute('public', 'false'); + } + $parent->appendChild($service); + } + + /** + * Adds services. + * + * @param \DOMElement $parent + */ + private function addServices(\DOMElement $parent) + { + $definitions = $this->container->getDefinitions(); + if (!$definitions) { + return; + } + + $services = $this->document->createElement('services'); + foreach ($definitions as $id => $definition) { + $this->addService($definition, $id, $services); + } + + foreach ($this->container->getAliases() as $alias => $id) { + $this->addServiceAlias($alias, $id, $services); + } + $parent->appendChild($services); + } + + /** + * Converts parameters. + * + * @param array $parameters + * @param string $type + * @param \DOMElement $parent + * @param string $keyAttribute + */ + private function convertParameters($parameters, $type, \DOMElement $parent, $keyAttribute = 'key') + { + $withKeys = array_keys($parameters) !== range(0, count($parameters) - 1); + foreach ($parameters as $key => $value) { + $element = $this->document->createElement($type); + if ($withKeys) { + $element->setAttribute($keyAttribute, $key); + } + + if (is_array($value)) { + $element->setAttribute('type', 'collection'); + $this->convertParameters($value, $type, $element, 'key'); + } elseif ($value instanceof Reference) { + $element->setAttribute('type', 'service'); + $element->setAttribute('id', (string) $value); + $behaviour = $value->getInvalidBehavior(); + if ($behaviour == ContainerInterface::NULL_ON_INVALID_REFERENCE) { + $element->setAttribute('on-invalid', 'null'); + } elseif ($behaviour == ContainerInterface::IGNORE_ON_INVALID_REFERENCE) { + $element->setAttribute('on-invalid', 'ignore'); + } + } elseif ($value instanceof Definition) { + $element->setAttribute('type', 'service'); + $this->addService($value, null, $element); + } else { + if (in_array($value, array('null', 'true', 'false'), true)) { + $element->setAttribute('type', 'string'); + } + $text = $this->document->createTextNode(self::phpToXml($value)); + $element->appendChild($text); + } + $parent->appendChild($element); + } + } + + /** + * Escapes arguments + * + * @param array $arguments + * + * @return array + */ + private function escape($arguments) + { + $args = array(); + foreach ($arguments as $k => $v) { + if (is_array($v)) { + $args[$k] = $this->escape($v); + } elseif (is_string($v)) { + $args[$k] = str_replace('%', '%%', $v); + } else { + $args[$k] = $v; + } + } + + return $args; + } + + /** + * Converts php types to xml types. + * + * @param mixed $value Value to convert + * + * @return string + * + * @throws RuntimeException When trying to dump object or resource + */ + public static function phpToXml($value) + { + switch (true) { + case null === $value: + return 'null'; + case true === $value: + return 'true'; + case false === $value: + return 'false'; + case $value instanceof Parameter: + return '%'.$value.'%'; + case is_object($value) || is_resource($value): + throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); + default: + return (string) $value; + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php new file mode 100755 index 0000000000..82d68008e0 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php @@ -0,0 +1,299 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Dumper; + +use Symfony\Component\Yaml\Dumper as YmlDumper; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Parameter; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * YamlDumper dumps a service container as a YAML string. + * + * @author Fabien Potencier + * + * @api + */ +class YamlDumper extends Dumper +{ + private $dumper; + + /** + * Constructor. + * + * @param ContainerBuilder $container The service container to dump + * + * @api + */ + public function __construct(ContainerBuilder $container) + { + parent::__construct($container); + + $this->dumper = new YmlDumper(); + } + + /** + * Dumps the service container as an YAML string. + * + * @param array $options An array of options + * + * @return string A YAML string representing of the service container + * + * @api + */ + public function dump(array $options = array()) + { + return $this->addParameters()."\n".$this->addServices(); + } + + /** + * Adds a service + * + * @param string $id + * @param Definition $definition + * + * @return string + */ + private function addService($id, $definition) + { + $code = " $id:\n"; + if ($definition->getClass()) { + $code .= sprintf(" class: %s\n", $definition->getClass()); + } + + $tagsCode = ''; + foreach ($definition->getTags() as $name => $tags) { + foreach ($tags as $attributes) { + $att = array(); + foreach ($attributes as $key => $value) { + $att[] = sprintf('%s: %s', $this->dumper->dump($key), $this->dumper->dump($value)); + } + $att = $att ? ', '.implode(' ', $att) : ''; + + $tagsCode .= sprintf(" - { name: %s%s }\n", $this->dumper->dump($name), $att); + } + } + if ($tagsCode) { + $code .= " tags:\n".$tagsCode; + } + + if ($definition->getFile()) { + $code .= sprintf(" file: %s\n", $definition->getFile()); + } + + if ($definition->getFactoryMethod()) { + $code .= sprintf(" factory_method: %s\n", $definition->getFactoryMethod()); + } + + if ($definition->getFactoryService()) { + $code .= sprintf(" factory_service: %s\n", $definition->getFactoryService()); + } + + if ($definition->getArguments()) { + $code .= sprintf(" arguments: %s\n", $this->dumper->dump($this->dumpValue($definition->getArguments()), 0)); + } + + if ($definition->getProperties()) { + $code .= sprintf(" properties: %s\n", $this->dumper->dump($this->dumpValue($definition->getProperties()), 0)); + } + + if ($definition->getMethodCalls()) { + $code .= sprintf(" calls:\n%s\n", $this->dumper->dump($this->dumpValue($definition->getMethodCalls()), 1, 12)); + } + + if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { + $code .= sprintf(" scope: %s\n", $scope); + } + + if ($callable = $definition->getConfigurator()) { + if (is_array($callable)) { + if ($callable[0] instanceof Reference) { + $callable = array($this->getServiceCall((string) $callable[0], $callable[0]), $callable[1]); + } else { + $callable = array($callable[0], $callable[1]); + } + } + + $code .= sprintf(" configurator: %s\n", $this->dumper->dump($callable, 0)); + } + + return $code; + } + + /** + * Adds a service alias + * + * @param string $alias + * @param Alias $id + * + * @return string + */ + private function addServiceAlias($alias, $id) + { + if ($id->isPublic()) { + return sprintf(" %s: @%s\n", $alias, $id); + } else { + return sprintf(" %s:\n alias: %s\n public: false", $alias, $id); + } + } + + /** + * Adds services + * + * @return string + */ + private function addServices() + { + if (!$this->container->getDefinitions()) { + return ''; + } + + $code = "services:\n"; + foreach ($this->container->getDefinitions() as $id => $definition) { + $code .= $this->addService($id, $definition); + } + + foreach ($this->container->getAliases() as $alias => $id) { + $code .= $this->addServiceAlias($alias, $id); + } + + return $code; + } + + /** + * Adds parameters + * + * @return string + */ + private function addParameters() + { + if (!$this->container->getParameterBag()->all()) { + return ''; + } + + if ($this->container->isFrozen()) { + $parameters = $this->prepareParameters($this->container->getParameterBag()->all()); + } else { + $parameters = $this->container->getParameterBag()->all(); + } + + return $this->dumper->dump(array('parameters' => $parameters), 2); + } + + /** + * Dumps the value to YAML format + * + * @param mixed $value + * + * @return mixed + * + * @throws RuntimeException When trying to dump object or resource + */ + private function dumpValue($value) + { + if (is_array($value)) { + $code = array(); + foreach ($value as $k => $v) { + $code[$k] = $this->dumpValue($v); + } + + return $code; + } elseif ($value instanceof Reference) { + return $this->getServiceCall((string) $value, $value); + } elseif ($value instanceof Parameter) { + return $this->getParameterCall((string) $value); + } elseif (is_object($value) || is_resource($value)) { + throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.'); + } + + return $value; + } + + /** + * Gets the service call. + * + * @param string $id + * @param Reference $reference + * + * @return string + */ + private function getServiceCall($id, Reference $reference = null) + { + if (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) { + return sprintf('@?%s', $id); + } + + return sprintf('@%s', $id); + } + + /** + * Gets parameter call. + * + * @param string $id + * + * @return string + */ + private function getParameterCall($id) + { + return sprintf('%%%s%%', $id); + } + + /** + * Prepares parameters + * + * @param array $parameters + * + * @return array + */ + private function prepareParameters($parameters) + { + $filtered = array(); + foreach ($parameters as $key => $value) { + if (is_array($value)) { + $value = $this->prepareParameters($value); + } elseif ($value instanceof Reference) { + $value = '@'.$value; + } + + $filtered[$key] = $value; + } + + return $this->escape($filtered); + } + + /** + * Escapes arguments + * + * @param array $arguments + * + * @return array + */ + private function escape($arguments) + { + $args = array(); + foreach ($arguments as $k => $v) { + if (is_array($v)) { + $args[$k] = $this->escape($v); + } elseif (is_string($v)) { + $args[$k] = str_replace('%', '%%', $v); + } else { + $args[$k] = $v; + } + } + + return $args; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php new file mode 100755 index 0000000000..959238e939 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/BadMethodCallException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base BadMethodCallException for Dependency Injection component. + */ +class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php new file mode 100755 index 0000000000..f5e9099f11 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ExceptionInterface.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base ExceptionInterface for Dependency Injection component. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + */ +interface ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php new file mode 100755 index 0000000000..24d1ca0547 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InactiveScopeException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when you try to create a service of an inactive scope. + * + * @author Johannes M. Schmitt + */ +class InactiveScopeException extends RuntimeException +{ + private $serviceId; + private $scope; + + public function __construct($serviceId, $scope) + { + parent::__construct(sprintf('You cannot create a service ("%s") of an inactive scope ("%s").', $serviceId, $scope)); + + $this->serviceId = $serviceId; + $this->scope = $scope; + } + + public function getServiceId() + { + return $this->serviceId; + } + + public function getScope() + { + return $this->scope; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php new file mode 100755 index 0000000000..119bb7d195 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base InvalidArgumentException for Dependency Injection component. + * + * @author Bulat Shakirzyanov + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php new file mode 100755 index 0000000000..17a070ca82 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/LogicException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base LogicException for Dependency Injection component. + */ +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php new file mode 100755 index 0000000000..a61f143b30 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/OutOfBoundsException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base OutOfBoundsException for Dependency Injection component. + */ +class OutOfBoundsException extends \OutOfBoundsException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php new file mode 100755 index 0000000000..958ade060c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterCircularReferenceException.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a circular reference in a parameter is detected. + * + * @author Fabien Potencier + */ +class ParameterCircularReferenceException extends RuntimeException +{ + private $parameters; + + public function __construct($parameters) + { + parent::__construct(sprintf('Circular reference detected for parameter "%s" ("%s" > "%s").', $parameters[0], implode('" > "', $parameters), $parameters[0])); + + $this->parameters = $parameters; + } + + public function getParameters() + { + return $this->parameters; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php new file mode 100755 index 0000000000..200fbec2af --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ParameterNotFoundException.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a non-existent parameter is used. + * + * @author Fabien Potencier + */ +class ParameterNotFoundException extends InvalidArgumentException +{ + private $key; + private $sourceId; + private $sourceKey; + + /** + * Constructor. + * + * @param string $key The requested parameter key + * @param string $sourceId The service id that references the non-existent parameter + * @param string $sourceKey The parameter key that references the non-existent parameter + */ + public function __construct($key, $sourceId = null, $sourceKey = null) + { + $this->key = $key; + $this->sourceId = $sourceId; + $this->sourceKey = $sourceKey; + + $this->updateRepr(); + } + + public function updateRepr() + { + if (null !== $this->sourceId) { + $this->message = sprintf('The service "%s" has a dependency on a non-existent parameter "%s".', $this->sourceId, $this->key); + } elseif (null !== $this->sourceKey) { + $this->message = sprintf('The parameter "%s" has a dependency on a non-existent parameter "%s".', $this->sourceKey, $this->key); + } else { + $this->message = sprintf('You have requested a non-existent parameter "%s".', $this->key); + } + } + + public function getKey() + { + return $this->key; + } + + public function getSourceId() + { + return $this->sourceId; + } + + public function getSourceKey() + { + return $this->sourceKey; + } + + public function setSourceId($sourceId) + { + $this->sourceId = $sourceId; + + $this->updateRepr(); + } + + public function setSourceKey($sourceKey) + { + $this->sourceKey = $sourceKey; + + $this->updateRepr(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php new file mode 100755 index 0000000000..5c24541208 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/RuntimeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Base RuntimeException for Dependency Injection component. + * + * @author Johannes M. Schmitt + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php new file mode 100755 index 0000000000..f23374f210 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeCrossingInjectionException.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when the a scope crossing injection is detected. + * + * @author Johannes M. Schmitt + */ +class ScopeCrossingInjectionException extends RuntimeException +{ + private $sourceServiceId; + private $sourceScope; + private $destServiceId; + private $destScope; + + public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope) + { + parent::__construct(sprintf( + 'Scope Crossing Injection detected: The definition "%s" references the service "%s" which belongs to another scope hierarchy. ' + .'This service might not be available consistently. Generally, it is safer to either move the definition "%s" to scope "%s", or ' + .'declare "%s" as a child scope of "%s". If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error.', + $sourceServiceId, + $destServiceId, + $sourceServiceId, + $destScope, + $sourceScope, + $destScope + )); + + $this->sourceServiceId = $sourceServiceId; + $this->sourceScope = $sourceScope; + $this->destServiceId = $destServiceId; + $this->destScope = $destScope; + } + + public function getSourceServiceId() + { + return $this->sourceServiceId; + } + + public function getSourceScope() + { + return $this->sourceScope; + } + + public function getDestServiceId() + { + return $this->destServiceId; + } + + public function getDestScope() + { + return $this->destScope; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php new file mode 100755 index 0000000000..d46345334c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * Thrown when a scope widening injection is detected. + * + * @author Johannes M. Schmitt + */ +class ScopeWideningInjectionException extends RuntimeException +{ + private $sourceServiceId; + private $sourceScope; + private $destServiceId; + private $destScope; + + public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope) + { + parent::__construct(sprintf( + 'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' + .'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' + .'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', + $sourceServiceId, + $destServiceId, + $sourceServiceId, + $destScope, + $destServiceId + )); + + $this->sourceServiceId = $sourceServiceId; + $this->sourceScope = $sourceScope; + $this->destServiceId = $destServiceId; + $this->destScope = $destScope; + } + + public function getSourceServiceId() + { + return $this->sourceServiceId; + } + + public function getSourceScope() + { + return $this->sourceScope; + } + + public function getDestServiceId() + { + return $this->destServiceId; + } + + public function getDestScope() + { + return $this->destScope; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php new file mode 100755 index 0000000000..e0000011fc --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a circular reference is detected. + * + * @author Johannes M. Schmitt + */ +class ServiceCircularReferenceException extends RuntimeException +{ + private $serviceId; + private $path; + + public function __construct($serviceId, array $path) + { + parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path))); + + $this->serviceId = $serviceId; + $this->path = $path; + } + + public function getServiceId() + { + return $this->serviceId; + } + + public function getPath() + { + return $this->path; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php new file mode 100755 index 0000000000..f9af1ea84e --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Exception; + +/** + * This exception is thrown when a non-existent service is requested. + * + * @author Johannes M. Schmitt + */ +class ServiceNotFoundException extends InvalidArgumentException +{ + private $id; + private $sourceId; + + public function __construct($id, $sourceId = null) + { + if (null === $sourceId) { + $msg = sprintf('You have requested a non-existent service "%s".', $id); + } else { + $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id); + } + + parent::__construct($msg); + + $this->id = $id; + $this->sourceId = $sourceId; + } + + public function getId() + { + return $this->id; + } + + public function getSourceId() + { + return $this->sourceId; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php new file mode 100755 index 0000000000..1d96d240f4 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * ConfigurationExtensionInterface is the interface implemented by container extension classes. + * + * @author Kevin Bond + */ +interface ConfigurationExtensionInterface +{ + /** + * Returns extension configuration + * + * @param array $config $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @return ConfigurationInterface|null The configuration or null + */ + public function getConfiguration(array $config, ContainerBuilder $container); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php new file mode 100755 index 0000000000..e5c51a7b58 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/Extension.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Definition\Processor; +use Symfony\Component\Config\Definition\ConfigurationInterface; + +/** + * Provides useful features shared by many extensions. + * + * @author Fabien Potencier + */ +abstract class Extension implements ExtensionInterface, ConfigurationExtensionInterface +{ + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + */ + public function getXsdValidationBasePath() + { + return false; + } + + /** + * Returns the namespace to be used for this extension (XML namespace). + * + * @return string The XML namespace + */ + public function getNamespace() + { + return 'http://example.org/schema/dic/'.$this->getAlias(); + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * This convention is to remove the "Extension" postfix from the class + * name and then lowercase and underscore the result. So: + * + * AcmeHelloExtension + * + * becomes + * + * acme_hello + * + * This can be overridden in a sub-class to specify the alias manually. + * + * @return string The alias + * + * @throws \BadMethodCallException When the extension name does not follow conventions + */ + public function getAlias() + { + $className = get_class($this); + if (substr($className, -9) != 'Extension') { + throw new \BadMethodCallException('This extension does not follow the naming convention; you must overwrite the getAlias() method.'); + } + $classBaseName = substr(strrchr($className, '\\'), 1, -9); + + return Container::underscore($classBaseName); + } + + final protected function processConfiguration(ConfigurationInterface $configuration, array $configs) + { + $processor = new Processor(); + + return $processor->processConfiguration($configuration, $configs); + } + + /** + * {@inheritDoc} + */ + public function getConfiguration(array $config, ContainerBuilder $container) + { + $reflected = new \ReflectionClass($this); + $namespace = $reflected->getNamespaceName(); + + $class = $namespace . '\\Configuration'; + if (class_exists($class)) { + $r = new \ReflectionClass($class); + $container->addResource(new FileResource($r->getFileName())); + + if (!method_exists($class, '__construct')) { + $configuration = new $class(); + + return $configuration; + } + } + + return null; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php new file mode 100755 index 0000000000..fc015e1459 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Extension/ExtensionInterface.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Extension; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * ExtensionInterface is the interface implemented by container extension classes. + * + * @author Fabien Potencier + * + * @api + */ +interface ExtensionInterface +{ + /** + * Loads a specific configuration. + * + * @param array $config An array of configuration values + * @param ContainerBuilder $container A ContainerBuilder instance + * + * @throws InvalidArgumentException When provided tag is not defined in this extension + * + * @api + */ + public function load(array $config, ContainerBuilder $container); + + /** + * Returns the namespace to be used for this extension (XML namespace). + * + * @return string The XML namespace + * + * @api + */ + public function getNamespace(); + + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + * + * @api + */ + public function getXsdValidationBasePath(); + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * @return string The alias + * + * @api + */ + public function getAlias(); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php new file mode 100755 index 0000000000..34d6cada9a --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * IntrospectableContainerInterface defines additional introspection functionality + * for containers, allowing logic to be implemented based on a Container's state. + * + * @author Evan Villemez + * + */ +interface IntrospectableContainerInterface extends ContainerInterface +{ + /** + * Check for whether or not a service has been initialized. + * + * @param string $id + * + * @return Boolean true if the service has been initialized, false otherwise + * + */ + public function initialized($id); + +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE new file mode 100755 index 0000000000..cdffe7aebc --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2012 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php new file mode 100755 index 0000000000..775a3525d8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Loader\Loader; + +/** + * ClosureLoader loads service definitions from a PHP closure. + * + * The Closure has access to the container as its first argument. + * + * @author Fabien Potencier + */ +class ClosureLoader extends Loader +{ + private $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container A ContainerBuilder instance + */ + public function __construct(ContainerBuilder $container) + { + $this->container = $container; + } + + /** + * Loads a Closure. + * + * @param \Closure $closure The resource + * @param string $type The resource type + */ + public function load($closure, $type = null) + { + call_user_func($closure, $this->container); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return $resource instanceof \Closure; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php new file mode 100755 index 0000000000..ad437b5138 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/FileLoader.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Loader\FileLoader as BaseFileLoader; +use Symfony\Component\Config\FileLocatorInterface; + +/** + * FileLoader is the abstract class used by all built-in loaders that are file based. + * + * @author Fabien Potencier + */ +abstract class FileLoader extends BaseFileLoader +{ + protected $container; + + /** + * Constructor. + * + * @param ContainerBuilder $container A ContainerBuilder instance + * @param FileLocatorInterface $locator A FileLocator instance + */ + public function __construct(ContainerBuilder $container, FileLocatorInterface $locator) + { + $this->container = $container; + + parent::__construct($locator); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php new file mode 100755 index 0000000000..e4b99f60d9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; + +/** + * IniFileLoader loads parameters from INI files. + * + * @author Fabien Potencier + */ +class IniFileLoader extends FileLoader +{ + /** + * Loads a resource. + * + * @param mixed $file The resource + * @param string $type The resource type + * + * @throws InvalidArgumentException When ini file is not valid + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $this->container->addResource(new FileResource($path)); + + $result = parse_ini_file($path, true); + if (false === $result || array() === $result) { + throw new InvalidArgumentException(sprintf('The "%s" file is not valid.', $file)); + } + + if (isset($result['parameters']) && is_array($result['parameters'])) { + foreach ($result['parameters'] as $key => $value) { + $this->container->setParameter($key, $value); + } + } + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'ini' === pathinfo($resource, PATHINFO_EXTENSION); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php new file mode 100755 index 0000000000..f2bf441d25 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; + +/** + * PhpFileLoader loads service definitions from a PHP file. + * + * The PHP file is required and the $container variable can be + * used form the file to change the container. + * + * @author Fabien Potencier + */ +class PhpFileLoader extends FileLoader +{ + /** + * Loads a PHP file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + // the container and loader variables are exposed to the included file below + $container = $this->container; + $loader = $this; + + $path = $this->locator->locate($file); + $this->setCurrentDir(dirname($path)); + $this->container->addResource(new FileResource($path)); + + include $path; + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php new file mode 100755 index 0000000000..f8f4336736 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -0,0 +1,416 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\SimpleXMLElement; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * XmlFileLoader loads XML files service definitions. + * + * @author Fabien Potencier + */ +class XmlFileLoader extends FileLoader +{ + /** + * Loads an XML file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $xml = $this->parseFile($path); + $xml->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services'); + + $this->container->addResource(new FileResource($path)); + + // anonymous services + $this->processAnonymousServices($xml, $path); + + // imports + $this->parseImports($xml, $path); + + // parameters + $this->parseParameters($xml, $path); + + // extensions + $this->loadFromExtensions($xml); + + // services + $this->parseDefinitions($xml, $path); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION); + } + + /** + * Parses parameters + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseParameters(SimpleXMLElement $xml, $file) + { + if (!$xml->parameters) { + return; + } + + $this->container->getParameterBag()->add($xml->parameters->getArgumentsAsPhp('parameter')); + } + + /** + * Parses imports + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseImports(SimpleXMLElement $xml, $file) + { + if (false === $imports = $xml->xpath('//container:imports/container:import')) { + return; + } + + foreach ($imports as $import) { + $this->setCurrentDir(dirname($file)); + $this->import((string) $import['resource'], null, (Boolean) $import->getAttributeAsPhp('ignore-errors'), $file); + } + } + + /** + * Parses multiple definitions + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function parseDefinitions(SimpleXMLElement $xml, $file) + { + if (false === $services = $xml->xpath('//container:services/container:service')) { + return; + } + + foreach ($services as $service) { + $this->parseDefinition((string) $service['id'], $service, $file); + } + } + + /** + * Parses an individual Definition + * + * @param string $id + * @param SimpleXMLElement $service + * @param string $file + */ + private function parseDefinition($id, $service, $file) + { + if ((string) $service['alias']) { + $public = true; + if (isset($service['public'])) { + $public = $service->getAttributeAsPhp('public'); + } + $this->container->setAlias($id, new Alias((string) $service['alias'], $public)); + + return; + } + + if (isset($service['parent'])) { + $definition = new DefinitionDecorator((string) $service['parent']); + } else { + $definition = new Definition(); + } + + foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'abstract') as $key) { + if (isset($service[$key])) { + $method = 'set'.str_replace('-', '', $key); + $definition->$method((string) $service->getAttributeAsPhp($key)); + } + } + + if ($service->file) { + $definition->setFile((string) $service->file); + } + + $definition->setArguments($service->getArgumentsAsPhp('argument')); + $definition->setProperties($service->getArgumentsAsPhp('property')); + + if (isset($service->configurator)) { + if (isset($service->configurator['function'])) { + $definition->setConfigurator((string) $service->configurator['function']); + } else { + if (isset($service->configurator['service'])) { + $class = new Reference((string) $service->configurator['service'], ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false); + } else { + $class = (string) $service->configurator['class']; + } + + $definition->setConfigurator(array($class, (string) $service->configurator['method'])); + } + } + + foreach ($service->call as $call) { + $definition->addMethodCall((string) $call['method'], $call->getArgumentsAsPhp('argument')); + } + + foreach ($service->tag as $tag) { + $parameters = array(); + foreach ($tag->attributes() as $name => $value) { + if ('name' === $name) { + continue; + } + + $parameters[$name] = SimpleXMLElement::phpize($value); + } + + $definition->addTag((string) $tag['name'], $parameters); + } + + $this->container->setDefinition($id, $definition); + } + + /** + * Parses a XML file. + * + * @param string $file Path to a file + * + * @return SimpleXMLElement + * + * @throws InvalidArgumentException When loading of XML file returns error + */ + protected function parseFile($file) + { + try { + $dom = XmlUtils::loadFile($file, array($this, 'validateSchema')); + } catch (\InvalidArgumentException $e) { + throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); + } + + $this->validateExtensions($dom, $file); + + return simplexml_import_dom($dom, 'Symfony\\Component\\DependencyInjection\\SimpleXMLElement'); + } + + /** + * Processes anonymous services + * + * @param SimpleXMLElement $xml + * @param string $file + */ + private function processAnonymousServices(SimpleXMLElement $xml, $file) + { + $definitions = array(); + $count = 0; + + // anonymous services as arguments/properties + if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); + + $definitions[(string) $node['id']] = array($node->service, $file, false); + $node->service['id'] = (string) $node['id']; + } + } + + // anonymous services "in the wild" + if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) { + foreach ($nodes as $node) { + // give it a unique name + $node['id'] = sprintf('%s_%d', md5($file), ++$count); + + $definitions[(string) $node['id']] = array($node, $file, true); + $node->service['id'] = (string) $node['id']; + } + } + + // resolve definitions + krsort($definitions); + foreach ($definitions as $id => $def) { + // anonymous services are always private + $def[0]['public'] = false; + + $this->parseDefinition($id, $def[0], $def[1]); + + $oNode = dom_import_simplexml($def[0]); + if (true === $def[2]) { + $nNode = new \DOMElement('_services'); + $oNode->parentNode->replaceChild($nNode, $oNode); + $nNode->setAttribute('id', $id); + } else { + $oNode->parentNode->removeChild($oNode); + } + } + } + + /** + * Validates a documents XML schema. + * + * @param \DOMDocument $dom + * + * @throws RuntimeException When extension references a non-existent XSD file + */ + public function validateSchema(\DOMDocument $dom) + { + $schemaLocations = array('http://symfony.com/schema/dic/services' => str_replace('\\', '/', __DIR__.'/schema/dic/services/services-1.0.xsd')); + + if ($element = $dom->documentElement->getAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation')) { + $items = preg_split('/\s+/', $element); + for ($i = 0, $nb = count($items); $i < $nb; $i += 2) { + if (!$this->container->hasExtension($items[$i])) { + continue; + } + + if (($extension = $this->container->getExtension($items[$i])) && false !== $extension->getXsdValidationBasePath()) { + $path = str_replace($extension->getNamespace(), str_replace('\\', '/', $extension->getXsdValidationBasePath()).'/', $items[$i + 1]); + + if (!is_file($path)) { + throw new RuntimeException(sprintf('Extension "%s" references a non-existent XSD file "%s"', get_class($extension), $path)); + } + + $schemaLocations[$items[$i]] = $path; + } + } + } + + $tmpfiles = array(); + $imports = ''; + foreach ($schemaLocations as $namespace => $location) { + $parts = explode('/', $location); + if (0 === stripos($location, 'phar://')) { + $tmpfile = tempnam(sys_get_temp_dir(), 'sf2'); + if ($tmpfile) { + copy($location, $tmpfile); + $tmpfiles[] = $tmpfile; + $parts = explode('/', str_replace('\\', '/', $tmpfile)); + } + } + $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; + $location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); + + $imports .= sprintf(' '."\n", $namespace, $location); + } + + $source = << + + + +$imports + +EOF + ; + + $valid = @$dom->schemaValidateSource($source); + + foreach ($tmpfiles as $tmpfile) { + @unlink($tmpfile); + } + + return $valid; + } + + /** + * Validates an extension. + * + * @param \DOMDocument $dom + * @param string $file + * + * @throws InvalidArgumentException When no extension is found corresponding to a tag + */ + private function validateExtensions(\DOMDocument $dom, $file) + { + foreach ($dom->documentElement->childNodes as $node) { + if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) { + continue; + } + + // can it be handled by an extension? + if (!$this->container->hasExtension($node->namespaceURI)) { + $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions())); + throw new InvalidArgumentException(sprintf( + 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', + $node->tagName, + $file, + $node->namespaceURI, + $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' + )); + } + } + } + + /** + * Loads from an extension. + * + * @param SimpleXMLElement $xml + */ + private function loadFromExtensions(SimpleXMLElement $xml) + { + foreach (dom_import_simplexml($xml)->childNodes as $node) { + if (!$node instanceof \DOMElement || $node->namespaceURI === 'http://symfony.com/schema/dic/services') { + continue; + } + + $values = static::convertDomElementToArray($node); + if (!is_array($values)) { + $values = array(); + } + + $this->container->loadFromExtension($node->namespaceURI, $values); + } + } + + /** + * Converts a \DomElement object to a PHP array. + * + * The following rules applies during the conversion: + * + * * Each tag is converted to a key value or an array + * if there is more than one "value" + * + * * The content of a tag is set under a "value" key (bar) + * if the tag also has some nested tags + * + * * The attributes are converted to keys () + * + * * The nested-tags are converted to keys (bar) + * + * @param \DomElement $element A \DomElement instance + * + * @return array A PHP array + */ + public static function convertDomElementToArray(\DomElement $element) + { + return XmlUtils::convertDomElementToArray($element); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php new file mode 100755 index 0000000000..71de4ac659 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -0,0 +1,333 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Loader; + +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Yaml\Yaml; + +/** + * YamlFileLoader loads YAML files service definitions. + * + * The YAML format does not support anonymous services (cf. the XML loader). + * + * @author Fabien Potencier + */ +class YamlFileLoader extends FileLoader +{ + /** + * Loads a Yaml file. + * + * @param mixed $file The resource + * @param string $type The resource type + */ + public function load($file, $type = null) + { + $path = $this->locator->locate($file); + + $content = $this->loadFile($path); + + $this->container->addResource(new FileResource($path)); + + // empty file + if (null === $content) { + return; + } + + // imports + $this->parseImports($content, $file); + + // parameters + if (isset($content['parameters'])) { + foreach ($content['parameters'] as $key => $value) { + $this->container->setParameter($key, $this->resolveServices($value)); + } + } + + // extensions + $this->loadFromExtensions($content); + + // services + $this->parseDefinitions($content, $file); + } + + /** + * Returns true if this class supports the given resource. + * + * @param mixed $resource A resource + * @param string $type The resource type + * + * @return Boolean true if this class supports the given resource, false otherwise + */ + public function supports($resource, $type = null) + { + return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION); + } + + /** + * Parses all imports + * + * @param array $content + * @param string $file + */ + private function parseImports($content, $file) + { + if (!isset($content['imports'])) { + return; + } + + foreach ($content['imports'] as $import) { + $this->setCurrentDir(dirname($file)); + $this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false, $file); + } + } + + /** + * Parses definitions + * + * @param array $content + * @param string $file + */ + private function parseDefinitions($content, $file) + { + if (!isset($content['services'])) { + return; + } + + foreach ($content['services'] as $id => $service) { + $this->parseDefinition($id, $service, $file); + } + } + + /** + * Parses a definition. + * + * @param string $id + * @param array $service + * @param string $file + * + * @throws InvalidArgumentException When tags are invalid + */ + private function parseDefinition($id, $service, $file) + { + if (is_string($service) && 0 === strpos($service, '@')) { + $this->container->setAlias($id, substr($service, 1)); + + return; + } elseif (isset($service['alias'])) { + $public = !array_key_exists('public', $service) || (Boolean) $service['public']; + $this->container->setAlias($id, new Alias($service['alias'], $public)); + + return; + } + + if (isset($service['parent'])) { + $definition = new DefinitionDecorator($service['parent']); + } else { + $definition = new Definition(); + } + + if (isset($service['class'])) { + $definition->setClass($service['class']); + } + + if (isset($service['scope'])) { + $definition->setScope($service['scope']); + } + + if (isset($service['synthetic'])) { + $definition->setSynthetic($service['synthetic']); + } + + if (isset($service['public'])) { + $definition->setPublic($service['public']); + } + + if (isset($service['abstract'])) { + $definition->setAbstract($service['abstract']); + } + + if (isset($service['factory_class'])) { + $definition->setFactoryClass($service['factory_class']); + } + + if (isset($service['factory_method'])) { + $definition->setFactoryMethod($service['factory_method']); + } + + if (isset($service['factory_service'])) { + $definition->setFactoryService($service['factory_service']); + } + + if (isset($service['file'])) { + $definition->setFile($service['file']); + } + + if (isset($service['arguments'])) { + $definition->setArguments($this->resolveServices($service['arguments'])); + } + + if (isset($service['properties'])) { + $definition->setProperties($this->resolveServices($service['properties'])); + } + + if (isset($service['configurator'])) { + if (is_string($service['configurator'])) { + $definition->setConfigurator($service['configurator']); + } else { + $definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1])); + } + } + + if (isset($service['calls'])) { + foreach ($service['calls'] as $call) { + $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + $definition->addMethodCall($call[0], $args); + } + } + + if (isset($service['tags'])) { + if (!is_array($service['tags'])) { + throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.', $id, $file)); + } + + foreach ($service['tags'] as $tag) { + if (!isset($tag['name'])) { + throw new InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.', $id, $file)); + } + + $name = $tag['name']; + unset($tag['name']); + + foreach ($tag as $attribute => $value) { + if (!is_scalar($value)) { + throw new InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.', $id, $name, $file)); + } + } + + $definition->addTag($name, $tag); + } + } + + $this->container->setDefinition($id, $definition); + } + + /** + * Loads a YAML file. + * + * @param string $file + * + * @return array The file content + */ + protected function loadFile($file) + { + return $this->validate(Yaml::parse($file), $file); + } + + /** + * Validates a YAML file. + * + * @param mixed $content + * @param string $file + * + * @return array + * + * @throws InvalidArgumentException When service file is not valid + */ + private function validate($content, $file) + { + if (null === $content) { + return $content; + } + + if (!is_array($content)) { + throw new InvalidArgumentException(sprintf('The service file "%s" is not valid.', $file)); + } + + foreach (array_keys($content) as $namespace) { + if (in_array($namespace, array('imports', 'parameters', 'services'))) { + continue; + } + + if (!$this->container->hasExtension($namespace)) { + $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions())); + throw new InvalidArgumentException(sprintf( + 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', + $namespace, + $file, + $namespace, + $extensionNamespaces ? sprintf('"%s"', implode('", "', $extensionNamespaces)) : 'none' + )); + } + } + + return $content; + } + + /** + * Resolves services. + * + * @param string $value + * + * @return Reference + */ + private function resolveServices($value) + { + if (is_array($value)) { + $value = array_map(array($this, 'resolveServices'), $value); + } elseif (is_string($value) && 0 === strpos($value, '@')) { + if (0 === strpos($value, '@?')) { + $value = substr($value, 2); + $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; + } else { + $value = substr($value, 1); + $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; + } + + if ('=' === substr($value, -1)) { + $value = substr($value, 0, -1); + $strict = false; + } else { + $strict = true; + } + + $value = new Reference($value, $invalidBehavior, $strict); + } + + return $value; + } + + /** + * Loads from Extensions + * + * @param array $content + */ + private function loadFromExtensions($content) + { + foreach ($content as $namespace => $values) { + if (in_array($namespace, array('imports', 'parameters', 'services'))) { + continue; + } + + if (!is_array($values)) { + $values = array(); + } + + $this->container->loadFromExtension($namespace, $values); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd new file mode 100755 index 0000000000..316f2d7596 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php new file mode 100755 index 0000000000..7ba8c3a630 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Parameter.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Parameter represents a parameter reference. + * + * @author Fabien Potencier + * + * @api + */ +class Parameter +{ + private $id; + + /** + * Constructor. + * + * @param string $id The parameter key + */ + public function __construct($id) + { + $this->id = $id; + } + + /** + * __toString. + * + * @return string The parameter key + */ + public function __toString() + { + return (string) $this->id; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php new file mode 100755 index 0000000000..9664b134ef --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\LogicException; + +/** + * Holds read-only parameters. + * + * @author Fabien Potencier + * + * @api + */ +class FrozenParameterBag extends ParameterBag +{ + /** + * Constructor. + * + * For performance reasons, the constructor assumes that + * all keys are already lowercased. + * + * This is always the case when used internally. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->parameters = $parameters; + $this->resolved = true; + } + + /** + * {@inheritDoc} + * + * @api + */ + public function clear() + { + throw new LogicException('Impossible to call clear() on a frozen ParameterBag.'); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function add(array $parameters) + { + throw new LogicException('Impossible to call add() on a frozen ParameterBag.'); + } + + /** + * {@inheritDoc} + * + * @api + */ + public function set($name, $value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php new file mode 100755 index 0000000000..70f3956e3c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php @@ -0,0 +1,294 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +/** + * Holds parameters. + * + * @author Fabien Potencier + * + * @api + */ +class ParameterBag implements ParameterBagInterface +{ + protected $parameters; + protected $resolved; + + /** + * Constructor. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function __construct(array $parameters = array()) + { + $this->parameters = array(); + $this->add($parameters); + $this->resolved = false; + } + + /** + * Clears all parameters. + * + * @api + */ + public function clear() + { + $this->parameters = array(); + } + + /** + * Adds parameters to the service container parameters. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function add(array $parameters) + { + foreach ($parameters as $key => $value) { + $this->parameters[strtolower($key)] = $value; + } + } + + /** + * Gets the service container parameters. + * + * @return array An array of parameters + * + * @api + */ + public function all() + { + return $this->parameters; + } + + /** + * Gets a service container parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws ParameterNotFoundException if the parameter is not defined + * + * @api + */ + public function get($name) + { + $name = strtolower($name); + + if (!array_key_exists($name, $this->parameters)) { + throw new ParameterNotFoundException($name); + } + + return $this->parameters[$name]; + } + + /** + * Sets a service container parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function set($name, $value) + { + $this->parameters[strtolower($name)] = $value; + } + + /** + * Returns true if a parameter name is defined. + * + * @param string $name The parameter name + * + * @return Boolean true if the parameter name is defined, false otherwise + * + * @api + */ + public function has($name) + { + return array_key_exists(strtolower($name), $this->parameters); + } + + /** + * Removes a parameter. + * + * @param string $name The parameter name + * + * @api + */ + public function remove($name) + { + unset($this->parameters[strtolower($name)]); + } + + /** + * Replaces parameter placeholders (%name%) by their values for all parameters. + */ + public function resolve() + { + if ($this->resolved) { + return; + } + + $parameters = array(); + foreach ($this->parameters as $key => $value) { + try { + $value = $this->resolveValue($value); + $parameters[$key] = $this->unescapeValue($value); + } catch (ParameterNotFoundException $e) { + $e->setSourceKey($key); + + throw $e; + } + } + + $this->parameters = $parameters; + $this->resolved = true; + } + + /** + * Replaces parameter placeholders (%name%) by their values. + * + * @param mixed $value A value + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) + * + * @return mixed The resolved value + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + * @throws ParameterCircularReferenceException if a circular reference if detected + * @throws RuntimeException when a given parameter has a type problem. + */ + public function resolveValue($value, array $resolving = array()) + { + if (is_array($value)) { + $args = array(); + foreach ($value as $k => $v) { + $args[$this->resolveValue($k, $resolving)] = $this->resolveValue($v, $resolving); + } + + return $args; + } + + if (!is_string($value)) { + return $value; + } + + return $this->resolveString($value, $resolving); + } + + /** + * Resolves parameters inside a string + * + * @param string $value The string to resolve + * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) + * + * @return string The resolved string + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + * @throws ParameterCircularReferenceException if a circular reference if detected + * @throws RuntimeException when a given parameter has a type problem. + */ + public function resolveString($value, array $resolving = array()) + { + // we do this to deal with non string values (Boolean, integer, ...) + // as the preg_replace_callback throw an exception when trying + // a non-string in a parameter value + if (preg_match('/^%([^%\s]+)%$/', $value, $match)) { + $key = strtolower($match[1]); + + if (isset($resolving[$key])) { + throw new ParameterCircularReferenceException(array_keys($resolving)); + } + + $resolving[$key] = true; + + return $this->resolved ? $this->get($key) : $this->resolveValue($this->get($key), $resolving); + } + + $self = $this; + + return preg_replace_callback('/%%|%([^%\s]+)%/', function ($match) use ($self, $resolving, $value) { + // skip %% + if (!isset($match[1])) { + return '%%'; + } + + $key = strtolower($match[1]); + if (isset($resolving[$key])) { + throw new ParameterCircularReferenceException(array_keys($resolving)); + } + + $resolved = $self->get($key); + + if (!is_string($resolved) && !is_numeric($resolved)) { + throw new RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".', $key, gettype($resolved), $value)); + } + + $resolved = (string) $resolved; + $resolving[$key] = true; + + return $self->isResolved() ? $resolved : $self->resolveString($resolved, $resolving); + }, $value); + } + + public function isResolved() + { + return $this->resolved; + } + + /** + * {@inheritDoc} + */ + public function escapeValue($value) + { + if (is_string($value)) { + return str_replace('%', '%%', $value); + } + + if (is_array($value)) { + $result = array(); + foreach ($value as $k => $v) { + $result[$k] = $this->escapeValue($v); + } + + return $result; + } + + return $value; + } + + public function unescapeValue($value) + { + if (is_string($value)) { + return str_replace('%%', '%', $value); + } + + if (is_array($value)) { + $result = array(); + foreach ($value as $k => $v) { + $result[$k] = $this->unescapeValue($v); + } + + return $result; + } + + return $value; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php new file mode 100755 index 0000000000..a26d6aee17 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\ParameterBag; + +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; + +/** + * ParameterBagInterface. + * + * @author Fabien Potencier + * + * @api + */ +interface ParameterBagInterface +{ + /** + * Clears all parameters. + * + * @api + */ + public function clear(); + + /** + * Adds parameters to the service container parameters. + * + * @param array $parameters An array of parameters + * + * @api + */ + public function add(array $parameters); + + /** + * Gets the service container parameters. + * + * @return array An array of parameters + * + * @api + */ + public function all(); + + /** + * Gets a service container parameter. + * + * @param string $name The parameter name + * + * @return mixed The parameter value + * + * @throws ParameterNotFoundException if the parameter is not defined + * + * @api + */ + public function get($name); + + /** + * Sets a service container parameter. + * + * @param string $name The parameter name + * @param mixed $value The parameter value + * + * @api + */ + public function set($name, $value); + + /** + * Returns true if a parameter name is defined. + * + * @param string $name The parameter name + * + * @return Boolean true if the parameter name is defined, false otherwise + * + * @api + */ + public function has($name); + + /** + * Replaces parameter placeholders (%name%) by their values for all parameters. + */ + public function resolve(); + + /** + * Replaces parameter placeholders (%name%) by their values. + * + * @param mixed $value A value + * + * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist + */ + public function resolveValue($value); + + /** + * Escape parameter placeholders % + * + * @param mixed $value + * + * @return mixed + */ + public function escapeValue($value); + + /** + * Unescape parameter placeholders % + * + * @param mixed $value + * + * @return mixed + */ + public function unescapeValue($value); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md new file mode 100755 index 0000000000..ab67595240 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md @@ -0,0 +1,73 @@ +DependencyInjection Component +============================= + +DependencyInjection manages your services via a robust and flexible Dependency +Injection Container. + +Here is a simple example that shows how to register services and parameters: + + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Symfony\Component\DependencyInjection\Reference; + + $sc = new ContainerBuilder(); + $sc + ->register('foo', '%foo.class%') + ->addArgument(new Reference('bar')) + ; + $sc->setParameter('foo.class', 'Foo'); + + $sc->get('foo'); + +Method Calls (Setter Injection): + + $sc = new ContainerBuilder(); + + $sc + ->register('bar', '%bar.class%') + ->addMethodCall('setFoo', array(new Reference('foo'))) + ; + $sc->setParameter('bar.class', 'Bar'); + + $sc->get('bar'); + +Factory Class: + +If your service is retrieved by calling a static method: + + $sc = new ContainerBuilder(); + + $sc + ->register('bar', '%bar.class%') + ->setFactoryClass('%bar.class%') + ->setFactoryMethod('getInstance') + ->addArgument('Aarrg!!!') + ; + $sc->setParameter('bar.class', 'Bar'); + + $sc->get('bar'); + +File Include: + +For some services, especially those that are difficult or impossible to +autoload, you may need the container to include a file before +instantiating your class. + + $sc = new ContainerBuilder(); + + $sc + ->register('bar', '%bar.class%') + ->setFile('/path/to/file') + ->addArgument('Aarrg!!!') + ; + $sc->setParameter('bar.class', 'Bar'); + + $sc->get('bar'); + +Resources +--------- + +You can run the unit tests with the following command: + + $ cd path/to/Symfony/Component/DependencyInjection/ + $ composer.phar install --dev + $ phpunit diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php new file mode 100755 index 0000000000..1517da2988 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Reference.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Reference represents a service reference. + * + * @author Fabien Potencier + * + * @api + */ +class Reference +{ + private $id; + private $invalidBehavior; + private $strict; + + /** + * Constructor. + * + * @param string $id The service identifier + * @param int $invalidBehavior The behavior when the service does not exist + * @param Boolean $strict Sets how this reference is validated + * + * @see Container + */ + public function __construct($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, $strict = true) + { + $this->id = strtolower($id); + $this->invalidBehavior = $invalidBehavior; + $this->strict = $strict; + } + + /** + * __toString. + * + * @return string The service identifier + */ + public function __toString() + { + return (string) $this->id; + } + + /** + * Returns the behavior to be used when the service does not exist. + * + * @return int + */ + public function getInvalidBehavior() + { + return $this->invalidBehavior; + } + + /** + * Returns true when this Reference is strict + * + * @return Boolean + */ + public function isStrict() + { + return $this->strict; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php new file mode 100755 index 0000000000..161229e44b --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Scope.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Scope class. + * + * @author Johannes M. Schmitt + * + * @api + */ +class Scope implements ScopeInterface +{ + private $name; + private $parentName; + + /** + * @api + */ + public function __construct($name, $parentName = ContainerInterface::SCOPE_CONTAINER) + { + $this->name = $name; + $this->parentName = $parentName; + } + + /** + * @api + */ + public function getName() + { + return $this->name; + } + + /** + * @api + */ + public function getParentName() + { + return $this->parentName; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php new file mode 100755 index 0000000000..81ac67cc4d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ScopeInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Scope Interface. + * + * @author Johannes M. Schmitt + * + * @api + */ +interface ScopeInterface +{ + /** + * @api + */ + public function getName(); + + /** + * @api + */ + public function getParentName(); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php new file mode 100755 index 0000000000..cc5e311987 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/SimpleXMLElement.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +use Symfony\Component\Config\Util\XmlUtils; + +/** + * SimpleXMLElement class. + * + * @author Fabien Potencier + */ +class SimpleXMLElement extends \SimpleXMLElement +{ + /** + * Converts an attribute as a php type. + * + * @param string $name + * + * @return mixed + */ + public function getAttributeAsPhp($name) + { + return self::phpize($this[$name]); + } + + /** + * Returns arguments as valid php types. + * + * @param string $name + * @param Boolean $lowercase + * + * @return mixed + */ + public function getArgumentsAsPhp($name, $lowercase = true) + { + $arguments = array(); + foreach ($this->$name as $arg) { + if (isset($arg['name'])) { + $arg['key'] = (string) $arg['name']; + } + $key = isset($arg['key']) ? (string) $arg['key'] : (!$arguments ? 0 : max(array_keys($arguments)) + 1); + + // parameter keys are case insensitive + if ('parameter' == $name && $lowercase) { + $key = strtolower($key); + } + + // this is used by DefinitionDecorator to overwrite a specific + // argument of the parent definition + if (isset($arg['index'])) { + $key = 'index_'.$arg['index']; + } + + switch ($arg['type']) { + case 'service': + $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE; + if (isset($arg['on-invalid']) && 'ignore' == $arg['on-invalid']) { + $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE; + } elseif (isset($arg['on-invalid']) && 'null' == $arg['on-invalid']) { + $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE; + } + + if (isset($arg['strict'])) { + $strict = self::phpize($arg['strict']); + } else { + $strict = true; + } + + $arguments[$key] = new Reference((string) $arg['id'], $invalidBehavior, $strict); + break; + case 'collection': + $arguments[$key] = $arg->getArgumentsAsPhp($name, false); + break; + case 'string': + $arguments[$key] = (string) $arg; + break; + case 'constant': + $arguments[$key] = constant((string) $arg); + break; + default: + $arguments[$key] = self::phpize($arg); + } + } + + return $arguments; + } + + /** + * Converts an xml value to a php type. + * + * @param mixed $value + * + * @return mixed + */ + public static function phpize($value) + { + return XmlUtils::phpize($value); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php new file mode 100755 index 0000000000..3b4881703c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/TaggedContainerInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * TaggedContainerInterface is the interface implemented when a container knows how to deals with tags. + * + * @author Fabien Potencier + * + * @api + */ +interface TaggedContainerInterface extends ContainerInterface +{ + /** + * Returns service ids for a given tag. + * + * @param string $name The tag name + * + * @return array An array of tags + * + * @api + */ + public function findTaggedServiceIds($name); +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php new file mode 100755 index 0000000000..c99659e5a6 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Compiler\Compiler; +use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; +use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + + $a = $container + ->register('a') + ->addArgument($ref1 = new Reference('b')) + ; + + $b = $container + ->register('b') + ->addMethodCall('setA', array($ref2 = new Reference('a'))) + ; + + $c = $container + ->register('c') + ->addArgument($ref3 = new Reference('a')) + ->addArgument($ref4 = new Reference('b')) + ; + + $d = $container + ->register('d') + ->setProperty('foo', $ref5 = new Reference('b')) + ; + + $e = $container + ->register('e') + ->setConfigurator(array($ref6 = new Reference('b'), 'methodName')) + ; + + $graph = $this->process($container); + + $this->assertCount(4, $edges = $graph->getNode('b')->getInEdges()); + + $this->assertSame($ref1, $edges[0]->getValue()); + $this->assertSame($ref4, $edges[1]->getValue()); + $this->assertSame($ref5, $edges[2]->getValue()); + $this->assertSame($ref6, $edges[3]->getValue()); + } + + public function testProcessDetectsReferencesFromInlinedDefinitions() + { + $container = new ContainerBuilder(); + + $container + ->register('a') + ; + + $container + ->register('b') + ->addArgument(new Definition(null, array($ref = new Reference('a')))) + ; + + $graph = $this->process($container); + + $this->assertCount(1, $refs = $graph->getNode('a')->getInEdges()); + $this->assertSame($ref, $refs[0]->getValue()); + } + + public function testProcessDoesNotSaveDuplicateReferences() + { + $container = new ContainerBuilder(); + + $container + ->register('a') + ; + $container + ->register('b') + ->addArgument(new Definition(null, array($ref1 = new Reference('a')))) + ->addArgument(new Definition(null, array($ref2 = new Reference('a')))) + ; + + $graph = $this->process($container); + + $this->assertCount(2, $graph->getNode('a')->getInEdges()); + } + + protected function process(ContainerBuilder $container) + { + $pass = new RepeatedPass(array(new AnalyzeServiceReferencesPass())); + $pass->process($container); + + return $container->getCompiler()->getServiceReferenceGraph(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php new file mode 100755 index 0000000000..25f816b834 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Reference; + +use Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass; + +use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; + +use Symfony\Component\DependencyInjection\Compiler\Compiler; + +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase +{ + /** + * @expectedException \RuntimeException + */ + public function testProcess() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->register('b')->addArgument(new Reference('a')); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessWithAliases() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->setAlias('b', 'c'); + $container->setAlias('c', 'a'); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsIndirectCircularReference() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->register('b')->addArgument(new Reference('c')); + $container->register('c')->addArgument(new Reference('a')); + + $this->process($container); + } + + public function testProcessIgnoresMethodCalls() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->register('b')->addMethodCall('setA', array(new Reference('a'))); + + $this->process($container); + } + + protected function process(ContainerBuilder $container) + { + $compiler = new Compiler(); + $passConfig = $compiler->getPassConfig(); + $passConfig->setOptimizationPasses(array( + new AnalyzeServiceReferencesPass(true), + new CheckCircularReferencesPass(), + )); + $passConfig->setRemovingPasses(array()); + + $compiler->compile($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php new file mode 100755 index 0000000000..06845a2b86 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class CheckDefinitionValidityPassTest extends \PHPUnit_Framework_TestCase +{ + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsSyntheticNonPublicDefinitions() + { + $container = new ContainerBuilder(); + $container->register('a')->setSynthetic(true)->setPublic(false); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsSyntheticPrototypeDefinitions() + { + $container = new ContainerBuilder(); + $container->register('a')->setSynthetic(true)->setScope(ContainerInterface::SCOPE_PROTOTYPE); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass() + { + $container = new ContainerBuilder(); + $container->register('a')->setSynthetic(false)->setAbstract(false); + + $this->process($container); + } + + public function testProcess() + { + $container = new ContainerBuilder(); + $container->register('a', 'class'); + $container->register('b', 'class')->setSynthetic(true)->setPublic(true); + $container->register('c', 'class')->setAbstract(true); + $container->register('d', 'class')->setSynthetic(true); + + $this->process($container); + } + + protected function process(ContainerBuilder $container) + { + $pass = new CheckDefinitionValidityPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php new file mode 100755 index 0000000000..cbf9934a10 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Definition; + +use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class CheckExceptionOnInvalidReferenceBehaviorPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + + $container + ->register('a', '\stdClass') + ->addArgument(new Reference('b')) + ; + $container->register('b', '\stdClass'); + } + + /** + * @expectedException Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException + */ + public function testProcessThrowsExceptionOnInvalidReference() + { + $container = new ContainerBuilder(); + + $container + ->register('a', '\stdClass') + ->addArgument(new Reference('b')) + ; + + $this->process($container); + } + + /** + * @expectedException Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException + */ + public function testProcessThrowsExceptionOnInvalidReferenceFromInlinedDefinition() + { + $container = new ContainerBuilder(); + + $def = new Definition(); + $def->addArgument(new Reference('b')); + + $container + ->register('a', '\stdClass') + ->addArgument($def) + ; + + $this->process($container); + } + + private function process(ContainerBuilder $container) + { + $pass = new CheckExceptionOnInvalidReferenceBehaviorPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php new file mode 100755 index 0000000000..ee18e5cc74 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Scope; + +use Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class CheckReferenceValidityPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcessIgnoresScopeWideningIfNonStrictReference() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); + $container->register('b')->setScope('prototype'); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsScopeWidening() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->register('b')->setScope('prototype'); + + $this->process($container); + } + + public function testProcessIgnoresCrossScopeHierarchyReferenceIfNotStrict() + { + $container = new ContainerBuilder(); + $container->addScope(new Scope('a')); + $container->addScope(new Scope('b')); + + $container->register('a')->setScope('a')->addArgument(new Reference('b', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false)); + $container->register('b')->setScope('b'); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsCrossScopeHierarchyReference() + { + $container = new ContainerBuilder(); + $container->addScope(new Scope('a')); + $container->addScope(new Scope('b')); + + $container->register('a')->setScope('a')->addArgument(new Reference('b')); + $container->register('b')->setScope('b'); + + $this->process($container); + } + + /** + * @expectedException \RuntimeException + */ + public function testProcessDetectsReferenceToAbstractDefinition() + { + $container = new ContainerBuilder(); + + $container->register('a')->setAbstract(true); + $container->register('b')->addArgument(new Reference('a')); + + $this->process($container); + } + + public function testProcess() + { + $container = new ContainerBuilder(); + $container->register('a')->addArgument(new Reference('b')); + $container->register('b'); + + $this->process($container); + } + + protected function process(ContainerBuilder $container) + { + $pass = new CheckReferenceValidityPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php new file mode 100755 index 0000000000..f22f0da9f8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php @@ -0,0 +1,134 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Scope; + +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; +use Symfony\Component\DependencyInjection\Compiler\Compiler; +use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; +use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + $container + ->register('inlinable.service') + ->setPublic(false) + ; + + $container + ->register('service') + ->setArguments(array(new Reference('inlinable.service'))) + ; + + $this->process($container); + + $arguments = $container->getDefinition('service')->getArguments(); + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $arguments[0]); + $this->assertSame($container->getDefinition('inlinable.service'), $arguments[0]); + } + + public function testProcessDoesNotInlineWhenAliasedServiceIsNotOfPrototypeScope() + { + $container = new ContainerBuilder(); + $container + ->register('foo') + ->setPublic(false) + ; + $container->setAlias('moo', 'foo'); + + $container + ->register('service') + ->setArguments(array($ref = new Reference('foo'))) + ; + + $this->process($container); + + $arguments = $container->getDefinition('service')->getArguments(); + $this->assertSame($ref, $arguments[0]); + } + + public function testProcessDoesInlineServiceOfPrototypeScope() + { + $container = new ContainerBuilder(); + $container + ->register('foo') + ->setScope('prototype') + ; + $container + ->register('bar') + ->setPublic(false) + ->setScope('prototype') + ; + $container->setAlias('moo', 'bar'); + + $container + ->register('service') + ->setArguments(array(new Reference('foo'), $ref = new Reference('moo'), new Reference('bar'))) + ; + + $this->process($container); + + $arguments = $container->getDefinition('service')->getArguments(); + $this->assertEquals($container->getDefinition('foo'), $arguments[0]); + $this->assertNotSame($container->getDefinition('foo'), $arguments[0]); + $this->assertSame($ref, $arguments[1]); + $this->assertEquals($container->getDefinition('bar'), $arguments[2]); + $this->assertNotSame($container->getDefinition('bar'), $arguments[2]); + } + + public function testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition() + { + $container = new ContainerBuilder(); + + $a = $container->register('a')->setPublic(false); + $b = $container + ->register('b') + ->addArgument(new Reference('a')) + ->addArgument(new Definition(null, array(new Reference('a')))) + ; + + $this->process($container); + + $arguments = $b->getArguments(); + $this->assertSame($a, $arguments[0]); + + $inlinedArguments = $arguments[1]->getArguments(); + $this->assertSame($a, $inlinedArguments[0]); + } + + public function testProcessInlinesOnlyIfSameScope() + { + $container = new ContainerBuilder(); + + $container->addScope(new Scope('foo')); + $a = $container->register('a')->setPublic(false)->setScope('foo'); + $b = $container->register('b')->addArgument(new Reference('a')); + + $this->process($container); + $arguments = $b->getArguments(); + $this->assertEquals(new Reference('a'), $arguments[0]); + $this->assertTrue($container->hasDefinition('a')); + } + + protected function process(ContainerBuilder $container) + { + $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass())); + $repeatedPass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php new file mode 100755 index 0000000000..c16e9e0176 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +/** + * This class tests the integration of the different compiler passes + */ +class IntegrationTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + /** + * This tests that the following dependencies are correctly processed: + * + * A is public, B/C are private + * A -> C + * B -> C + */ + public function testProcessRemovesAndInlinesRecursively() + { + $container = new ContainerBuilder(); + + $a = $container + ->register('a', '\stdClass') + ->addArgument(new Reference('c')) + ; + + $b = $container + ->register('b', '\stdClass') + ->addArgument(new Reference('c')) + ->setPublic(false) + ; + + $c = $container + ->register('c', '\stdClass') + ->setPublic(false) + ; + + $container->compile(); + + $this->assertTrue($container->hasDefinition('a')); + $arguments = $a->getArguments(); + $this->assertSame($c, $arguments[0]); + $this->assertFalse($container->hasDefinition('b')); + $this->assertFalse($container->hasDefinition('c')); + } + + public function testProcessInlinesReferencesToAliases() + { + $container = new ContainerBuilder(); + + $a = $container + ->register('a', '\stdClass') + ->addArgument(new Reference('b')) + ; + + $container->setAlias('b', new Alias('c', false)); + + $c = $container + ->register('c', '\stdClass') + ->setPublic(false) + ; + + $container->compile(); + + $this->assertTrue($container->hasDefinition('a')); + $arguments = $a->getArguments(); + $this->assertSame($c, $arguments[0]); + $this->assertFalse($container->hasAlias('b')); + $this->assertFalse($container->hasDefinition('c')); + } + + public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDefinition() + { + $container = new ContainerBuilder(); + + $container + ->register('a', '\stdClass') + ->addArgument(new Reference('b')) + ->addMethodCall('setC', array(new Reference('c'))) + ; + + $container + ->register('b', '\stdClass') + ->addArgument(new Reference('c')) + ->setPublic(false) + ; + + $container + ->register('c', '\stdClass') + ->setPublic(false) + ; + + $container->compile(); + + $this->assertTrue($container->hasDefinition('a')); + $this->assertFalse($container->hasDefinition('b')); + $this->assertFalse($container->hasDefinition('c'), 'Service C was not inlined.'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php new file mode 100755 index 0000000000..d7e55214a9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; +use Symfony\Component\DependencyInjection\Compiler\Compiler; +use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; +use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class RemoveUnusedDefinitionsPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + $container + ->register('foo') + ->setPublic(false) + ; + $container + ->register('bar') + ->setPublic(false) + ; + $container + ->register('moo') + ->setArguments(array(new Reference('bar'))) + ; + + $this->process($container); + + $this->assertFalse($container->hasDefinition('foo')); + $this->assertTrue($container->hasDefinition('bar')); + $this->assertTrue($container->hasDefinition('moo')); + } + + public function testProcessRemovesUnusedDefinitionsRecursively() + { + $container = new ContainerBuilder(); + $container + ->register('foo') + ->setPublic(false) + ; + $container + ->register('bar') + ->setArguments(array(new Reference('foo'))) + ->setPublic(false) + ; + + $this->process($container); + + $this->assertFalse($container->hasDefinition('foo')); + $this->assertFalse($container->hasDefinition('bar')); + } + + public function testProcessWorksWithInlinedDefinitions() + { + $container = new ContainerBuilder(); + $container + ->register('foo') + ->setPublic(false) + ; + $container + ->register('bar') + ->setArguments(array(new Definition(null, array(new Reference('foo'))))) + ; + + $this->process($container); + + $this->assertTrue($container->hasDefinition('foo')); + $this->assertTrue($container->hasDefinition('bar')); + } + + protected function process(ContainerBuilder $container) + { + $repeatedPass = new RepeatedPass(array(new AnalyzeServiceReferencesPass(), new RemoveUnusedDefinitionsPass())); + $repeatedPass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php new file mode 100755 index 0000000000..a445a20d09 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; + +class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + + $container->register('a', '\stdClass'); + + $bDefinition = new Definition('\stdClass'); + $bDefinition->setPublic(false); + $container->setDefinition('b', $bDefinition); + + $container->setAlias('a_alias', 'a'); + $container->setAlias('b_alias', 'b'); + + $this->process($container); + + $this->assertTrue($container->has('a'), '->process() does nothing to public definitions.'); + $this->assertTrue($container->hasAlias('a_alias')); + $this->assertFalse($container->has('b'), '->process() removes non-public definitions.'); + $this->assertTrue( + $container->has('b_alias') && !$container->hasAlias('b_alias'), + '->process() replaces alias to actual.' + ); + } + + protected function process(ContainerBuilder $container) + { + $pass = new ReplaceAliasByActualDefinitionPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php new file mode 100755 index 0000000000..f3c5b1544d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php @@ -0,0 +1,151 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class ResolveDefinitionTemplatesPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + $container->register('parent', 'foo')->setArguments(array('moo', 'b'))->setProperty('foo', 'moo'); + $container->setDefinition('child', new DefinitionDecorator('parent')) + ->replaceArgument(0, 'a') + ->setProperty('foo', 'bar') + ->setClass('bar') + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertNotInstanceOf('Symfony\Component\DependencyInjection\DefinitionDecorator', $def); + $this->assertEquals('bar', $def->getClass()); + $this->assertEquals(array('a', 'b'), $def->getArguments()); + $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); + } + + public function testProcessAppendsMethodCallsAlways() + { + $container = new ContainerBuilder(); + + $container + ->register('parent') + ->addMethodCall('foo', array('bar')) + ; + + $container + ->setDefinition('child', new DefinitionDecorator('parent')) + ->addMethodCall('bar', array('foo')) + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertEquals(array( + array('foo', array('bar')), + array('bar', array('foo')), + ), $def->getMethodCalls()); + } + + public function testProcessDoesNotCopyAbstract() + { + $container = new ContainerBuilder(); + + $container + ->register('parent') + ->setAbstract(true) + ; + + $container + ->setDefinition('child', new DefinitionDecorator('parent')) + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertFalse($def->isAbstract()); + } + + public function testProcessDoesNotCopyScope() + { + $container = new ContainerBuilder(); + + $container + ->register('parent') + ->setScope('foo') + ; + + $container + ->setDefinition('child', new DefinitionDecorator('parent')) + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertEquals(ContainerInterface::SCOPE_CONTAINER, $def->getScope()); + } + + public function testProcessDoesNotCopyTags() + { + $container = new ContainerBuilder(); + + $container + ->register('parent') + ->addTag('foo') + ; + + $container + ->setDefinition('child', new DefinitionDecorator('parent')) + ; + + $this->process($container); + + $def = $container->getDefinition('child'); + $this->assertEquals(array(), $def->getTags()); + } + + public function testProcessHandlesMultipleInheritance() + { + $container = new ContainerBuilder(); + + $container + ->register('parent', 'foo') + ->setArguments(array('foo', 'bar', 'c')) + ; + + $container + ->setDefinition('child2', new DefinitionDecorator('child1')) + ->replaceArgument(1, 'b') + ; + + $container + ->setDefinition('child1', new DefinitionDecorator('parent')) + ->replaceArgument(0, 'a') + ; + + $this->process($container); + + $def = $container->getDefinition('child2'); + $this->assertEquals(array('a', 'b', 'c'), $def->getArguments()); + $this->assertEquals('foo', $def->getClass()); + } + + protected function process(ContainerBuilder $container) + { + $pass = new ResolveDefinitionTemplatesPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php new file mode 100755 index 0000000000..a18ba73862 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class ResolveInvalidReferencesPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + $def = $container + ->register('foo') + ->setArguments(array(new Reference('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE))) + ->addMethodCall('foo', array(new Reference('moo', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) + ; + + $this->process($container); + + $arguments = $def->getArguments(); + $this->assertNull($arguments[0]); + $this->assertCount(0, $def->getMethodCalls()); + } + + public function testProcessIgnoreNonExistentServices() + { + $container = new ContainerBuilder(); + $def = $container + ->register('foo') + ->setArguments(array(new Reference('bar'))) + ; + + $this->process($container); + + $arguments = $def->getArguments(); + $this->assertEquals('bar', (string) $arguments[0]); + } + + public function testProcessRemovesPropertiesOnInvalid() + { + $container = new ContainerBuilder(); + $def = $container + ->register('foo') + ->setProperty('foo', new Reference('bar', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)) + ; + + $this->process($container); + + $this->assertEquals(array(), $def->getProperties()); + } + + protected function process(ContainerBuilder $container) + { + $pass = new ResolveInvalidReferencesPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php new file mode 100755 index 0000000000..ca089a556b --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Compiler; + +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; + +class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase +{ + public function testProcess() + { + $container = new ContainerBuilder(); + $container->setAlias('bar', 'foo'); + $def = $container + ->register('moo') + ->setArguments(array(new Reference('bar'))) + ; + + $this->process($container); + + $arguments = $def->getArguments(); + $this->assertEquals('foo', (string) $arguments[0]); + } + + public function testProcessRecursively() + { + $container = new ContainerBuilder(); + $container->setAlias('bar', 'foo'); + $container->setAlias('moo', 'bar'); + $def = $container + ->register('foobar') + ->setArguments(array(new Reference('moo'))) + ; + + $this->process($container); + + $arguments = $def->getArguments(); + $this->assertEquals('foo', (string) $arguments[0]); + } + + protected function process(ContainerBuilder $container) + { + $pass = new ResolveReferencesToAliasesPass(); + $pass->process($container); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php new file mode 100755 index 0000000000..66658efdeb --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -0,0 +1,575 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +require_once __DIR__.'/Fixtures/includes/classes.php'; +require_once __DIR__.'/Fixtures/includes/ProjectExtension.php'; + +use Symfony\Component\DependencyInjection\Alias; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\Config\Resource\FileResource; + +class ContainerBuilderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition + */ + public function testDefinitions() + { + $builder = new ContainerBuilder(); + $definitions = array( + 'foo' => new Definition('FooClass'), + 'bar' => new Definition('BarClass'), + ); + $builder->setDefinitions($definitions); + $this->assertEquals($definitions, $builder->getDefinitions(), '->setDefinitions() sets the service definitions'); + $this->assertTrue($builder->hasDefinition('foo'), '->hasDefinition() returns true if a service definition exists'); + $this->assertFalse($builder->hasDefinition('foobar'), '->hasDefinition() returns false if a service definition does not exist'); + + $builder->setDefinition('foobar', $foo = new Definition('FooBarClass')); + $this->assertEquals($foo, $builder->getDefinition('foobar'), '->getDefinition() returns a service definition if defined'); + $this->assertTrue($builder->setDefinition('foobar', $foo = new Definition('FooBarClass')) === $foo, '->setDefinition() implements a fluid interface by returning the service reference'); + + $builder->addDefinitions($defs = array('foobar' => new Definition('FooBarClass'))); + $this->assertEquals(array_merge($definitions, $defs), $builder->getDefinitions(), '->addDefinitions() adds the service definitions'); + + try { + $builder->getDefinition('baz'); + $this->fail('->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); + } catch (\InvalidArgumentException $e) { + $this->assertEquals('The service definition "baz" does not exist.', $e->getMessage(), '->getDefinition() throws an InvalidArgumentException if the service definition does not exist'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::register + */ + public function testRegister() + { + $builder = new ContainerBuilder(); + $builder->register('foo', 'FooClass'); + $this->assertTrue($builder->hasDefinition('foo'), '->register() registers a new service definition'); + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $builder->getDefinition('foo'), '->register() returns the newly created Definition instance'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::has + */ + public function testHas() + { + $builder = new ContainerBuilder(); + $this->assertFalse($builder->has('foo'), '->has() returns false if the service does not exist'); + $builder->register('foo', 'FooClass'); + $this->assertTrue($builder->has('foo'), '->has() returns true if a service definition exists'); + $builder->set('bar', new \stdClass()); + $this->assertTrue($builder->has('bar'), '->has() returns true if a service exists'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get + */ + public function testGet() + { + $builder = new ContainerBuilder(); + try { + $builder->get('foo'); + $this->fail('->get() throws an InvalidArgumentException if the service does not exist'); + } catch (\InvalidArgumentException $e) { + $this->assertEquals('The service definition "foo" does not exist.', $e->getMessage(), '->get() throws an InvalidArgumentException if the service does not exist'); + } + + $this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service does not exist and NULL_ON_INVALID_REFERENCE is passed as a second argument'); + + $builder->register('foo', 'stdClass'); + $this->assertInternalType('object', $builder->get('foo'), '->get() returns the service definition associated with the id'); + $builder->set('bar', $bar = new \stdClass()); + $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id'); + $builder->register('bar', 'stdClass'); + $this->assertEquals($bar, $builder->get('bar'), '->get() returns the service associated with the id even if a definition has been defined'); + + $builder->register('baz', 'stdClass')->setArguments(array(new Reference('baz'))); + try { + @$builder->get('baz'); + $this->fail('->get() throws a ServiceCircularReferenceException if the service has a circular reference to itself'); + } catch (\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException $e) { + $this->assertEquals('Circular reference detected for service "baz", path: "baz".', $e->getMessage(), '->get() throws a LogicException if the service has a circular reference to itself'); + } + + $builder->register('foobar', 'stdClass')->setScope('container'); + $this->assertTrue($builder->get('bar') === $builder->get('bar'), '->get() always returns the same instance if the service is shared'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds + */ + public function testGetServiceIds() + { + $builder = new ContainerBuilder(); + $builder->register('foo', 'stdClass'); + $builder->bar = $bar = new \stdClass(); + $builder->register('bar', 'stdClass'); + $this->assertEquals(array('foo', 'bar', 'service_container'), $builder->getServiceIds(), '->getServiceIds() returns all defined service ids'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias + */ + public function testAliases() + { + $builder = new ContainerBuilder(); + $builder->register('foo', 'stdClass'); + $builder->setAlias('bar', 'foo'); + $this->assertTrue($builder->hasAlias('bar'), '->hasAlias() returns true if the alias exists'); + $this->assertFalse($builder->hasAlias('foobar'), '->hasAlias() returns false if the alias does not exist'); + $this->assertEquals('foo', (string) $builder->getAlias('bar'), '->getAlias() returns the aliased service'); + $this->assertTrue($builder->has('bar'), '->setAlias() defines a new service'); + $this->assertTrue($builder->get('bar') === $builder->get('foo'), '->setAlias() creates a service that is an alias to another one'); + + try { + $builder->getAlias('foobar'); + $this->fail('->getAlias() throws an InvalidArgumentException if the alias does not exist'); + } catch (\InvalidArgumentException $e) { + $this->assertEquals('The service alias "foobar" does not exist.', $e->getMessage(), '->getAlias() throws an InvalidArgumentException if the alias does not exist'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases + */ + public function testGetAliases() + { + $builder = new ContainerBuilder(); + $builder->setAlias('bar', 'foo'); + $builder->setAlias('foobar', 'foo'); + $builder->setAlias('moo', new Alias('foo', false)); + + $aliases = $builder->getAliases(); + $this->assertEquals('foo', (string) $aliases['bar']); + $this->assertTrue($aliases['bar']->isPublic()); + $this->assertEquals('foo', (string) $aliases['foobar']); + $this->assertEquals('foo', (string) $aliases['moo']); + $this->assertFalse($aliases['moo']->isPublic()); + + $builder->register('bar', 'stdClass'); + $this->assertFalse($builder->hasAlias('bar')); + + $builder->set('foobar', 'stdClass'); + $builder->set('moo', 'stdClass'); + $this->assertCount(0, $builder->getAliases(), '->getAliases() does not return aliased services that have been overridden'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases + */ + public function testSetAliases() + { + $builder = new ContainerBuilder(); + $builder->setAliases(array('bar' => 'foo', 'foobar' => 'foo')); + + $aliases = $builder->getAliases(); + $this->assertTrue(isset($aliases['bar'])); + $this->assertTrue(isset($aliases['foobar'])); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases + */ + public function testAddAliases() + { + $builder = new ContainerBuilder(); + $builder->setAliases(array('bar' => 'foo')); + $builder->addAliases(array('foobar' => 'foo')); + + $aliases = $builder->getAliases(); + $this->assertTrue(isset($aliases['bar'])); + $this->assertTrue(isset($aliases['foobar'])); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig + */ + public function testAddGetCompilerPass() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $builder = new ContainerBuilder(); + $builderCompilerPasses = $builder->getCompiler()->getPassConfig()->getPasses(); + $builder->addCompilerPass($this->getMock('Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface')); + $this->assertEquals(sizeof($builderCompilerPasses) + 1, sizeof($builder->getCompiler()->getPassConfig()->getPasses())); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateService() + { + $builder = new ContainerBuilder(); + $builder->register('foo1', 'FooClass')->setFile(__DIR__.'/Fixtures/includes/foo.php'); + $this->assertInstanceOf('\FooClass', $builder->get('foo1'), '->createService() requires the file defined by the service definition'); + $builder->register('foo2', 'FooClass')->setFile(__DIR__.'/Fixtures/includes/%file%.php'); + $builder->setParameter('file', 'foo'); + $this->assertInstanceOf('\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceClass() + { + $builder = new ContainerBuilder(); + $builder->register('foo1', '%class%'); + $builder->setParameter('class', 'stdClass'); + $this->assertInstanceOf('\stdClass', $builder->get('foo1'), '->createService() replaces parameters in the class provided by the service definition'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceArguments() + { + $builder = new ContainerBuilder(); + $builder->register('bar', 'stdClass'); + $builder->register('foo1', 'FooClass')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'), '%%unescape_it%%')); + $builder->setParameter('value', 'bar'); + $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceFactoryMethod() + { + $builder = new ContainerBuilder(); + $builder->register('bar', 'stdClass'); + $builder->register('foo1', 'FooClass')->setFactoryClass('FooClass')->setFactoryMethod('getInstance')->addArgument(array('foo' => '%value%', '%value%' => 'foo', new Reference('bar'))); + $builder->setParameter('value', 'bar'); + $this->assertTrue($builder->get('foo1')->called, '->createService() calls the factory method to create the service instance'); + $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar')), $builder->get('foo1')->arguments, '->createService() passes the arguments to the factory method'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceFactoryService() + { + $builder = new ContainerBuilder(); + $builder->register('baz_service')->setFactoryService('baz_factory')->setFactoryMethod('getInstance'); + $builder->register('baz_factory', 'BazClass'); + + $this->assertInstanceOf('BazClass', $builder->get('baz_service')); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceMethodCalls() + { + $builder = new ContainerBuilder(); + $builder->register('bar', 'stdClass'); + $builder->register('foo1', 'FooClass')->addMethodCall('setBar', array(array('%value%', new Reference('bar')))); + $builder->setParameter('value', 'bar'); + $this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService + */ + public function testCreateServiceConfigurator() + { + $builder = new ContainerBuilder(); + $builder->register('foo1', 'FooClass')->setConfigurator('sc_configure'); + $this->assertTrue($builder->get('foo1')->configured, '->createService() calls the configurator'); + + $builder->register('foo2', 'FooClass')->setConfigurator(array('%class%', 'configureStatic')); + $builder->setParameter('class', 'BazClass'); + $this->assertTrue($builder->get('foo2')->configured, '->createService() calls the configurator'); + + $builder->register('baz', 'BazClass'); + $builder->register('foo3', 'FooClass')->setConfigurator(array(new Reference('baz'), 'configure')); + $this->assertTrue($builder->get('foo3')->configured, '->createService() calls the configurator'); + + $builder->register('foo4', 'FooClass')->setConfigurator('foo'); + try { + $builder->get('foo4'); + $this->fail('->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); + } catch (\InvalidArgumentException $e) { + $this->assertEquals('The configure callable for class "FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices + */ + public function testResolveServices() + { + $builder = new ContainerBuilder(); + $builder->register('foo', 'FooClass'); + $this->assertEquals($builder->get('foo'), $builder->resolveServices(new Reference('foo')), '->resolveServices() resolves service references to service instances'); + $this->assertEquals(array('foo' => array('foo', $builder->get('foo'))), $builder->resolveServices(array('foo' => array('foo', new Reference('foo')))), '->resolveServices() resolves service references to service instances in nested arrays'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge + */ + public function testMerge() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); + $config = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); + $container->merge($config); + $this->assertEquals(array('bar' => 'foo', 'foo' => 'bar'), $container->getParameterBag()->all(), '->merge() merges current parameters with the loaded ones'); + + $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); + $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%'))); + $container->merge($config); +////// FIXME + $container->compile(); + $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); + + $container = new ContainerBuilder(new ParameterBag(array('bar' => 'foo'))); + $config = new ContainerBuilder(new ParameterBag(array('foo' => '%bar%', 'baz' => '%foo%'))); + $container->merge($config); +////// FIXME + $container->compile(); + $this->assertEquals(array('bar' => 'foo', 'foo' => 'foo', 'baz' => 'foo'), $container->getParameterBag()->all(), '->merge() evaluates the values of the parameters towards already defined ones'); + + $container = new ContainerBuilder(); + $container->register('foo', 'FooClass'); + $container->register('bar', 'BarClass'); + $config = new ContainerBuilder(); + $config->setDefinition('baz', new Definition('BazClass')); + $config->setAlias('alias_for_foo', 'foo'); + $container->merge($config); + $this->assertEquals(array('foo', 'bar', 'baz'), array_keys($container->getDefinitions()), '->merge() merges definitions already defined ones'); + + $aliases = $container->getAliases(); + $this->assertTrue(isset($aliases['alias_for_foo'])); + $this->assertEquals('foo', (string) $aliases['alias_for_foo']); + + $container = new ContainerBuilder(); + $container->register('foo', 'FooClass'); + $config->setDefinition('foo', new Definition('BazClass')); + $container->merge($config); + $this->assertEquals('BazClass', $container->getDefinition('foo')->getClass(), '->merge() overrides already defined services'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge + * @expectedException LogicException + */ + public function testMergeLogicException() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(); + $container->compile(); + $container->merge(new ContainerBuilder()); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds + */ + public function testfindTaggedServiceIds() + { + $builder = new ContainerBuilder(); + $builder + ->register('foo', 'FooClass') + ->addTag('foo', array('foo' => 'foo')) + ->addTag('bar', array('bar' => 'bar')) + ->addTag('foo', array('foofoo' => 'foofoo')) + ; + $this->assertEquals($builder->findTaggedServiceIds('foo'), array( + 'foo' => array( + array('foo' => 'foo'), + array('foofoo' => 'foofoo'), + ) + ), '->findTaggedServiceIds() returns an array of service ids and its tag attributes'); + $this->assertEquals(array(), $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition + */ + public function testFindDefinition() + { + $container = new ContainerBuilder(); + $container->setDefinition('foo', $definition = new Definition('FooClass')); + $container->setAlias('bar', 'foo'); + $container->setAlias('foobar', 'bar'); + $this->assertEquals($definition, $container->findDefinition('foobar'), '->findDefinition() returns a Definition'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource + */ + public function testResources() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(); + $container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml')); + $container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml')); + $resources = array(); + foreach ($container->getResources() as $resource) { + if (false === strpos($resource, '.php')) { + $resources[] = $resource; + } + } + $this->assertEquals(array($a, $b), $resources, '->getResources() returns an array of resources read for the current configuration'); + $this->assertSame($container, $container->setResources(array())); + $this->assertEquals(array(), $container->getResources()); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension + */ + public function testExtension() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(); + + $container->registerExtension($extension = new \ProjectExtension()); + $this->assertTrue($container->getExtension('project') === $extension, '->registerExtension() registers an extension'); + + $this->setExpectedException('LogicException'); + $container->getExtension('no_registered'); + } + + public function testRegisteredButNotLoadedExtension() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); + $extension->expects($this->once())->method('getAlias')->will($this->returnValue('project')); + $extension->expects($this->never())->method('load'); + + $container = new ContainerBuilder(); + $container->registerExtension($extension); + $container->compile(); + } + + public function testRegisteredAndLoadedExtension() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface'); + $extension->expects($this->exactly(2))->method('getAlias')->will($this->returnValue('project')); + $extension->expects($this->once())->method('load')->with(array(array('foo' => 'bar'))); + + $container = new ContainerBuilder(); + $container->registerExtension($extension); + $container->loadFromExtension('project', array('foo' => 'bar')); + $container->compile(); + } + + public function testPrivateServiceUser() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $fooDefinition = new Definition('BarClass'); + $fooUserDefinition = new Definition('BarUserClass', array(new Reference('bar'))); + $container = new ContainerBuilder(); + + $fooDefinition->setPublic(false); + + $container->addDefinitions(array( + 'bar' => $fooDefinition, + 'bar_user' => $fooUserDefinition + )); + + $container->compile(); + $this->assertInstanceOf('BarClass', $container->get('bar_user')->bar); + } + + /** + * @expectedException BadMethodCallException + */ + public function testThrowsExceptionWhenSetServiceOnAFrozenContainer() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(); + $container->compile(); + $container->set('a', new \stdClass()); + } + + /** + * @expectedException BadMethodCallException + */ + public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer() + { + if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $container = new ContainerBuilder(); + $container->compile(); + $container->setDefinition('a', new Definition()); + } + + /** + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig + * @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig + */ + public function testExtensionConfig() + { + $container = new ContainerBuilder(); + + $configs = $container->getExtensionConfig('foo'); + $this->assertEmpty($configs); + + $first = array('foo' => 'bar'); + $container->prependExtensionConfig('foo', $first); + $configs = $container->getExtensionConfig('foo'); + $this->assertEquals(array($first), $configs); + + $second = array('ding' => 'dong'); + $container->prependExtensionConfig('foo', $second); + $configs = $container->getExtensionConfig('foo'); + $this->assertEquals(array($second, $first), $configs); + } +} + +class FooClass {} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php new file mode 100755 index 0000000000..95b3953991 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerTest.php @@ -0,0 +1,478 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\Scope; +use Symfony\Component\DependencyInjection\Container; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; + +class ContainerTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\Container::__construct + */ + public function testConstructor() + { + $sc = new Container(); + $this->assertSame($sc, $sc->get('service_container'), '__construct() automatically registers itself as a service'); + + $sc = new Container(new ParameterBag(array('foo' => 'bar'))); + $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '__construct() takes an array of parameters as its first argument'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::compile + */ + public function testCompile() + { + $sc = new Container(new ParameterBag(array('foo' => 'bar'))); + $sc->compile(); + $this->assertInstanceOf('Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag', $sc->getParameterBag(), '->compile() changes the parameter bag to a FrozenParameterBag instance'); + $this->assertEquals(array('foo' => 'bar'), $sc->getParameterBag()->all(), '->compile() copies the current parameters to the new parameter bag'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::isFrozen + */ + public function testIsFrozen() + { + $sc = new Container(new ParameterBag(array('foo' => 'bar'))); + $this->assertFalse($sc->isFrozen(), '->isFrozen() returns false if the parameters are not frozen'); + $sc->compile(); + $this->assertTrue($sc->isFrozen(), '->isFrozen() returns true if the parameters are frozen'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::getParameterBag + */ + public function testGetParameterBag() + { + $sc = new Container(); + $this->assertEquals(array(), $sc->getParameterBag()->all(), '->getParameterBag() returns an empty array if no parameter has been defined'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::setParameter + * @covers Symfony\Component\DependencyInjection\Container::getParameter + */ + public function testGetSetParameter() + { + $sc = new Container(new ParameterBag(array('foo' => 'bar'))); + $sc->setParameter('bar', 'foo'); + $this->assertEquals('foo', $sc->getParameter('bar'), '->setParameter() sets the value of a new parameter'); + + $sc->setParameter('foo', 'baz'); + $this->assertEquals('baz', $sc->getParameter('foo'), '->setParameter() overrides previously set parameter'); + + $sc->setParameter('Foo', 'baz1'); + $this->assertEquals('baz1', $sc->getParameter('foo'), '->setParameter() converts the key to lowercase'); + $this->assertEquals('baz1', $sc->getParameter('FOO'), '->getParameter() converts the key to lowercase'); + + try { + $sc->getParameter('baba'); + $this->fail('->getParameter() thrown an \InvalidArgumentException if the key does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); + $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::getServiceIds + */ + public function testGetServiceIds() + { + $sc = new Container(); + $sc->set('foo', $obj = new \stdClass()); + $sc->set('bar', $obj = new \stdClass()); + $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids'); + + $sc = new ProjectServiceContainer(); + $this->assertEquals(array('scoped', 'scoped_foo', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'service_container'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::set + */ + public function testSet() + { + $sc = new Container(); + $sc->set('foo', $foo = new \stdClass()); + $this->assertEquals($foo, $sc->get('foo'), '->set() sets a service'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testSetDoesNotAllowPrototypeScope() + { + $c = new Container(); + $c->set('foo', new \stdClass(), 'prototype'); + } + + /** + * @expectedException \RuntimeException + */ + public function testSetDoesNotAllowInactiveScope() + { + $c = new Container(); + $c->addScope(new Scope('foo')); + $c->set('foo', new \stdClass(), 'foo'); + } + + public function testSetAlsoSetsScopedService() + { + $c = new Container(); + $c->addScope(new Scope('foo')); + $c->enterScope('foo'); + $c->set('foo', $foo = new \stdClass(), 'foo'); + + $services = $this->getField($c, 'scopedServices'); + $this->assertTrue(isset($services['foo']['foo'])); + $this->assertSame($foo, $services['foo']['foo']); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::get + */ + public function testGet() + { + $sc = new ProjectServiceContainer(); + $sc->set('foo', $foo = new \stdClass()); + $this->assertEquals($foo, $sc->get('foo'), '->get() returns the service for the given id'); + $this->assertEquals($sc->__bar, $sc->get('bar'), '->get() returns the service for the given id'); + $this->assertEquals($sc->__foo_bar, $sc->get('foo_bar'), '->get() returns the service if a get*Method() is defined'); + $this->assertEquals($sc->__foo_baz, $sc->get('foo.baz'), '->get() returns the service if a get*Method() is defined'); + + $sc->set('bar', $bar = new \stdClass()); + $this->assertEquals($bar, $sc->get('bar'), '->get() prefers to return a service defined with set() than one defined with a getXXXMethod()'); + + try { + $sc->get(''); + $this->fail('->get() throws a \InvalidArgumentException exception if the service is empty'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException', $e, '->get() throws a ServiceNotFoundException exception if the service is empty'); + } + $this->assertNull($sc->get('', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + public function testGetCircularReference() + { + + $sc = new ProjectServiceContainer(); + try { + $sc->get('circular'); + $this->fail('->get() throws a ServiceCircularReferenceException if it contains circular reference'); + } catch (\Exception $e) { + $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException', $e, '->get() throws a ServiceCircularReferenceException if it contains circular reference'); + $this->assertStringStartsWith('Circular reference detected for service "circular"', $e->getMessage(), '->get() throws a \LogicException if it contains circular reference'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::has + */ + public function testHas() + { + $sc = new ProjectServiceContainer(); + $sc->set('foo', new \stdClass()); + $this->assertFalse($sc->has('foo1'), '->has() returns false if the service does not exist'); + $this->assertTrue($sc->has('foo'), '->has() returns true if the service exists'); + $this->assertTrue($sc->has('bar'), '->has() returns true if a get*Method() is defined'); + $this->assertTrue($sc->has('foo_bar'), '->has() returns true if a get*Method() is defined'); + $this->assertTrue($sc->has('foo.baz'), '->has() returns true if a get*Method() is defined'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Container::initialized + */ + public function testInitialized() + { + $sc = new ProjectServiceContainer(); + $sc->set('foo', new \stdClass()); + $this->assertTrue($sc->initialized('foo'), '->initialized() returns true if service is loaded'); + $this->assertFalse($sc->initialized('foo1'), '->initialized() returns false if service is not loaded'); + $this->assertFalse($sc->initialized('bar'), '->initialized() returns false if a service is defined, but not currently loaded'); + } + + public function testEnterLeaveCurrentScope() + { + $container = new ProjectServiceContainer(); + $container->addScope(new Scope('foo')); + + $container->enterScope('foo'); + $scoped1 = $container->get('scoped'); + $scopedFoo1 = $container->get('scoped_foo'); + + $container->enterScope('foo'); + $scoped2 = $container->get('scoped'); + $scoped3 = $container->get('scoped'); + $scopedFoo2 = $container->get('scoped_foo'); + + $container->leaveScope('foo'); + $scoped4 = $container->get('scoped'); + $scopedFoo3 = $container->get('scoped_foo'); + + $this->assertNotSame($scoped1, $scoped2); + $this->assertSame($scoped2, $scoped3); + $this->assertSame($scoped1, $scoped4); + $this->assertNotSame($scopedFoo1, $scopedFoo2); + $this->assertSame($scopedFoo1, $scopedFoo3); + } + + public function testEnterLeaveScopeWithChildScopes() + { + $container = new Container(); + $container->addScope(new Scope('foo')); + $container->addScope(new Scope('bar', 'foo')); + + $this->assertFalse($container->isScopeActive('foo')); + + $container->enterScope('foo'); + $container->enterScope('bar'); + + $this->assertTrue($container->isScopeActive('foo')); + $this->assertFalse($container->has('a')); + + $a = new \stdClass(); + $container->set('a', $a, 'bar'); + + $services = $this->getField($container, 'scopedServices'); + $this->assertTrue(isset($services['bar']['a'])); + $this->assertSame($a, $services['bar']['a']); + + $this->assertTrue($container->has('a')); + $container->leaveScope('foo'); + + $services = $this->getField($container, 'scopedServices'); + $this->assertFalse(isset($services['bar'])); + + $this->assertFalse($container->isScopeActive('foo')); + $this->assertFalse($container->has('a')); + } + + public function testLeaveScopeNotActive() + { + $container = new Container(); + $container->addScope(new Scope('foo')); + + try { + $container->leaveScope('foo'); + $this->fail('->leaveScope() throws a \LogicException if the scope is not active yet'); + } catch (\Exception $e) { + $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope is not active yet'); + $this->assertEquals('The scope "foo" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope is not active yet'); + } + + try { + $container->leaveScope('bar'); + $this->fail('->leaveScope() throws a \LogicException if the scope does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\LogicException', $e, '->leaveScope() throws a \LogicException if the scope does not exist'); + $this->assertEquals('The scope "bar" is not active.', $e->getMessage(), '->leaveScope() throws a \LogicException if the scope does not exist'); + } + } + + /** + * @expectedException \InvalidArgumentException + * @dataProvider getBuiltInScopes + */ + public function testAddScopeDoesNotAllowBuiltInScopes($scope) + { + $container = new Container(); + $container->addScope(new Scope($scope)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testAddScopeDoesNotAllowExistingScope() + { + $container = new Container(); + $container->addScope(new Scope('foo')); + $container->addScope(new Scope('foo')); + } + + /** + * @expectedException \InvalidArgumentException + * @dataProvider getInvalidParentScopes + */ + public function testAddScopeDoesNotAllowInvalidParentScope($scope) + { + $c = new Container(); + $c->addScope(new Scope('foo', $scope)); + } + + public function testAddScope() + { + $c = new Container(); + $c->addScope(new Scope('foo')); + $c->addScope(new Scope('bar', 'foo')); + + $this->assertSame(array('foo' => 'container', 'bar' => 'foo'), $this->getField($c, 'scopes')); + $this->assertSame(array('foo' => array('bar'), 'bar' => array()), $this->getField($c, 'scopeChildren')); + } + + public function testHasScope() + { + $c = new Container(); + + $this->assertFalse($c->hasScope('foo')); + $c->addScope(new Scope('foo')); + $this->assertTrue($c->hasScope('foo')); + } + + public function testIsScopeActive() + { + $c = new Container(); + + $this->assertFalse($c->isScopeActive('foo')); + $c->addScope(new Scope('foo')); + + $this->assertFalse($c->isScopeActive('foo')); + $c->enterScope('foo'); + + $this->assertTrue($c->isScopeActive('foo')); + $c->leaveScope('foo'); + + $this->assertFalse($c->isScopeActive('foo')); + } + + public function testGetThrowsException() + { + $c = new ProjectServiceContainer(); + + try { + $c->get('throw_exception'); + $this->fail(); + } catch (\Exception $e) { + $this->assertEquals('Something went terribly wrong!', $e->getMessage()); + } + + try { + $c->get('throw_exception'); + $this->fail(); + } catch (\Exception $e) { + $this->assertEquals('Something went terribly wrong!', $e->getMessage()); + } + } + + public function testGetThrowsExceptionOnServiceConfiguration() + { + $c = new ProjectServiceContainer(); + + try { + $c->get('throws_exception_on_service_configuration'); + $this->fail('The container can not contain invalid service!'); + } catch (\Exception $e) { + $this->assertEquals('Something was terribly wrong while trying to configure the service!', $e->getMessage()); + } + $this->assertFalse($c->initialized('throws_exception_on_service_configuration')); + + try { + $c->get('throws_exception_on_service_configuration'); + $this->fail('The container can not contain invalid service!'); + } catch (\Exception $e) { + $this->assertEquals('Something was terribly wrong while trying to configure the service!', $e->getMessage()); + } + $this->assertFalse($c->initialized('throws_exception_on_service_configuration')); + } + + public function getInvalidParentScopes() + { + return array( + array(ContainerInterface::SCOPE_PROTOTYPE), + array('bar'), + ); + } + + public function getBuiltInScopes() + { + return array( + array(ContainerInterface::SCOPE_CONTAINER), + array(ContainerInterface::SCOPE_PROTOTYPE), + ); + } + + protected function getField($obj, $field) + { + $reflection = new \ReflectionProperty($obj, $field); + $reflection->setAccessible(true); + + return $reflection->getValue($obj); + } +} + +class ProjectServiceContainer extends Container +{ + public $__bar, $__foo_bar, $__foo_baz; + + public function __construct() + { + parent::__construct(); + + $this->__bar = new \stdClass(); + $this->__foo_bar = new \stdClass(); + $this->__foo_baz = new \stdClass(); + } + + protected function getScopedService() + { + if (!isset($this->scopedServices['foo'])) { + throw new \RuntimeException('Invalid call'); + } + + return $this->services['scoped'] = $this->scopedServices['foo']['scoped'] = new \stdClass(); + } + + protected function getScopedFooService() + { + if (!isset($this->scopedServices['foo'])) { + throw new \RuntimeException('invalid call'); + } + + return $this->services['scoped_foo'] = $this->scopedServices['foo']['scoped_foo'] = new \stdClass(); + } + + protected function getBarService() + { + return $this->__bar; + } + + protected function getFooBarService() + { + return $this->__foo_bar; + } + + protected function getFoo_BazService() + { + return $this->__foo_baz; + } + + protected function getCircularService() + { + return $this->get('circular'); + } + + protected function getThrowExceptionService() + { + throw new \Exception('Something went terribly wrong!'); + } + + protected function getThrowsExceptionOnServiceConfigurationService() + { + $this->services['throws_exception_on_service_configuration'] = $instance = new \stdClass(); + + throw new \Exception('Something was terribly wrong while trying to configure the service!'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php new file mode 100755 index 0000000000..ec82cc1e80 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\FileLocator; + +class CrossCheckTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = __DIR__.'/Fixtures/'; + + require_once self::$fixturesPath.'/includes/classes.php'; + require_once self::$fixturesPath.'/includes/foo.php'; + } + + /** + * @dataProvider crossCheckLoadersDumpers + */ + public function testCrossCheck($fixture, $type) + { + $loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader'; + $dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper'; + + $tmp = tempnam('sf_service_container', 'sf'); + + file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture)); + + $container1 = new ContainerBuilder(); + $loader1 = new $loaderClass($container1, new FileLocator()); + $loader1->load($tmp); + + $dumper = new $dumperClass($container1); + file_put_contents($tmp, $dumper->dump()); + + $container2 = new ContainerBuilder(); + $loader2 = new $loaderClass($container2, new FileLocator()); + $loader2->load($tmp); + + unlink($tmp); + + $this->assertEquals($container2->getAliases(), $container1->getAliases(), 'loading a dump from a previously loaded container returns the same container'); + $this->assertEquals($container2->getDefinitions(), $container1->getDefinitions(), 'loading a dump from a previously loaded container returns the same container'); + $this->assertEquals($container2->getParameterBag()->all(), $container1->getParameterBag()->all(), '->getParameterBag() returns the same value for both containers'); + + $this->assertEquals(serialize($container2), serialize($container1), 'loading a dump from a previously loaded container returns the same container'); + + $services1 = array(); + foreach ($container1 as $id => $service) { + $services1[$id] = serialize($service); + } + $services2 = array(); + foreach ($container2 as $id => $service) { + $services2[$id] = serialize($service); + } + + unset($services1['service_container'], $services2['service_container']); + + $this->assertEquals($services2, $services1, 'Iterator on the containers returns the same services'); + } + + public function crossCheckLoadersDumpers() + { + return array( + array('services1.xml', 'xml'), + array('services2.xml', 'xml'), + array('services6.xml', 'xml'), + array('services8.xml', 'xml'), + array('services9.xml', 'xml'), + + array('services1.yml', 'yaml'), + array('services2.yml', 'yaml'), + array('services6.yml', 'yaml'), + array('services8.yml', 'yaml'), + array('services9.yml', 'yaml'), + ); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php new file mode 100755 index 0000000000..bf1bab1e29 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionDecoratorTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\DefinitionDecorator; + +class DefinitionDecoratorTest extends \PHPUnit_Framework_TestCase +{ + public function testConstructor() + { + $def = new DefinitionDecorator('foo'); + + $this->assertEquals('foo', $def->getParent()); + $this->assertEquals(array(), $def->getChanges()); + } + + /** + * @dataProvider getPropertyTests + */ + public function testSetProperty($property, $changeKey) + { + $def = new DefinitionDecorator('foo'); + + $getter = 'get'.ucfirst($property); + $setter = 'set'.ucfirst($property); + + $this->assertNull($def->$getter()); + $this->assertSame($def, $def->$setter('foo')); + $this->assertEquals('foo', $def->$getter()); + $this->assertEquals(array($changeKey => true), $def->getChanges()); + } + + public function getPropertyTests() + { + return array( + array('class', 'class'), + array('factoryClass', 'factory_class'), + array('factoryMethod', 'factory_method'), + array('factoryService', 'factory_service'), + array('configurator', 'configurator'), + array('file', 'file'), + ); + } + + public function testSetPublic() + { + $def = new DefinitionDecorator('foo'); + + $this->assertTrue($def->isPublic()); + $this->assertSame($def, $def->setPublic(false)); + $this->assertFalse($def->isPublic()); + $this->assertEquals(array('public' => true), $def->getChanges()); + } + + public function testSetArgument() + { + $def = new DefinitionDecorator('foo'); + + $this->assertEquals(array(), $def->getArguments()); + $this->assertSame($def, $def->replaceArgument(0, 'foo')); + $this->assertEquals(array('index_0' => 'foo'), $def->getArguments()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testReplaceArgumentShouldRequireIntegerIndex() + { + $def = new DefinitionDecorator('foo'); + + $def->replaceArgument('0', 'foo'); + } + + public function testReplaceArgument() + { + $def = new DefinitionDecorator('foo'); + + $def->setArguments(array(0 => 'foo', 1 => 'bar')); + $this->assertEquals('foo', $def->getArgument(0)); + $this->assertEquals('bar', $def->getArgument(1)); + + $this->assertSame($def, $def->replaceArgument(1, 'baz')); + $this->assertEquals('foo', $def->getArgument(0)); + $this->assertEquals('baz', $def->getArgument(1)); + + $this->assertEquals(array(0 => 'foo', 1 => 'bar', 'index_1' => 'baz'), $def->getArguments()); + } + + /** + * @expectedException OutOfBoundsException + */ + public function testGetArgumentShouldCheckBounds() + { + $def = new DefinitionDecorator('foo'); + + $def->setArguments(array(0 => 'foo')); + $def->replaceArgument(0, 'foo'); + + $def->getArgument(1); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php new file mode 100755 index 0000000000..46ea75d5cd --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php @@ -0,0 +1,292 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\Definition; + +class DefinitionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\Definition::__construct + */ + public function testConstructor() + { + $def = new Definition('stdClass'); + $this->assertEquals('stdClass', $def->getClass(), '__construct() takes the class name as its first argument'); + + $def = new Definition('stdClass', array('foo')); + $this->assertEquals(array('foo'), $def->getArguments(), '__construct() takes an optional array of arguments as its second argument'); + } + + public function testSetGetFactoryClass() + { + $def = new Definition('stdClass'); + $this->assertNull($def->getFactoryClass()); + $this->assertSame($def, $def->setFactoryClass('stdClass2'), "->setFactoryClass() implements a fluent interface."); + $this->assertEquals('stdClass2', $def->getFactoryClass(), "->getFactoryClass() returns current class to construct this service."); + } + + public function testSetGetFactoryMethod() + { + $def = new Definition('stdClass'); + $this->assertNull($def->getFactoryMethod()); + $this->assertSame($def, $def->setFactoryMethod('foo'), '->setFactoryMethod() implements a fluent interface'); + $this->assertEquals('foo', $def->getFactoryMethod(), '->getFactoryMethod() returns the factory method name'); + } + + public function testSetGetFactoryService() + { + $def = new Definition('stdClass'); + $this->assertNull($def->getFactoryService()); + $this->assertSame($def, $def->setFactoryService('foo.bar'), "->setFactoryService() implements a fluent interface."); + $this->assertEquals('foo.bar', $def->getFactoryService(), "->getFactoryService() returns current service to construct this service."); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setClass + * @covers Symfony\Component\DependencyInjection\Definition::getClass + */ + public function testSetGetClass() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->setClass('foo'), '->setClass() implements a fluent interface'); + $this->assertEquals('foo', $def->getClass(), '->getClass() returns the class name'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setArguments + * @covers Symfony\Component\DependencyInjection\Definition::getArguments + * @covers Symfony\Component\DependencyInjection\Definition::addArgument + */ + public function testArguments() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->setArguments(array('foo')), '->setArguments() implements a fluent interface'); + $this->assertEquals(array('foo'), $def->getArguments(), '->getArguments() returns the arguments'); + $this->assertSame($def, $def->addArgument('bar'), '->addArgument() implements a fluent interface'); + $this->assertEquals(array('foo', 'bar'), $def->getArguments(), '->addArgument() adds an argument'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setMethodCalls + * @covers Symfony\Component\DependencyInjection\Definition::addMethodCall + * @covers Symfony\Component\DependencyInjection\Definition::hasMethodCall + * @covers Symfony\Component\DependencyInjection\Definition::removeMethodCall + */ + public function testMethodCalls() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->setMethodCalls(array(array('foo', array('foo')))), '->setMethodCalls() implements a fluent interface'); + $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->getMethodCalls() returns the methods to call'); + $this->assertSame($def, $def->addMethodCall('bar', array('bar')), '->addMethodCall() implements a fluent interface'); + $this->assertEquals(array(array('foo', array('foo')), array('bar', array('bar'))), $def->getMethodCalls(), '->addMethodCall() adds a method to call'); + $this->assertTrue($def->hasMethodCall('bar'), '->hasMethodCall() returns true if first argument is a method to call registered'); + $this->assertFalse($def->hasMethodCall('no_registered'), '->hasMethodCall() returns false if first argument is not a method to call registered'); + $this->assertSame($def, $def->removeMethodCall('bar'), '->removeMethodCall() implements a fluent interface'); + $this->assertEquals(array(array('foo', array('foo'))), $def->getMethodCalls(), '->removeMethodCall() removes a method to call'); + } + + /** + * @expectedException Symfony\Component\DependencyInjection\Exception\InvalidArgumentException + * @expectedExceptionMessage Method name cannot be empty. + */ + public function testExceptionOnEmptyMethodCall() + { + $def = new Definition('stdClass'); + $def->addMethodCall(''); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setFile + * @covers Symfony\Component\DependencyInjection\Definition::getFile + */ + public function testSetGetFile() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->setFile('foo'), '->setFile() implements a fluent interface'); + $this->assertEquals('foo', $def->getFile(), '->getFile() returns the file to include'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setScope + * @covers Symfony\Component\DependencyInjection\Definition::getScope + */ + public function testSetGetScope() + { + $def = new Definition('stdClass'); + $this->assertEquals('container', $def->getScope()); + $this->assertSame($def, $def->setScope('foo')); + $this->assertEquals('foo', $def->getScope()); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setPublic + * @covers Symfony\Component\DependencyInjection\Definition::isPublic + */ + public function testSetIsPublic() + { + $def = new Definition('stdClass'); + $this->assertTrue($def->isPublic(), '->isPublic() returns true by default'); + $this->assertSame($def, $def->setPublic(false), '->setPublic() implements a fluent interface'); + $this->assertFalse($def->isPublic(), '->isPublic() returns false if the instance must not be public.'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setSynthetic + * @covers Symfony\Component\DependencyInjection\Definition::isSynthetic + */ + public function testSetIsSynthetic() + { + $def = new Definition('stdClass'); + $this->assertFalse($def->isSynthetic(), '->isSynthetic() returns false by default'); + $this->assertSame($def, $def->setSynthetic(true), '->setSynthetic() implements a fluent interface'); + $this->assertTrue($def->isSynthetic(), '->isSynthetic() returns true if the instance must not be public.'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setAbstract + * @covers Symfony\Component\DependencyInjection\Definition::isAbstract + */ + public function testSetIsAbstract() + { + $def = new Definition('stdClass'); + $this->assertFalse($def->isAbstract(), '->isAbstract() returns false by default'); + $this->assertSame($def, $def->setAbstract(true), '->setAbstract() implements a fluent interface'); + $this->assertTrue($def->isAbstract(), '->isAbstract() returns true if the instance must not be public.'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::setConfigurator + * @covers Symfony\Component\DependencyInjection\Definition::getConfigurator + */ + public function testSetGetConfigurator() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->setConfigurator('foo'), '->setConfigurator() implements a fluent interface'); + $this->assertEquals('foo', $def->getConfigurator(), '->getConfigurator() returns the configurator'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::clearTags + */ + public function testClearTags() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); + $def->addTag('foo', array('foo' => 'bar')); + $def->clearTags(); + $this->assertEquals(array(), $def->getTags(), '->clearTags() removes all current tags'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::clearTags + */ + public function testClearTag() + { + $def = new Definition('stdClass'); + $this->assertSame($def, $def->clearTags(), '->clearTags() implements a fluent interface'); + $def->addTag('1foo1', array('foo1' => 'bar1')); + $def->addTag('2foo2', array('foo2' => 'bar2')); + $def->addTag('3foo3', array('foo3' => 'bar3')); + $def->clearTag('2foo2'); + $this->assertTrue($def->hasTag('1foo1')); + $this->assertFalse($def->hasTag('2foo2')); + $this->assertTrue($def->hasTag('3foo3')); + $def->clearTag('1foo1'); + $this->assertFalse($def->hasTag('1foo1')); + $this->assertTrue($def->hasTag('3foo3')); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::addTag + * @covers Symfony\Component\DependencyInjection\Definition::getTag + * @covers Symfony\Component\DependencyInjection\Definition::getTags + * @covers Symfony\Component\DependencyInjection\Definition::hasTag + */ + public function testTags() + { + $def = new Definition('stdClass'); + $this->assertEquals(array(), $def->getTag('foo'), '->getTag() returns an empty array if the tag is not defined'); + $this->assertFalse($def->hasTag('foo')); + $this->assertSame($def, $def->addTag('foo'), '->addTag() implements a fluent interface'); + $this->assertTrue($def->hasTag('foo')); + $this->assertEquals(array(array()), $def->getTag('foo'), '->getTag() returns attributes for a tag name'); + $def->addTag('foo', array('foo' => 'bar')); + $this->assertEquals(array(array(), array('foo' => 'bar')), $def->getTag('foo'), '->addTag() can adds the same tag several times'); + $def->addTag('bar', array('bar' => 'bar')); + $this->assertEquals($def->getTags(), array( + 'foo' => array(array(), array('foo' => 'bar')), + 'bar' => array(array('bar' => 'bar')), + ), '->getTags() returns all tags'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Definition::replaceArgument + */ + public function testSetArgument() + { + $def = new Definition('stdClass'); + + $def->addArgument('foo'); + $this->assertSame(array('foo'), $def->getArguments()); + + $this->assertSame($def, $def->replaceArgument(0, 'moo')); + $this->assertSame(array('moo'), $def->getArguments()); + + $def->addArgument('moo'); + $def + ->replaceArgument(0, 'foo') + ->replaceArgument(1, 'bar') + ; + $this->assertSame(array('foo', 'bar'), $def->getArguments()); + } + + /** + * @expectedException OutOfBoundsException + */ + public function testGetArgumentShouldCheckBounds() + { + $def = new Definition('stdClass'); + + $def->addArgument('foo'); + $def->getArgument(1); + } + + /** + * @expectedException OutOfBoundsException + */ + public function testReplaceArgumentShouldCheckBounds() + { + $def = new Definition('stdClass'); + + $def->addArgument('foo'); + $def->replaceArgument(1, 'bar'); + } + + public function testSetGetProperties() + { + $def = new Definition('stdClass'); + + $this->assertEquals(array(), $def->getProperties()); + $this->assertSame($def, $def->setProperties(array('foo' => 'bar'))); + $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); + } + + public function testSetProperty() + { + $def = new Definition('stdClass'); + + $this->assertEquals(array(), $def->getProperties()); + $this->assertSame($def, $def->setProperty('foo', 'bar')); + $this->assertEquals(array('foo' => 'bar'), $def->getProperties()); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php new file mode 100755 index 0000000000..d3b93fdee8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/GraphvizDumperTest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper; + +class GraphvizDumperTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = __DIR__.'/../Fixtures/'; + } + + public function testDump() + { + $dumper = new GraphvizDumper($container = new ContainerBuilder()); + + $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services1.dot', $dumper->dump(), '->dump() dumps an empty container as an empty dot file'); + + $container = include self::$fixturesPath.'/containers/container9.php'; + $dumper = new GraphvizDumper($container); + $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services9.dot')), $dumper->dump(), '->dump() dumps services'); + + $container = include self::$fixturesPath.'/containers/container10.php'; + $dumper = new GraphvizDumper($container); + $this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10.dot')), $dumper->dump(), '->dump() dumps services'); + + $container = include self::$fixturesPath.'/containers/container10.php'; + $dumper = new GraphvizDumper($container); + $this->assertEquals($dumper->dump(array( + 'graph' => array('ratio' => 'normal'), + 'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'), + 'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1), + 'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'), + 'node.definition' => array('fillcolor' => 'grey'), + 'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'), + )), str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10-1.dot')), '->dump() dumps services'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php new file mode 100755 index 0000000000..859ca50013 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -0,0 +1,144 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\PhpDumper; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Definition; + +class PhpDumperTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + } + + public function testDump() + { + $dumper = new PhpDumper($container = new ContainerBuilder()); + + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services1-1.php', $dumper->dump(array('class' => 'Container', 'base_class' => 'AbstractContainer')), '->dump() takes a class and a base_class options'); + + $container = new ContainerBuilder(); + new PhpDumper($container); + } + + public function testDumpFrozenContainerWithNoParameter() + { + $container = new ContainerBuilder(); + $container->register('foo', 'stdClass'); + + $container->compile(); + + $dumper = new PhpDumper($container); + + $dumpedString = $dumper->dump(); + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services11.php', $dumpedString, '->dump() does not add getDefaultParameters() method call if container have no parameters.'); + $this->assertNotRegexp("/function getDefaultParameters\(/", $dumpedString, '->dump() does not add getDefaultParameters() method definition.'); + } + + public function testDumpOptimizationString() + { + $definition = new Definition(); + $definition->setClass('stdClass'); + $definition->addArgument(array( + 'only dot' => '.', + 'concatenation as value' => '.\'\'.', + 'concatenation from the start value' => '\'\'.', + '.' => 'dot as a key', + '.\'\'.' => 'concatenation as a key', + '\'\'.' =>'concatenation from the start key', + 'optimize concatenation' => "string1%some_string%string2", + 'optimize concatenation with empty string' => "string1%empty_value%string2", + 'optimize concatenation from the start' => '%empty_value%start', + 'optimize concatenation at the end' => 'end%empty_value%', + )); + + $container = new ContainerBuilder(); + $container->setDefinition('test', $definition); + $container->setParameter('empty_value', ''); + $container->setParameter('some_string', '-'); + $container->compile(); + + $dumper = new PhpDumper($container); + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services10.php', $dumper->dump(), '->dump() dumps an empty container as an empty PHP class'); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testExportParameters() + { + $dumper = new PhpDumper(new ContainerBuilder(new ParameterBag(array('foo' => new Reference('foo'))))); + $dumper->dump(); + } + + public function testAddParameters() + { + $container = include self::$fixturesPath.'/containers/container8.php'; + $dumper = new PhpDumper($container); + $this->assertStringEqualsFile(self::$fixturesPath.'/php/services8.php', $dumper->dump(), '->dump() dumps parameters'); + } + + public function testAddService() + { + $container = include self::$fixturesPath.'/containers/container9.php'; + $dumper = new PhpDumper($container); + $this->assertEquals(str_replace('%path%', str_replace('\\','\\\\',self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), file_get_contents(self::$fixturesPath.'/php/services9.php')), $dumper->dump(), '->dump() dumps services'); + + $dumper = new PhpDumper($container = new ContainerBuilder()); + $container->register('foo', 'FooClass')->addArgument(new \stdClass()); + try { + $dumper->dump(); + $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } catch (\Exception $e) { + $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } + } + + public function testOverrideServiceWhenUsingADumpedContainer() + { + require_once self::$fixturesPath.'/php/services9.php'; + require_once self::$fixturesPath.'/includes/foo.php'; + + $container = new \ProjectServiceContainer(); + $container->set('bar', $bar = new \stdClass()); + $container->setParameter('foo_bar', 'foo_bar'); + + $this->assertEquals($bar, $container->get('bar'), '->set() overrides an already defined service'); + } + + public function testOverrideServiceWhenUsingADumpedContainerAndServiceIsUsedFromAnotherOne() + { + require_once self::$fixturesPath.'/php/services9.php'; + require_once self::$fixturesPath.'/includes/foo.php'; + require_once self::$fixturesPath.'/includes/classes.php'; + + $container = new \ProjectServiceContainer(); + $container->set('bar', $bar = new \stdClass()); + + $this->assertSame($bar, $container->get('foo')->bar, '->set() overrides an already defined service'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php new file mode 100755 index 0000000000..b2cddb593d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\XmlDumper; + +class XmlDumperTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + } + + public function testDump() + { + $dumper = new XmlDumper($container = new ContainerBuilder()); + + $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services1.xml', $dumper->dump(), '->dump() dumps an empty container as an empty XML file'); + + $container = new ContainerBuilder(); + $dumper = new XmlDumper($container); + } + + public function testExportParameters() + { + $container = include self::$fixturesPath.'//containers/container8.php'; + $dumper = new XmlDumper($container); + $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); + } + + public function testAddParameters() + { + $container = include self::$fixturesPath.'//containers/container8.php'; + $dumper = new XmlDumper($container); + $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/xml/services8.xml', $dumper->dump(), '->dump() dumps parameters'); + } + + public function testAddService() + { + $container = include self::$fixturesPath.'/containers/container9.php'; + $dumper = new XmlDumper($container); + $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/services9.xml')), $dumper->dump(), '->dump() dumps services'); + + $dumper = new XmlDumper($container = new ContainerBuilder()); + $container->register('foo', 'FooClass')->addArgument(new \stdClass()); + try { + $dumper->dump(); + $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } catch (\Exception $e) { + $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } + } + + public function testDumpAnonymousServices() + { + include self::$fixturesPath.'/containers/container11.php'; + $dumper = new XmlDumper($container); + $this->assertEquals(" + + + + + + + + + + + + + +", $dumper->dump()); + } + + public function testDumpEntities() + { + include self::$fixturesPath.'/containers/container12.php'; + $dumper = new XmlDumper($container); + $this->assertEquals(" + + + + + foo<>&bar + + + +", $dumper->dump()); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php new file mode 100755 index 0000000000..47cc4bea1e --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Dumper; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Dumper\YamlDumper; + +class YamlDumperTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + } + + public function testDump() + { + $dumper = new YamlDumper($container = new ContainerBuilder()); + + $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services1.yml', $dumper->dump(), '->dump() dumps an empty container as an empty YAML file'); + + $container = new ContainerBuilder(); + $dumper = new YamlDumper($container); + } + + public function testAddParameters() + { + $container = include self::$fixturesPath.'/containers/container8.php'; + $dumper = new YamlDumper($container); + $this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services8.yml', $dumper->dump(), '->dump() dumps parameters'); + } + + public function testAddService() + { + $container = include self::$fixturesPath.'/containers/container9.php'; + $dumper = new YamlDumper($container); + $this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services'); + + $dumper = new YamlDumper($container = new ContainerBuilder()); + $container->register('foo', 'FooClass')->addArgument(new \stdClass()); + try { + $dumper->dump(); + $this->fail('->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } catch (\Exception $e) { + $this->assertInstanceOf('\RuntimeException', $e, '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + $this->assertEquals('Unable to dump a service container if a parameter is an object or a resource.', $e->getMessage(), '->dump() throws a RuntimeException if the container to be dumped has reference to objects or resources'); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php new file mode 100755 index 0000000000..a16ca9fff8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container10.php @@ -0,0 +1,14 @@ + + register('foo', 'FooClass')-> + addArgument(new Reference('bar')) +; + +return $container; diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php new file mode 100755 index 0000000000..3e6cafca24 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container11.php @@ -0,0 +1,12 @@ + + register('foo', 'FooClass')-> + addArgument(new Definition('BarClass', array(new Definition('BazClass')))) +; + +return $container; diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php new file mode 100755 index 0000000000..0dc8679d86 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container12.php @@ -0,0 +1,13 @@ + + register('foo', 'FooClass\\Foo')-> + addArgument('foo<>&bar')-> + addTag('foo"bar\\bar', array('foo' => 'foo"barřž€')) +; + +return $container; diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php new file mode 100755 index 0000000000..28c65369c2 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php @@ -0,0 +1,13 @@ + '%baz%', + 'baz' => 'bar', + 'bar' => 'foo is %%foo bar', + 'values' => array(true, false, null, 0, 1000.3, 'true', 'false', 'null'), +))); + +return $container; diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php new file mode 100755 index 0000000000..663f2a7fd9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php @@ -0,0 +1,58 @@ + + register('foo', 'FooClass')-> + addTag('foo', array('foo' => 'foo'))-> + addTag('foo', array('bar' => 'bar'))-> + setFactoryClass('FooClass')-> + setFactoryMethod('getInstance')-> + setArguments(array('foo', new Reference('foo.baz'), array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, new Reference('service_container')))-> + setProperties(array('foo' => 'bar', 'moo' => new Reference('foo.baz')))-> + setScope('prototype')-> + addMethodCall('setBar', array(new Reference('bar')))-> + addMethodCall('initialize')-> + setConfigurator('sc_configure') +; +$container-> + register('bar', 'FooClass')-> + setArguments(array('foo', new Reference('foo.baz'), new Parameter('foo_bar')))-> + setScope('container')-> + setConfigurator(array(new Reference('foo.baz'), 'configure')) +; +$container-> + register('foo.baz', '%baz_class%')-> + setFactoryClass('%baz_class%')-> + setFactoryMethod('getInstance')-> + setConfigurator(array('%baz_class%', 'configureStatic1')) +; +$container->register('foo_bar', '%foo_class%'); +$container->getParameterBag()->clear(); +$container->getParameterBag()->add(array( + 'baz_class' => 'BazClass', + 'foo_class' => 'FooClass', + 'foo' => 'bar', +)); +$container->setAlias('alias_for_foo', 'foo'); +$container-> + register('method_call1', 'FooClass')-> + setFile(realpath(__DIR__.'/../includes/foo.php'))-> + addMethodCall('setBar', array(new Reference('foo')))-> + addMethodCall('setBar', array(new Reference('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)))-> + addMethodCall('setBar', array(new Reference('foo3', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)))-> + addMethodCall('setBar', array(new Reference('foobaz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))) +; +$container-> + register('factory_service')-> + setFactoryService('foo.baz')-> + setFactoryMethod('getInstance') +; + +return $container; diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php new file mode 100755 index 0000000000..27503a351c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces1.php @@ -0,0 +1,25 @@ +setParameter('cla', 'Fo'); +$container->setParameter('ss', 'Class'); + +$definition = new Definition('%cla%o%ss%'); +$container->setDefinition('foo', $definition); + +return $container; + +if (!class_exists('FooClass')) { + class FooClass + { + public $bar; + + public function setBar($bar) + { + $this->bar = $bar; + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php new file mode 100755 index 0000000000..a85190145e --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/interfaces2.php @@ -0,0 +1,34 @@ +setDefinition('barFactory', $factoryDefinition); + +$definition = new Definition(); +$definition->setFactoryService('barFactory'); +$definition->setFactoryMethod('createBarClass'); +$container->setDefinition('bar', $definition); + +return $container; + +class BarClass +{ + public $foo; + + public function setBar($foo) + { + $this->foo = $foo; + } +} + +class BarClassFactory +{ + public function createBarClass() + { + return new BarClass(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot new file mode 100755 index 0000000000..1bb7c30b8c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services1.dot @@ -0,0 +1,7 @@ +digraph sc { + ratio="compress" + node [fontsize="11" fontname="Arial" shape="record"]; + edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; + + node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot new file mode 100755 index 0000000000..0e578b161b --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10-1.dot @@ -0,0 +1,10 @@ +digraph sc { + ratio="normal" + node [fontsize="13" fontname="Verdana" shape="square"]; + edge [fontsize="12" fontname="Verdana" color="white" arrowhead="closed" arrowsize="1"]; + + node_foo [label="foo\nFooClass\n", shape=square, fillcolor="grey", style="filled"]; + node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=square, fillcolor="green", style="empty"]; + node_bar [label="bar\n\n", shape=square, fillcolor="red", style="empty"]; + node_foo -> node_bar [label="" style="filled"]; +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot new file mode 100755 index 0000000000..f17857fe42 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services10.dot @@ -0,0 +1,10 @@ +digraph sc { + ratio="compress" + node [fontsize="11" fontname="Arial" shape="record"]; + edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; + + node_foo [label="foo\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; + node_bar [label="bar\n\n", shape=record, fillcolor="#ff9999", style="filled"]; + node_foo -> node_bar [label="" style="filled"]; +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot new file mode 100755 index 0000000000..fdff2219ef --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/graphviz/services9.dot @@ -0,0 +1,25 @@ +digraph sc { + ratio="compress" + node [fontsize="11" fontname="Arial" shape="record"]; + edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"]; + + node_foo [label="foo (alias_for_foo)\nFooClass\n", shape=record, fillcolor="#eeeeee", style="dotted"]; + node_bar [label="bar\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_foo_baz [label="foo.baz\nBazClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_foo_bar [label="foo_bar\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_method_call1 [label="method_call1\nFooClass\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_factory_service [label="factory_service\n\n", shape=record, fillcolor="#eeeeee", style="filled"]; + node_service_container [label="service_container\nSymfony\\Component\\DependencyInjection\\ContainerBuilder\n", shape=record, fillcolor="#9999ff", style="filled"]; + node_foo2 [label="foo2\n\n", shape=record, fillcolor="#ff9999", style="filled"]; + node_foo3 [label="foo3\n\n", shape=record, fillcolor="#ff9999", style="filled"]; + node_foobaz [label="foobaz\n\n", shape=record, fillcolor="#ff9999", style="filled"]; + node_foo -> node_foo_baz [label="" style="filled"]; + node_foo -> node_service_container [label="" style="filled"]; + node_foo -> node_foo_baz [label="" style="dashed"]; + node_foo -> node_bar [label="setBar()" style="dashed"]; + node_bar -> node_foo_baz [label="" style="filled"]; + node_method_call1 -> node_foo [label="setBar()" style="dashed"]; + node_method_call1 -> node_foo2 [label="setBar()" style="dashed"]; + node_method_call1 -> node_foo3 [label="setBar()" style="dashed"]; + node_method_call1 -> node_foobaz [label="setBar()" style="dashed"]; +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php new file mode 100755 index 0000000000..81ff7aa6fe --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php @@ -0,0 +1,41 @@ +setDefinition('project.service.bar', new Definition('FooClass')); + $configuration->setParameter('project.parameter.bar', isset($config['foo']) ? $config['foo'] : 'foobar'); + + $configuration->setDefinition('project.service.foo', new Definition('FooClass')); + $configuration->setParameter('project.parameter.foo', isset($config['foo']) ? $config['foo'] : 'foobar'); + + return $configuration; + } + + public function getXsdValidationBasePath() + { + return false; + } + + public function getNamespace() + { + return 'http://www.example.com/schema/project'; + } + + public function getAlias() + { + return 'project'; + } + + public function getConfiguration(array $config, ContainerBuilder $container) + { + return null; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php new file mode 100755 index 0000000000..2ee2f12dc8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtension.php @@ -0,0 +1,19 @@ +configure(); +} + +class BarClass +{ +} + +class BazClass +{ + public function configure($instance) + { + $instance->configure(); + } + + public static function getInstance() + { + return new self(); + } + + public static function configureStatic($instance) + { + $instance->configure(); + } + + public static function configureStatic1() + { + } +} + +class BarUserClass +{ + public $bar; + + public function __construct(BarClass $bar) + { + $this->bar = $bar; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php new file mode 100755 index 0000000000..a5933513da --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php @@ -0,0 +1,47 @@ +addFromString('ProjectWithXsdExtensionInPhar.php',<<addFromString('schema/project-1.0.xsd', << + + + + + + + + + +EOT +); +$phar->setStub(''); diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php new file mode 100755 index 0000000000..180bb384a3 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php @@ -0,0 +1,36 @@ +arguments = $arguments; + } + + public static function getInstance($arguments = array()) + { + $obj = new self($arguments); + $obj->called = true; + + return $obj; + } + + public function initialize() + { + $this->initialized = true; + } + + public function configure() + { + $this->configured = true; + } + + public function setBar($value = null) + { + $this->bar = $value; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd new file mode 100755 index 0000000000..282884e4e2 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/schema/project-1.0.xsd @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini new file mode 100755 index 0000000000..9f84a60873 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/nonvalid.ini @@ -0,0 +1,2 @@ +{NOT AN INI FILE} +{JUST A PLAIN TEXT FILE} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini new file mode 100755 index 0000000000..df92f7527f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters.ini @@ -0,0 +1,3 @@ +[parameters] + foo = bar + bar = %foo% diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini new file mode 100755 index 0000000000..e50f7222be --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters1.ini @@ -0,0 +1,3 @@ +[parameters] + FOO = foo + baz = baz diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini new file mode 100755 index 0000000000..75fbac6280 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/ini/parameters2.ini @@ -0,0 +1,2 @@ +[parameters] + imported_from_ini = true diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php new file mode 100755 index 0000000000..de4b64244f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php @@ -0,0 +1,28 @@ +parameters = $this->getDefaultParameters(); + + $this->services = + $this->scopedServices = + $this->scopeStacks = array(); + + $this->set('service_container', $this); + + $this->scopes = array(); + $this->scopeChildren = array(); + } + + /** + * Gets the 'test' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return stdClass A stdClass instance. + */ + protected function getTestService() + { + return $this->services['test'] = new \stdClass(array('only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end')); + } + + /** + * {@inheritdoc} + */ + public function getParameter($name) + { + $name = strtolower($name); + + if (!array_key_exists($name, $this->parameters)) { + throw new InvalidArgumentException(sprintf('The parameter "%s" must be defined.', $name)); + } + + return $this->parameters[$name]; + } + + /** + * {@inheritdoc} + */ + public function hasParameter($name) + { + return array_key_exists(strtolower($name), $this->parameters); + } + + /** + * {@inheritdoc} + */ + public function setParameter($name, $value) + { + throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); + } + + /** + * {@inheritDoc} + */ + public function getParameterBag() + { + if (null === $this->parameterBag) { + $this->parameterBag = new FrozenParameterBag($this->parameters); + } + + return $this->parameterBag; + } + /** + * Gets the default parameters. + * + * @return array An array of the default parameters + */ + protected function getDefaultParameters() + { + return array( + 'empty_value' => '', + 'some_string' => '-', + ); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php new file mode 100755 index 0000000000..6cf65ee5b0 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php @@ -0,0 +1,48 @@ +services = + $this->scopedServices = + $this->scopeStacks = array(); + + $this->set('service_container', $this); + + $this->scopes = array(); + $this->scopeChildren = array(); + } + + /** + * Gets the 'foo' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return stdClass A stdClass instance. + */ + protected function getFooService() + { + return $this->services['foo'] = new \stdClass(); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php new file mode 100755 index 0000000000..77e4183a7c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php @@ -0,0 +1,52 @@ +getDefaultParameters())); + } + + /** + * Gets the default parameters. + * + * @return array An array of the default parameters + */ + protected function getDefaultParameters() + { + return array( + 'foo' => '%baz%', + 'baz' => 'bar', + 'bar' => 'foo is %%foo bar', + 'values' => array( + 0 => true, + 1 => false, + 2 => NULL, + 3 => 0, + 4 => 1000.3, + 5 => 'true', + 6 => 'false', + 7 => 'null', + ), + ); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php new file mode 100755 index 0000000000..a0d2ece432 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php @@ -0,0 +1,160 @@ +getDefaultParameters())); + } + + /** + * Gets the 'bar' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return FooClass A FooClass instance. + */ + protected function getBarService() + { + $this->services['bar'] = $instance = new \FooClass('foo', $this->get('foo.baz'), $this->getParameter('foo_bar')); + + $this->get('foo.baz')->configure($instance); + + return $instance; + } + + /** + * Gets the 'factory_service' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return Object An instance returned by foo.baz::getInstance(). + */ + protected function getFactoryServiceService() + { + return $this->services['factory_service'] = $this->get('foo.baz')->getInstance(); + } + + /** + * Gets the 'foo' service. + * + * @return FooClass A FooClass instance. + */ + protected function getFooService() + { + $a = $this->get('foo.baz'); + + $instance = call_user_func(array('FooClass', 'getInstance'), 'foo', $a, array($this->getParameter('foo') => 'foo is '.$this->getParameter('foo').'', 'bar' => $this->getParameter('foo')), true, $this); + + $instance->setBar($this->get('bar')); + $instance->initialize(); + $instance->foo = 'bar'; + $instance->moo = $a; + sc_configure($instance); + + return $instance; + } + + /** + * Gets the 'foo.baz' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return Object A %baz_class% instance. + */ + protected function getFoo_BazService() + { + $this->services['foo.baz'] = $instance = call_user_func(array($this->getParameter('baz_class'), 'getInstance')); + + call_user_func(array($this->getParameter('baz_class'), 'configureStatic1'), $instance); + + return $instance; + } + + /** + * Gets the 'foo_bar' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return Object A %foo_class% instance. + */ + protected function getFooBarService() + { + $class = $this->getParameter('foo_class'); + + return $this->services['foo_bar'] = new $class(); + } + + /** + * Gets the 'method_call1' service. + * + * This service is shared. + * This method always returns the same instance of the service. + * + * @return FooClass A FooClass instance. + */ + protected function getMethodCall1Service() + { + require_once '%path%foo.php'; + + $this->services['method_call1'] = $instance = new \FooClass(); + + $instance->setBar($this->get('foo')); + $instance->setBar($this->get('foo2', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + if ($this->has('foo3')) { + $instance->setBar($this->get('foo3', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + if ($this->has('foobaz')) { + $instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE)); + } + + return $instance; + } + + /** + * Gets the alias_for_foo service alias. + * + * @return FooClass An instance of the foo service + */ + protected function getAliasForFooService() + { + return $this->get('foo'); + } + + /** + * Gets the default parameters. + * + * @return array An array of the default parameters + */ + protected function getDefaultParameters() + { + return array( + 'baz_class' => 'BazClass', + 'foo_class' => 'FooClass', + 'foo' => 'bar', + ); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php new file mode 100755 index 0000000000..aa4df998ce --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/simple.php @@ -0,0 +1,3 @@ +setParameter('foo', 'foo'); diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml new file mode 100755 index 0000000000..52df38d0c9 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension1/services.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml new file mode 100755 index 0000000000..21a7ef58c0 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extension2/services.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml new file mode 100755 index 0000000000..792fa07051 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services1.xml @@ -0,0 +1,19 @@ + + + + + + BAR + + + + + + + + + %project.parameter.foo% + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml new file mode 100755 index 0000000000..67d462be98 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services2.xml @@ -0,0 +1,19 @@ + + + + + + BAR + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml new file mode 100755 index 0000000000..c23f02a087 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services3.xml @@ -0,0 +1,19 @@ + + + + + + BAR + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml new file mode 100755 index 0000000000..2c33c3a7d1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services4.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml new file mode 100755 index 0000000000..0eaaff2d2c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services5.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml new file mode 100755 index 0000000000..a9c01030d1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services6.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml new file mode 100755 index 0000000000..e77780db6a --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/extensions/services7.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml new file mode 100755 index 0000000000..e7b5bc973c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/nonvalid.xml @@ -0,0 +1,3 @@ + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml new file mode 100755 index 0000000000..6aa5732f9a --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services1.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml new file mode 100755 index 0000000000..1ac4938841 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services13.xml @@ -0,0 +1,9 @@ + + + + + true + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml new file mode 100755 index 0000000000..bada1c892f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services2.xml @@ -0,0 +1,31 @@ + + + + + a string + bar + + 0 + 4 + null + true + true + false + on + off + 1.3 + 1,000.3 + a string + + foo + bar + + + + + value + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml new file mode 100755 index 0000000000..87bf183db3 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services3.xml @@ -0,0 +1,13 @@ + + + + + foo + + true + false + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml new file mode 100755 index 0000000000..03ad9f8081 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml new file mode 100755 index 0000000000..0b7f10a309 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services4_bad_import.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml new file mode 100755 index 0000000000..acb93e748e --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services5.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml new file mode 100755 index 0000000000..45bc042f61 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + %path%/foo.php + + + foo + + + true + false + + + + + + + + + + + + + + + + + foo + + + true + false + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml new file mode 100755 index 0000000000..824d8b5d75 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services7.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml new file mode 100755 index 0000000000..f11d6069de --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services8.xml @@ -0,0 +1,21 @@ + + + + + %baz% + bar + foo is %%foo bar + + true + false + null + 0 + 1000.3 + true + false + null + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml new file mode 100755 index 0000000000..a73fb3e7d1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml @@ -0,0 +1,56 @@ + + + + BazClass + FooClass + bar + + + + + + foo + + + foo is %foo% + %foo% + + true + + bar + + + + + + + + + foo + + %foo_bar% + + + + + + + + %path%foo.php + + + + + + + + + + + + + + + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/withdoctype.xml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/withdoctype.xml new file mode 100755 index 0000000000..f217d5bcac --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/withdoctype.xml @@ -0,0 +1,3 @@ + + + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml new file mode 100755 index 0000000000..14536fdb36 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag1.yml @@ -0,0 +1,5 @@ +services: + foo_service: + class: FooClass + # tags is not an array + tags: string diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml new file mode 100755 index 0000000000..90288144c8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag2.yml @@ -0,0 +1,6 @@ +services: + foo_service: + class: FooClass + tags: + # tag is missing the name key + foo_tag: { foo: bar } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml new file mode 100755 index 0000000000..8137fab63f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/badtag3.yml @@ -0,0 +1,6 @@ +services: + foo_service: + class: FooClass + tags: + # tag-attribute is not a scalar + - { name: foo, foo: { foo: foo, bar: bar } } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml new file mode 100755 index 0000000000..4eddb872b8 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid1.yml @@ -0,0 +1,2 @@ +foo: + bar diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml new file mode 100755 index 0000000000..c508d5366f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/nonvalid2.yml @@ -0,0 +1 @@ +false diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml new file mode 100755 index 0000000000..8b13789179 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services1.yml @@ -0,0 +1 @@ + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml new file mode 100755 index 0000000000..f2f8d953d5 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml @@ -0,0 +1,9 @@ +parameters: + project.parameter.foo: BAR + +services: + project.service.foo: + class: BAR + +project: + test: %project.parameter.foo% diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml new file mode 100755 index 0000000000..40126f005d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services11.yml @@ -0,0 +1 @@ +foobarfoobar: {} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml new file mode 100755 index 0000000000..d52d355c2d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services13.yml @@ -0,0 +1,3 @@ +# used to test imports in XML +parameters: + imported_from_yaml: true diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml new file mode 100755 index 0000000000..8ddfe0d421 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml @@ -0,0 +1,11 @@ +parameters: + FOO: bar + values: + - true + - false + - 0 + - 1000.3 + bar: foo + foo_bar: @foo_bar + MixedCase: + MixedCaseKey: value diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml new file mode 100755 index 0000000000..0e92cdf500 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services3.yml @@ -0,0 +1,5 @@ +parameters: + foo: foo + values: + - true + - false diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml new file mode 100755 index 0000000000..18f10658c4 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4.yml @@ -0,0 +1,6 @@ +imports: + - { resource: services2.yml } + - { resource: services3.yml } + - { resource: "../ini/parameters.ini", class: Symfony\Component\DependencyInjection\Loader\IniFileLoader } + - { resource: "../ini/parameters2.ini" } + - { resource: "../xml/services13.xml" } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml new file mode 100755 index 0000000000..f7089fc4d4 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services4_bad_import.yml @@ -0,0 +1,2 @@ +imports: + - { resource: foo_fake.yml, ignore_errors: true } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml new file mode 100755 index 0000000000..eaa52bda62 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml @@ -0,0 +1,26 @@ +services: + foo: { class: FooClass } + baz: { class: BazClass } + scope.container: { class: FooClass, scope: container } + scope.custom: { class: FooClass, scope: custom } + scope.prototype: { class: FooClass, scope: prototype } + constructor: { class: FooClass, factory_method: getInstance } + file: { class: FooClass, file: %path%/foo.php } + arguments: { class: FooClass, arguments: [foo, @foo, [true, false]] } + configurator1: { class: FooClass, configurator: sc_configure } + configurator2: { class: FooClass, configurator: [@baz, configure] } + configurator3: { class: FooClass, configurator: [BazClass, configureStatic] } + method_call1: + class: FooClass + calls: + - [ setBar, [] ] + - [ setBar ] + method_call2: + class: FooClass + calls: + - [ setBar, [ foo, @foo, [true, false] ] ] + alias_for_foo: @foo + another_alias_for_foo: + alias: foo + public: false + factory_service: { class: BazClass, factory_method: getInstance, factory_service: baz_factory } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml new file mode 100755 index 0000000000..09064f2005 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services7.yml @@ -0,0 +1,2 @@ +services: + foo: { class: BarClass } diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml new file mode 100755 index 0000000000..5e747486cb --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services8.yml @@ -0,0 +1,6 @@ +parameters: + foo: '%baz%' + baz: bar + bar: 'foo is %%foo bar' + values: [true, false, null, 0, 1000.3, 'true', 'false', 'null'] + diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml new file mode 100755 index 0000000000..0fd2ae37bf --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml @@ -0,0 +1,43 @@ +parameters: + baz_class: BazClass + foo_class: FooClass + foo: bar + +services: + foo: + class: FooClass + tags: + - { name: foo, foo: foo } + - { name: foo, bar: bar } + factory_method: getInstance + arguments: [foo, '@foo.baz', { '%foo%': 'foo is %foo%', bar: '%foo%' }, true, '@service_container'] + properties: { foo: bar, moo: '@foo.baz' } + calls: + - [setBar, ['@bar']] + - [initialize, { }] + + scope: prototype + configurator: sc_configure + bar: + class: FooClass + arguments: [foo, '@foo.baz', '%foo_bar%'] + configurator: ['@foo.baz', configure] + foo.baz: + class: %baz_class% + factory_method: getInstance + configurator: ['%baz_class%', configureStatic1] + foo_bar: + class: %foo_class% + method_call1: + class: FooClass + file: %path%foo.php + calls: + - [setBar, ['@foo']] + - [setBar, ['@?foo2']] + - [setBar, ['@?foo3']] + - [setBar, ['@?foobaz']] + + factory_service: + factory_method: getInstance + factory_service: foo.baz + alias_for_foo: @foo diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php new file mode 100755 index 0000000000..33594d640c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\ClosureLoader; + +class ClosureLoaderTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports + */ + public function testSupports() + { + $loader = new ClosureLoader(new ContainerBuilder()); + + $this->assertTrue($loader->supports(function ($container) {}), '->supports() returns true if the resource is loadable'); + $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::load + */ + public function testLoad() + { + $loader = new ClosureLoader($container = new ContainerBuilder()); + + $loader->load(function ($container) { + $container->setParameter('foo', 'foo'); + }); + + $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a \Closure resource'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php new file mode 100755 index 0000000000..bba9c8c85f --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Loader\IniFileLoader; +use Symfony\Component\Config\FileLocator; + +class IniFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected $container; + protected $loader; + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + } + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + $this->container = new ContainerBuilder(); + $this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini')); + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load + */ + public function testIniFileCanBeLoaded() + { + $this->loader->load('parameters.ini'); + $this->assertEquals(array('foo' => 'bar', 'bar' => '%foo%'), $this->container->getParameterBag()->all(), '->load() takes a single file name as its first argument'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load + */ + public function testExceptionIsRaisedWhenIniFileDoesNotExist() + { + try { + $this->loader->load('foo.ini'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); + $this->assertStringStartsWith('The file "foo.ini" does not exist (in: ', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load + */ + public function testExceptionIsRaisedWhenIniFileCannotBeParsed() + { + try { + @$this->loader->load('nonvalid.ini'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file is not parseable'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not parseable'); + $this->assertEquals('The "nonvalid.ini" file is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not parseable'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::supports + */ + public function testSupports() + { + $loader = new IniFileLoader(new ContainerBuilder(), new FileLocator()); + + $this->assertTrue($loader->supports('foo.ini'), '->supports() returns true if the resource is loadable'); + $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php new file mode 100755 index 0000000000..3a97dc27da --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Config\Loader\Loader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; +use Symfony\Component\Config\FileLocator; + +class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports + */ + public function testSupports() + { + $loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator()); + + $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable'); + $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::load + */ + public function testLoad() + { + $loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator()); + + $loader->load(__DIR__.'/../Fixtures/php/simple.php'); + + $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php new file mode 100755 index 0000000000..b589ed95ac --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -0,0 +1,343 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Loader; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\Config\Loader\Loader; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Loader\IniFileLoader; +use Symfony\Component\Config\Loader\LoaderResolver; +use Symfony\Component\Config\FileLocator; + +class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + require_once self::$fixturesPath.'/includes/foo.php'; + require_once self::$fixturesPath.'/includes/ProjectExtension.php'; + require_once self::$fixturesPath.'/includes/ProjectWithXsdExtension.php'; + } + + public function testLoad() + { + $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); + + try { + $loader->load('foo.xml'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); + $this->assertStringStartsWith('The file "foo.xml" does not exist (in:', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); + } + } + + public function testParseFile() + { + $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); + $r = new \ReflectionObject($loader); + $m = $r->getMethod('parseFile'); + $m->setAccessible(true); + + try { + $m->invoke($loader, self::$fixturesPath.'/ini/parameters.ini'); + $this->fail('->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); + $this->assertStringStartsWith('[ERROR 4] Start tag expected, \'<\' not found (in', $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file is not a valid XML file'); + } + + $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/xml')); + + try { + $m->invoke($loader, self::$fixturesPath.'/xml/nonvalid.xml'); + $this->fail('->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); + $this->assertStringStartsWith('[ERROR 1845] Element \'nonvalid\': No matching global declaration available for the validation root. (in', $e->getMessage(), '->parseFile() throws an InvalidArgumentException if the loaded file does not validate the XSD'); + } + + $xml = $m->invoke($loader, self::$fixturesPath.'/xml/services1.xml'); + $this->assertEquals('Symfony\\Component\\DependencyInjection\\SimpleXMLElement', get_class($xml), '->parseFile() returns an SimpleXMLElement object'); + } + + public function testLoadParameters() + { + $container = new ContainerBuilder(); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('services2.xml'); + + $actual = $container->getParameterBag()->all(); + $expected = array('a string', 'foo' => 'bar', 'values' => array(0, 'integer' => 4, 100 => null, 'true', true, false, 'on', 'off', 'float' => 1.3, 1000.3, 'a string', array('foo', 'bar')), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value')); + + $this->assertEquals($expected, $actual, '->load() converts XML values to PHP ones'); + } + + public function testLoadImports() + { + $container = new ContainerBuilder(); + $resolver = new LoaderResolver(array( + new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), + new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), + )); + $loader->setResolver($resolver); + $loader->load('services4.xml'); + + $actual = $container->getParameterBag()->all(); + $expected = array('a string', 'foo' => 'bar', 'values' => array(true, false), 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'bar' => '%foo%', 'imported_from_ini' => true, 'imported_from_yaml' => true); + + $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); + + // Bad import throws no exception due to ignore_errors value. + $loader->load('services4_bad_import.xml'); + } + + public function testLoadAnonymousServices() + { + $container = new ContainerBuilder(); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('services5.xml'); + $services = $container->getDefinitions(); + $this->assertEquals(4, count($services), '->load() attributes unique ids to anonymous services'); + + // anonymous service as an argument + $args = $services['foo']->getArguments(); + $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); + $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); + $inner = $services[(string) $args[0]]; + $this->assertEquals('BarClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); + + // inner anonymous services + $args = $inner->getArguments(); + $this->assertEquals(1, count($args), '->load() references anonymous services as "normal" ones'); + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($args[0]), '->load() converts anonymous services to references to "normal" services'); + $this->assertTrue(isset($services[(string) $args[0]]), '->load() makes a reference to the created ones'); + $inner = $services[(string) $args[0]]; + $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); + + // anonymous service as a property + $properties = $services['foo']->getProperties(); + $property = $properties['p']; + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Reference', get_class($property), '->load() converts anonymous services to references to "normal" services'); + $this->assertTrue(isset($services[(string) $property]), '->load() makes a reference to the created ones'); + $inner = $services[(string) $property]; + $this->assertEquals('BazClass', $inner->getClass(), '->load() uses the same configuration as for the anonymous ones'); + } + + public function testLoadServices() + { + $container = new ContainerBuilder(); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('services6.xml'); + $services = $container->getDefinitions(); + $this->assertTrue(isset($services['foo']), '->load() parses elements'); + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Definition', get_class($services['foo']), '->load() converts element to Definition instances'); + $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); + $this->assertEquals('container', $services['scope.container']->getScope()); + $this->assertEquals('custom', $services['scope.custom']->getScope()); + $this->assertEquals('prototype', $services['scope.prototype']->getScope()); + $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod(), '->load() parses the factory-method attribute'); + $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); + $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); + $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array(new Reference('baz', ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array(array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); + $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); + $this->assertNull($services['factory_service']->getClass()); + $this->assertEquals('getInstance', $services['factory_service']->getFactoryMethod()); + $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); + + $aliases = $container->getAliases(); + $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses elements'); + $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); + $this->assertTrue($aliases['alias_for_foo']->isPublic()); + $this->assertTrue(isset($aliases['another_alias_for_foo'])); + $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); + $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); + } + + public function testConvertDomElementToArray() + { + $doc = new \DOMDocument("1.0"); + $doc->loadXML('bar'); + $this->assertEquals('bar', XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML(''); + $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML('bar'); + $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML('barbar'); + $this->assertEquals(array('foo' => array('value' => 'bar', 'foo' => 'bar')), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML(''); + $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML(''); + $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + + $doc = new \DOMDocument("1.0"); + $doc->loadXML(''); + $this->assertEquals(array('foo' => array(array('foo' => 'bar'), array('foo' => 'bar'))), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); + } + + public function testExtensions() + { + $container = new ContainerBuilder(); + $container->registerExtension(new \ProjectExtension()); + $container->registerExtension(new \ProjectWithXsdExtension()); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + + // extension without an XSD + $loader->load('extensions/services1.xml'); + $container->compile(); + $services = $container->getDefinitions(); + $parameters = $container->getParameterBag()->all(); + + $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); + $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); + + $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); + $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); + + // extension with an XSD + $container = new ContainerBuilder(); + $container->registerExtension(new \ProjectExtension()); + $container->registerExtension(new \ProjectWithXsdExtension()); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('extensions/services2.xml'); + $container->compile(); + $services = $container->getDefinitions(); + $parameters = $container->getParameterBag()->all(); + + $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); + $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); + + $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); + $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); + + $container = new ContainerBuilder(); + $container->registerExtension(new \ProjectExtension()); + $container->registerExtension(new \ProjectWithXsdExtension()); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + + // extension with an XSD (does not validate) + try { + $loader->load('extensions/services3.xml'); + $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + $this->assertRegexp('/The attribute \'bar\' is not allowed/', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + } + + // non-registered extension + try { + $loader->load('extensions/services4.xml'); + $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); + $this->assertStringStartsWith('There is no extension able to load the configuration for "project:bar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); + } + } + + public function testExtensionInPhar() + { + if (extension_loaded('suhosin') && false === strpos(ini_get('suhosin.executor.include.whitelist'), 'phar')) { + $this->markTestSkipped('To run this test, add "phar" to the "suhosin.executor.include.whitelist" settings in your php.ini file.'); + } + + require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar'; + + // extension with an XSD in PHAR archive + $container = new ContainerBuilder(); + $container->registerExtension(new \ProjectWithXsdExtensionInPhar()); + $loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader->load('extensions/services6.xml'); + + // extension with an XSD in PHAR archive (does not validate) + try { + $loader->load('extensions/services7.xml'); + $this->fail('->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + $this->assertRegexp('/The attribute \'bar\' is not allowed/', $e->getMessage(), '->load() throws an InvalidArgumentException if the configuration does not validate the XSD'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\XmlFileLoader::supports + */ + public function testSupports() + { + $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator()); + + $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); + $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); + } + + public function testNoNamingConflictsForAnonymousServices() + { + $container = new ContainerBuilder(); + + $loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension1')); + $loader1->load('services.xml'); + $services = $container->getDefinitions(); + $this->assertEquals(2, count($services), '->load() attributes unique ids to anonymous services'); + $loader2 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml/extension2')); + $loader2->load('services.xml'); + $services = $container->getDefinitions(); + $this->assertEquals(4, count($services), '->load() attributes unique ids to anonymous services'); + + $services = $container->getDefinitions(); + $args1 = $services['extension1.foo']->getArguments(); + $inner1 = $services[(string) $args1[0]]; + $this->assertEquals('BarClass1', $inner1->getClass(), '->load() uses the same configuration as for the anonymous ones'); + $args2 = $services['extension2.foo']->getArguments(); + $inner2 = $services[(string) $args2[0]]; + $this->assertEquals('BarClass2', $inner2->getClass(), '->load() uses the same configuration as for the anonymous ones'); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Document types are not allowed. + */ + public function testDocTypeIsNotAllowed() + { + $container = new ContainerBuilder(); + + $loader1 = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')); + $loader1->load('withdoctype.xml'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php new file mode 100755 index 0000000000..e655d3bd89 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php @@ -0,0 +1,211 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\Loader; + +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\Config\Loader\Loader; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Loader\IniFileLoader; +use Symfony\Component\Config\Loader\LoaderResolver; +use Symfony\Component\Config\FileLocator; + +class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase +{ + protected static $fixturesPath; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Config\Loader\Loader')) { + $this->markTestSkipped('The "Config" component is not available'); + } + + if (!class_exists('Symfony\Component\Yaml\Yaml')) { + $this->markTestSkipped('The "Yaml" component is not available'); + } + } + + public static function setUpBeforeClass() + { + self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); + require_once self::$fixturesPath.'/includes/foo.php'; + require_once self::$fixturesPath.'/includes/ProjectExtension.php'; + } + + public function testLoadFile() + { + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/ini')); + $r = new \ReflectionObject($loader); + $m = $r->getMethod('loadFile'); + $m->setAccessible(true); + + try { + $m->invoke($loader, 'foo.yml'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist'); + $this->assertEquals('The service file "foo.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist'); + } + + try { + $m->invoke($loader, 'parameters.ini'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); + $this->assertEquals('The service file "parameters.ini" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not a valid YAML file'); + } + + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); + + foreach (array('nonvalid1', 'nonvalid2') as $fixture) { + try { + $m->invoke($loader, $fixture.'.yml'); + $this->fail('->load() throws an InvalidArgumentException if the loaded file does not validate'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not validate'); + $this->assertStringMatchesFormat('The service file "nonvalid%d.yml" is not valid.', $e->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not validate'); + } + } + } + + public function testLoadParameters() + { + $container = new ContainerBuilder(); + $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); + $loader->load('services2.yml'); + $this->assertEquals(array('foo' => 'bar', 'mixedcase' => array('MixedCaseKey' => 'value'), 'values' => array(true, false, 0, 1000.3), 'bar' => 'foo', 'foo_bar' => new Reference('foo_bar')), $container->getParameterBag()->all(), '->load() converts YAML keys to lowercase'); + } + + public function testLoadImports() + { + $container = new ContainerBuilder(); + $resolver = new LoaderResolver(array( + new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), + new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), + $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')), + )); + $loader->setResolver($resolver); + $loader->load('services4.yml'); + + $actual = $container->getParameterBag()->all(); + $expected = array('foo' => 'bar', 'values' => array(true, false), 'bar' => '%foo%', 'foo_bar' => new Reference('foo_bar'), 'mixedcase' => array('MixedCaseKey' => 'value'), 'imported_from_ini' => true, 'imported_from_xml' => true); + $this->assertEquals(array_keys($expected), array_keys($actual), '->load() imports and merges imported files'); + + // Bad import throws no exception due to ignore_errors value. + $loader->load('services4_bad_import.yml'); + } + + public function testLoadServices() + { + $container = new ContainerBuilder(); + $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); + $loader->load('services6.yml'); + $services = $container->getDefinitions(); + $this->assertTrue(isset($services['foo']), '->load() parses service elements'); + $this->assertEquals('Symfony\\Component\\DependencyInjection\\Definition', get_class($services['foo']), '->load() converts service element to Definition instances'); + $this->assertEquals('FooClass', $services['foo']->getClass(), '->load() parses the class attribute'); + $this->assertEquals('container', $services['scope.container']->getScope()); + $this->assertEquals('custom', $services['scope.custom']->getScope()); + $this->assertEquals('prototype', $services['scope.prototype']->getScope()); + $this->assertEquals('getInstance', $services['constructor']->getFactoryMethod(), '->load() parses the factory_method attribute'); + $this->assertEquals('%path%/foo.php', $services['file']->getFile(), '->load() parses the file tag'); + $this->assertEquals(array('foo', new Reference('foo'), array(true, false)), $services['arguments']->getArguments(), '->load() parses the argument tags'); + $this->assertEquals('sc_configure', $services['configurator1']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array(new Reference('baz'), 'configure'), $services['configurator2']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array('BazClass', 'configureStatic'), $services['configurator3']->getConfigurator(), '->load() parses the configurator tag'); + $this->assertEquals(array(array('setBar', array()), array('setBar', array())), $services['method_call1']->getMethodCalls(), '->load() parses the method_call tag'); + $this->assertEquals(array(array('setBar', array('foo', new Reference('foo'), array(true, false)))), $services['method_call2']->getMethodCalls(), '->load() parses the method_call tag'); + $this->assertEquals('baz_factory', $services['factory_service']->getFactoryService()); + + $aliases = $container->getAliases(); + $this->assertTrue(isset($aliases['alias_for_foo']), '->load() parses aliases'); + $this->assertEquals('foo', (string) $aliases['alias_for_foo'], '->load() parses aliases'); + $this->assertTrue($aliases['alias_for_foo']->isPublic()); + $this->assertTrue(isset($aliases['another_alias_for_foo'])); + $this->assertEquals('foo', (string) $aliases['another_alias_for_foo']); + $this->assertFalse($aliases['another_alias_for_foo']->isPublic()); + } + + public function testExtensions() + { + $container = new ContainerBuilder(); + $container->registerExtension(new \ProjectExtension()); + $loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')); + $loader->load('services10.yml'); + $container->compile(); + $services = $container->getDefinitions(); + $parameters = $container->getParameterBag()->all(); + + $this->assertTrue(isset($services['project.service.bar']), '->load() parses extension elements'); + $this->assertTrue(isset($parameters['project.parameter.bar']), '->load() parses extension elements'); + + $this->assertEquals('BAR', $services['project.service.foo']->getClass(), '->load() parses extension elements'); + $this->assertEquals('BAR', $parameters['project.parameter.foo'], '->load() parses extension elements'); + + try { + $loader->load('services11.yml'); + $this->fail('->load() throws an InvalidArgumentException if the tag is not valid'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tag is not valid'); + $this->assertStringStartsWith('There is no extension able to load the configuration for "foobarfoobar" (in', $e->getMessage(), '->load() throws an InvalidArgumentException if the tag is not valid'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\Loader\YamlFileLoader::supports + */ + public function testSupports() + { + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator()); + + $this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable'); + $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); + } + + public function testNonArrayTagThrowsException() + { + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); + try { + $loader->load('badtag1.yml'); + $this->fail('->load() should throw an exception when the tags key of a service is not an array'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the tags key is not an array'); + $this->assertStringStartsWith('Parameter "tags" must be an array for service', $e->getMessage(), '->load() throws an InvalidArgumentException if the tags key is not an array'); + } + } + + public function testTagWithoutNameThrowsException() + { + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); + try { + $loader->load('badtag2.yml'); + $this->fail('->load() should throw an exception when a tag is missing the name key'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag is missing the name key'); + $this->assertStringStartsWith('A "tags" entry is missing a "name" key for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag is missing the name key'); + } + } + + public function testTagWithAttributeArrayThrowsException() + { + $loader = new YamlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath.'/yaml')); + try { + $loader->load('badtag3.yml'); + $this->fail('->load() should throw an exception when a tag-attribute is not a scalar'); + } catch (\Exception $e) { + $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); + $this->assertStringStartsWith('A "tags" attribute must be of a scalar-type for service ', $e->getMessage(), '->load() throws an InvalidArgumentException if a tag-attribute is not a scalar'); + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php new file mode 100755 index 0000000000..e6e7fea2f1 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; + +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; + +class FrozenParameterBagTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::__construct + */ + public function testConstructor() + { + $parameters = array( + 'foo' => 'foo', + 'bar' => 'bar', + ); + $bag = new FrozenParameterBag($parameters); + $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::clear + * @expectedException \LogicException + */ + public function testClear() + { + $bag = new FrozenParameterBag(array()); + $bag->clear(); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::set + * @expectedException \LogicException + */ + public function testSet() + { + $bag = new FrozenParameterBag(array()); + $bag->set('foo', 'bar'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag::add + * @expectedException \LogicException + */ + public function testAdd() + { + $bag = new FrozenParameterBag(array()); + $bag->add(array()); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php new file mode 100755 index 0000000000..968ae9bcf5 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php @@ -0,0 +1,246 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; + +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; +use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; + +class ParameterBagTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::__construct + */ + public function testConstructor() + { + $bag = new ParameterBag($parameters = array( + 'foo' => 'foo', + 'bar' => 'bar', + )); + $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::clear + */ + public function testClear() + { + $bag = new ParameterBag($parameters = array( + 'foo' => 'foo', + 'bar' => 'bar', + )); + $bag->clear(); + $this->assertEquals(array(), $bag->all(), '->clear() removes all parameters'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::remove + */ + public function testRemove() + { + $bag = new ParameterBag(array( + 'foo' => 'foo', + 'bar' => 'bar', + )); + $bag->remove('foo'); + $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter'); + $bag->remove('BAR'); + $this->assertEquals(array(), $bag->all(), '->remove() converts key to lowercase before removing'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::get + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::set + */ + public function testGetSet() + { + $bag = new ParameterBag(array('foo' => 'bar')); + $bag->set('bar', 'foo'); + $this->assertEquals('foo', $bag->get('bar'), '->set() sets the value of a new parameter'); + + $bag->set('foo', 'baz'); + $this->assertEquals('baz', $bag->get('foo'), '->set() overrides previously set parameter'); + + $bag->set('Foo', 'baz1'); + $this->assertEquals('baz1', $bag->get('foo'), '->set() converts the key to lowercase'); + $this->assertEquals('baz1', $bag->get('FOO'), '->get() converts the key to lowercase'); + + try { + $bag->get('baba'); + $this->fail('->get() throws an \InvalidArgumentException if the key does not exist'); + } catch (\Exception $e) { + $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws an \InvalidArgumentException if the key does not exist'); + $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->get() throws an \InvalidArgumentException if the key does not exist'); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::has + */ + public function testHas() + { + $bag = new ParameterBag(array('foo' => 'bar')); + $this->assertTrue($bag->has('foo'), '->has() returns true if a parameter is defined'); + $this->assertTrue($bag->has('Foo'), '->has() converts the key to lowercase'); + $this->assertFalse($bag->has('bar'), '->has() returns false if a parameter is not defined'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolveValue + */ + public function testResolveValue() + { + $bag = new ParameterBag(array()); + $this->assertEquals('foo', $bag->resolveValue('foo'), '->resolveValue() returns its argument unmodified if no placeholders are found'); + + $bag = new ParameterBag(array('foo' => 'bar')); + $this->assertEquals('I\'m a bar', $bag->resolveValue('I\'m a %foo%'), '->resolveValue() replaces placeholders by their values'); + $this->assertEquals(array('bar' => 'bar'), $bag->resolveValue(array('%foo%' => '%foo%')), '->resolveValue() replaces placeholders in keys and values of arrays'); + $this->assertEquals(array('bar' => array('bar' => array('bar' => 'bar'))), $bag->resolveValue(array('%foo%' => array('%foo%' => array('%foo%' => '%foo%')))), '->resolveValue() replaces placeholders in nested arrays'); + $this->assertEquals('I\'m a %%foo%%', $bag->resolveValue('I\'m a %%foo%%'), '->resolveValue() supports % escaping by doubling it'); + $this->assertEquals('I\'m a bar %%foo bar', $bag->resolveValue('I\'m a %foo% %%foo %foo%'), '->resolveValue() supports % escaping by doubling it'); + $this->assertEquals(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar'))), $bag->resolveValue(array('foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')))), '->resolveValue() supports % escaping by doubling it'); + + $bag = new ParameterBag(array('foo' => true)); + $this->assertTrue($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); + $bag = new ParameterBag(array('foo' => null)); + $this->assertNull($bag->resolveValue('%foo%'), '->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings'); + + $bag = new ParameterBag(array('foo' => 'bar', 'baz' => '%%%foo% %foo%%% %%foo%% %%%foo%%%')); + $this->assertEquals('%%bar bar%% %%foo%% %%bar%%', $bag->resolveValue('%baz%'), '->resolveValue() replaces params placed besides escaped %'); + + $bag = new ParameterBag(array('baz' => '%%s?%%s')); + $this->assertEquals('%%s?%%s', $bag->resolveValue('%baz%'), '->resolveValue() is not replacing greedily'); + + $bag = new ParameterBag(array()); + try { + $bag->resolveValue('%foobar%'); + $this->fail('->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter'); + } catch (ParameterNotFoundException $e) { + $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); + } + + try { + $bag->resolveValue('foo %foobar% bar'); + $this->fail('->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); + } catch (ParameterNotFoundException $e) { + $this->assertEquals('You have requested a non-existent parameter "foobar".', $e->getMessage(), '->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter'); + } + + $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => array())); + try { + $bag->resolveValue('%foo%'); + $this->fail('->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); + } catch (RuntimeException $e) { + $this->assertEquals('A string value must be composed of strings and/or numbers, but found parameter "bar" of type array inside string value "a %bar%".', $e->getMessage(), '->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter'); + } + + $bag = new ParameterBag(array('foo' => '%bar%', 'bar' => '%foobar%', 'foobar' => '%foo%')); + try { + $bag->resolveValue('%foo%'); + $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); + } catch (ParameterCircularReferenceException $e) { + $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); + } + + $bag = new ParameterBag(array('foo' => 'a %bar%', 'bar' => 'a %foobar%', 'foobar' => 'a %foo%')); + try { + $bag->resolveValue('%foo%'); + $this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); + } catch (ParameterCircularReferenceException $e) { + $this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").', $e->getMessage(), '->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference'); + } + + $bag = new ParameterBag(array('host' => 'foo.bar', 'port' => 1337)); + $this->assertEquals('foo.bar:1337', $bag->resolveValue('%host%:%port%')); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve + */ + public function testResolveIndicatesWhyAParameterIsNeeded() + { + $bag = new ParameterBag(array('foo' => '%bar%')); + + try { + $bag->resolve(); + } catch (ParameterNotFoundException $e) { + $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); + } + + $bag = new ParameterBag(array('foo' => '%bar%')); + + try { + $bag->resolve(); + } catch (ParameterNotFoundException $e) { + $this->assertEquals('The parameter "foo" has a dependency on a non-existent parameter "bar".', $e->getMessage()); + } + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve + */ + public function testResolveUnescapesValue() + { + $bag = new ParameterBag(array( + 'foo' => array('bar' => array('ding' => 'I\'m a bar %%foo %%bar')), + 'bar' => 'I\'m a %%foo%%', + )); + + $bag->resolve(); + + $this->assertEquals('I\'m a %foo%', $bag->get('bar'), '->resolveValue() supports % escaping by doubling it'); + $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %foo %bar')), $bag->get('foo'), '->resolveValue() supports % escaping by doubling it'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue + */ + public function testEscapeValue() + { + $bag = new ParameterBag(); + + $bag->add(array( + 'foo' => $bag->escapeValue(array('bar' => array('ding' => 'I\'m a bar %foo %bar', 'zero' => null))), + 'bar' => $bag->escapeValue('I\'m a %foo%'), + )); + + $this->assertEquals('I\'m a %%foo%%', $bag->get('bar'), '->escapeValue() escapes % by doubling it'); + $this->assertEquals(array('bar' => array('ding' => 'I\'m a bar %%foo %%bar', 'zero' => null)), $bag->get('foo'), '->escapeValue() escapes % by doubling it'); + } + + /** + * @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve + * @dataProvider stringsWithSpacesProvider + */ + public function testResolveStringWithSpacesReturnsString($expected, $test, $description) + { + $bag = new ParameterBag(array('foo' => 'bar')); + + try { + $this->assertEquals($expected, $bag->resolveString($test), $description); + } catch (ParameterNotFoundException $e) { + $this->fail(sprintf('%s - "%s"', $description, $expected)); + } + } + + public function stringsWithSpacesProvider() + { + return array( + array('bar', '%foo%', 'Parameters must be wrapped by %.'), + array('% foo %', '% foo %', 'Parameters should not have spaces.'), + array('{% set my_template = "foo" %}', '{% set my_template = "foo" %}', 'Twig-like strings are not parameters.'), + array('50% is less than 100%', '50% is less than 100%', 'Text between % signs is allowed, if there are spaces.'), + ); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterTest.php new file mode 100755 index 0000000000..bed188e95c --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ParameterTest.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\Parameter; + +class ParameterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\Parameter::__construct + */ + public function testConstructor() + { + $ref = new Parameter('foo'); + $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the parameter, which is used for the __toString() method'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php new file mode 100755 index 0000000000..f14e99f926 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ReferenceTest.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection\Tests; + +use Symfony\Component\DependencyInjection\Reference; + +class ReferenceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers Symfony\Component\DependencyInjection\Reference::__construct + */ + public function testConstructor() + { + $ref = new Reference('foo'); + $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the reference, which is used for the __toString() method'); + } + + public function testCaseInsensitive() + { + $ref = new Reference('FooBar'); + $this->assertEquals('foobar', (string) $ref, 'the id is lowercased as the container is case insensitive'); + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php new file mode 100755 index 0000000000..c84b8fd3f5 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Variable.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\DependencyInjection; + +/** + * Represents a variable. + * + * $var = new Variable('a'); + * + * will be dumped as + * + * $a + * + * by the PHP dumper. + * + * @author Johannes M. Schmitt + */ +class Variable +{ + private $name; + + /** + * Constructor + * + * @param string $name + */ + public function __construct($name) + { + $this->name = $name; + } + + /** + * Converts the object to a string + * + * @return string + */ + public function __toString() + { + return $this->name; + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json new file mode 100755 index 0000000000..d951f3041d --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/composer.json @@ -0,0 +1,39 @@ +{ + "name": "symfony/dependency-injection", + "type": "library", + "description": "Symfony DependencyInjection Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/yaml": "2.2.*", + "symfony/config": "2.2.*" + }, + "suggest": { + "symfony/yaml": "2.2.*", + "symfony/config": "2.2.*" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\DependencyInjection\\": "" } + }, + "target-dir": "Symfony/Component/DependencyInjection", + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + } +} diff --git a/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist new file mode 100755 index 0000000000..53f5f99d60 --- /dev/null +++ b/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + + ./Tests/ + + + + + + ./ + + ./Resources + ./Tests + ./vendor + + + + diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php index 42f09eaa51..fc2c0d4eac 100755 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php +++ b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Event.php @@ -74,11 +74,11 @@ class Event /** * Stores the EventDispatcher that dispatches this Event * - * @param EventDispatcherInterface $dispatcher + * @param EventDispatcher $dispatcher * * @api */ - public function setDispatcher(EventDispatcherInterface $dispatcher) + public function setDispatcher(EventDispatcher $dispatcher) { $this->dispatcher = $dispatcher; } @@ -86,7 +86,7 @@ class Event /** * Returns the EventDispatcher that dispatches this Event * - * @return EventDispatcherInterface + * @return EventDispatcher * * @api */ diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md index 11f6b1888e..a2bcfca1e3 100755 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md +++ b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md @@ -20,6 +20,9 @@ Resources You can run the unit tests with the following command: - $ cd path/to/Symfony/Component/EventDispatcher/ - $ composer.phar install --dev - $ phpunit + phpunit + +If you also want to run the unit tests that depend on other Symfony +Components, install dev dependencies before running PHPUnit: + + php composer.phar install --dev diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php new file mode 100755 index 0000000000..033180fd3f --- /dev/null +++ b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/bootstrap.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\EventDispatcher')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\EventDispatcher')).'.php')) { + require_once $file; + } + } +}); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json index 1a90992fd1..2b89a2865f 100755 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json +++ b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/composer.json @@ -19,20 +19,15 @@ "php": ">=5.3.3" }, "require-dev": { - "symfony/dependency-injection": "2.2.*" + "symfony/dependency-injection": "2.1.*" }, "suggest": { - "symfony/dependency-injection": "2.2.*", - "symfony/http-kernel": "2.2.*" + "symfony/dependency-injection": "2.1.*", + "symfony/http-kernel": "2.1.*" }, "autoload": { - "psr-0": { "Symfony\\Component\\EventDispatcher\\": "" } + "psr-0": { "Symfony\\Component\\EventDispatcher": "" } }, "target-dir": "Symfony/Component/EventDispatcher", - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - } + "minimum-stability": "dev" } diff --git a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist index 0c3de4f7b2..c5571353a6 100755 --- a/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist +++ b/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist @@ -9,7 +9,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="vendor/autoload.php" + bootstrap="Tests/bootstrap.php" > diff --git a/vendor/symfony/form/Symfony/Component/Form/AbstractExtension.php b/vendor/symfony/form/Symfony/Component/Form/AbstractExtension.php new file mode 100755 index 0000000000..ea2e95924c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/AbstractExtension.php @@ -0,0 +1,195 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +abstract class AbstractExtension implements FormExtensionInterface +{ + /** + * The types provided by this extension + * @var array An array of FormTypeInterface + */ + private $types; + + /** + * The type extensions provided by this extension + * @var array An array of FormTypeExtensionInterface + */ + private $typeExtensions; + + /** + * The type guesser provided by this extension + * @var FormTypeGuesserInterface + */ + private $typeGuesser; + + /** + * Whether the type guesser has been loaded + * @var Boolean + */ + private $typeGuesserLoaded = false; + + /** + * {@inheritdoc} + */ + public function getType($name) + { + if (null === $this->types) { + $this->initTypes(); + } + + if (!isset($this->types[$name])) { + throw new FormException(sprintf('The type "%s" can not be loaded by this extension', $name)); + } + + return $this->types[$name]; + } + + /** + * {@inheritdoc} + */ + public function hasType($name) + { + if (null === $this->types) { + $this->initTypes(); + } + + return isset($this->types[$name]); + } + + /** + * {@inheritdoc} + */ + public function getTypeExtensions($name) + { + if (null === $this->typeExtensions) { + $this->initTypeExtensions(); + } + + return isset($this->typeExtensions[$name]) + ? $this->typeExtensions[$name] + : array(); + } + + /** + * {@inheritdoc} + */ + public function hasTypeExtensions($name) + { + if (null === $this->typeExtensions) { + $this->initTypeExtensions(); + } + + return isset($this->typeExtensions[$name]) && count($this->typeExtensions[$name]) > 0; + } + + /** + * {@inheritdoc} + */ + public function getTypeGuesser() + { + if (!$this->typeGuesserLoaded) { + $this->initTypeGuesser(); + } + + return $this->typeGuesser; + } + + /** + * Registers the types. + * + * @return array An array of FormTypeInterface instances + */ + protected function loadTypes() + { + return array(); + } + + /** + * Registers the type extensions. + * + * @return array An array of FormTypeExtensionInterface instances + */ + protected function loadTypeExtensions() + { + return array(); + } + + /** + * Registers the type guesser. + * + * @return FormTypeGuesserInterface|null A type guesser + */ + protected function loadTypeGuesser() + { + return null; + } + + /** + * Initializes the types. + * + * @throws UnexpectedTypeException if any registered type is not an instance of FormTypeInterface + */ + private function initTypes() + { + $this->types = array(); + + foreach ($this->loadTypes() as $type) { + if (!$type instanceof FormTypeInterface) { + throw new UnexpectedTypeException($type, 'Symfony\Component\Form\FormTypeInterface'); + } + + $this->types[$type->getName()] = $type; + } + } + + /** + * Initializes the type extensions. + * + * @throws UnexpectedTypeException if any registered type extension is not + * an instance of FormTypeExtensionInterface + */ + private function initTypeExtensions() + { + $this->typeExtensions = array(); + + foreach ($this->loadTypeExtensions() as $extension) { + if (!$extension instanceof FormTypeExtensionInterface) { + throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormTypeExtensionInterface'); + } + + $type = $extension->getExtendedType(); + + $this->typeExtensions[$type][] = $extension; + } + } + + /** + * Initializes the type guesser. + * + * @throws UnexpectedTypeException if the type guesser is not an instance of FormTypeGuesserInterface + */ + private function initTypeGuesser() + { + $this->typeGuesserLoaded = true; + + $this->typeGuesser = $this->loadTypeGuesser(); + if (null !== $this->typeGuesser && !$this->typeGuesser instanceof FormTypeGuesserInterface) { + throw new UnexpectedTypeException($this->typeGuesser, 'Symfony\Component\Form\FormTypeGuesserInterface'); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/AbstractRendererEngine.php b/vendor/symfony/form/Symfony/Component/Form/AbstractRendererEngine.php new file mode 100755 index 0000000000..347be10d29 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/AbstractRendererEngine.php @@ -0,0 +1,206 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Default implementation of {@link FormRendererEngineInterface}. + * + * @author Bernhard Schussek + */ +abstract class AbstractRendererEngine implements FormRendererEngineInterface +{ + /** + * The variable in {@link FormView} used as cache key. + */ + const CACHE_KEY_VAR = 'cache_key'; + + /** + * @var array + */ + protected $defaultThemes; + + /** + * @var array + */ + protected $themes = array(); + + /** + * @var array + */ + protected $resources = array(); + + /** + * @var array + */ + private $resourceHierarchyLevels = array(); + + /** + * Creates a new renderer engine. + * + * @param array $defaultThemes The default themes. The type of these + * themes is open to the implementation. + */ + public function __construct(array $defaultThemes = array()) + { + $this->defaultThemes = $defaultThemes; + } + + /** + * {@inheritdoc} + */ + public function setTheme(FormView $view, $themes) + { + $cacheKey = $view->vars[self::CACHE_KEY_VAR]; + + // Do not cast, as casting turns objects into arrays of properties + $this->themes[$cacheKey] = is_array($themes) ? $themes : array($themes); + + // Unset instead of resetting to an empty array, in order to allow + // implementations (like TwigRendererEngine) to check whether $cacheKey + // is set at all. + unset($this->resources[$cacheKey]); + unset($this->resourceHierarchyLevels[$cacheKey]); + } + + /** + * {@inheritdoc} + */ + public function getResourceForBlockName(FormView $view, $blockName) + { + $cacheKey = $view->vars[self::CACHE_KEY_VAR]; + + if (!isset($this->resources[$cacheKey][$blockName])) { + $this->loadResourceForBlockName($cacheKey, $view, $blockName); + } + + return $this->resources[$cacheKey][$blockName]; + } + + /** + * {@inheritdoc} + */ + public function getResourceForBlockNameHierarchy(FormView $view, array $blockNameHierarchy, $hierarchyLevel) + { + $cacheKey = $view->vars[self::CACHE_KEY_VAR]; + $blockName = $blockNameHierarchy[$hierarchyLevel]; + + if (!isset($this->resources[$cacheKey][$blockName])) { + $this->loadResourceForBlockNameHierarchy($cacheKey, $view, $blockNameHierarchy, $hierarchyLevel); + } + + return $this->resources[$cacheKey][$blockName]; + } + + /** + * {@inheritdoc} + */ + public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, $hierarchyLevel) + { + $cacheKey = $view->vars[self::CACHE_KEY_VAR]; + $blockName = $blockNameHierarchy[$hierarchyLevel]; + + if (!isset($this->resources[$cacheKey][$blockName])) { + $this->loadResourceForBlockNameHierarchy($cacheKey, $view, $blockNameHierarchy, $hierarchyLevel); + } + + // If $block was previously rendered loaded with loadTemplateForBlock(), the template + // is cached but the hierarchy level is not. In this case, we know that the block + // exists at this very hierarchy level, so we can just set it. + if (!isset($this->resourceHierarchyLevels[$cacheKey][$blockName])) { + $this->resourceHierarchyLevels[$cacheKey][$blockName] = $hierarchyLevel; + } + + return $this->resourceHierarchyLevels[$cacheKey][$blockName]; + } + + /** + * Loads the cache with the resource for a given block name. + * + * @see getResourceForBlock() + * + * @param string $cacheKey The cache key of the form view. + * @param FormView $view The form view for finding the applying themes. + * @param string $blockName The name of the block to load. + * + * @return Boolean True if the resource could be loaded, false otherwise. + */ + abstract protected function loadResourceForBlockName($cacheKey, FormView $view, $blockName); + + /** + * Loads the cache with the resource for a specific level of a block hierarchy. + * + * @see getResourceForBlockHierarchy() + * + * @param string $cacheKey The cache key used for storing the + * resource. + * @param FormView $view The form view for finding the applying + * themes. + * @param array $blockNameHierarchy The block hierarchy, with the most + * specific block name at the end. + * @param integer $hierarchyLevel The level in the block hierarchy that + * should be loaded. + * + * @return Boolean True if the resource could be loaded, false otherwise. + */ + private function loadResourceForBlockNameHierarchy($cacheKey, FormView $view, array $blockNameHierarchy, $hierarchyLevel) + { + $blockName = $blockNameHierarchy[$hierarchyLevel]; + + // Try to find a template for that block + if ($this->loadResourceForBlockName($cacheKey, $view, $blockName)) { + // If loadTemplateForBlock() returns true, it was able to populate the + // cache. The only missing thing is to set the hierarchy level at which + // the template was found. + $this->resourceHierarchyLevels[$cacheKey][$blockName] = $hierarchyLevel; + + return true; + } + + if ($hierarchyLevel > 0) { + $parentLevel = $hierarchyLevel - 1; + $parentBlockName = $blockNameHierarchy[$parentLevel]; + + // The next two if statements contain slightly duplicated code. This is by intention + // and tries to avoid execution of unnecessary checks in order to increase performance. + + if (isset($this->resources[$cacheKey][$parentBlockName])) { + // It may happen that the parent block is already loaded, but its level is not. + // In this case, the parent block must have been loaded by loadResourceForBlock(), + // which does not check the hierarchy of the block. Subsequently the block must have + // been found directly on the parent level. + if (!isset($this->resourceHierarchyLevels[$cacheKey][$parentBlockName])) { + $this->resourceHierarchyLevels[$cacheKey][$parentBlockName] = $parentLevel; + } + + // Cache the shortcuts for further accesses + $this->resources[$cacheKey][$blockName] = $this->resources[$cacheKey][$parentBlockName]; + $this->resourceHierarchyLevels[$cacheKey][$blockName] = $this->resourceHierarchyLevels[$cacheKey][$parentBlockName]; + + return true; + } + + if ($this->loadResourceForBlockNameHierarchy($cacheKey, $view, $blockNameHierarchy, $parentLevel)) { + // Cache the shortcuts for further accesses + $this->resources[$cacheKey][$blockName] = $this->resources[$cacheKey][$parentBlockName]; + $this->resourceHierarchyLevels[$cacheKey][$blockName] = $this->resourceHierarchyLevels[$cacheKey][$parentBlockName]; + + return true; + } + } + + // Cache the result for further accesses + $this->resources[$cacheKey][$blockName] = false; + $this->resourceHierarchyLevels[$cacheKey][$blockName] = false; + + return false; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/AbstractType.php b/vendor/symfony/form/Symfony/Component/Form/AbstractType.php new file mode 100755 index 0000000000..67919632c2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/AbstractType.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +abstract class AbstractType implements FormTypeInterface +{ + /** + * @var array + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + private $extensions = array(); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults($this->getDefaultOptions(array())); + $resolver->addAllowedValues($this->getAllowedOptionValues(array())); + } + + /** + * Returns the default options for this type. + * + * @param array $options Unsupported as of Symfony 2.1. + * + * @return array The default options + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link setDefaultOptions()} instead. + */ + public function getDefaultOptions(array $options) + { + return array(); + } + + /** + * Returns the allowed option values for each option (if any). + * + * @param array $options Unsupported as of Symfony 2.1. + * + * @return array The allowed option values + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link setDefaultOptions()} instead. + */ + public function getAllowedOptionValues(array $options) + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'form'; + } + + /** + * Sets the extensions for this type. + * + * @param array $extensions An array of FormTypeExtensionInterface + * + * @throws Exception\UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function setExtensions(array $extensions) + { + $this->extensions = $extensions; + } + + /** + * Returns the extensions associated with this type. + * + * @return array An array of FormTypeExtensionInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link ResolvedFormTypeInterface::getTypeExtensions()} instead. + */ + public function getExtensions() + { + return $this->extensions; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/AbstractTypeExtension.php b/vendor/symfony/form/Symfony/Component/Form/AbstractTypeExtension.php new file mode 100755 index 0000000000..080b546b2d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/AbstractTypeExtension.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +abstract class AbstractTypeExtension implements FormTypeExtensionInterface +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults($this->getDefaultOptions()); + $resolver->addAllowedValues($this->getAllowedOptionValues()); + } + + /** + * Overrides the default options form the extended type. + * + * @return array + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link setDefaultOptions()} instead. + */ + public function getDefaultOptions() + { + return array(); + } + + /** + * Returns the allowed option values for each option (if any). + * + * @return array The allowed option values + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link setDefaultOptions()} instead. + */ + public function getAllowedOptionValues() + { + return array(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/CHANGELOG.md b/vendor/symfony/form/Symfony/Component/Form/CHANGELOG.md new file mode 100755 index 0000000000..d8c4589db2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/CHANGELOG.md @@ -0,0 +1,180 @@ +CHANGELOG +========= + +2.1.0 +----- + + * [BC BREAK] ``read_only`` field attribute now renders as ``readonly="readonly"``, use ``disabled`` instead + * [BC BREAK] child forms now aren't validated anymore by default + * made validation of form children configurable (new option: cascade_validation) + * added support for validation groups as callbacks + * made the translation catalogue configurable via the "translation_domain" option + * added Form::getErrorsAsString() to help debugging forms + * allowed setting different options for RepeatedType fields (like the label) + * added support for empty form name at root level, this enables rendering forms + without form name prefix in field names + * [BC BREAK] form and field names must start with a letter, digit or underscore + and only contain letters, digits, underscores, hyphens and colons + * [BC BREAK] changed default name of the prototype in the "collection" type + from "$$name$$" to "\__name\__". No dollars are appended/prepended to custom + names anymore. + * [BC BREAK] improved ChoiceListInterface + * [BC BREAK] added SimpleChoiceList and LazyChoiceList as replacement of + ArrayChoiceList + * added ChoiceList and ObjectChoiceList to use objects as choices + * [BC BREAK] removed EntitiesToArrayTransformer and EntityToIdTransformer. + The former has been replaced by CollectionToArrayTransformer in combination + with EntityChoiceList, the latter is not required in the core anymore. + * [BC BREAK] renamed + * ArrayToBooleanChoicesTransformer to ChoicesToBooleanArrayTransformer + * ScalarToBooleanChoicesTransformer to ChoiceToBooleanArrayTransformer + * ArrayToChoicesTransformer to ChoicesToValuesTransformer + * ScalarToChoiceTransformer to ChoiceToValueTransformer + to be consistent with the naming in ChoiceListInterface. + They were merged into ChoiceList and have no public equivalent anymore. + * choice fields now throw a FormException if neither the "choices" nor the + "choice_list" option is set + * the radio type is now a child of the checkbox type + * the collection, choice (with multiple selection) and entity (with multiple + selection) types now make use of addXxx() and removeXxx() methods in your + model if you set "by_reference" to false. For a custom, non-recognized + singular form, set the "property_path" option like this: "plural|singular" + * forms now don't create an empty object anymore if they are completely + empty and not required. The empty value for such forms is null. + * added constant Guess::VERY_HIGH_CONFIDENCE + * [BC BREAK] The methods `add`, `remove`, `setParent`, `bind` and `setData` + in class Form now throw an exception if the form is already bound + * fields of constrained classes without a NotBlank or NotNull constraint are + set to not required now, as stated in the docs + * fixed TimeType and DateTimeType to not display seconds when "widget" is + "single_text" unless "with_seconds" is set to true + * checkboxes of in an expanded multiple-choice field don't include the choice + in their name anymore. Their names terminate with "[]" now. + * deprecated FormValidatorInterface and substituted its implementations + by event subscribers + * simplified CSRF protection and removed the csrf type + * deprecated FieldType and merged it into FormType + * added new option "compound" that lets you switch between field and form behavior + * [BC BREAK] renamed theme blocks + * "field_*" to "form_*" + * "field_widget" to "form_widget_simple" + * "widget_choice_options" to "choice_widget_options" + * "generic_label" to "form_label" + * added theme blocks "form_widget_compound", "choice_widget_expanded" and + "choice_widget_collapsed" to make theming more modular + * ValidatorTypeGuesser now guesses "collection" for array type constraint + * added method `guessPattern` to FormTypeGuesserInterface to guess which pattern to use in the HTML5 attribute "pattern" + * deprecated method `guessMinLength` in favor of `guessPattern` + * labels don't display field attributes anymore. Label attributes can be + passed in the "label_attr" option/variable + * added option "mapped" which should be used instead of setting "property_path" to false + * [BC BREAK] "data_class" now *must* be set if a form maps to an object and should be left empty otherwise + * improved error mapping on forms + * dot (".") rules are now allowed to map errors assigned to a form to + one of its children + * errors are not mapped to unsynchronized forms anymore + * [BC BREAK] changed Form constructor to accept a single `FormConfigInterface` object + * [BC BREAK] changed argument order in the FormBuilder constructor + * added Form method `getViewData` + * deprecated Form methods + * `getTypes` + * `getErrorBubbling` + * `getNormTransformers` + * `getClientTransformers` + * `getAttribute` + * `hasAttribute` + * `getClientData` + * added FormBuilder methods + * `getTypes` + * `addViewTransformer` + * `getViewTransformers` + * `resetViewTransformers` + * `addModelTransformer` + * `getModelTransformers` + * `resetModelTransformers` + * deprecated FormBuilder methods + * `prependClientTransformer` + * `appendClientTransformer` + * `getClientTransformers` + * `resetClientTransformers` + * `prependNormTransformer` + * `appendNormTransformer` + * `getNormTransformers` + * `resetNormTransformers` + * deprecated the option "validation_constraint" in favor of the new + option "constraints" + * removed superfluous methods from DataMapperInterface + * `mapFormToData` + * `mapDataToForm` + * added `setDefaultOptions` to FormTypeInterface and FormTypeExtensionInterface + which accepts an OptionsResolverInterface instance + * deprecated the methods `getDefaultOptions` and `getAllowedOptionValues` + in FormTypeInterface and FormTypeExtensionInterface + * options passed during construction can now be accessed from FormConfigInterface + * added FormBuilderInterface and FormConfigEditorInterface + * [BC BREAK] the method `buildForm` in FormTypeInterface and FormTypeExtensionInterface + now receives a FormBuilderInterface instead of a FormBuilder instance + * [BC BREAK] the method `buildViewBottomUp` was renamed to `finishView` in + FormTypeInterface and FormTypeExtensionInterface + * [BC BREAK] the options array is now passed as last argument of the + methods + * `buildView` + * `finishView` + in FormTypeInterface and FormTypeExtensionInterface + * [BC BREAK] no options are passed to `getParent` of FormTypeInterface anymore + * deprecated DataEvent and FilterDataEvent in favor of the new FormEvent which is + now passed to all events thrown by the component + * FormEvents::BIND now replaces FormEvents::BIND_NORM_DATA + * FormEvents::PRE_SET_DATA now replaces FormEvents::SET_DATA + * FormEvents::PRE_BIND now replaces FormEvents::BIND_CLIENT_DATA + * deprecated FormEvents::SET_DATA, FormEvents::BIND_CLIENT_DATA and + FormEvents::BIND_NORM_DATA + * [BC BREAK] reversed the order of the first two arguments to `createNamed` + and `createNamedBuilder` in `FormFactoryInterface` + * deprecated `getChildren` in Form and FormBuilder in favor of `all` + * deprecated `hasChildren` in Form and FormBuilder in favor of `count` + * FormBuilder now implements \IteratorAggregate + * [BC BREAK] compound forms now always need a data mapper + * FormBuilder now maintains the order when explicitly adding form builders as children + * ChoiceType now doesn't add the empty value anymore if the choices already contain an empty element + * DateType, TimeType and DateTimeType now show empty values again if not required + * [BC BREAK] fixed rendering of errors for DateType, BirthdayType and similar ones + * [BC BREAK] fixed: form constraints are only validated if they belong to the validated group + * deprecated `bindRequest` in `Form` and replaced it by a listener to FormEvents::PRE_BIND + * fixed: the "data" option supersedes default values from the model + * changed DateType to refer to the "format" option for calculating the year and day choices instead + of padding them automatically + * [BC BREAK] DateType defaults to the format "yyyy-MM-dd" now if the widget is + "single_text", in order to support the HTML 5 date field out of the box + * added the option "format" to DateTimeType + * [BC BREAK] DateTimeType now outputs RFC 3339 dates by default, as generated and + consumed by HTML5 browsers, if the widget is "single_text" + * deprecated the options "data_timezone" and "user_timezone" in DateType, DateTimeType and TimeType + and renamed them to "model_timezone" and "view_timezone" + * fixed: TransformationFailedExceptions thrown in the model transformer are now caught by the form + * added FormRegistryInterface, ResolvedFormTypeInterface and ResolvedFormTypeFactoryInterface + * deprecated FormFactory methods + * `addType` + * `hasType` + * `getType` + * [BC BREAK] FormFactory now expects a FormRegistryInterface and a ResolvedFormTypeFactoryInterface as constructor argument + * [BC BREAK] The method `createBuilder` in FormTypeInterface is not supported anymore for performance reasons + * [BC BREAK] Removed `setTypes` from FormBuilder + * deprecated AbstractType methods + * `getExtensions` + * `setExtensions` + * ChoiceType now caches its created choice lists to improve performance + * [BC BREAK] Rows of a collection field cannot be themed individually anymore. All rows in the collection + field now have the same block names, which contains "entry" where it previously contained the row index. + * [BC BREAK] When registering a type through the DI extension, the tag alias has to match the actual type name. + * added FormRendererInterface, FormRendererEngineInterface and implementations of these interfaces + * [BC BREAK] removed the following methods from FormUtil: + * `toArrayKey` + * `toArrayKeys` + * `isChoiceGroup` + * `isChoiceSelected` + * [BC BREAK] renamed method `renderBlock` in FormHelper to `block` and changed its signature + * made FormView properties public and deprecated their accessor methods + * made the normalized data of a form accessible in the template through the variable "form.vars.data" + * made the original data of a choice accessible in the template through the property "choice.data" + * added convenience class Forms and FormFactoryBuilderInterface diff --git a/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php b/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php new file mode 100755 index 0000000000..1dfe890027 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +class CallbackTransformer implements DataTransformerInterface +{ + /** + * The callback used for forward transform + * @var \Closure + */ + private $transform; + + /** + * The callback used for reverse transform + * @var \Closure + */ + private $reverseTransform; + + /** + * Constructor. + * + * @param \Closure $transform The forward transform callback + * @param \Closure $reverseTransform The reverse transform callback + */ + public function __construct(\Closure $transform, \Closure $reverseTransform) + { + $this->transform = $transform; + $this->reverseTransform = $reverseTransform; + } + + /** + * Transforms a value from the original representation to a transformed representation. + * + * @param mixed $data The value in the original representation + * + * @return mixed The value in the transformed representation + * + * @throws UnexpectedTypeException when the argument is not a string + * @throws TransformationFailedException when the transformation fails + */ + public function transform($data) + { + return call_user_func($this->transform, $data); + } + + /** + * Transforms a value from the transformed representation to its original + * representation. + * + * @param mixed $data The value in the transformed representation + * + * @return mixed The value in the original representation + * + * @throws UnexpectedTypeException when the argument is not of the expected type + * @throws TransformationFailedException when the transformation fails + */ + public function reverseTransform($data) + { + return call_user_func($this->reverseTransform, $data); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/CallbackValidator.php b/vendor/symfony/form/Symfony/Component/Form/CallbackValidator.php new file mode 100755 index 0000000000..6d677c11f0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/CallbackValidator.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Deprecated. You should use FormEvents::POST_BIND event listeners instead. + * + * @author Bernhard Schussek + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ +class CallbackValidator implements FormValidatorInterface +{ + private $callback; + + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function __construct($callback) + { + $this->callback = $callback; + } + + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function validate(FormInterface $form) + { + return call_user_func($this->callback, $form); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/DataMapperInterface.php b/vendor/symfony/form/Symfony/Component/Form/DataMapperInterface.php new file mode 100755 index 0000000000..a574cbc8de --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/DataMapperInterface.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +interface DataMapperInterface +{ + /** + * Maps properties of some data to a list of forms. + * + * @param mixed $data Structured data. + * @param array $forms A list of {@link FormInterface} instances. + * + * @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported. + */ + public function mapDataToForms($data, array $forms); + + /** + * Maps the data of a list of forms into the properties of some data. + * + * @param array $forms A list of {@link FormInterface} instances. + * @param mixed $data Structured data. + * + * @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported. + */ + public function mapFormsToData(array $forms, &$data); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/DataTransformerInterface.php b/vendor/symfony/form/Symfony/Component/Form/DataTransformerInterface.php new file mode 100755 index 0000000000..07183d54b3 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/DataTransformerInterface.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Transforms a value between different representations. + * + * @author Bernhard Schussek + */ +interface DataTransformerInterface +{ + /** + * Transforms a value from the original representation to a transformed representation. + * + * This method is called on two occasions inside a form field: + * + * 1. When the form field is initialized with the data attached from the datasource (object or array). + * 2. When data from a request is bound using {@link Form::bind()} to transform the new input data + * back into the renderable format. For example if you have a date field and bind '2009-10-10' onto + * it you might accept this value because its easily parsed, but the transformer still writes back + * "2009/10/10" onto the form field (for further displaying or other purposes). + * + * This method must be able to deal with empty values. Usually this will + * be NULL, but depending on your implementation other empty values are + * possible as well (such as empty strings). The reasoning behind this is + * that value transformers must be chainable. If the transform() method + * of the first value transformer outputs NULL, the second value transformer + * must be able to process that value. + * + * By convention, transform() should return an empty string if NULL is + * passed. + * + * @param mixed $value The value in the original representation + * + * @return mixed The value in the transformed representation + * + * @throws UnexpectedTypeException when the argument is not a string + * @throws TransformationFailedException when the transformation fails + */ + public function transform($value); + + /** + * Transforms a value from the transformed representation to its original + * representation. + * + * This method is called when {@link Form::bind()} is called to transform the requests tainted data + * into an acceptable format for your data processing/model layer. + * + * This method must be able to deal with empty values. Usually this will + * be an empty string, but depending on your implementation other empty + * values are possible as well (such as empty strings). The reasoning behind + * this is that value transformers must be chainable. If the + * reverseTransform() method of the first value transformer outputs an + * empty string, the second value transformer must be able to process that + * value. + * + * By convention, reverseTransform() should return NULL if an empty string + * is passed. + * + * @param mixed $value The value in the transformed representation + * + * @return mixed The value in the original representation + * + * @throws UnexpectedTypeException when the argument is not of the expected type + * @throws TransformationFailedException when the transformation fails + */ + public function reverseTransform($value); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Event/DataEvent.php b/vendor/symfony/form/Symfony/Component/Form/Event/DataEvent.php new file mode 100755 index 0000000000..1091b5ccf2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Event/DataEvent.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Event; + +use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\Form\FormInterface; + +/** + * @author Bernhard Schussek + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against + * {@link \Symfony\Component\Form\FormEvent} instead. + */ +class DataEvent extends Event +{ + private $form; + protected $data; + + /** + * Constructs an event. + * + * @param FormInterface $form The associated form + * @param mixed $data The data + */ + public function __construct(FormInterface $form, $data) + { + $this->form = $form; + $this->data = $data; + } + + /** + * Returns the form at the source of the event. + * + * @return FormInterface + */ + public function getForm() + { + return $this->form; + } + + /** + * Returns the data associated with this event. + * + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * Allows updating with some filtered data. + * + * @param mixed $data + */ + public function setData($data) + { + $this->data = $data; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Event/FilterDataEvent.php b/vendor/symfony/form/Symfony/Component/Form/Event/FilterDataEvent.php new file mode 100755 index 0000000000..d20f483c69 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Event/FilterDataEvent.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Event; + +/** + * @author Bernhard Schussek + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against + * {@link \Symfony\Component\Form\FormEvent} instead. + */ +class FilterDataEvent extends DataEvent +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/AlreadyBoundException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/AlreadyBoundException.php new file mode 100755 index 0000000000..c08d8cf732 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/AlreadyBoundException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class AlreadyBoundException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/CreationException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/CreationException.php new file mode 100755 index 0000000000..91caa0fd59 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/CreationException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +/** + * Thrown when a form could not be constructed by a FormFactory + * + * @author Bernhard Schussek + */ +class CreationException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/ErrorMappingException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/ErrorMappingException.php new file mode 100755 index 0000000000..2283b0f775 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/ErrorMappingException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class ErrorMappingException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/FormException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/FormException.php new file mode 100755 index 0000000000..5dd0884d8b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/FormException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class FormException extends \Exception +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidConfigurationException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidConfigurationException.php new file mode 100755 index 0000000000..9804f4b433 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidConfigurationException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class InvalidConfigurationException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyException.php new file mode 100755 index 0000000000..4d9eee5599 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class InvalidPropertyException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyPathException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyPathException.php new file mode 100755 index 0000000000..e2a6a84183 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/InvalidPropertyPathException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class InvalidPropertyPathException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/NotInitializedException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/NotInitializedException.php new file mode 100755 index 0000000000..62fea232c1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/NotInitializedException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class NotInitializedException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/NotValidException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/NotValidException.php new file mode 100755 index 0000000000..2b3cc00854 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/NotValidException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class NotValidException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/PropertyAccessDeniedException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/PropertyAccessDeniedException.php new file mode 100755 index 0000000000..a89e9583be --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/PropertyAccessDeniedException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class PropertyAccessDeniedException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/StringCastException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/StringCastException.php new file mode 100755 index 0000000000..ff882ae8f6 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/StringCastException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class StringCastException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/TransformationFailedException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/TransformationFailedException.php new file mode 100755 index 0000000000..73e0b7b2ee --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/TransformationFailedException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +/** + * Indicates a value transformation error. + * + * @author Bernhard Schussek + */ +class TransformationFailedException extends \RuntimeException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/TypeDefinitionException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/TypeDefinitionException.php new file mode 100755 index 0000000000..ece48004c7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/TypeDefinitionException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +/** + * Thrown when a form type is configured incorrectly + * + * @author Bernhard Schussek + */ +class TypeDefinitionException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/TypeLoaderException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/TypeLoaderException.php new file mode 100755 index 0000000000..0c70bb2eb2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/TypeLoaderException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class TypeLoaderException extends FormException +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Exception/UnexpectedTypeException.php b/vendor/symfony/form/Symfony/Component/Form/Exception/UnexpectedTypeException.php new file mode 100755 index 0000000000..ef898fd349 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Exception/UnexpectedTypeException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Exception; + +class UnexpectedTypeException extends FormException +{ + public function __construct($value, $expectedType) + { + parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value))); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php new file mode 100755 index 0000000000..4fbca4b451 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php @@ -0,0 +1,509 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\ChoiceList; + +use Symfony\Component\Form\FormConfigBuilder; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Exception\InvalidConfigurationException; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +/** + * A choice list for choices of arbitrary data types. + * + * Choices and labels are passed in two arrays. The indices of the choices + * and the labels should match. Choices may also be given as hierarchy of + * unlimited depth by creating nested arrays. The title of the sub-hierarchy + * can be stored in the array key pointing to the nested array. The topmost + * level of the hierarchy may also be a \Traversable. + * + * + * $choices = array(true, false); + * $labels = array('Agree', 'Disagree'); + * $choiceList = new ChoiceList($choices, $labels); + * + * + * @author Bernhard Schussek + */ +class ChoiceList implements ChoiceListInterface +{ + /** + * The choices with their indices as keys. + * + * @var array + */ + private $choices = array(); + + /** + * The choice values with the indices of the matching choices as keys. + * + * @var array + */ + private $values = array(); + + /** + * The preferred view objects as hierarchy containing also the choice groups + * with the indices of the matching choices as bottom-level keys. + * + * @var array + */ + private $preferredViews = array(); + + /** + * The non-preferred view objects as hierarchy containing also the choice + * groups with the indices of the matching choices as bottom-level keys. + * + * @var array + */ + private $remainingViews = array(); + + /** + * Creates a new choice list. + * + * @param array|\Traversable $choices The array of choices. Choices may also be given + * as hierarchy of unlimited depth. Hierarchies are + * created by creating nested arrays. The title of + * the sub-hierarchy can be stored in the array + * key pointing to the nested array. The topmost + * 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 + * presented to the user with priority. + * + * @throws UnexpectedTypeException If the choices are not an array or \Traversable. + */ + public function __construct($choices, array $labels, array $preferredChoices = array()) + { + if (!is_array($choices) && !$choices instanceof \Traversable) { + throw new UnexpectedTypeException($choices, 'array or \Traversable'); + } + + $this->initialize($choices, $labels, $preferredChoices); + } + + /** + * Initializes the list with choices. + * + * Safe to be called multiple times. The list is cleared on every call. + * + * @param array|\Traversable $choices The choices to write into the list. + * @param array $labels The labels belonging to the choices. + * @param array $preferredChoices The choices to display with priority. + */ + protected function initialize($choices, array $labels, array $preferredChoices) + { + $this->choices = array(); + $this->values = array(); + $this->preferredViews = array(); + $this->remainingViews = array(); + + $this->addChoices( + $this->preferredViews, + $this->remainingViews, + $choices, + $labels, + $preferredChoices + ); + } + + /** + * {@inheritdoc} + */ + public function getChoices() + { + return $this->choices; + } + + /** + * {@inheritdoc} + */ + public function getValues() + { + return $this->values; + } + + /** + * {@inheritdoc} + */ + public function getPreferredViews() + { + return $this->preferredViews; + } + + /** + * {@inheritdoc} + */ + public function getRemainingViews() + { + return $this->remainingViews; + } + + /** + * {@inheritdoc} + */ + public function getChoicesForValues(array $values) + { + $values = $this->fixValues($values); + $choices = array(); + + foreach ($values as $j => $givenValue) { + foreach ($this->values as $i => $value) { + if ($value === $givenValue) { + $choices[] = $this->choices[$i]; + unset($values[$j]); + + if (0 === count($values)) { + break 2; + } + } + } + } + + return $choices; + } + + /** + * {@inheritdoc} + */ + public function getValuesForChoices(array $choices) + { + $choices = $this->fixChoices($choices); + $values = array(); + + foreach ($this->choices as $i => $choice) { + foreach ($choices as $j => $givenChoice) { + if ($choice === $givenChoice) { + $values[] = $this->values[$i]; + unset($choices[$j]); + + if (0 === count($choices)) { + break 2; + } + } + } + } + + return $values; + } + + /** + * {@inheritdoc} + */ + public function getIndicesForChoices(array $choices) + { + $choices = $this->fixChoices($choices); + $indices = array(); + + foreach ($this->choices as $i => $choice) { + foreach ($choices as $j => $givenChoice) { + if ($choice === $givenChoice) { + $indices[] = $i; + unset($choices[$j]); + + if (0 === count($choices)) { + break 2; + } + } + } + } + + return $indices; + } + + /** + * {@inheritdoc} + */ + public function getIndicesForValues(array $values) + { + $values = $this->fixValues($values); + $indices = array(); + + foreach ($this->values as $i => $value) { + foreach ($values as $j => $givenValue) { + if ($value === $givenValue) { + $indices[] = $i; + unset($values[$j]); + + if (0 === count($values)) { + break 2; + } + } + } + } + + return $indices; + } + + /** + * 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|\Traversable $choices The list of choices. + * @param array $labels The labels corresponding to the choices. + * @param array $preferredChoices The preferred choices. + * + * @throws \InvalidArgumentException If the structures of the choices and labels array do not match. + * @throws InvalidConfigurationException If no valid value or index could be created for a choice. + */ + protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, array $labels, array $preferredChoices) + { + // Add choices to the nested buckets + foreach ($choices as $group => $choice) { + if (!array_key_exists($group, $labels)) { + throw new \InvalidArgumentException('The structures of the choices and labels array do not match.'); + } + + if (is_array($choice)) { + // Don't do the work if the array is empty + if (count($choice) > 0) { + $this->addChoiceGroup( + $group, + $bucketForPreferred, + $bucketForRemaining, + $choice, + $labels[$group], + $preferredChoices + ); + } + } else { + $this->addChoice( + $bucketForPreferred, + $bucketForRemaining, + $choice, + $labels[$group], + $preferredChoices + ); + } + } + } + + /** + * 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 $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. + * + * @throws InvalidConfigurationException If no valid value or index could be created for a choice. + */ + protected function addChoiceGroup($group, array &$bucketForPreferred, array &$bucketForRemaining, array $choices, array $labels, array $preferredChoices) + { + // If this is a choice group, create a new level in the choice + // key hierarchy + $bucketForPreferred[$group] = array(); + $bucketForRemaining[$group] = array(); + + $this->addChoices( + $bucketForPreferred[$group], + $bucketForRemaining[$group], + $choices, + $labels, + $preferredChoices + ); + + // Remove child levels if empty + if (empty($bucketForPreferred[$group])) { + unset($bucketForPreferred[$group]); + } + if (empty($bucketForRemaining[$group])) { + unset($bucketForRemaining[$group]); + } + } + + /** + * 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 mixed $choice The choice to add. + * @param string $label The label for the choice. + * @param array $preferredChoices The preferred choices. + * + * @throws InvalidConfigurationException If no valid value or index could be created. + */ + protected function addChoice(array &$bucketForPreferred, array &$bucketForRemaining, $choice, $label, array $preferredChoices) + { + $index = $this->createIndex($choice); + + if ('' === $index || null === $index || !FormConfigBuilder::isValidName((string) $index)) { + throw new InvalidConfigurationException('The index "' . $index . '" created by the choice list is invalid. It should be a valid, non-empty Form name.'); + } + + $value = $this->createValue($choice); + + if (!is_string($value)) { + throw new InvalidConfigurationException('The value created by the choice list is of type "' . gettype($value) . '", but should be a string.'); + } + + $view = new ChoiceView($choice, $value, $label); + + $this->choices[$index] = $this->fixChoice($choice); + $this->values[$index] = $value; + + if ($this->isPreferred($choice, $preferredChoices)) { + $bucketForPreferred[$index] = $view; + } else { + $bucketForRemaining[$index] = $view; + } + } + + /** + * Returns whether the given choice should be preferred judging by the + * given array of preferred choices. + * + * Extension point to optimize performance by changing the structure of the + * $preferredChoices array. + * + * @param mixed $choice The choice to test. + * @param array $preferredChoices An array of preferred choices. + * + * @return Boolean Whether the choice is preferred. + */ + protected function isPreferred($choice, array $preferredChoices) + { + return false !== array_search($choice, $preferredChoices, true); + } + + /** + * Creates a new unique index for this choice. + * + * Extension point to change the indexing strategy. + * + * @param mixed $choice The choice to create an index for + * + * @return integer|string A unique index containing only ASCII letters, + * digits and underscores. + */ + protected function createIndex($choice) + { + return count($this->choices); + } + + /** + * Creates a new unique value for this choice. + * + * By default, an integer is generated since it cannot be guaranteed that + * all values in the list are convertible to (unique) strings. Subclasses + * can override this behaviour if they can guarantee this property. + * + * @param mixed $choice The choice to create a value for + * + * @return string A unique string. + */ + protected function createValue($choice) + { + return (string) count($this->values); + } + + /** + * Fixes the data type of the given choice value to avoid comparison + * problems. + * + * @param mixed $value The choice value. + * + * @return string The value as string. + */ + protected function fixValue($value) + { + return (string) $value; + } + + /** + * Fixes the data types of the given choice values to avoid comparison + * problems. + * + * @param array $values The choice values. + * + * @return array The values as strings. + */ + protected function fixValues(array $values) + { + foreach ($values as $i => $value) { + $values[$i] = $this->fixValue($value); + } + + return $values; + } + + /** + * Fixes the data type of the given choice index to avoid comparison + * problems. + * + * @param mixed $index The choice index. + * + * @return integer|string The index as PHP array key. + */ + protected function fixIndex($index) + { + if (is_bool($index) || (string) (int) $index === (string) $index) { + return (int) $index; + } + + return (string) $index; + } + + /** + * Fixes the data types of the given choice indices to avoid comparison + * problems. + * + * @param array $indices The choice indices. + * + * @return array The indices as strings. + */ + protected function fixIndices(array $indices) + { + foreach ($indices as $i => $index) { + $indices[$i] = $this->fixIndex($index); + } + + return $indices; + } + + /** + * Fixes the data type of the given choice to avoid comparison problems. + * + * Extension point. In this implementation, choices are guaranteed to + * always maintain their type and thus can be typesafely compared. + * + * @param mixed $choice The choice. + * + * @return mixed The fixed choice. + */ + protected function fixChoice($choice) + { + return $choice; + } + + /** + * Fixes the data type of the given choices to avoid comparison problems. + * + * @param array $choices The choices. + * + * @return array The fixed choices. + * + * @see fixChoice + */ + protected function fixChoices(array $choices) + { + return $choices; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php new file mode 100755 index 0000000000..c81c560f4f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\ChoiceList; + +/** + * Contains choices that can be selected in a form field. + * + * Each choice has three different properties: + * + * - Choice: The choice that should be returned to the application by the + * choice field. Can be any scalar value or an object, but no + * array. + * - Label: A text representing the choice that is displayed to the user. + * - Value: A uniquely identifying value that can contain arbitrary + * characters, but no arrays or objects. This value is displayed + * in the HTML "value" attribute. + * + * @author Bernhard Schussek + */ +interface ChoiceListInterface +{ + /** + * Returns the list of choices + * + * @return array The choices with their indices as keys. + */ + public function getChoices(); + + /** + * Returns the values for the choices + * + * @return array The values with the corresponding choice indices as keys. + */ + public function getValues(); + + /** + * Returns the choice views of the preferred choices as nested array with + * the choice groups as top-level keys. + * + * Example: + * + * + * array( + * 'Group 1' => array( + * 10 => ChoiceView object, + * 20 => ChoiceView object, + * ), + * 'Group 2' => array( + * 30 => ChoiceView object, + * ), + * ) + * + * + * @return array A nested array containing the views with the corresponding + * choice indices as keys on the lowest levels and the choice + * group names in the keys of the higher levels. + */ + public function getPreferredViews(); + + /** + * Returns the choice views of the choices that are not preferred as nested + * array with the choice groups as top-level keys. + * + * Example: + * + * + * array( + * 'Group 1' => array( + * 10 => ChoiceView object, + * 20 => ChoiceView object, + * ), + * 'Group 2' => array( + * 30 => ChoiceView object, + * ), + * ) + * + * + * @return array A nested array containing the views with the corresponding + * choice indices as keys on the lowest levels and the choice + * group names in the keys of the higher levels. + * + * @see getPreferredValues + */ + public function getRemainingViews(); + + /** + * Returns the choices corresponding to the given values. + * + * @param array $values An array of choice values. Not existing values in + * this array are ignored. + * + * @return array An array of choices with ascending, 0-based numeric keys + */ + public function getChoicesForValues(array $values); + + /** + * Returns the values corresponding to the given choices. + * + * @param array $choices An array of choices. Not existing choices in this + * array are ignored. + * + * @return array An array of choice values with ascending, 0-based numeric + * keys + */ + public function getValuesForChoices(array $choices); + + /** + * Returns the indices corresponding to the given choices. + * + * @param array $choices An array of choices. Not existing choices in this + * array are ignored. + * + * @return array An array of indices with ascending, 0-based numeric keys + */ + public function getIndicesForChoices(array $choices); + + /** + * Returns the indices corresponding to the given values. + * + * @param array $values An array of choice values. Not existing values in + * this array are ignored. + * + * @return array An array of indices with ascending, 0-based numeric keys + */ + public function getIndicesForValues(array $values); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php new file mode 100755 index 0000000000..d5f5cfd555 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php @@ -0,0 +1,149 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Exception\FormException; + +/** + * A choice list that is loaded lazily + * + * This list loads itself as soon as any of the getters is accessed for the + * first time. You should implement loadChoiceList() in your child classes, + * which should return a ChoiceListInterface instance. + * + * @author Bernhard Schussek + */ +abstract class LazyChoiceList implements ChoiceListInterface +{ + /** + * The loaded choice list + * + * @var ChoiceListInterface + */ + private $choiceList; + + /** + * {@inheritdoc} + */ + public function getChoices() + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getChoices(); + } + + /** + * {@inheritdoc} + */ + public function getValues() + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getValues(); + } + + /** + * {@inheritdoc} + */ + public function getPreferredViews() + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getPreferredViews(); + } + + /** + * {@inheritdoc} + */ + public function getRemainingViews() + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getRemainingViews(); + } + + /** + * {@inheritdoc} + */ + public function getChoicesForValues(array $values) + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getChoicesForValues($values); + } + + /** + * {@inheritdoc} + */ + public function getValuesForChoices(array $choices) + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getValuesForChoices($choices); + } + + /** + * {@inheritdoc} + */ + public function getIndicesForChoices(array $choices) + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getIndicesForChoices($choices); + } + + /** + * {@inheritdoc} + */ + public function getIndicesForValues(array $values) + { + if (!$this->choiceList) { + $this->load(); + } + + return $this->choiceList->getIndicesForValues($values); + } + + /** + * Loads the choice list + * + * Should be implemented by child classes. + * + * @return ChoiceListInterface The loaded choice list + */ + abstract protected function loadChoiceList(); + + private function load() + { + $choiceList = $this->loadChoiceList(); + + if (!$choiceList instanceof ChoiceListInterface) { + throw new FormException('loadChoiceList() should return a ChoiceListInterface instance. Got ' . gettype($choiceList)); + } + + $this->choiceList = $choiceList; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php new file mode 100755 index 0000000000..eeb6b646c3 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php @@ -0,0 +1,174 @@ + +* +* For the full copyright and license information, please view the LICENSE +* file that was distributed with this source code. +*/ + +namespace Symfony\Component\Form\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Exception\StringCastException; +use Symfony\Component\Form\Exception\InvalidPropertyException; + +/** + * A choice list for object choices. + * + * Supports generation of choice labels, choice groups and choice values + * by calling getters of the object (or associated objects). + * + * + * $choices = array($user1, $user2); + * + * // call getName() to determine the choice labels + * $choiceList = new ObjectChoiceList($choices, 'name'); + * + * + * @author Bernhard Schussek + */ +class ObjectChoiceList extends ChoiceList +{ + /** + * The property path used to obtain the choice label. + * + * @var PropertyPath + */ + private $labelPath; + + /** + * The property path used for object grouping. + * + * @var PropertyPath + */ + private $groupPath; + + /** + * The property path used to obtain the choice value. + * + * @var PropertyPath + */ + private $valuePath; + + /** + * Creates a new object choice list. + * + * @param array|\Traversable $choices The array of choices. Choices may also be given + * as hierarchy of unlimited depth by creating nested + * arrays. The title of the sub-hierarchy can be + * stored in the array key pointing to the nested + * array. The topmost level of the hierarchy may also + * be a \Traversable. + * @param string $labelPath A property path pointing to the property used + * for the choice labels. The value is obtained + * 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 + * presented to the user with priority. + * @param string $groupPath A property path pointing to the property used + * to group the choices. Only allowed if + * the choices are given as flat array. + * @param string $valuePath A property path pointing to the property used + * for the choice values. If not given, integers + * are generated instead. + */ + public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null) + { + $this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null; + $this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null; + $this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null; + + parent::__construct($choices, array(), $preferredChoices); + } + + /** + * Initializes the list with choices. + * + * Safe to be called multiple times. The list is cleared on every call. + * + * @param array|\Traversable $choices The choices to write into the list. + * @param array $labels Ignored. + * @param array $preferredChoices The choices to display with priority. + * + * @throws \InvalidArgumentException When passing a hierarchy of choices and using + * the "groupPath" option at the same time. + */ + protected function initialize($choices, array $labels, array $preferredChoices) + { + if (null !== $this->groupPath) { + $groupedChoices = array(); + + foreach ($choices as $i => $choice) { + if (is_array($choice)) { + throw new \InvalidArgumentException('You should pass a plain object array (without groups) when using the "groupPath" option.'); + } + + try { + $group = $this->groupPath->getValue($choice); + } catch (InvalidPropertyException $e) { + // Don't group items whose group property does not exist + // see https://github.com/symfony/symfony/commit/d9b7abb7c7a0f28e0ce970afc5e305dce5dccddf + $group = null; + } + + if (null === $group) { + $groupedChoices[$i] = $choice; + } else { + if (!isset($groupedChoices[$group])) { + $groupedChoices[$group] = array(); + } + + $groupedChoices[$group][$i] = $choice; + } + } + + $choices = $groupedChoices; + } + + $labels = array(); + + $this->extractLabels($choices, $labels); + + parent::initialize($choices, $labels, $preferredChoices); + } + + /** + * Creates a new unique value for this choice. + * + * If a property path for the value was given at object creation, + * the getter behind that path is now called to obtain a new value. + * Otherwise a new integer is generated. + * + * @param mixed $choice The choice to create a value for + * + * @return integer|string A unique value without character limitations. + */ + protected function createValue($choice) + { + if ($this->valuePath) { + return (string) $this->valuePath->getValue($choice); + } + + return parent::createValue($choice); + } + + private function extractLabels($choices, array &$labels) + { + foreach ($choices as $i => $choice) { + if (is_array($choice)) { + $labels[$i] = array(); + $this->extractLabels($choice, $labels[$i]); + } elseif ($this->labelPath) { + $labels[$i] = $this->labelPath->getValue($choice); + } elseif (method_exists($choice, '__toString')) { + $labels[$i] = (string) $choice; + } else { + throw new StringCastException('A "__toString()" method was not found on the objects of type "' . get_class($choice) . '" passed to the choice field. To read a custom getter instead, set the argument $labelPath to the desired property path.'); + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php new file mode 100755 index 0000000000..914dbe5fdb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php @@ -0,0 +1,164 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\ChoiceList; + +/** + * A choice list for choices of type string or integer. + * + * Choices and their associated labels can be passed in a single array. Since + * choices are passed as array keys, only strings or integer choices are + * allowed. Choices may also be given as hierarchy of unlimited depth by + * creating nested arrays. The title of the sub-hierarchy can be stored in the + * array key pointing to the nested array. + * + * + * $choiceList = new SimpleChoiceList(array( + * 'creditcard' => 'Credit card payment', + * 'cash' => 'Cash payment', + * )); + * + * + * @author Bernhard Schussek + */ +class SimpleChoiceList extends ChoiceList +{ + /** + * Creates a new simple choice list. + * + * @param array $choices The array of choices with the choices as keys and + * the labels as values. Choices may also be given + * 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 + * presented to the user with priority. + */ + public function __construct(array $choices, array $preferredChoices = array()) + { + // Flip preferred choices to speed up lookup + parent::__construct($choices, $choices, array_flip($preferredChoices)); + } + + /** + * {@inheritdoc} + */ + public function getChoicesForValues(array $values) + { + $values = $this->fixValues($values); + + // The values are identical to the choices, so we can just return them + // to improve performance a little bit + return $this->fixChoices(array_intersect($values, $this->getValues())); + } + + /** + * {@inheritdoc} + */ + public function getValuesForChoices(array $choices) + { + $choices = $this->fixChoices($choices); + + // The choices are identical to the values, so we can just return them + // to improve performance a little bit + return $this->fixValues(array_intersect($choices, $this->getValues())); + } + + /** + * Recursively adds the given choices to the list. + * + * 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|\Traversable $choices The list of choices. + * @param array $labels Ignored. + * @param array $preferredChoices The preferred choices. + */ + protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, array $labels, array $preferredChoices) + { + // Add choices to the nested buckets + foreach ($choices as $choice => $label) { + if (is_array($label)) { + // Don't do the work if the array is empty + if (count($label) > 0) { + $this->addChoiceGroup( + $choice, + $bucketForPreferred, + $bucketForRemaining, + $label, + $label, + $preferredChoices + ); + } + } else { + $this->addChoice( + $bucketForPreferred, + $bucketForRemaining, + $choice, + $label, + $preferredChoices + ); + } + } + } + + /** + * Returns whether the given choice should be preferred judging by the + * given array of preferred choices. + * + * Optimized for performance by treating the preferred choices as array + * where choices are stored in the keys. + * + * @param mixed $choice The choice to test. + * @param array $preferredChoices An array of preferred choices. + * + * @return Boolean Whether the choice is preferred. + */ + protected function isPreferred($choice, array $preferredChoices) + { + // Optimize performance over the default implementation + return isset($preferredChoices[$choice]); + } + + /** + * Converts the choice to a valid PHP array key. + * + * @param mixed $choice The choice. + * + * @return string|integer A valid PHP array key. + */ + protected function fixChoice($choice) + { + return $this->fixIndex($choice); + } + + /** + * {@inheritdoc} + */ + protected function fixChoices(array $choices) + { + return $this->fixIndices($choices); + } + + /** + * {@inheritdoc} + */ + protected function createValue($choice) + { + // Choices are guaranteed to be unique and scalar, so we can simply + // convert them to strings + return (string) $choice; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/CoreExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/CoreExtension.php new file mode 100755 index 0000000000..f0f0d181da --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/CoreExtension.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core; + +use Symfony\Component\Form\AbstractExtension; + +/** + * Represents the main form extension, which loads the core functionality. + * + * @author Bernhard Schussek + */ +class CoreExtension extends AbstractExtension +{ + protected function loadTypes() + { + return array( + new Type\FieldType(), + new Type\FormType(), + new Type\BirthdayType(), + new Type\CheckboxType(), + new Type\ChoiceType(), + new Type\CollectionType(), + new Type\CountryType(), + new Type\DateType(), + new Type\DateTimeType(), + new Type\EmailType(), + new Type\HiddenType(), + new Type\IntegerType(), + new Type\LanguageType(), + new Type\LocaleType(), + new Type\MoneyType(), + new Type\NumberType(), + new Type\PasswordType(), + new Type\PercentType(), + new Type\RadioType(), + new Type\RepeatedType(), + new Type\SearchType(), + new Type\TextareaType(), + new Type\TextType(), + new Type\TimeType(), + new Type\TimezoneType(), + new Type\UrlType(), + new Type\FileType(), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php new file mode 100755 index 0000000000..ce850eaac7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataMapper; + +use Symfony\Component\Form\DataMapperInterface; +use Symfony\Component\Form\Util\VirtualFormAwareIterator; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +class PropertyPathMapper implements DataMapperInterface +{ + /** + * {@inheritdoc} + */ + public function mapDataToForms($data, array $forms) + { + if (null === $data || array() === $data) { + return; + } + + if (!is_array($data) && !is_object($data)) { + throw new UnexpectedTypeException($data, 'object, array or empty'); + } + + $iterator = new VirtualFormAwareIterator($forms); + $iterator = new \RecursiveIteratorIterator($iterator); + + foreach ($iterator as $form) { + /* @var FormInterface $form */ + $propertyPath = $form->getPropertyPath(); + $config = $form->getConfig(); + + if (null !== $propertyPath && $config->getMapped()) { + $form->setData($propertyPath->getValue($data)); + } + } + } + + /** + * {@inheritdoc} + */ + public function mapFormsToData(array $forms, &$data) + { + if (null === $data) { + return; + } + + if (!is_array($data) && !is_object($data)) { + throw new UnexpectedTypeException($data, 'object, array or empty'); + } + + $iterator = new VirtualFormAwareIterator($forms); + $iterator = new \RecursiveIteratorIterator($iterator); + + foreach ($iterator as $form) { + /* @var FormInterface $form */ + $propertyPath = $form->getPropertyPath(); + $config = $form->getConfig(); + + // Write-back is disabled if the form is not synchronized (transformation failed) + // and if the form is disabled (modification not allowed) + if (null !== $propertyPath && $config->getMapped() && $form->isSynchronized() && !$form->isDisabled()) { + // If the data is identical to the value in $data, we are + // dealing with a reference + if (!is_object($data) || !$config->getByReference() || $form->getData() !== $propertyPath->getValue($data)) { + $propertyPath->setValue($data, $form->getData()); + } + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php new file mode 100755 index 0000000000..da5737037f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class ArrayToPartsTransformer implements DataTransformerInterface +{ + private $partMapping; + + public function __construct(array $partMapping) + { + $this->partMapping = $partMapping; + } + + public function transform($array) + { + if (null === $array) { + $array = array(); + } + + if (!is_array($array) ) { + throw new UnexpectedTypeException($array, 'array'); + } + + $result = array(); + + foreach ($this->partMapping as $partKey => $originalKeys) { + if (empty($array)) { + $result[$partKey] = null; + } else { + $result[$partKey] = array_intersect_key($array, array_flip($originalKeys)); + } + } + + return $result; + } + + public function reverseTransform($array) + { + if (!is_array($array) ) { + throw new UnexpectedTypeException($array, 'array'); + } + + $result = array(); + $emptyKeys = array(); + + foreach ($this->partMapping as $partKey => $originalKeys) { + if (!empty($array[$partKey])) { + foreach ($originalKeys as $originalKey) { + if (isset($array[$partKey][$originalKey])) { + $result[$originalKey] = $array[$partKey][$originalKey]; + } + } + } else { + $emptyKeys[] = $partKey; + } + } + + if (count($emptyKeys) > 0) { + if (count($emptyKeys) === count($this->partMapping)) { + // All parts empty + return null; + } + + throw new TransformationFailedException( + sprintf('The keys "%s" should not be empty', implode('", "', $emptyKeys) + )); + } + + return $result; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php new file mode 100755 index 0000000000..e4e8932ee9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +abstract class BaseDateTimeTransformer implements DataTransformerInterface +{ + protected static $formats = array( + \IntlDateFormatter::NONE, + \IntlDateFormatter::FULL, + \IntlDateFormatter::LONG, + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::SHORT, + ); + + protected $inputTimezone; + + protected $outputTimezone; + + /** + * Constructor. + * + * @param string $inputTimezone The name of the input timezone + * @param string $outputTimezone The name of the output timezone + * + * @throws UnexpectedTypeException if a timezone is not a string + */ + public function __construct($inputTimezone = null, $outputTimezone = null) + { + if (!is_string($inputTimezone) && null !== $inputTimezone) { + throw new UnexpectedTypeException($inputTimezone, 'string'); + } + + if (!is_string($outputTimezone) && null !== $outputTimezone) { + throw new UnexpectedTypeException($outputTimezone, 'string'); + } + + $this->inputTimezone = $inputTimezone ?: date_default_timezone_get(); + $this->outputTimezone = $outputTimezone ?: date_default_timezone_get(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php new file mode 100755 index 0000000000..e902d89e0c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a Boolean and a string. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +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 + */ + public function __construct($trueValue) + { + $this->trueValue = $trueValue; + } + + /** + * Transforms a Boolean into a string. + * + * @param Boolean $value Boolean value. + * + * @return string String value. + * + * @throws UnexpectedTypeException if the given value is not a Boolean + */ + public function transform($value) + { + if (null === $value) { + return null; + } + + if (!is_bool($value)) { + throw new UnexpectedTypeException($value, 'Boolean'); + } + + return true === $value ? $this->trueValue : null; + } + + /** + * Transforms a string into a Boolean. + * + * @param string $value String value. + * + * @return Boolean Boolean value. + * + * @throws UnexpectedTypeException if the given value is not a string + */ + public function reverseTransform($value) + { + if (null === $value) { + return false; + } + + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + return true; + } + +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php new file mode 100755 index 0000000000..7e6203c64d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class ChoiceToBooleanArrayTransformer implements DataTransformerInterface +{ + private $choiceList; + + /** + * Constructor. + * + * @param ChoiceListInterface $choiceList + */ + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + /** + * Transforms a single choice to a format appropriate for the nested + * checkboxes/radio buttons. + * + * The result is an array with the options as keys and true/false as values, + * 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. + * + * @return mixed An array + * + * @throws UnexpectedTypeException if the given value is not scalar + * @throws TransformationFailedException if the choices can not be retrieved + */ + public function transform($choice) + { + try { + $values = $this->choiceList->getValues(); + } catch (\Exception $e) { + throw new TransformationFailedException('Can not get the choice list', $e->getCode(), $e); + } + + $index = current($this->choiceList->getIndicesForChoices(array($choice))); + + foreach ($values as $i => $value) { + $values[$i] = $i === $index; + } + + return $values; + } + + /** + * Transforms a checkbox/radio button array to a single choice. + * + * The input value is an array with the choices as keys and true/false as + * values, depending on whether a given choice is selected. The output + * is the selected choice. + * + * @param array $values An array of values + * + * @return mixed A scalar value + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if the recuperation of the choices fails or + * if some choice can't be found + */ + public function reverseTransform($values) + { + if (!is_array($values)) { + throw new UnexpectedTypeException($values, 'array'); + } + + try { + $choices = $this->choiceList->getChoices(); + } catch (\Exception $e) { + throw new TransformationFailedException('Can not get the choice list', $e->getCode(), $e); + } + + foreach ($values as $i => $selected) { + if ($selected) { + if (isset($choices[$i])) { + return $choices[$i] === '' ? null : $choices[$i]; + } else { + throw new TransformationFailedException('The choice "' . $i . '" does not exist'); + } + } + } + + return null; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php new file mode 100755 index 0000000000..dfab6ec454 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; + +/** + * @author Bernhard Schussek + */ +class ChoiceToValueTransformer implements DataTransformerInterface +{ + private $choiceList; + + /** + * Constructor. + * + * @param ChoiceListInterface $choiceList + */ + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + public function transform($choice) + { + return (string) current($this->choiceList->getValuesForChoices(array($choice))); + } + + public function reverseTransform($value) + { + if (null !== $value && !is_scalar($value)) { + throw new UnexpectedTypeException($value, 'scalar'); + } + + // These are now valid ChoiceList values, so we can return null + // right away + if ('' === $value || null === $value) { + return null; + } + + $choices = $this->choiceList->getChoicesForValues(array($value)); + + if (1 !== count($choices)) { + throw new TransformationFailedException('The choice "' . $value . '" does not exist or is not unique'); + } + + $choice = current($choices); + + return '' === $choice ? null : $choice; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php new file mode 100755 index 0000000000..9c3b6475d1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class ChoicesToBooleanArrayTransformer implements DataTransformerInterface +{ + private $choiceList; + + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + /** + * Transforms an array of choices to a format appropriate for the nested + * checkboxes/radio buttons. + * + * The result is an array with the options as keys and true/false as values, + * depending on whether a given option is selected. If this field is rendered + * as select tag, the value is not modified. + * + * @param mixed $array An array + * + * @return mixed An array + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if the choices can not be retrieved + */ + public function transform($array) + { + if (null === $array) { + return array(); + } + + if (!is_array($array)) { + throw new UnexpectedTypeException($array, 'array'); + } + + try { + $values = $this->choiceList->getValues(); + } catch (\Exception $e) { + throw new TransformationFailedException('Can not get the choice list', $e->getCode(), $e); + } + + $indexMap = array_flip($this->choiceList->getIndicesForChoices($array)); + + foreach ($values as $i => $value) { + $values[$i] = isset($indexMap[$i]); + } + + return $values; + } + + /** + * Transforms a checkbox/radio button array to an array of choices. + * + * The input value is an array with the choices as keys and true/false as + * values, depending on whether a given choice is selected. The output + * is an array with the selected choices. + * + * @param mixed $values An array + * + * @return mixed An array + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if the recuperation of the choices fails or + * if some choice can't be found + */ + public function reverseTransform($values) + { + if (!is_array($values)) { + throw new UnexpectedTypeException($values, 'array'); + } + + try { + $choices = $this->choiceList->getChoices(); + } catch (\Exception $e) { + throw new TransformationFailedException('Can not get the choice list', $e->getCode(), $e); + } + + $result = array(); + $unknown = array(); + + foreach ($values as $i => $selected) { + if ($selected) { + if (isset($choices[$i])) { + $result[] = $choices[$i]; + } else { + $unknown[] = $i; + } + } + } + + if (count($unknown) > 0) { + throw new TransformationFailedException('The choices "' . implode('", "', $unknown) . '" were not found'); + } + + return $result; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.php new file mode 100755 index 0000000000..e72fcf097e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ChoicesToValuesTransformer.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; + +/** + * @author Bernhard Schussek + */ +class ChoicesToValuesTransformer implements DataTransformerInterface +{ + private $choiceList; + + /** + * Constructor. + * + * @param ChoiceListInterface $choiceList + */ + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + /** + * @param array $array + * + * @return array + * + * @throws UnexpectedTypeException if the given value is not an array + */ + public function transform($array) + { + if (null === $array) { + return array(); + } + + if (!is_array($array)) { + throw new UnexpectedTypeException($array, 'array'); + } + + return $this->choiceList->getValuesForChoices($array); + } + + /** + * @param array $array + * + * @return array + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if could not find all matching choices for the given values + */ + public function reverseTransform($array) + { + if (null === $array) { + return array(); + } + + if (!is_array($array)) { + throw new UnexpectedTypeException($array, 'array'); + } + + $choices = $this->choiceList->getChoicesForValues($array); + + if (count($choices) !== count($array)) { + throw new TransformationFailedException('Could not find all matching choices for the given values'); + } + + return $choices; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DataTransformerChain.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DataTransformerChain.php new file mode 100755 index 0000000000..7d434434b9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DataTransformerChain.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; + +/** + * Passes a value through multiple value transformers + * + * @author Bernhard Schussek + */ +class DataTransformerChain implements DataTransformerInterface +{ + /** + * The value transformers + * @var array + */ + protected $transformers; + + /** + * Uses the given value transformers to transform values + * + * @param array $transformers + */ + public function __construct(array $transformers) + { + $this->transformers = $transformers; + } + + /** + * Passes the value through the transform() method of all nested transformers + * + * The transformers receive the value in the same order as they were passed + * to the constructor. Each transformer receives the result of the previous + * transformer as input. The output of the last transformer is returned + * by this method. + * + * @param mixed $value The original value + * + * @return mixed The transformed value + * + * @throws Symfony\Component\Form\Exception\TransformationFailedException + * @throws Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function transform($value) + { + foreach ($this->transformers as $transformer) { + $value = $transformer->transform($value); + } + + return $value; + } + + /** + * Passes the value through the reverseTransform() method of all nested + * transformers + * + * The transformers receive the value in the reverse order as they were passed + * to the constructor. Each transformer receives the result of the previous + * transformer as input. The output of the last transformer is returned + * by this method. + * + * @param mixed $value The transformed value + * + * @return mixed The reverse-transformed value + * + * @throws Symfony\Component\Form\Exception\TransformationFailedException + * @throws Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function reverseTransform($value) + { + for ($i = count($this->transformers) - 1; $i >= 0; --$i) { + $value = $this->transformers[$i]->reverseTransform($value); + } + + return $value; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php new file mode 100755 index 0000000000..873a596586 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php @@ -0,0 +1,182 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a normalized time and a localized time string/array. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class DateTimeToArrayTransformer extends BaseDateTimeTransformer +{ + private $pad; + + private $fields; + + /** + * Constructor. + * + * @param string $inputTimezone The input timezone + * @param string $outputTimezone The output timezone + * @param array $fields The date fields + * @param Boolean $pad Whether to use padding + * + * @throws UnexpectedTypeException if a timezone is not a string + */ + public function __construct($inputTimezone = null, $outputTimezone = null, array $fields = null, $pad = false) + { + parent::__construct($inputTimezone, $outputTimezone); + + if (null === $fields) { + $fields = array('year', 'month', 'day', 'hour', 'minute', 'second'); + } + + $this->fields = $fields; + $this->pad = (Boolean) $pad; + } + + /** + * Transforms a normalized date into a localized date. + * + * @param DateTime $dateTime Normalized date. + * + * @return array Localized date. + * + * @throws UnexpectedTypeException if the given value is not an instance of \DateTime + * @throws TransformationFailedException if the output timezone is not supported + */ + public function transform($dateTime) + { + if (null === $dateTime) { + return array_intersect_key(array( + 'year' => '', + 'month' => '', + 'day' => '', + 'hour' => '', + 'minute' => '', + 'second' => '', + ), array_flip($this->fields)); + } + + if (!$dateTime instanceof \DateTime) { + throw new UnexpectedTypeException($dateTime, '\DateTime'); + } + + $dateTime = clone $dateTime; + if ($this->inputTimezone !== $this->outputTimezone) { + try { + $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone)); + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + } + + $result = array_intersect_key(array( + 'year' => $dateTime->format('Y'), + 'month' => $dateTime->format('m'), + 'day' => $dateTime->format('d'), + 'hour' => $dateTime->format('H'), + 'minute' => $dateTime->format('i'), + 'second' => $dateTime->format('s'), + ), array_flip($this->fields)); + + if (!$this->pad) { + foreach ($result as &$entry) { + // remove leading zeros + $entry = (string) (int) $entry; + } + } + + return $result; + } + + /** + * Transforms a localized date into a normalized date. + * + * @param array $value Localized date + * + * @return DateTime Normalized date + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if the value could not be transformed + * @throws TransformationFailedException if the input timezone is not supported + */ + public function reverseTransform($value) + { + if (null === $value) { + return null; + } + + if (!is_array($value)) { + throw new UnexpectedTypeException($value, 'array'); + } + + if ('' === implode('', $value)) { + return null; + } + + $emptyFields = array(); + + foreach ($this->fields as $field) { + if (!isset($value[$field])) { + $emptyFields[] = $field; + } + } + + if (count($emptyFields) > 0) { + throw new TransformationFailedException( + sprintf('The fields "%s" should not be empty', implode('", "', $emptyFields) + )); + } + + if (isset($value['month']) && !ctype_digit($value['month']) && !is_int($value['month'])) { + throw new TransformationFailedException('This month is invalid'); + } + + if (isset($value['day']) && !ctype_digit($value['day']) && !is_int($value['day'])) { + throw new TransformationFailedException('This day is invalid'); + } + + if (isset($value['year']) && !ctype_digit($value['year']) && !is_int($value['year'])) { + throw new TransformationFailedException('This year is invalid'); + } + + if (!empty($value['month']) && !empty($value['day']) && !empty($value['year']) && false === checkdate($value['month'], $value['day'], $value['year'])) { + throw new TransformationFailedException('This is an invalid date'); + } + + try { + $dateTime = new \DateTime(sprintf( + '%s-%s-%s %s:%s:%s %s', + empty($value['year']) ? '1970' : $value['year'], + empty($value['month']) ? '1' : $value['month'], + empty($value['day']) ? '1' : $value['day'], + empty($value['hour']) ? '0' : $value['hour'], + empty($value['minute']) ? '0' : $value['minute'], + empty($value['second']) ? '0' : $value['second'], + $this->outputTimezone + )); + + if ($this->inputTimezone !== $this->outputTimezone) { + $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone)); + } + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + + return $dateTime; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php new file mode 100755 index 0000000000..673fd5fde2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php @@ -0,0 +1,165 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a normalized time and a localized time string + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer +{ + private $dateFormat; + private $timeFormat; + private $pattern; + private $calendar; + + /** + * Constructor. + * + * @see BaseDateTimeTransformer::formats for available format options + * + * @param string $inputTimezone The name of the input timezone + * @param string $outputTimezone The name of the output timezone + * @param integer $dateFormat The date format + * @param integer $timeFormat The time format + * @param integer $calendar One of the \IntlDateFormatter calendar constants + * @param string $pattern A pattern to pass to \IntlDateFormatter + * + * @throws UnexpectedTypeException If a format is not supported + * @throws UnexpectedTypeException if a timezone is not a string + */ + public function __construct($inputTimezone = null, $outputTimezone = null, $dateFormat = null, $timeFormat = null, $calendar = \IntlDateFormatter::GREGORIAN, $pattern = null) + { + parent::__construct($inputTimezone, $outputTimezone); + + if (null === $dateFormat) { + $dateFormat = \IntlDateFormatter::MEDIUM; + } + + if (null === $timeFormat) { + $timeFormat = \IntlDateFormatter::SHORT; + } + + if (!in_array($dateFormat, self::$formats, true)) { + throw new UnexpectedTypeException($dateFormat, implode('", "', self::$formats)); + } + + if (!in_array($timeFormat, self::$formats, true)) { + throw new UnexpectedTypeException($timeFormat, implode('", "', self::$formats)); + } + + $this->dateFormat = $dateFormat; + $this->timeFormat = $timeFormat; + $this->calendar = $calendar; + $this->pattern = $pattern; + } + + /** + * Transforms a normalized date into a localized date string/array. + * + * @param \DateTime $dateTime Normalized date. + * + * @return string|array Localized date string/array. + * + * @throws UnexpectedTypeException if the given value is not an instance of \DateTime + * @throws TransformationFailedException if the date could not be transformed + */ + public function transform($dateTime) + { + if (null === $dateTime) { + return ''; + } + + if (!$dateTime instanceof \DateTime) { + throw new UnexpectedTypeException($dateTime, '\DateTime'); + } + + // convert time to UTC before passing it to the formatter + $dateTime = clone $dateTime; + if ('UTC' !== $this->inputTimezone) { + $dateTime->setTimezone(new \DateTimeZone('UTC')); + } + + $value = $this->getIntlDateFormatter()->format((int) $dateTime->format('U')); + + if (intl_get_error_code() != 0) { + throw new TransformationFailedException(intl_get_error_message()); + } + + return $value; + } + + /** + * Transforms a localized date string/array into a normalized date. + * + * @param string|array $value Localized date string/array + * + * @return \DateTime Normalized date + * + * @throws UnexpectedTypeException if the given value is not a string + * @throws TransformationFailedException if the date could not be parsed + * @throws TransformationFailedException if the input timezone is not supported + */ + public function reverseTransform($value) + { + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + if ('' === $value) { + return null; + } + + $timestamp = $this->getIntlDateFormatter()->parse($value); + + if (intl_get_error_code() != 0) { + throw new TransformationFailedException(intl_get_error_message()); + } + + // read timestamp into DateTime object - the formatter delivers in UTC + $dateTime = new \DateTime(sprintf('@%s UTC', $timestamp)); + + if ('UTC' !== $this->inputTimezone) { + try { + $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone)); + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + } + + return $dateTime; + } + + /** + * Returns a preconfigured IntlDateFormatter instance + * + * @return \IntlDateFormatter + */ + protected function getIntlDateFormatter() + { + $dateFormat = $this->dateFormat; + $timeFormat = $this->timeFormat; + $timezone = $this->outputTimezone; + $calendar = $this->calendar; + $pattern = $this->pattern; + + $intlDateFormatter = new \IntlDateFormatter(\Locale::getDefault(), $dateFormat, $timeFormat, $timezone, $calendar, $pattern); + $intlDateFormatter->setLenient(false); + + return $intlDateFormatter; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php new file mode 100755 index 0000000000..7131ff6519 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Exception\TransformationFailedException; + +/** + * @author Bernhard Schussek + */ +class DateTimeToRfc3339Transformer extends BaseDateTimeTransformer +{ + /** + * {@inheritDoc} + */ + public function transform($dateTime) + { + if (null === $dateTime) { + return ''; + } + + if (!$dateTime instanceof \DateTime) { + throw new UnexpectedTypeException($dateTime, '\DateTime'); + } + + if ($this->inputTimezone !== $this->outputTimezone) { + $dateTime = clone $dateTime; + $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone)); + } + + return preg_replace('/\+00:00$/', 'Z', $dateTime->format('c')); + } + + /** + * {@inheritDoc} + */ + public function reverseTransform($rfc3339) + { + if (!is_string($rfc3339)) { + throw new UnexpectedTypeException($rfc3339, 'string'); + } + + if ('' === $rfc3339) { + return null; + } + + $dateTime = new \DateTime($rfc3339); + + if ($this->outputTimezone !== $this->inputTimezone) { + try { + $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone)); + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + } + + if (preg_match('/(\d{4})-(\d{2})-(\d{2})/', $rfc3339, $matches)) { + if (!checkdate($matches[2], $matches[3], $matches[1])) { + throw new TransformationFailedException(sprintf( + 'The date "%s-%s-%s" is not a valid date.', + $matches[1], + $matches[2], + $matches[3] + )); + } + } + + return $dateTime; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php new file mode 100755 index 0000000000..f7c4eb4798 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php @@ -0,0 +1,229 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a date string and a DateTime object + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class DateTimeToStringTransformer extends BaseDateTimeTransformer +{ + /** + * Format used for generating strings + * @var string + */ + private $generateFormat; + + /** + * Format used for parsing strings + * + * Different than the {@link $generateFormat} because formats for parsing + * support additional characters in PHP that are not supported for + * generating strings. + * + * @var string + */ + private $parseFormat; + + /** + * Whether to parse by appending a pipe "|" to the parse format. + * + * This only works as of PHP 5.3.8. + * + * @var Boolean + */ + private $parseUsingPipe; + + /** + * Transforms a \DateTime instance to a string + * + * @see \DateTime::format() for supported formats + * + * @param string $inputTimezone The name of the input timezone + * @param string $outputTimezone The name of the output timezone + * @param string $format The date format + * @param Boolean $parseUsingPipe Whether to parse by appending a pipe "|" to the parse format + * + * @throws UnexpectedTypeException if a timezone is not a string + */ + public function __construct($inputTimezone = null, $outputTimezone = null, $format = 'Y-m-d H:i:s', $parseUsingPipe = null) + { + parent::__construct($inputTimezone, $outputTimezone); + + $this->generateFormat = $this->parseFormat = $format; + + // The pipe in the parser pattern only works as of PHP 5.3.8 + $this->parseUsingPipe = null === $parseUsingPipe + ? version_compare(phpversion(), '5.3.8', '>=') + : $parseUsingPipe; + + // See http://php.net/manual/en/datetime.createfromformat.php + // The character "|" in the format makes sure that the parts of a date + // that are *not* specified in the format are reset to the corresponding + // values from 1970-01-01 00:00:00 instead of the current time. + // Without "|" and "Y-m-d", "2010-02-03" becomes "2010-02-03 12:32:47", + // where the time corresponds to the current server time. + // With "|" and "Y-m-d", "2010-02-03" becomes "2010-02-03 00:00:00", + // which is at least deterministic and thus used here. + if ($this->parseUsingPipe && false === strpos($this->parseFormat, '|')) { + $this->parseFormat .= '|'; + } + } + + /** + * Transforms a DateTime object into a date string with the configured format + * and timezone + * + * @param \DateTime $value A DateTime object + * + * @return string A value as produced by PHP's date() function + * + * @throws UnexpectedTypeException if the given value is not a \DateTime instance + * @throws TransformationFailedException if the output timezone is not supported + */ + public function transform($value) + { + if (null === $value) { + return ''; + } + + if (!$value instanceof \DateTime) { + throw new UnexpectedTypeException($value, '\DateTime'); + } + + $value = clone $value; + try { + $value->setTimezone(new \DateTimeZone($this->outputTimezone)); + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + + return $value->format($this->generateFormat); + } + + /** + * Transforms a date string in the configured timezone into a DateTime object. + * + * @param string $value A value as produced by PHP's date() function + * + * @return \DateTime An instance of \DateTime + * + * @throws UnexpectedTypeException if the given value is not a string + * @throws TransformationFailedException if the date could not be parsed + * @throws TransformationFailedException if the input timezone is not supported + */ + public function reverseTransform($value) + { + if (empty($value)) { + return null; + } + + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + try { + $outputTz = new \DateTimeZone($this->outputTimezone); + $dateTime = \DateTime::createFromFormat($this->parseFormat, $value, $outputTz); + + $lastErrors = \DateTime::getLastErrors(); + + if (0 < $lastErrors['warning_count'] || 0 < $lastErrors['error_count']) { + throw new TransformationFailedException( + implode(', ', array_merge( + array_values($lastErrors['warnings']), + array_values($lastErrors['errors']) + )) + ); + } + + // On PHP versions < 5.3.8 we need to emulate the pipe operator + // and reset parts not given in the format to their equivalent + // of the UNIX base timestamp. + if (!$this->parseUsingPipe) { + list($year, $month, $day, $hour, $minute, $second) = explode('-', $dateTime->format('Y-m-d-H-i-s')); + + // Check which of the date parts are present in the pattern + preg_match( + '/(' . + '(?[djDl])|' . + '(?[FMmn])|' . + '(?[Yy])|' . + '(?[ghGH])|' . + '(?i)|' . + '(?s)|' . + '(?z)|' . + '(?U)|' . + '[^djDlFMmnYyghGHiszU]' . + ')*/', + $this->parseFormat, + $matches + ); + + // preg_match() does not guarantee to set all indices, so + // set them unless given + $matches = array_merge(array( + 'day' => false, + 'month' => false, + 'year' => false, + 'hour' => false, + 'minute' => false, + 'second' => false, + 'dayofyear' => false, + 'timestamp' => false, + ), $matches); + + // Reset all parts that don't exist in the format to the + // corresponding part of the UNIX base timestamp + if (!$matches['timestamp']) { + if (!$matches['dayofyear']) { + if (!$matches['day']) { + $day = 1; + } + if (!$matches['month']) { + $month = 1; + } + } + if (!$matches['year']) { + $year = 1970; + } + if (!$matches['hour']) { + $hour = 0; + } + if (!$matches['minute']) { + $minute = 0; + } + if (!$matches['second']) { + $second = 0; + } + $dateTime->setDate($year, $month, $day); + $dateTime->setTime($hour, $minute, $second); + } + } + + if ($this->inputTimezone !== $this->outputTimezone) { + $dateTime->setTimeZone(new \DateTimeZone($this->inputTimezone)); + } + } catch (TransformationFailedException $e) { + throw $e; + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + + return $dateTime; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php new file mode 100755 index 0000000000..dff3c52083 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a timestamp and a DateTime object + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class DateTimeToTimestampTransformer extends BaseDateTimeTransformer +{ + /** + * Transforms a DateTime object into a timestamp in the configured timezone. + * + * @param DateTime $value A DateTime object + * + * @return integer A timestamp + * + * @throws UnexpectedTypeException if the given value is not an instance of \DateTime + * @throws TransformationFailedException if the output timezone is not supported + */ + public function transform($value) + { + if (null === $value) { + return null; + } + + if (!$value instanceof \DateTime) { + throw new UnexpectedTypeException($value, '\DateTime'); + } + + $value = clone $value; + try { + $value->setTimezone(new \DateTimeZone($this->outputTimezone)); + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + + return (int) $value->format('U'); + } + + /** + * Transforms a timestamp in the configured timezone into a DateTime object + * + * @param string $value A timestamp + * + * @return \DateTime An instance of \DateTime + * + * @throws UnexpectedTypeException if the given value is not a timestamp + * @throws TransformationFailedException if the given timestamp is invalid + */ + public function reverseTransform($value) + { + if (null === $value) { + return null; + } + + if (!is_numeric($value)) { + throw new UnexpectedTypeException($value, 'numeric'); + } + + try { + $dateTime = new \DateTime(); + $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone)); + $dateTime->setTimestamp($value); + + if ($this->inputTimezone !== $this->outputTimezone) { + $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone)); + } + } catch (\Exception $e) { + throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e); + } + + return $dateTime; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php new file mode 100755 index 0000000000..4dd04af820 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between an integer and a localized number with grouping + * (each thousand) and comma separators. + * + * @author Bernhard Schussek + */ +class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransformer +{ + /** + * {@inheritDoc} + */ + public function reverseTransform($value) + { + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + if ('' === $value) { + return null; + } + + if ('NaN' === $value) { + throw new TransformationFailedException('"NaN" is not a valid integer'); + } + + $formatter = $this->getNumberFormatter(); + $value = $formatter->parse( + $value, + PHP_INT_SIZE == 8 ? $formatter::TYPE_INT64 : $formatter::TYPE_INT32 + ); + + if (intl_is_failure($formatter->getErrorCode())) { + throw new TransformationFailedException($formatter->getErrorMessage()); + } + + return $value; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php new file mode 100755 index 0000000000..d3b5998b42 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a normalized format and a localized money string. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransformer +{ + + private $divisor; + + public function __construct($precision = null, $grouping = null, $roundingMode = null, $divisor = null) + { + if (null === $grouping) { + $grouping = true; + } + + if (null === $precision) { + $precision = 2; + } + + parent::__construct($precision, $grouping, $roundingMode); + + if (null === $divisor) { + $divisor = 1; + } + + $this->divisor = $divisor; + } + + /** + * Transforms a normalized format into a localized money string. + * + * @param number $value Normalized number + * + * @return string Localized money string. + * + * @throws UnexpectedTypeException if the given value is not numeric + * @throws TransformationFailedException if the value can not be transformed + */ + public function transform($value) + { + if (null !== $value) { + if (!is_numeric($value)) { + throw new UnexpectedTypeException($value, 'numeric'); + } + + $value /= $this->divisor; + } + + return parent::transform($value); + } + + /** + * Transforms a localized money string into a normalized format. + * + * @param string $value Localized money string + * + * @return number Normalized number + * + * @throws UnexpectedTypeException if the given value is not a string + * @throws TransformationFailedException if the value can not be transformed + */ + public function reverseTransform($value) + { + $value = parent::reverseTransform($value); + + if (null !== $value) { + $value *= $this->divisor; + } + + return $value; + } + +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php new file mode 100755 index 0000000000..41a0ea12e8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php @@ -0,0 +1,153 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a number type and a localized number with grouping + * (each thousand) and comma separators. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class NumberToLocalizedStringTransformer implements DataTransformerInterface +{ + const ROUND_FLOOR = \NumberFormatter::ROUND_FLOOR; + const ROUND_DOWN = \NumberFormatter::ROUND_DOWN; + const ROUND_HALFDOWN = \NumberFormatter::ROUND_HALFDOWN; + const ROUND_HALFEVEN = \NumberFormatter::ROUND_HALFEVEN; + const ROUND_HALFUP = \NumberFormatter::ROUND_HALFUP; + const ROUND_UP = \NumberFormatter::ROUND_UP; + const ROUND_CEILING = \NumberFormatter::ROUND_CEILING; + + protected $precision; + + protected $grouping; + + protected $roundingMode; + + public function __construct($precision = null, $grouping = null, $roundingMode = null) + { + if (null === $grouping) { + $grouping = false; + } + + if (null === $roundingMode) { + $roundingMode = self::ROUND_HALFUP; + } + + $this->precision = $precision; + $this->grouping = $grouping; + $this->roundingMode = $roundingMode; + } + + /** + * Transforms a number type into localized number. + * + * @param integer|float $value Number value. + * + * @return string Localized value. + * + * @throws UnexpectedTypeException if the given value is not numeric + * @throws TransformationFailedException if the value can not be transformed + */ + public function transform($value) + { + if (null === $value) { + return ''; + } + + if (!is_numeric($value)) { + throw new UnexpectedTypeException($value, 'numeric'); + } + + $formatter = $this->getNumberFormatter(); + $value = $formatter->format($value); + + if (intl_is_failure($formatter->getErrorCode())) { + throw new TransformationFailedException($formatter->getErrorMessage()); + } + + return $value; + } + + /** + * Transforms a localized number into an integer or float + * + * @param string $value The localized value + * + * @return integer|float The numeric value + * + * @throws UnexpectedTypeException if the given value is not a string + * @throws TransformationFailedException if the value can not be transformed + */ + public function reverseTransform($value) + { + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + if ('' === $value) { + return null; + } + + if ('NaN' === $value) { + throw new TransformationFailedException('"NaN" is not a valid number'); + } + + $formatter = $this->getNumberFormatter(); + $groupSep = $formatter->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL); + $decSep = $formatter->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); + + if ('.' !== $decSep && (!$this->grouping || '.' !== $groupSep)) { + $value = str_replace('.', $decSep, $value); + } + + if (',' !== $decSep && (!$this->grouping || ',' !== $groupSep)) { + $value = str_replace(',', $decSep, $value); + } + + $value = $formatter->parse($value); + + if (intl_is_failure($formatter->getErrorCode())) { + throw new TransformationFailedException($formatter->getErrorMessage()); + } + + if ($value >= INF || $value <= -INF) { + throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like'); + } + + return $value; + } + + /** + * Returns a preconfigured \NumberFormatter instance + * + * @return \NumberFormatter + */ + protected function getNumberFormatter() + { + $formatter = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL); + + if (null !== $this->precision) { + $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->precision); + $formatter->setAttribute(\NumberFormatter::ROUNDING_MODE, $this->roundingMode); + } + + $formatter->setAttribute(\NumberFormatter::GROUPING_USED, $this->grouping); + + return $formatter; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php new file mode 100755 index 0000000000..bbf66466a0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php @@ -0,0 +1,149 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Transforms between a normalized format (integer or float) and a percentage value. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + */ +class PercentToLocalizedStringTransformer implements DataTransformerInterface +{ + const FRACTIONAL = 'fractional'; + const INTEGER = 'integer'; + + protected static $types = array( + self::FRACTIONAL, + self::INTEGER, + ); + + private $type; + + private $precision; + + /** + * Constructor. + * + * @see self::$types for a list of supported types + * + * @param integer $precision The precision + * @param string $type One of the supported types + * + * @throws UnexpectedTypeException if the given value of type is unknown + */ + public function __construct($precision = null, $type = null) + { + if (null === $precision) { + $precision = 0; + } + + if (null === $type) { + $type = self::FRACTIONAL; + } + + if (!in_array($type, self::$types, true)) { + throw new UnexpectedTypeException($type, implode('", "', self::$types)); + } + + $this->type = $type; + $this->precision = $precision; + } + + /** + * Transforms between a normalized format (integer or float) into a percentage value. + * + * @param number $value Normalized value + * + * @return number Percentage value + * + * @throws UnexpectedTypeException if the given value is not numeric + * @throws TransformationFailedException if the value could not be transformed + */ + public function transform($value) + { + if (null === $value) { + return ''; + } + + if (!is_numeric($value)) { + throw new UnexpectedTypeException($value, 'numeric'); + } + + if (self::FRACTIONAL == $this->type) { + $value *= 100; + } + + $formatter = $this->getNumberFormatter(); + $value = $formatter->format($value); + + if (intl_is_failure($formatter->getErrorCode())) { + throw new TransformationFailedException($formatter->getErrorMessage()); + } + + // replace the UTF-8 non break spaces + return $value; + } + + /** + * Transforms between a percentage value into a normalized format (integer or float). + * + * @param number $value Percentage value. + * + * @return number Normalized value. + * + * @throws UnexpectedTypeException if the given value is not a string + * @throws TransformationFailedException if the value could not be transformed + */ + public function reverseTransform($value) + { + if (!is_string($value)) { + throw new UnexpectedTypeException($value, 'string'); + } + + if ('' === $value) { + return null; + } + + $formatter = $this->getNumberFormatter(); + // replace normal spaces so that the formatter can read them + $value = $formatter->parse(str_replace(' ', ' ', $value)); + + if (intl_is_failure($formatter->getErrorCode())) { + throw new TransformationFailedException($formatter->getErrorMessage()); + } + + if (self::FRACTIONAL == $this->type) { + $value /= 100; + } + + return $value; + } + + /** + * Returns a preconfigured \NumberFormatter instance + * + * @return \NumberFormatter + */ + protected function getNumberFormatter() + { + $formatter = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL); + + $formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $this->precision); + + return $formatter; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php new file mode 100755 index 0000000000..22fa01c39a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\DataTransformer; + +use Symfony\Component\Form\DataTransformerInterface; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class ValueToDuplicatesTransformer implements DataTransformerInterface +{ + private $keys; + + public function __construct(array $keys) + { + $this->keys = $keys; + } + + /** + * Duplicates the given value through the array. + * + * @param mixed $value The value + * + * @return array The array + */ + public function transform($value) + { + $result = array(); + + foreach ($this->keys as $key) { + $result[$key] = $value; + } + + return $result; + } + + /** + * Extracts the duplicated value from an array. + * + * @param array $array + * + * @return mixed The value + * + * @throws UnexpectedTypeException if the given value is not an array + * @throws TransformationFailedException if the given array can not be transformed + */ + public function reverseTransform($array) + { + if (!is_array($array)) { + throw new UnexpectedTypeException($array, 'array'); + } + + $result = current($array); + $emptyKeys = array(); + + foreach ($this->keys as $key) { + if (!empty($array[$key])) { + if ($array[$key] !== $result) { + throw new TransformationFailedException( + 'All values in the array should be the same' + ); + } + } else { + $emptyKeys[] = $key; + } + } + + if (count($emptyKeys) > 0) { + if (count($emptyKeys) == count($this->keys)) { + // All keys empty + return null; + } + + throw new TransformationFailedException( + sprintf('The keys "%s" should not be empty', implode('", "', $emptyKeys) + )); + } + + return $result; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php new file mode 100755 index 0000000000..083e23e946 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; + +/** + * Takes care of converting the input from a list of checkboxes to a correctly + * indexed array. + * + * @author Bernhard Schussek + */ +class FixCheckboxInputListener implements EventSubscriberInterface +{ + private $choiceList; + + /** + * Constructor. + * + * @param ChoiceListInterface $choiceList + */ + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + public function preBind(FormEvent $event) + { + $values = (array) $event->getData(); + $indices = $this->choiceList->getIndicesForValues($values); + + $event->setData(count($indices) > 0 ? array_combine($indices, $values) : array()); + } + + public static function getSubscribedEvents() + { + return array(FormEvents::PRE_BIND => 'preBind'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php new file mode 100755 index 0000000000..c60bd26b53 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface; + +/** + * Takes care of converting the input from a single radio button + * to an array. + * + * @author Bernhard Schussek + */ +class FixRadioInputListener implements EventSubscriberInterface +{ + private $choiceList; + + /** + * Constructor. + * + * @param ChoiceListInterface $choiceList + */ + public function __construct(ChoiceListInterface $choiceList) + { + $this->choiceList = $choiceList; + } + + public function preBind(FormEvent $event) + { + $value = $event->getData(); + $index = current($this->choiceList->getIndicesForValues(array($value))); + + $event->setData(false !== $index ? array($index => $value) : array()); + } + + public static function getSubscribedEvents() + { + return array(FormEvents::PRE_BIND => 'preBind'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php new file mode 100755 index 0000000000..1079903b59 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Adds a protocol to a URL if it doesn't already have one. + * + * @author Bernhard Schussek + */ +class FixUrlProtocolListener implements EventSubscriberInterface +{ + private $defaultProtocol; + + public function __construct($defaultProtocol = 'http') + { + $this->defaultProtocol = $defaultProtocol; + } + + public function onBind(FormEvent $event) + { + $data = $event->getData(); + + if ($this->defaultProtocol && $data && !preg_match('~^\w+://~', $data)) { + $event->setData($this->defaultProtocol.'://'.$data); + } + } + + public static function getSubscribedEvents() + { + return array(FormEvents::BIND => 'onBind'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php new file mode 100755 index 0000000000..ec887015b1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php @@ -0,0 +1,126 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * @author Bernhard Schussek + */ +class MergeCollectionListener implements EventSubscriberInterface +{ + /** + * Whether elements may be added to the collection + * @var Boolean + */ + private $allowAdd; + + /** + * Whether elements may be removed from the collection + * @var Boolean + */ + private $allowDelete; + + /** + * Creates a new listener. + * + * @param Boolean $allowAdd Whether values might be added to the + * collection. + * @param Boolean $allowDelete Whether values might be removed from the + * collection. + */ + public function __construct($allowAdd = false, $allowDelete = false) + { + $this->allowAdd = $allowAdd; + $this->allowDelete = $allowDelete; + } + + public static function getSubscribedEvents() + { + return array( + FormEvents::BIND => 'onBind', + ); + } + + public function onBind(FormEvent $event) + { + $dataToMergeInto = $event->getForm()->getNormData(); + $data = $event->getData(); + + if (null === $data) { + $data = array(); + } + + if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) { + throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)'); + } + + if (null !== $dataToMergeInto && !is_array($dataToMergeInto) && !($dataToMergeInto instanceof \Traversable && $dataToMergeInto instanceof \ArrayAccess)) { + throw new UnexpectedTypeException($dataToMergeInto, 'array or (\Traversable and \ArrayAccess)'); + } + + // If we are not allowed to change anything, return immediately + if ((!$this->allowAdd && !$this->allowDelete) || $data === $dataToMergeInto) { + $event->setData($dataToMergeInto); + + return; + } + + if (!$dataToMergeInto) { + // No original data was set. Set it if allowed + if ($this->allowAdd) { + $dataToMergeInto = $data; + } + } else { + // Calculate delta + $itemsToAdd = is_object($data) ? clone $data : $data; + $itemsToDelete = array(); + + foreach ($dataToMergeInto as $beforeKey => $beforeItem) { + foreach ($data as $afterKey => $afterItem) { + if ($afterItem === $beforeItem) { + // Item found, next original item + unset($itemsToAdd[$afterKey]); + continue 2; + } + } + + // Item not found, remember for deletion + $itemsToDelete[] = $beforeKey; + } + + // Remove deleted items before adding to free keys that are to be + // replaced + if ($this->allowDelete) { + foreach ($itemsToDelete as $key) { + unset($dataToMergeInto[$key]); + } + } + + // Add remaining items + if ($this->allowAdd) { + foreach ($itemsToAdd as $key => $item) { + if (!isset($dataToMergeInto[$key])) { + $dataToMergeInto[$key] = $item; + } else { + $dataToMergeInto[] = $item; + } + } + } + } + + $event->setData($dataToMergeInto); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php new file mode 100755 index 0000000000..7c34a99161 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Resize a collection form element based on the data sent from the client. + * + * @author Bernhard Schussek + */ +class ResizeFormListener implements EventSubscriberInterface +{ + /** + * @var FormFactoryInterface + */ + protected $factory; + + /** + * @var string + */ + protected $type; + + /** + * @var array + */ + protected $options; + + /** + * Whether children could be added to the group + * @var Boolean + */ + protected $allowAdd; + + /** + * Whether children could be removed from the group + * @var Boolean + */ + protected $allowDelete; + + public function __construct(FormFactoryInterface $factory, $type, array $options = array(), $allowAdd = false, $allowDelete = false) + { + $this->factory = $factory; + $this->type = $type; + $this->allowAdd = $allowAdd; + $this->allowDelete = $allowDelete; + $this->options = $options; + } + + public static function getSubscribedEvents() + { + return array( + FormEvents::PRE_SET_DATA => 'preSetData', + FormEvents::PRE_BIND => 'preBind', + // (MergeCollectionListener, MergeDoctrineCollectionListener) + FormEvents::BIND => array('onBind', 50), + ); + } + + public function preSetData(FormEvent $event) + { + $form = $event->getForm(); + $data = $event->getData(); + + if (null === $data) { + $data = array(); + } + + if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) { + throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)'); + } + + // First remove all rows + foreach ($form as $name => $child) { + $form->remove($name); + } + + // Then add all rows again in the correct order + foreach ($data as $name => $value) { + $form->add($this->factory->createNamed($name, $this->type, null, array_replace(array( + 'property_path' => '['.$name.']', + ), $this->options))); + } + } + + public function preBind(FormEvent $event) + { + $form = $event->getForm(); + $data = $event->getData(); + + if (null === $data || '' === $data) { + $data = array(); + } + + if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) { + throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)'); + } + + // Remove all empty rows + if ($this->allowDelete) { + foreach ($form as $name => $child) { + if (!isset($data[$name])) { + $form->remove($name); + } + } + } + + // Add all additional rows + if ($this->allowAdd) { + foreach ($data as $name => $value) { + if (!$form->has($name)) { + $form->add($this->factory->createNamed($name, $this->type, null, array_replace(array( + 'property_path' => '['.$name.']', + ), $this->options))); + } + } + } + } + + public function onBind(FormEvent $event) + { + $form = $event->getForm(); + $data = $event->getData(); + + if (null === $data) { + $data = array(); + } + + if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) { + throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)'); + } + + // The data mapper only adds, but does not remove items, so do this + // here + if ($this->allowDelete) { + foreach ($data as $name => $child) { + if (!$form->has($name)) { + unset($data[$name]); + } + } + } + + $event->setData($data); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php new file mode 100755 index 0000000000..c5d692052d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * Trims string data + * + * @author Bernhard Schussek + */ +class TrimListener implements EventSubscriberInterface +{ + public function preBind(FormEvent $event) + { + $data = $event->getData(); + + if (is_string($data)) { + $event->setData(trim($data)); + } + } + + public static function getSubscribedEvents() + { + return array(FormEvents::PRE_BIND => 'preBind'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php new file mode 100755 index 0000000000..5314c140a1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/BirthdayType.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class BirthdayType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'years' => range(date('Y') - 120, date('Y')), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'date'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'birthday'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php new file mode 100755 index 0000000000..8d489d6db0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\BooleanToStringTransformer; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class CheckboxType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->addViewTransformer(new BooleanToStringTransformer($options['value'])) + ; + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars = array_replace($view->vars, array( + 'value' => $options['value'], + 'checked' => null !== $form->getViewData(), + )); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $emptyData = function (FormInterface $form, $clientData) { + return $clientData; + }; + + $resolver->setDefaults(array( + 'value' => '1', + 'empty_data' => $emptyData, + 'compound' => false, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'checkbox'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php new file mode 100755 index 0000000000..356cc2322c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -0,0 +1,263 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; +use Symfony\Component\Form\Extension\Core\EventListener\FixRadioInputListener; +use Symfony\Component\Form\Extension\Core\EventListener\FixCheckboxInputListener; +use Symfony\Component\Form\Extension\Core\EventListener\MergeCollectionListener; +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToBooleanArrayTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToBooleanArrayTransformer; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class ChoiceType extends AbstractType +{ + /** + * Caches created choice lists. + * @var array + */ + private $choiceListCache = array(); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + if (!$options['choice_list'] && !is_array($options['choices']) && !$options['choices'] instanceof \Traversable) { + throw new FormException('Either the option "choices" or "choice_list" must be set.'); + } + + if ($options['expanded']) { + $this->addSubForms($builder, $options['choice_list']->getPreferredViews(), $options); + $this->addSubForms($builder, $options['choice_list']->getRemainingViews(), $options); + + if ($options['multiple']) { + $builder + ->addViewTransformer(new ChoicesToBooleanArrayTransformer($options['choice_list'])) + ->addEventSubscriber(new FixCheckboxInputListener($options['choice_list']), 10) + ; + } else { + $builder + ->addViewTransformer(new ChoiceToBooleanArrayTransformer($options['choice_list'])) + ->addEventSubscriber(new FixRadioInputListener($options['choice_list']), 10) + ; + } + } else { + if ($options['multiple']) { + $builder->addViewTransformer(new ChoicesToValuesTransformer($options['choice_list'])); + } else { + $builder->addViewTransformer(new ChoiceToValueTransformer($options['choice_list'])); + } + } + + if ($options['multiple'] && $options['by_reference']) { + // Make sure the collection created during the client->norm + // transformation is merged back into the original collection + $builder->addEventSubscriber(new MergeCollectionListener(true, true)); + } + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars = array_replace($view->vars, array( + 'multiple' => $options['multiple'], + 'expanded' => $options['expanded'], + 'preferred_choices' => $options['choice_list']->getPreferredViews(), + 'choices' => $options['choice_list']->getRemainingViews(), + 'separator' => '-------------------', + 'empty_value' => null, + )); + + // The decision, whether a choice is selected, is potentially done + // thousand of times during the rendering of a template. Provide a + // closure here that is optimized for the value of the form, to + // avoid making the type check inside the closure. + if ($options['multiple']) { + $view->vars['is_selected'] = function ($choice, array $values) { + return false !== array_search($choice, $values, true); + }; + } else { + $view->vars['is_selected'] = function ($choice, $value) { + return $choice === $value; + }; + } + + // Check if the choices already contain the empty value + // Only add the empty value option if this is not the case + if (0 === count($options['choice_list']->getIndicesForValues(array('')))) { + $view->vars['empty_value'] = $options['empty_value']; + } + + if ($options['multiple'] && !$options['expanded']) { + // Add "[]" to the name in case a select tag with multiple options is + // displayed. Otherwise only one of the selected options is sent in the + // POST request. + $view->vars['full_name'] = $view->vars['full_name'].'[]'; + } + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + if ($options['expanded']) { + // Radio buttons should have the same name as the parent + $childName = $view->vars['full_name']; + + // Checkboxes should append "[]" to allow multiple selection + if ($options['multiple']) { + $childName .= '[]'; + } + + foreach ($view as $childView) { + $childView->vars['full_name'] = $childName; + } + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $choiceListCache =& $this->choiceListCache; + + $choiceList = function (Options $options) use (&$choiceListCache) { + // Harden against NULL values (like in EntityType and ModelType) + $choices = null !== $options['choices'] ? $options['choices'] : array(); + + // Reuse existing choice lists in order to increase performance + $hash = md5(json_encode(array($choices, $options['preferred_choices']))); + + if (!isset($choiceListCache[$hash])) { + $choiceListCache[$hash] = new SimpleChoiceList($choices, $options['preferred_choices']); + } + + return $choiceListCache[$hash]; + }; + + $emptyData = function (Options $options) { + if ($options['multiple'] || $options['expanded']) { + return array(); + } + + return ''; + }; + + $emptyValue = function (Options $options) { + return $options['required'] ? null : ''; + }; + + $emptyValueNormalizer = function (Options $options, $emptyValue) { + if ($options['multiple'] || $options['expanded']) { + // never use an empty value for these cases + return null; + } elseif (false === $emptyValue) { + // an empty value should be added but the user decided otherwise + return null; + } + + // empty value has been set explicitly + return $emptyValue; + }; + + $compound = function (Options $options) { + return $options['expanded']; + }; + + $resolver->setDefaults(array( + 'multiple' => false, + 'expanded' => false, + 'choice_list' => $choiceList, + 'choices' => array(), + 'preferred_choices' => array(), + 'empty_data' => $emptyData, + 'empty_value' => $emptyValue, + 'error_bubbling' => false, + 'compound' => $compound, + // The view data is always a string, even if the "data" option + // is manually set to an object. + // See https://github.com/symfony/symfony/pull/5582 + 'data_class' => null, + )); + + $resolver->setNormalizers(array( + 'empty_value' => $emptyValueNormalizer, + )); + + $resolver->setAllowedTypes(array( + 'choice_list' => array('null', 'Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface'), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'choice'; + } + + /** + * Adds the sub fields for an expanded choice field. + * + * @param FormBuilderInterface $builder The form builder. + * @param array $choiceViews The choice view objects. + * @param array $options The build options. + */ + private function addSubForms(FormBuilderInterface $builder, array $choiceViews, array $options) + { + foreach ($choiceViews as $i => $choiceView) { + if (is_array($choiceView)) { + // Flatten groups + $this->addSubForms($builder, $choiceView, $options); + } else { + $choiceOpts = array( + 'value' => $choiceView->value, + 'label' => $choiceView->label, + 'translation_domain' => $options['translation_domain'], + ); + + if ($options['multiple']) { + $choiceType = 'checkbox'; + // The user can check 0 or more checkboxes. If required + // is true, he is required to check all of them. + $choiceOpts['required'] = false; + } else { + $choiceType = 'radio'; + } + + $builder->add((string) $i, $choiceType, $choiceOpts); + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CollectionType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CollectionType.php new file mode 100755 index 0000000000..353a89bc4b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CollectionType.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class CollectionType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + if ($options['allow_add'] && $options['prototype']) { + $prototype = $builder->create($options['prototype_name'], $options['type'], array_replace(array( + 'label' => $options['prototype_name'] . 'label__', + ), $options['options'])); + $builder->setAttribute('prototype', $prototype->getForm()); + } + + $resizeListener = new ResizeFormListener( + $builder->getFormFactory(), + $options['type'], + $options['options'], + $options['allow_add'], + $options['allow_delete'] + ); + + $builder->addEventSubscriber($resizeListener); + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars = array_replace($view->vars, array( + 'allow_add' => $options['allow_add'], + 'allow_delete' => $options['allow_delete'], + )); + + if ($form->getConfig()->hasAttribute('prototype')) { + $view->vars['prototype'] = $form->getConfig()->getAttribute('prototype')->createView($view); + } + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + if ($form->getConfig()->hasAttribute('prototype') && $view->vars['prototype']->vars['multipart']) { + $view->vars['multipart'] = true; + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $optionsNormalizer = function (Options $options, $value) { + $value['block_name'] = 'entry'; + + return $value; + }; + + $resolver->setDefaults(array( + 'allow_add' => false, + 'allow_delete' => false, + 'prototype' => true, + 'prototype_name' => '__name__', + 'type' => 'text', + 'options' => array(), + )); + + $resolver->setNormalizers(array( + 'options' => $optionsNormalizer, + )); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'collection'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CountryType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CountryType.php new file mode 100755 index 0000000000..4d5f29b995 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/CountryType.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Locale\Locale; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class CountryType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'choices' => Locale::getDisplayCountries(\Locale::getDefault()), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'choice'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'country'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php new file mode 100755 index 0000000000..8151c3e7fb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -0,0 +1,295 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\ReversedTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DataTransformerChain; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToLocalizedStringTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToRfc3339Transformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\ArrayToPartsTransformer; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class DateTimeType extends AbstractType +{ + const DEFAULT_DATE_FORMAT = \IntlDateFormatter::MEDIUM; + + const DEFAULT_TIME_FORMAT = \IntlDateFormatter::MEDIUM; + + /** + * This is not quite the HTML5 format yet, because ICU lacks the + * capability of parsing and generating RFC 3339 dates, which + * are like the below pattern but with a timezone suffix. The + * timezone suffix is + * + * * "Z" for UTC + * * "(-|+)HH:mm" for other timezones (note the colon!) + * + * For more information see: + * + * http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax + * http://www.w3.org/TR/html-markup/input.datetime.html + * http://tools.ietf.org/html/rfc3339 + * + * An ICU ticket was created: + * http://icu-project.org/trac/ticket/9421 + * + * It was supposedly fixed, but is not available in all PHP installations + * yet. To temporarily circumvent this issue, DateTimeToRfc3339Transformer + * is used when the format matches this constant. + */ + const HTML5_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"; + + private static $acceptedFormats = array( + \IntlDateFormatter::FULL, + \IntlDateFormatter::LONG, + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::SHORT, + ); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $parts = array('year', 'month', 'day', 'hour', 'minute'); + $dateParts = array('year', 'month', 'day'); + $timeParts = array('hour', 'minute'); + + if ($options['with_seconds']) { + $parts[] = 'second'; + $timeParts[] = 'second'; + } + + $dateFormat = is_int($options['date_format']) ? $options['date_format'] : self::DEFAULT_DATE_FORMAT; + $timeFormat = self::DEFAULT_TIME_FORMAT; + $calendar = \IntlDateFormatter::GREGORIAN; + $pattern = is_string($options['format']) ? $options['format'] : null; + + if (!in_array($dateFormat, self::$acceptedFormats, true)) { + throw new InvalidOptionsException('The "date_format" option must be one of the IntlDateFormatter constants (FULL, LONG, MEDIUM, SHORT) or a string representing a custom format.'); + } + + if ('single_text' === $options['widget']) { + if (self::HTML5_FORMAT === $pattern) { + $builder->addViewTransformer(new DateTimeToRfc3339Transformer( + $options['model_timezone'], + $options['view_timezone'] + )); + } else { + $builder->addViewTransformer(new DateTimeToLocalizedStringTransformer( + $options['model_timezone'], + $options['view_timezone'], + $dateFormat, + $timeFormat, + $calendar, + $pattern + )); + } + } else { + // Only pass a subset of the options to children + $dateOptions = array_intersect_key($options, array_flip(array( + 'years', + 'months', + 'days', + 'empty_value', + 'required', + 'translation_domain', + ))); + + $timeOptions = array_intersect_key($options, array_flip(array( + 'hours', + 'minutes', + 'seconds', + 'with_seconds', + 'empty_value', + 'required', + 'translation_domain', + ))); + + if (null !== $options['date_widget']) { + $dateOptions['widget'] = $options['date_widget']; + } + + if (null !== $options['time_widget']) { + $timeOptions['widget'] = $options['time_widget']; + } + + if (null !== $options['date_format']) { + $dateOptions['format'] = $options['date_format']; + } + + $dateOptions['input'] = $timeOptions['input'] = 'array'; + $dateOptions['error_bubbling'] = $timeOptions['error_bubbling'] = true; + + $builder + ->addViewTransformer(new DataTransformerChain(array( + new DateTimeToArrayTransformer($options['model_timezone'], $options['view_timezone'], $parts), + new ArrayToPartsTransformer(array( + 'date' => $dateParts, + 'time' => $timeParts, + )), + ))) + ->add('date', 'date', $dateOptions) + ->add('time', 'time', $timeOptions) + ; + } + + if ('string' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToStringTransformer($options['model_timezone'], $options['model_timezone']) + )); + } elseif ('timestamp' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToTimestampTransformer($options['model_timezone'], $options['model_timezone']) + )); + } elseif ('array' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToArrayTransformer($options['model_timezone'], $options['model_timezone'], $parts) + )); + } + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['widget'] = $options['widget']; + + // Change the input to a HTML5 date input if + // * the widget is set to "single_text" + // * the format matches the one expected by HTML5 + if ('single_text' === $options['widget'] && self::HTML5_FORMAT === $options['format']) { + $view->vars['type'] = 'datetime'; + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $compound = function (Options $options) { + return $options['widget'] !== 'single_text'; + }; + + // Defaults to the value of "widget" + $dateWidget = function (Options $options) { + return $options['widget']; + }; + + // Defaults to the value of "widget" + $timeWidget = function (Options $options) { + return $options['widget']; + }; + + // BC until Symfony 2.3 + $modelTimezone = function (Options $options) { + return $options['data_timezone']; + }; + + // BC until Symfony 2.3 + $viewTimezone = function (Options $options) { + return $options['user_timezone']; + }; + + $resolver->setDefaults(array( + 'input' => 'datetime', + 'model_timezone' => $modelTimezone, + 'view_timezone' => $viewTimezone, + // Deprecated timezone options + 'data_timezone' => null, + 'user_timezone' => null, + 'format' => self::HTML5_FORMAT, + 'date_format' => null, + 'widget' => null, + 'date_widget' => $dateWidget, + 'time_widget' => $timeWidget, + 'with_seconds' => false, + // Don't modify \DateTime classes by reference, we treat + // them like immutable value objects + 'by_reference' => false, + 'error_bubbling' => false, + // If initialized with a \DateTime object, FormType initializes + // this option to "\DateTime". Since the internal, normalized + // representation is not \DateTime, but an array, we need to unset + // this option. + 'data_class' => null, + 'compound' => $compound, + )); + + // Don't add some defaults in order to preserve the defaults + // set in DateType and TimeType + $resolver->setOptional(array( + 'empty_value', + 'years', + 'months', + 'days', + 'hours', + 'minutes', + 'seconds', + )); + + $resolver->setAllowedValues(array( + 'input' => array( + 'datetime', + 'string', + 'timestamp', + 'array', + ), + 'date_widget' => array( + null, // inherit default from DateType + 'single_text', + 'text', + 'choice', + ), + 'time_widget' => array( + null, // inherit default from TimeType + 'single_text', + 'text', + 'choice', + ), + // This option will overwrite "date_widget" and "time_widget" options + 'widget' => array( + null, // default, don't overwrite options + 'single_text', + 'text', + 'choice', + ), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'datetime'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateType.php new file mode 100755 index 0000000000..c659a77f04 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -0,0 +1,317 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToLocalizedStringTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; +use Symfony\Component\Form\ReversedTransformer; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; + +class DateType extends AbstractType +{ + const DEFAULT_FORMAT = \IntlDateFormatter::MEDIUM; + + const HTML5_FORMAT = 'yyyy-MM-dd'; + + private static $acceptedFormats = array( + \IntlDateFormatter::FULL, + \IntlDateFormatter::LONG, + \IntlDateFormatter::MEDIUM, + \IntlDateFormatter::SHORT, + ); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $dateFormat = is_int($options['format']) ? $options['format'] : self::DEFAULT_FORMAT; + $timeFormat = \IntlDateFormatter::NONE; + $calendar = \IntlDateFormatter::GREGORIAN; + $pattern = is_string($options['format']) ? $options['format'] : null; + + if (!in_array($dateFormat, self::$acceptedFormats, true)) { + throw new InvalidOptionsException('The "format" option must be one of the IntlDateFormatter constants (FULL, LONG, MEDIUM, SHORT) or a string representing a custom format.'); + } + + if (null !== $pattern && (false === strpos($pattern, 'y') || false === strpos($pattern, 'M') || false === strpos($pattern, 'd'))) { + throw new InvalidOptionsException(sprintf('The "format" option should contain the letters "y", "M" and "d". Its current value is "%s".', $pattern)); + } + + if ('single_text' === $options['widget']) { + $builder->addViewTransformer(new DateTimeToLocalizedStringTransformer( + $options['model_timezone'], + $options['view_timezone'], + $dateFormat, + $timeFormat, + $calendar, + $pattern + )); + } else { + $yearOptions = $monthOptions = $dayOptions = array( + 'error_bubbling' => true, + ); + + $formatter = new \IntlDateFormatter( + \Locale::getDefault(), + $dateFormat, + $timeFormat, + 'UTC', + $calendar, + $pattern + ); + $formatter->setLenient(false); + + if ('choice' === $options['widget']) { + // Only pass a subset of the options to children + $yearOptions['choices'] = $this->formatTimestamps($formatter, '/y+/', $this->listYears($options['years'])); + $yearOptions['empty_value'] = $options['empty_value']['year']; + $monthOptions['choices'] = $this->formatTimestamps($formatter, '/M+/', $this->listMonths($options['months'])); + $monthOptions['empty_value'] = $options['empty_value']['month']; + $dayOptions['choices'] = $this->formatTimestamps($formatter, '/d+/', $this->listDays($options['days'])); + $dayOptions['empty_value'] = $options['empty_value']['day']; + } + + // Append generic carry-along options + foreach (array('required', 'translation_domain') as $passOpt) { + $yearOptions[$passOpt] = $monthOptions[$passOpt] = $dayOptions[$passOpt] = $options[$passOpt]; + } + + $builder + ->add('year', $options['widget'], $yearOptions) + ->add('month', $options['widget'], $monthOptions) + ->add('day', $options['widget'], $dayOptions) + ->addViewTransformer(new DateTimeToArrayTransformer( + $options['model_timezone'], $options['view_timezone'], array('year', 'month', 'day') + )) + ->setAttribute('formatter', $formatter) + ; + } + + if ('string' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToStringTransformer($options['model_timezone'], $options['model_timezone'], 'Y-m-d') + )); + } elseif ('timestamp' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToTimestampTransformer($options['model_timezone'], $options['model_timezone']) + )); + } elseif ('array' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToArrayTransformer($options['model_timezone'], $options['model_timezone'], array('year', 'month', 'day')) + )); + } + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + $view->vars['widget'] = $options['widget']; + + // Change the input to a HTML5 date input if + // * the widget is set to "single_text" + // * the format matches the one expected by HTML5 + if ('single_text' === $options['widget'] && self::HTML5_FORMAT === $options['format']) { + $view->vars['type'] = 'date'; + } + + if ($form->getConfig()->hasAttribute('formatter')) { + $pattern = $form->getConfig()->getAttribute('formatter')->getPattern(); + + // set right order with respect to locale (e.g.: de_DE=dd.MM.yy; en_US=M/d/yy) + // lookup various formats at http://userguide.icu-project.org/formatparse/datetime + if (preg_match('/^([yMd]+).+([yMd]+).+([yMd]+)$/', $pattern)) { + $pattern = preg_replace(array('/y+/', '/M+/', '/d+/'), array('{{ year }}', '{{ month }}', '{{ day }}'), $pattern); + } else { + // default fallback + $pattern = '{{ year }}-{{ month }}-{{ day }}'; + } + + $view->vars['date_pattern'] = $pattern; + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $compound = function (Options $options) { + return $options['widget'] !== 'single_text'; + }; + + $emptyValue = $emptyValueDefault = function (Options $options) { + return $options['required'] ? null : ''; + }; + + $emptyValueNormalizer = function (Options $options, $emptyValue) use ($emptyValueDefault) { + if (is_array($emptyValue)) { + $default = $emptyValueDefault($options); + + return array_merge( + array('year' => $default, 'month' => $default, 'day' => $default), + $emptyValue + ); + } + + return array( + 'year' => $emptyValue, + 'month' => $emptyValue, + 'day' => $emptyValue + ); + }; + + $format = function (Options $options) { + return $options['widget'] === 'single_text' ? DateType::HTML5_FORMAT : DateType::DEFAULT_FORMAT; + }; + + // BC until Symfony 2.3 + $modelTimezone = function (Options $options) { + return $options['data_timezone']; + }; + + // BC until Symfony 2.3 + $viewTimezone = function (Options $options) { + return $options['user_timezone']; + }; + + $resolver->setDefaults(array( + 'years' => range(date('Y') - 5, date('Y') + 5), + 'months' => range(1, 12), + 'days' => range(1, 31), + 'widget' => 'choice', + 'input' => 'datetime', + 'format' => $format, + 'model_timezone' => $modelTimezone, + 'view_timezone' => $viewTimezone, + // Deprecated timezone options + 'data_timezone' => null, + 'user_timezone' => null, + 'empty_value' => $emptyValue, + // Don't modify \DateTime classes by reference, we treat + // them like immutable value objects + 'by_reference' => false, + 'error_bubbling' => false, + // If initialized with a \DateTime object, FormType initializes + // this option to "\DateTime". Since the internal, normalized + // representation is not \DateTime, but an array, we need to unset + // this option. + 'data_class' => null, + 'compound' => $compound, + )); + + $resolver->setNormalizers(array( + 'empty_value' => $emptyValueNormalizer, + )); + + $resolver->setAllowedValues(array( + 'input' => array( + 'datetime', + 'string', + 'timestamp', + 'array', + ), + 'widget' => array( + 'single_text', + 'text', + 'choice', + ), + )); + + $resolver->setAllowedTypes(array( + 'format' => array('int', 'string'), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'date'; + } + + private function formatTimestamps(\IntlDateFormatter $formatter, $regex, array $timestamps) + { + $pattern = $formatter->getPattern(); + $timezone = $formatter->getTimezoneId(); + + $formatter->setTimezoneId(\DateTimeZone::UTC); + + if (preg_match($regex, $pattern, $matches)) { + $formatter->setPattern($matches[0]); + + foreach ($timestamps as $key => $timestamp) { + $timestamps[$key] = $formatter->format($timestamp); + } + + // I'd like to clone the formatter above, but then we get a + // segmentation fault, so let's restore the old state instead + $formatter->setPattern($pattern); + } + + $formatter->setTimezoneId($timezone); + + return $timestamps; + } + + private function listYears(array $years) + { + $result = array(); + + foreach ($years as $year) { + $result[$year] = gmmktime(0, 0, 0, 6, 15, $year); + } + + return $result; + } + + private function listMonths(array $months) + { + $result = array(); + + foreach ($months as $month) { + $result[$month] = gmmktime(0, 0, 0, $month, 15); + } + + return $result; + } + + private function listDays(array $days) + { + $result = array(); + + foreach ($days as $day) { + $result[$day] = gmmktime(0, 0, 0, 5, $day); + } + + return $result; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/EmailType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/EmailType.php new file mode 100755 index 0000000000..26652ef660 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/EmailType.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; + +class EmailType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'text'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'email'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FieldType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FieldType.php new file mode 100755 index 0000000000..dbafde1f65 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FieldType.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; + +/** + * Deprecated. You should extend FormType instead. + * + * @author Bernhard Schussek + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ +class FieldType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function getName() + { + return 'field'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FileType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FileType.php new file mode 100755 index 0000000000..d6c9932cc4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FileType.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class FileType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars = array_replace($view->vars, array( + 'type' => 'file', + 'value' => '', + )); + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + $view + ->vars['multipart'] = true + ; + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'compound' => false, + 'data_class' => 'Symfony\Component\HttpFoundation\File\File', + 'empty_data' => null, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'file'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FormType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FormType.php new file mode 100755 index 0000000000..902a1750f5 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -0,0 +1,241 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\Extension\Core\EventListener\TrimListener; +use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper; +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class FormType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->setRequired($options['required']) + ->setDisabled($options['disabled']) + ->setErrorBubbling($options['error_bubbling']) + ->setEmptyData($options['empty_data']) + // BC compatibility, when "property_path" could be false + ->setPropertyPath(is_string($options['property_path']) ? $options['property_path'] : null) + ->setMapped($options['mapped']) + ->setByReference($options['by_reference']) + ->setVirtual($options['virtual']) + ->setCompound($options['compound']) + ->setData(isset($options['data']) ? $options['data'] : null) + ->setDataLocked(isset($options['data'])) + ->setDataMapper($options['compound'] ? new PropertyPathMapper() : null) + ; + + if ($options['trim']) { + $builder->addEventSubscriber(new TrimListener()); + } + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $name = $form->getName(); + $blockName = $options['block_name'] ?: $form->getName(); + $readOnly = $options['read_only']; + $translationDomain = $options['translation_domain']; + + if ($view->parent) { + if ('' === $name) { + throw new FormException('Form node with empty name can be used only as root form node.'); + } + + if ('' !== ($parentFullName = $view->parent->vars['full_name'])) { + $id = sprintf('%s_%s', $view->parent->vars['id'], $name); + $fullName = sprintf('%s[%s]', $parentFullName, $name); + $uniqueBlockPrefix = sprintf('%s_%s', $view->parent->vars['unique_block_prefix'], $blockName); + } else { + $id = $name; + $fullName = $name; + $uniqueBlockPrefix = '_' . $blockName; + } + + // Complex fields are read-only if they themselves or their parents are. + if (!$readOnly) { + $readOnly = $view->parent->vars['read_only']; + } + + if (!$translationDomain) { + $translationDomain = $view->parent->vars['translation_domain']; + } + } else { + $id = $name; + $fullName = $name; + $uniqueBlockPrefix = '_' . $blockName; + + // Strip leading underscores and digits. These are allowed in + // form names, but not in HTML4 ID attributes. + // http://www.w3.org/TR/html401/struct/global.html#adef-id + $id = ltrim($id, '_0123456789'); + } + + $blockPrefixes = array(); + for ($type = $form->getConfig()->getType(); null !== $type; $type = $type->getParent()) { + array_unshift($blockPrefixes, $type->getName()); + } + $blockPrefixes[] = $uniqueBlockPrefix; + + if (!$translationDomain) { + $translationDomain = 'messages'; + } + + $view->vars = array_replace($view->vars, array( + 'form' => $view, + 'id' => $id, + 'name' => $name, + 'full_name' => $fullName, + 'read_only' => $readOnly, + 'errors' => $form->getErrors(), + 'valid' => $form->isBound() ? $form->isValid() : true, + 'value' => $form->getViewData(), + 'data' => $form->getNormData(), + 'disabled' => $form->isDisabled(), + 'required' => $form->isRequired(), + 'max_length' => $options['max_length'], + 'pattern' => $options['pattern'], + 'size' => null, + 'label' => $options['label'], + 'multipart' => false, + 'attr' => $options['attr'], + 'label_attr' => $options['label_attr'], + 'compound' => $form->getConfig()->getCompound(), + 'block_prefixes' => $blockPrefixes, + 'unique_block_prefix' => $uniqueBlockPrefix, + 'translation_domain' => $translationDomain, + // Using the block name here speeds up performance in collection + // forms, where each entry has the same full block name. + // Including the type is important too, because if rows of a + // collection form have different types (dynamically), they should + // be rendered differently. + // https://github.com/symfony/symfony/issues/5038 + 'cache_key' => $uniqueBlockPrefix . '_' . $form->getConfig()->getType()->getName(), + )); + } + + /** + * {@inheritdoc} + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + $multipart = false; + + foreach ($view->children as $child) { + if ($child->vars['multipart']) { + $multipart = true; + break; + } + } + + $view->vars['multipart'] = $multipart; + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + // Derive "data_class" option from passed "data" object + $dataClass = function (Options $options) { + return isset($options['data']) && is_object($options['data']) ? get_class($options['data']) : null; + }; + + // Derive "empty_data" closure from "data_class" option + $emptyData = function (Options $options) { + $class = $options['data_class']; + + if (null !== $class) { + return function (FormInterface $form) use ($class) { + return $form->isEmpty() && !$form->isRequired() ? null : new $class(); + }; + } + + return function (FormInterface $form) { + return $form->getConfig()->getCompound() ? array() : ''; + }; + }; + + // For any form that is not represented by a single HTML control, + // errors should bubble up by default + $errorBubbling = function (Options $options) { + return $options['compound']; + }; + + // BC clause: former property_path=false now equals mapped=false + $mapped = function (Options $options) { + return false !== $options['property_path']; + }; + + // If data is given, the form is locked to that data + // (independent of its value) + $resolver->setOptional(array( + 'data', + )); + + $resolver->setDefaults(array( + 'block_name' => null, + 'data_class' => $dataClass, + 'empty_data' => $emptyData, + 'trim' => true, + 'required' => true, + 'read_only' => false, + 'disabled' => false, + 'max_length' => null, + 'pattern' => null, + 'property_path' => null, + 'mapped' => $mapped, + 'by_reference' => true, + 'error_bubbling' => $errorBubbling, + 'label' => null, + 'attr' => array(), + 'label_attr' => array(), + 'virtual' => false, + 'compound' => true, + 'translation_domain' => null, + )); + + $resolver->setAllowedTypes(array( + 'attr' => 'array', + 'label_attr' => 'array', + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return null; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'form'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/HiddenType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/HiddenType.php new file mode 100755 index 0000000000..fc1533648b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/HiddenType.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class HiddenType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + // hidden fields cannot have a required attribute + 'required' => false, + // Pass errors to the parent + 'error_bubbling' => true, + 'compound' => false, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'hidden'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/IntegerType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/IntegerType.php new file mode 100755 index 0000000000..c3ab0546da --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/IntegerType.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\IntegerToLocalizedStringTransformer; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class IntegerType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addViewTransformer( + new IntegerToLocalizedStringTransformer( + $options['precision'], + $options['grouping'], + $options['rounding_mode'] + )); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + // default precision is locale specific (usually around 3) + 'precision' => null, + 'grouping' => false, + // Integer cast rounds towards 0, so do the same when displaying fractions + 'rounding_mode' => \NumberFormatter::ROUND_DOWN, + 'compound' => false, + )); + + $resolver->setAllowedValues(array( + 'rounding_mode' => array( + \NumberFormatter::ROUND_FLOOR, + \NumberFormatter::ROUND_DOWN, + \NumberFormatter::ROUND_HALFDOWN, + \NumberFormatter::ROUND_HALFEVEN, + \NumberFormatter::ROUND_HALFUP, + \NumberFormatter::ROUND_UP, + \NumberFormatter::ROUND_CEILING, + ), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'integer'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LanguageType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LanguageType.php new file mode 100755 index 0000000000..1255ea9afc --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LanguageType.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Locale\Locale; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class LanguageType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'choices' => Locale::getDisplayLanguages(\Locale::getDefault()), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'choice'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'language'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LocaleType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LocaleType.php new file mode 100755 index 0000000000..e9793aae30 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/LocaleType.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Locale\Locale; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class LocaleType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'choices' => Locale::getDisplayLocales(\Locale::getDefault()), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'choice'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'locale'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/MoneyType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/MoneyType.php new file mode 100755 index 0000000000..dfbbae20a8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/MoneyType.php @@ -0,0 +1,119 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class MoneyType extends AbstractType +{ + private static $patterns = array(); + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->addViewTransformer(new MoneyToLocalizedStringTransformer( + $options['precision'], + $options['grouping'], + null, + $options['divisor'] + )) + ; + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['money_pattern'] = self::getPattern($options['currency']); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'precision' => 2, + 'grouping' => false, + 'divisor' => 1, + 'currency' => 'EUR', + 'compound' => false, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'money'; + } + + /** + * Returns the pattern for this locale + * + * The pattern contains the placeholder "{{ widget }}" where the HTML tag should + * be inserted + */ + private static function getPattern($currency) + { + if (!$currency) { + return '{{ widget }}'; + } + + $locale = \Locale::getDefault(); + + if (!isset(self::$patterns[$locale])) { + self::$patterns[$locale] = array(); + } + + if (!isset(self::$patterns[$locale][$currency])) { + $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY); + $pattern = $format->formatCurrency('123', $currency); + + // the spacings between currency symbol and number are ignored, because + // a single space leads to better readability in combination with input + // fields + + // the regex also considers non-break spaces (0xC2 or 0xA0 in UTF-8) + + preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches); + + if (!empty($matches[1])) { + self::$patterns[$locale][$currency] = $matches[1].' {{ widget }}'; + } elseif (!empty($matches[2])) { + self::$patterns[$locale][$currency] = '{{ widget }} '.$matches[2]; + } else { + self::$patterns[$locale][$currency] = '{{ widget }}'; + } + } + + return self::$patterns[$locale][$currency]; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/NumberType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/NumberType.php new file mode 100755 index 0000000000..93a3d9824e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/NumberType.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class NumberType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addViewTransformer(new NumberToLocalizedStringTransformer( + $options['precision'], + $options['grouping'], + $options['rounding_mode'] + )); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + // default precision is locale specific (usually around 3) + 'precision' => null, + 'grouping' => false, + 'rounding_mode' => \NumberFormatter::ROUND_HALFUP, + 'compound' => false, + )); + + $resolver->setAllowedValues(array( + 'rounding_mode' => array( + \NumberFormatter::ROUND_FLOOR, + \NumberFormatter::ROUND_DOWN, + \NumberFormatter::ROUND_HALFDOWN, + \NumberFormatter::ROUND_HALFEVEN, + \NumberFormatter::ROUND_HALFUP, + \NumberFormatter::ROUND_UP, + \NumberFormatter::ROUND_CEILING, + ), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'number'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PasswordType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PasswordType.php new file mode 100755 index 0000000000..14ece2ac50 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PasswordType.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class PasswordType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + if ($options['always_empty'] || !$form->isBound()) { + $view->vars['value'] = ''; + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'always_empty' => true, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'text'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'password'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PercentType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PercentType.php new file mode 100755 index 0000000000..52ca820e93 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/PercentType.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class PercentType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addViewTransformer(new PercentToLocalizedStringTransformer($options['precision'], $options['type'])); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'precision' => 0, + 'type' => 'fractional', + 'compound' => false, + )); + + $resolver->setAllowedValues(array( + 'type' => array( + 'fractional', + 'integer', + ), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'percent'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RadioType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RadioType.php new file mode 100755 index 0000000000..dfa7c7d53b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RadioType.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; + +class RadioType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'checkbox'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'radio'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RepeatedType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RepeatedType.php new file mode 100755 index 0000000000..f402f7896c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/RepeatedType.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\DataTransformer\ValueToDuplicatesTransformer; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class RepeatedType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + // Overwrite required option for child fields + $options['first_options']['required'] = $options['required']; + $options['second_options']['required'] = $options['required']; + + $builder + ->addViewTransformer(new ValueToDuplicatesTransformer(array( + $options['first_name'], + $options['second_name'], + ))) + ->add($options['first_name'], $options['type'], array_merge($options['options'], $options['first_options'])) + ->add($options['second_name'], $options['type'], array_merge($options['options'], $options['second_options'])) + ; + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'type' => 'text', + 'options' => array(), + 'first_options' => array(), + 'second_options' => array(), + 'first_name' => 'first', + 'second_name' => 'second', + 'error_bubbling' => false, + )); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'repeated'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/SearchType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/SearchType.php new file mode 100755 index 0000000000..bf82972d56 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/SearchType.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; + +class SearchType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'text'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'search'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextType.php new file mode 100755 index 0000000000..ebfeaf6ac2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextType.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class TextType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'compound' => false, + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'text'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextareaType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextareaType.php new file mode 100755 index 0000000000..0e749b1554 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TextareaType.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\FormInterface; + +class TextareaType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['pattern'] = null; + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'text'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'textarea'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimeType.php new file mode 100755 index 0000000000..8973948a2f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -0,0 +1,223 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\ReversedTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class TimeType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $parts = array('hour', 'minute'); + $format = 'H:i'; + if ($options['with_seconds']) { + $format = 'H:i:s'; + $parts[] = 'second'; + } + + if ('single_text' === $options['widget']) { + $builder->addViewTransformer(new DateTimeToStringTransformer($options['model_timezone'], $options['view_timezone'], $format)); + } else { + $hourOptions = $minuteOptions = $secondOptions = array( + 'error_bubbling' => true, + ); + + if ('choice' === $options['widget']) { + $hours = $minutes = array(); + + foreach ($options['hours'] as $hour) { + $hours[$hour] = str_pad($hour, 2, '0', STR_PAD_LEFT); + } + foreach ($options['minutes'] as $minute) { + $minutes[$minute] = str_pad($minute, 2, '0', STR_PAD_LEFT); + } + + // Only pass a subset of the options to children + $hourOptions['choices'] = $hours; + $hourOptions['empty_value'] = $options['empty_value']['hour']; + $minuteOptions['choices'] = $minutes; + $minuteOptions['empty_value'] = $options['empty_value']['minute']; + + if ($options['with_seconds']) { + $seconds = array(); + + foreach ($options['seconds'] as $second) { + $seconds[$second] = str_pad($second, 2, '0', STR_PAD_LEFT); + } + + $secondOptions['choices'] = $seconds; + $secondOptions['empty_value'] = $options['empty_value']['second']; + } + + // Append generic carry-along options + foreach (array('required', 'translation_domain') as $passOpt) { + $hourOptions[$passOpt] = $minuteOptions[$passOpt] = $options[$passOpt]; + if ($options['with_seconds']) { + $secondOptions[$passOpt] = $options[$passOpt]; + } + } + } + + $builder + ->add('hour', $options['widget'], $hourOptions) + ->add('minute', $options['widget'], $minuteOptions) + ; + + if ($options['with_seconds']) { + $builder->add('second', $options['widget'], $secondOptions); + } + + $builder->addViewTransformer(new DateTimeToArrayTransformer($options['model_timezone'], $options['view_timezone'], $parts, 'text' === $options['widget'])); + } + + if ('string' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToStringTransformer($options['model_timezone'], $options['model_timezone'], 'H:i:s') + )); + } elseif ('timestamp' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToTimestampTransformer($options['model_timezone'], $options['model_timezone']) + )); + } elseif ('array' === $options['input']) { + $builder->addModelTransformer(new ReversedTransformer( + new DateTimeToArrayTransformer($options['model_timezone'], $options['model_timezone'], $parts) + )); + } + } + + /** + * {@inheritdoc} + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars = array_replace($view->vars, array( + 'widget' => $options['widget'], + 'with_seconds' => $options['with_seconds'], + )); + + if ('single_text' === $options['widget']) { + $view->vars['type'] = 'time'; + } + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $compound = function (Options $options) { + return $options['widget'] !== 'single_text'; + }; + + $emptyValue = $emptyValueDefault = function (Options $options) { + return $options['required'] ? null : ''; + }; + + $emptyValueNormalizer = function (Options $options, $emptyValue) use ($emptyValueDefault) { + if (is_array($emptyValue)) { + $default = $emptyValueDefault($options); + + return array_merge( + array('hour' => $default, 'minute' => $default, 'second' => $default), + $emptyValue + ); + } + + return array( + 'hour' => $emptyValue, + 'minute' => $emptyValue, + 'second' => $emptyValue + ); + }; + + // BC until Symfony 2.3 + $modelTimezone = function (Options $options) { + return $options['data_timezone']; + }; + + // BC until Symfony 2.3 + $viewTimezone = function (Options $options) { + return $options['user_timezone']; + }; + + $resolver->setDefaults(array( + 'hours' => range(0, 23), + 'minutes' => range(0, 59), + 'seconds' => range(0, 59), + 'widget' => 'choice', + 'input' => 'datetime', + 'with_seconds' => false, + 'model_timezone' => $modelTimezone, + 'view_timezone' => $viewTimezone, + // Deprecated timezone options + 'data_timezone' => null, + 'user_timezone' => null, + 'empty_value' => $emptyValue, + // Don't modify \DateTime classes by reference, we treat + // them like immutable value objects + 'by_reference' => false, + 'error_bubbling' => false, + // If initialized with a \DateTime object, FormType initializes + // this option to "\DateTime". Since the internal, normalized + // representation is not \DateTime, but an array, we need to unset + // this option. + 'data_class' => null, + 'compound' => $compound, + )); + + $resolver->setNormalizers(array( + 'empty_value' => $emptyValueNormalizer, + )); + + $resolver->setAllowedValues(array( + 'input' => array( + 'datetime', + 'string', + 'timestamp', + 'array', + ), + 'widget' => array( + 'single_text', + 'text', + 'choice', + ), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'field'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'time'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php new file mode 100755 index 0000000000..cd4a2ad38b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class TimezoneType extends AbstractType +{ + /** + * Stores the available timezone choices + * @var array + */ + private static $timezones; + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'choices' => self::getTimezones(), + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'choice'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'timezone'; + } + + /** + * Returns the timezone choices. + * + * The choices are generated from the ICU function + * \DateTimeZone::listIdentifiers(). They are cached during a single request, + * so multiple timezone fields on the same page don't lead to unnecessary + * overhead. + * + * @return array The timezone choices + */ + public static function getTimezones() + { + if (null === static::$timezones) { + static::$timezones = array(); + + foreach (\DateTimeZone::listIdentifiers() as $timezone) { + $parts = explode('/', $timezone); + + if (count($parts) > 2) { + $region = $parts[0]; + $name = $parts[1].' - '.$parts[2]; + } elseif (count($parts) > 1) { + $region = $parts[0]; + $name = $parts[1]; + } else { + $region = 'Other'; + $name = $parts[0]; + } + + static::$timezones[$region][$timezone] = str_replace('_', ' ', $name); + } + } + + return static::$timezones; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/UrlType.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/UrlType.php new file mode 100755 index 0000000000..27749b1a8c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/Type/UrlType.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class UrlType extends AbstractType +{ + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addEventSubscriber(new FixUrlProtocolListener($options['default_protocol'])); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'default_protocol' => 'http', + )); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return 'text'; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'url'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Core/View/ChoiceView.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/View/ChoiceView.php new file mode 100755 index 0000000000..5b348eae2a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Core/View/ChoiceView.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Core\View; + +/** + * Represents a choice in templates. + * + * @author Bernhard Schussek + */ +class ChoiceView +{ + /** + * The original choice value. + * + * @var mixed + */ + public $data; + + /** + * The view representation of the choice. + * + * @var string + */ + public $value; + + /** + * The label displayed to humans. + * + * @var string + */ + public $label; + + /** + * Creates a new ChoiceView. + * + * @param mixed $data The original choice. + * @param string $value The view representation of the choice. + * @param string $label The label displayed to humans. + */ + public function __construct($data, $value, $label) + { + $this->data = $data; + $this->value = $value; + $this->label = $label; + } + + /** + * Returns whether this choice is selected for the given value. + * + * @param string|array $value The selected choice value. + * + * @return Boolean Whether the choice is selected. + */ + public function isSelected($value) + { + if (is_array($value)) { + return false !== array_search($this->value, $value, true); + } + + return $this->value === $value; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php new file mode 100755 index 0000000000..71d06381ad --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf; + +use Symfony\Component\Form\Extension\Csrf\Type; +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; +use Symfony\Component\Form\AbstractExtension; + +/** + * This extension protects forms by using a CSRF token. + */ +class CsrfExtension extends AbstractExtension +{ + private $csrfProvider; + + /** + * Constructor. + * + * @param CsrfProviderInterface $csrfProvider The CSRF provider + */ + public function __construct(CsrfProviderInterface $csrfProvider) + { + $this->csrfProvider = $csrfProvider; + } + + /** + * {@inheritDoc} + */ + protected function loadTypeExtensions() + { + return array( + new Type\FormTypeCsrfExtension($this->csrfProvider), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php new file mode 100755 index 0000000000..322a4f8326 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; + +/** + * Marks classes able to provide CSRF protection + * + * You can generate a CSRF token by using the method generateCsrfToken(). To + * this method you should pass a value that is unique to the page that should + * be secured against CSRF attacks. This value doesn't necessarily have to be + * secret. Implementations of this interface are responsible for adding more + * secret information. + * + * If you want to secure a form submission against CSRF attacks, you could + * supply an "intention" string. This way you make sure that the form can only + * be bound to pages that are designed to handle the form, that is, that use + * the same intention string to validate the CSRF token with isCsrfTokenValid(). + * + * @author Bernhard Schussek + */ +interface CsrfProviderInterface +{ + /** + * Generates a CSRF token for a page of your application. + * + * @param string $intention Some value that identifies the action intention + * (i.e. "authenticate"). Doesn't have to be a secret value. + */ + public function generateCsrfToken($intention); + + /** + * Validates a CSRF token. + * + * @param string $intention The intention used when generating the CSRF token + * @param string $token The token supplied by the browser + * + * @return Boolean Whether the token supplied by the browser is correct + */ + public function isCsrfTokenValid($intention, $token); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php new file mode 100755 index 0000000000..3cc4b4312a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; + +/** + * Default implementation of CsrfProviderInterface. + * + * This provider uses the session ID returned by session_id() as well as a + * user-defined secret value to secure the CSRF token. + * + * @author Bernhard Schussek + */ +class DefaultCsrfProvider implements CsrfProviderInterface +{ + /** + * A secret value used for generating the CSRF token + * @var string + */ + protected $secret; + + /** + * Initializes the provider with a secret value + * + * A recommended value for the secret is a generated value with at least + * 32 characters and mixed letters, digits and special characters. + * + * @param string $secret A secret value included in the CSRF token + */ + public function __construct($secret) + { + $this->secret = $secret; + } + + /** + * {@inheritDoc} + */ + public function generateCsrfToken($intention) + { + return sha1($this->secret.$intention.$this->getSessionId()); + } + + /** + * {@inheritDoc} + */ + public function isCsrfTokenValid($intention, $token) + { + return $token === $this->generateCsrfToken($intention); + } + + /** + * Returns the ID of the user session. + * + * Automatically starts the session if necessary. + * + * @return string The session ID + */ + protected function getSessionId() + { + if (!session_id()) { + session_start(); + } + + return session_id(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php new file mode 100755 index 0000000000..ea1fa58547 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; + +use Symfony\Component\HttpFoundation\Session\Session; + +/** + * This provider uses a Symfony2 Session object to retrieve the user's + * session ID. + * + * @see DefaultCsrfProvider + * + * @author Bernhard Schussek + */ +class SessionCsrfProvider extends DefaultCsrfProvider +{ + /** + * The user session from which the session ID is returned + * @var Session + */ + protected $session; + + /** + * Initializes the provider with a Session object and a secret value. + * + * 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 string $secret A secret value included in the CSRF token + */ + public function __construct(Session $session, $secret) + { + parent::__construct($secret); + + $this->session = $session; + } + + /** + * {@inheritdoc} + */ + protected function getSessionId() + { + $this->session->start(); + + return $this->session->getId(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php new file mode 100755 index 0000000000..345a7ea9a9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf\EventListener; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; + +/** + * @author Bernhard Schussek + */ +class CsrfValidationListener implements EventSubscriberInterface +{ + /** + * The name of the CSRF field + * @var string + */ + private $fieldName; + + /** + * The provider for generating and validating CSRF tokens + * @var CsrfProviderInterface + */ + private $csrfProvider; + + /** + * A text mentioning the intention of the CSRF token + * + * Validation of the token will only succeed if it was generated in the + * same session and with the same intention. + * + * @var string + */ + private $intention; + + public static function getSubscribedEvents() + { + return array( + FormEvents::PRE_BIND => 'preBind', + ); + } + + public function __construct($fieldName, CsrfProviderInterface $csrfProvider, $intention) + { + $this->fieldName = $fieldName; + $this->csrfProvider = $csrfProvider; + $this->intention = $intention; + } + + public function preBind(FormEvent $event) + { + $form = $event->getForm(); + $data = $event->getData(); + + if ($form->isRoot() && $form->getConfig()->getOption('compound')) { + if (!isset($data[$this->fieldName]) || !$this->csrfProvider->isCsrfTokenValid($this->intention, $data[$this->fieldName])) { + $form->addError(new FormError('The CSRF token is invalid. Please try to resubmit the form.')); + } + + unset($data[$this->fieldName]); + } + + $event->setData($data); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php new file mode 100755 index 0000000000..ea13056c86 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Csrf\Type; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; +use Symfony\Component\Form\Extension\Csrf\EventListener\CsrfValidationListener; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +class FormTypeCsrfExtension extends AbstractTypeExtension +{ + private $defaultCsrfProvider; + private $defaultEnabled; + private $defaultFieldName; + + public function __construct(CsrfProviderInterface $defaultCsrfProvider, $defaultEnabled = true, $defaultFieldName = '_token') + { + $this->defaultCsrfProvider = $defaultCsrfProvider; + $this->defaultEnabled = $defaultEnabled; + $this->defaultFieldName = $defaultFieldName; + } + + /** + * Adds a CSRF field to the form when the CSRF protection is enabled. + * + * @param FormBuilderInterface $builder The form builder + * @param array $options The options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + if (!$options['csrf_protection']) { + return; + } + + $builder + ->setAttribute('csrf_factory', $builder->getFormFactory()) + ->addEventSubscriber(new CsrfValidationListener($options['csrf_field_name'], $options['csrf_provider'], $options['intention'])) + ; + } + + /** + * Adds a CSRF field to the root form view. + * + * @param FormView $view The form view + * @param FormInterface $form The form + * @param array $options The options + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + if ($options['csrf_protection'] && !$view->parent && $options['compound']) { + $factory = $form->getConfig()->getAttribute('csrf_factory'); + $data = $options['csrf_provider']->generateCsrfToken($options['intention']); + + $csrfForm = $factory->createNamed($options['csrf_field_name'], 'hidden', $data, array( + 'mapped' => false, + )); + + $view->children[$options['csrf_field_name']] = $csrfForm->createView($view); + } + } + + /** + * {@inheritDoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'csrf_protection' => $this->defaultEnabled, + 'csrf_field_name' => $this->defaultFieldName, + 'csrf_provider' => $this->defaultCsrfProvider, + 'intention' => 'unknown', + )); + } + + /** + * {@inheritDoc} + */ + public function getExtendedType() + { + return 'form'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php new file mode 100755 index 0000000000..06936643a1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\DependencyInjection; + +use Symfony\Component\Form\FormExtensionInterface; +use Symfony\Component\Form\FormTypeGuesserChain; +use Symfony\Component\DependencyInjection\ContainerInterface; + +class DependencyInjectionExtension implements FormExtensionInterface +{ + private $container; + + private $typeServiceIds; + + private $guesserServiceIds; + + private $guesser; + + private $guesserLoaded = false; + + public function __construct(ContainerInterface $container, + array $typeServiceIds, array $typeExtensionServiceIds, + array $guesserServiceIds) + { + $this->container = $container; + $this->typeServiceIds = $typeServiceIds; + $this->typeExtensionServiceIds = $typeExtensionServiceIds; + $this->guesserServiceIds = $guesserServiceIds; + } + + public function getType($name) + { + if (!isset($this->typeServiceIds[$name])) { + throw new \InvalidArgumentException(sprintf('The field type "%s" is not registered with the service container.', $name)); + } + + $type = $this->container->get($this->typeServiceIds[$name]); + + if ($type->getName() !== $name) { + throw new \InvalidArgumentException( + sprintf('The type name specified for the service "%s" does not match the actual name. Expected "%s", given "%s"', + $this->typeServiceIds[$name], + $name, + $type->getName() + )); + } + + return $type; + } + + public function hasType($name) + { + return isset($this->typeServiceIds[$name]); + } + + public function getTypeExtensions($name) + { + $extensions = array(); + + if (isset($this->typeExtensionServiceIds[$name])) { + foreach ($this->typeExtensionServiceIds[$name] as $serviceId) { + $extensions[] = $this->container->get($serviceId); + } + } + + return $extensions; + } + + public function hasTypeExtensions($name) + { + return isset($this->typeExtensionServiceIds[$name]); + } + + public function getTypeGuesser() + { + if (!$this->guesserLoaded) { + $this->guesserLoaded = true; + $guessers = array(); + + foreach ($this->guesserServiceIds as $serviceId) { + $guessers[] = $this->container->get($serviceId); + } + + if (count($guessers) > 0) { + $this->guesser = new FormTypeGuesserChain($guessers); + } + } + + return $this->guesser; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php new file mode 100755 index 0000000000..1c019fc976 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\HttpFoundation\EventListener; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Request; + +/** + * @author Bernhard Schussek + */ +class BindRequestListener implements EventSubscriberInterface +{ + public static function getSubscribedEvents() + { + // High priority in order to supersede other listeners + return array(FormEvents::PRE_BIND => array('preBind', 128)); + } + + public function preBind(FormEvent $event) + { + $form = $event->getForm(); + + /* @var Request $request */ + $request = $event->getData(); + + // Only proceed if we actually deal with a Request + if (!$request instanceof Request) { + return; + } + + $name = $form->getConfig()->getName(); + $default = $form->getConfig()->getCompound() ? array() : null; + + // Store the bound data in case of a post request + switch ($request->getMethod()) { + case 'POST': + case 'PUT': + case 'DELETE': + case 'PATCH': + if ('' === $name) { + // Form bound without name + $params = $request->request->all(); + $files = $request->files->all(); + } else { + $params = $request->request->get($name, $default); + $files = $request->files->get($name, $default); + } + + if (is_array($params) && is_array($files)) { + $data = array_replace_recursive($params, $files); + } else { + $data = $params ?: $files; + } + + break; + + case 'GET': + $data = '' === $name + ? $request->query->all() + : $request->query->get($name, $default); + + break; + + default: + throw new FormException(sprintf( + 'The request method "%s" is not supported', + $request->getMethod() + )); + } + + $event->setData($data); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php new file mode 100755 index 0000000000..08bd89c9e4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\HttpFoundation; + +use Symfony\Component\Form\AbstractExtension; + +/** + * Integrates the HttpFoundation component with the Form library. + * + * @author Bernhard Schussek + */ +class HttpFoundationExtension extends AbstractExtension +{ + protected function loadTypeExtensions() + { + return array( + new Type\FormTypeHttpFoundationExtension(), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php new file mode 100755 index 0000000000..936f58efdd --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\HttpFoundation\Type; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener; +use Symfony\Component\Form\FormBuilderInterface; + +/** + * @author Bernhard Schussek + */ +class FormTypeHttpFoundationExtension extends AbstractTypeExtension +{ + /** + * @var BindRequestListener + */ + private $listener; + + public function __construct() + { + $this->listener = new BindRequestListener(); + } + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addEventSubscriber($this->listener); + } + + /** + * {@inheritdoc} + */ + public function getExtendedType() + { + return 'form'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php new file mode 100755 index 0000000000..573cb518d4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Templating; + +use Symfony\Component\Form\AbstractExtension; +use Symfony\Component\Form\FormRenderer; +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; +use Symfony\Component\Templating\PhpEngine; +use Symfony\Bundle\FrameworkBundle\Templating\Helper\FormHelper; + +/** + * Integrates the Templating component with the Form library. + * + * @author Bernhard Schussek + */ +class TemplatingExtension extends AbstractExtension +{ + public function __construct(PhpEngine $engine, CsrfProviderInterface $csrfProvider = null, array $defaultThemes = array()) + { + $engine->addHelpers(array( + new FormHelper(new FormRenderer(new TemplatingRendererEngine($engine, $defaultThemes), $csrfProvider)) + )); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php new file mode 100755 index 0000000000..a6a303ad10 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Templating/TemplatingRendererEngine.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Templating; + +use Symfony\Component\Form\AbstractRendererEngine; +use Symfony\Component\Form\FormView; +use Symfony\Component\Templating\EngineInterface; + +/** + * @author Bernhard Schussek + */ +class TemplatingRendererEngine extends AbstractRendererEngine +{ + /** + * @var EngineInterface + */ + private $engine; + + public function __construct(EngineInterface $engine, array $defaultThemes = array()) + { + parent::__construct($defaultThemes); + + $this->engine = $engine; + } + + /** + * {@inheritdoc} + */ + public function renderBlock(FormView $view, $resource, $blockName, array $variables = array()) + { + return trim($this->engine->render($resource, $variables)); + } + + /** + * Loads the cache with the resource for a given block name. + * + * This implementation tries to load as few blocks as possible, since each block + * is represented by a template on the file system. + * + * @see getResourceForBlock() + * + * @param string $cacheKey The cache key of the form view. + * @param FormView $view The form view for finding the applying themes. + * @param string $blockName The name of the block to load. + * + * @return Boolean True if the resource could be loaded, false otherwise. + */ + protected function loadResourceForBlockName($cacheKey, FormView $view, $blockName) + { + // Recursively try to find the block in the themes assigned to $view, + // then of its parent form, then of the parent form of the parent and so on. + // When the root form is reached in this recursion, also the default + // themes are taken into account. + + // Check each theme whether it contains the searched block + if (isset($this->themes[$cacheKey])) { + for ($i = count($this->themes[$cacheKey]) - 1; $i >= 0; --$i) { + if ($this->loadResourceFromTheme($cacheKey, $blockName, $this->themes[$cacheKey][$i])) { + return true; + } + } + } + + // Check the default themes once we reach the root form without success + if (!$view->parent) { + for ($i = count($this->defaultThemes) - 1; $i >= 0; --$i) { + if ($this->loadResourceFromTheme($cacheKey, $blockName, $this->defaultThemes[$i])) { + return true; + } + } + } + + // If we did not find anything in the themes of the current view, proceed + // with the themes of the parent view + if ($view->parent) { + $parentCacheKey = $view->parent->vars[self::CACHE_KEY_VAR]; + + if (!isset($this->resources[$parentCacheKey][$blockName])) { + $this->loadResourceForBlockName($parentCacheKey, $view->parent, $blockName); + } + + // If a template exists in the parent themes, cache that template + // for the current theme as well to speed up further accesses + if ($this->resources[$parentCacheKey][$blockName]) { + $this->resources[$cacheKey][$blockName] = $this->resources[$parentCacheKey][$blockName]; + + return true; + } + } + + // Cache that we didn't find anything to speed up further accesses + $this->resources[$cacheKey][$blockName] = false; + + return false; + } + + /** + * Tries to load the resource for a block from a theme. + * + * @param string $cacheKey The cache key for storing the resource. + * @param string $blockName The name of the block to load a resource for. + * @param mixed $theme The theme to load the block from. + * + * @return Boolean True if the resource could be loaded, false otherwise. + */ + protected function loadResourceFromTheme($cacheKey, $blockName, $theme) + { + if ($this->engine->exists($templateName = $theme . ':' . $blockName . '.html.php')) { + $this->resources[$cacheKey][$blockName] = $templateName; + + return true; + } + + return false; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/Form.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/Form.php new file mode 100755 index 0000000000..87e3329765 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/Form.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Constraints; + +use Symfony\Component\Validator\Constraint; + +/** + * @author Bernhard Schussek + */ +class Form extends Constraint +{ + /** + * Violation code marking an invalid form. + */ + const ERR_INVALID = 1; + + /** + * {@inheritdoc} + */ + public function getTargets() + { + return self::CLASS_CONSTRAINT; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php new file mode 100755 index 0000000000..65e54f6feb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -0,0 +1,196 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Constraints; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Extension\Validator\Util\ServerParams; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\ConstraintValidator; + +/** + * @author Bernhard Schussek + */ +class FormValidator extends ConstraintValidator +{ + /** + * @var ServerParams + */ + private $serverParams; + + /** + * Creates a validator with the given server parameters. + * + * @param ServerParams $params The server parameters. Default + * parameters are created if null. + */ + public function __construct(ServerParams $params = null) + { + $this->serverParams = $params ?: new ServerParams(); + } + + /** + * {@inheritdoc} + */ + public function validate($form, Constraint $constraint) + { + if (!$form instanceof FormInterface) { + return; + } + + /* @var FormInterface $form */ + $config = $form->getConfig(); + + if ($form->isSynchronized()) { + // Validate the form data only if transformation succeeded + $path = $this->context->getPropertyPath(); + $graphWalker = $this->context->getGraphWalker(); + $groups = self::getValidationGroups($form); + + if (!empty($path)) { + $path .= '.'; + } + + // Validate the data against its own constraints + if (self::allowDataWalking($form)) { + foreach ($groups as $group) { + $graphWalker->walkReference($form->getData(), $group, $path . 'data', true); + } + } + + // Validate the data against the constraints defined + // in the form + $constraints = $config->getOption('constraints'); + foreach ($constraints as $constraint) { + foreach ($groups as $group) { + if (in_array($group, $constraint->groups)) { + $graphWalker->walkConstraint($constraint, $form->getData(), $group, $path . 'data'); + + // Prevent duplicate validation + continue 2; + } + } + } + } else { + $childrenSynchronized = true; + + foreach ($form as $child) { + if (!$child->isSynchronized()) { + $childrenSynchronized = false; + break; + } + } + + // Mark the form with an error if it is not synchronized BUT all + // of its children are synchronized. If any child is not + // synchronized, an error is displayed there already and showing + // a second error in its parent form is pointless, or worse, may + // lead to duplicate errors if error bubbling is enabled on the + // child. + // See also https://github.com/symfony/symfony/issues/4359 + if ($childrenSynchronized) { + $clientDataAsString = is_scalar($form->getViewData()) + ? (string) $form->getViewData() + : gettype($form->getViewData()); + + $this->context->addViolation( + $config->getOption('invalid_message'), + array_replace(array('{{ value }}' => $clientDataAsString), $config->getOption('invalid_message_parameters')), + $form->getViewData(), + null, + Form::ERR_INVALID + ); + } + } + + // Mark the form with an error if it contains extra fields + if (count($form->getExtraData()) > 0) { + $this->context->addViolation( + $config->getOption('extra_fields_message'), + array('{{ extra_fields }}' => implode('", "', array_keys($form->getExtraData()))), + $form->getExtraData() + ); + } + + // Mark the form with an error if the uploaded size was too large + $length = $this->serverParams->getContentLength(); + + if ($form->isRoot() && null !== $length) { + $max = $this->serverParams->getPostMaxSize(); + + if (null !== $max && $length > $max) { + $this->context->addViolation( + $config->getOption('post_max_size_message'), + array('{{ max }}' => $this->serverParams->getNormalizedIniPostMaxSize()), + $length + ); + } + } + } + + /** + * Returns whether the data of a form may be walked. + * + * @param FormInterface $form The form to test. + * + * @return Boolean Whether the graph walker may walk the data. + */ + private static function allowDataWalking(FormInterface $form) + { + $data = $form->getData(); + + // Scalar values cannot have mapped constraints + if (!is_object($data) && !is_array($data)) { + return false; + } + + // Root forms are always validated + if ($form->isRoot()) { + return true; + } + + // Non-root forms are validated if validation cascading + // is enabled in all ancestor forms + while (null !== ($form = $form->getParent())) { + if (!$form->getConfig()->getOption('cascade_validation')) { + return false; + } + } + + return true; + } + + /** + * Returns the validation groups of the given form. + * + * @param FormInterface $form The form. + * + * @return array The validation groups. + */ + private static function getValidationGroups(FormInterface $form) + { + do { + $groups = $form->getConfig()->getOption('validation_groups'); + + if (null !== $groups) { + if (is_callable($groups)) { + $groups = call_user_func($groups, $form); + } + + return (array) $groups; + } + + $form = $form->getParent(); + } while (null !== $form); + + return array(Constraint::DEFAULT_GROUP); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php new file mode 100755 index 0000000000..dd2c51ab57 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\EventListener; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapperInterface; +use Symfony\Component\Validator\ValidatorInterface; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Validator\Constraints\Form; + +/** + * @author Bernhard Schussek + */ +class ValidationListener implements EventSubscriberInterface +{ + private $validator; + + private $violationMapper; + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() + { + return array(FormEvents::POST_BIND => 'validateForm'); + } + + public function __construct(ValidatorInterface $validator, ViolationMapperInterface $violationMapper) + { + $this->validator = $validator; + $this->violationMapper = $violationMapper; + } + + /** + * Validates the form and its domain object. + * + * @param FormEvent $event The event object + */ + public function validateForm(FormEvent $event) + { + $form = $event->getForm(); + + if ($form->isRoot()) { + // Validate the form in group "Default" + $violations = $this->validator->validate($form); + + if (count($violations) > 0) { + foreach ($violations as $violation) { + // Allow the "invalid" constraint to be put onto + // non-synchronized forms + $allowNonSynchronized = Form::ERR_INVALID === $violation->getCode(); + + $this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized); + } + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php new file mode 100755 index 0000000000..fe55ed7971 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Type; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; +use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener; +use Symfony\Component\Validator\ValidatorInterface; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +class FormTypeValidatorExtension extends AbstractTypeExtension +{ + /** + * @var ValidatorInterface + */ + private $validator; + + /** + * @var ViolationMapper + */ + private $violationMapper; + + public function __construct(ValidatorInterface $validator) + { + $this->validator = $validator; + $this->violationMapper = new ViolationMapper(); + } + + /** + * {@inheritdoc} + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addEventSubscriber(new ValidationListener($this->validator, $this->violationMapper)); + } + + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + // BC clause + $constraints = function (Options $options) { + return $options['validation_constraint']; + }; + + // Make sure that validation groups end up as null, closure or array + $validationGroupsNormalizer = function (Options $options, $groups) { + if (empty($groups)) { + return null; + } + + if (is_callable($groups)) { + return $groups; + } + + return (array) $groups; + }; + + // Constraint should always be converted to an array + $constraintsNormalizer = function (Options $options, $constraints) { + return is_object($constraints) ? array($constraints) : (array) $constraints; + }; + + $resolver->setDefaults(array( + 'error_mapping' => array(), + 'validation_groups' => null, + // "validation_constraint" is deprecated. Use "constraints". + 'validation_constraint' => null, + 'constraints' => $constraints, + 'cascade_validation' => false, + 'invalid_message' => 'This value is not valid.', + 'invalid_message_parameters' => array(), + 'extra_fields_message' => 'This form should not contain extra fields.', + 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', + )); + + $resolver->setNormalizers(array( + 'validation_groups' => $validationGroupsNormalizer, + 'constraints' => $constraintsNormalizer, + )); + } + + /** + * {@inheritdoc} + */ + public function getExtendedType() + { + return 'form'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php new file mode 100755 index 0000000000..858ff0fae1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Type/RepeatedTypeValidatorExtension.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Type; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\OptionsResolver\Options; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +class RepeatedTypeValidatorExtension extends AbstractTypeExtension +{ + /** + * {@inheritdoc} + */ + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + // Map errors to the first field + $errorMapping = function (Options $options) { + return array('.' => $options['first_name']); + }; + + $resolver->setDefaults(array( + 'error_mapping' => $errorMapping, + )); + } + + /** + * {@inheritdoc} + */ + public function getExtendedType() + { + return 'repeated'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php new file mode 100755 index 0000000000..cac6047ce2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Util; + +/** + * @author Bernhard Schussek + */ +class ServerParams +{ + /** + * Returns maximum post size in bytes. + * + * @return null|integer The maximum post size in bytes + */ + public function getPostMaxSize() + { + $iniMax = $this->getNormalizedIniPostMaxSize(); + + if ('' === $iniMax) { + return null; + } + + $max = (int) $iniMax; + + switch (substr($iniMax, -1)) { + case 'G': + $max *= 1024; + case 'M': + $max *= 1024; + case 'K': + $max *= 1024; + } + + return $max; + } + + /** + * Returns the normalized "post_max_size" ini setting. + * + * @return string + */ + public function getNormalizedIniPostMaxSize() + { + return strtoupper(trim(ini_get('post_max_size'))); + } + + /** + * Returns the content length of the request. + * + * @return mixed The request content length. + */ + public function getContentLength() + { + return isset($_SERVER['CONTENT_LENGTH']) + ? (int) $_SERVER['CONTENT_LENGTH'] + : null; + } + +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php new file mode 100755 index 0000000000..3a70b6215e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator; + +use Symfony\Component\Form\Extension\Validator\Type; +use Symfony\Component\Form\Extension\Validator\Constraints\Form; +use Symfony\Component\Form\AbstractExtension; +use Symfony\Component\Validator\ValidatorInterface; +use Symfony\Component\Validator\Constraints\Valid; + +/** + * Extension supporting the Symfony2 Validator component in forms. + * + * @author Bernhard Schussek + */ +class ValidatorExtension extends AbstractExtension +{ + private $validator; + + public function __construct(ValidatorInterface $validator) + { + $this->validator = $validator; + + // Register the form constraints in the validator programmatically. + // This functionality is required when using the Form component without + // the DIC, where the XML file is loaded automatically. Thus the following + // code must be kept synchronized with validation.xml + + /** @var \Symfony\Component\Validator\Mapping\ClassMetadata $metadata */ + $metadata = $this->validator->getMetadataFactory()->getClassMetadata('Symfony\Component\Form\Form'); + $metadata->addConstraint(new Form()); + $metadata->addPropertyConstraint('children', new Valid()); + } + + public function loadTypeGuesser() + { + return new ValidatorTypeGuesser($this->validator->getMetadataFactory()); + } + + protected function loadTypeExtensions() + { + return array( + new Type\FormTypeValidatorExtension($this->validator), + new Type\RepeatedTypeValidatorExtension(), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php new file mode 100755 index 0000000000..6aa2da1122 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -0,0 +1,299 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator; + +use Symfony\Component\Form\FormTypeGuesserInterface; +use Symfony\Component\Form\Guess\Guess; +use Symfony\Component\Form\Guess\TypeGuess; +use Symfony\Component\Form\Guess\ValueGuess; +use Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface; +use Symfony\Component\Validator\Constraint; + +class ValidatorTypeGuesser implements FormTypeGuesserInterface +{ + private $metadataFactory; + + public function __construct(ClassMetadataFactoryInterface $metadataFactory) + { + $this->metadataFactory = $metadataFactory; + } + + /** + * {@inheritDoc} + */ + public function guessType($class, $property) + { + $guesser = $this; + + return $this->guess($class, $property, function (Constraint $constraint) use ($guesser) { + return $guesser->guessTypeForConstraint($constraint); + }); + } + + /** + * {@inheritDoc} + */ + public function guessRequired($class, $property) + { + $guesser = $this; + + return $this->guess($class, $property, function (Constraint $constraint) use ($guesser) { + return $guesser->guessRequiredForConstraint($constraint); + // If we don't find any constraint telling otherwise, we can assume + // that a field is not required (with LOW_CONFIDENCE) + }, false); + } + + /** + * {@inheritDoc} + */ + public function guessMaxLength($class, $property) + { + $guesser = $this; + + return $this->guess($class, $property, function (Constraint $constraint) use ($guesser) { + return $guesser->guessMaxLengthForConstraint($constraint); + }); + } + + /** + * {@inheritDoc} + */ + public function guessMinLength($class, $property) + { + } + + /** + * {@inheritDoc} + */ + public function guessPattern($class, $property) + { + $guesser = $this; + + return $this->guess($class, $property, function (Constraint $constraint) use ($guesser) { + return $guesser->guessPatternForConstraint($constraint); + }); + } + + /** + * Guesses a field class name for a given constraint + * + * @param Constraint $constraint The constraint to guess for + * + * @return TypeGuess The guessed field class and options + */ + public function guessTypeForConstraint(Constraint $constraint) + { + switch (get_class($constraint)) { + case 'Symfony\Component\Validator\Constraints\Type': + switch ($constraint->type) { + case 'array': + return new TypeGuess('collection', array(), Guess::MEDIUM_CONFIDENCE); + case 'boolean': + case 'bool': + return new TypeGuess('checkbox', array(), Guess::MEDIUM_CONFIDENCE); + + case 'double': + case 'float': + case 'numeric': + case 'real': + return new TypeGuess('number', array(), Guess::MEDIUM_CONFIDENCE); + + case 'integer': + case 'int': + case 'long': + return new TypeGuess('integer', array(), Guess::MEDIUM_CONFIDENCE); + + case '\DateTime': + return new TypeGuess('date', array(), Guess::MEDIUM_CONFIDENCE); + + case 'string': + return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); + } + break; + + case 'Symfony\Component\Validator\Constraints\Country': + return new TypeGuess('country', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Date': + return new TypeGuess('date', array('input' => 'string'), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\DateTime': + return new TypeGuess('datetime', array('input' => 'string'), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Email': + return new TypeGuess('email', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\File': + case 'Symfony\Component\Validator\Constraints\Image': + return new TypeGuess('file', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Language': + return new TypeGuess('language', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Locale': + return new TypeGuess('locale', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Time': + return new TypeGuess('time', array('input' => 'string'), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Url': + return new TypeGuess('url', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Ip': + return new TypeGuess('text', array(), Guess::MEDIUM_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\MaxLength': + case 'Symfony\Component\Validator\Constraints\MinLength': + case 'Symfony\Component\Validator\Constraints\Regex': + return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Min': + case 'Symfony\Component\Validator\Constraints\Max': + return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\MinCount': + case 'Symfony\Component\Validator\Constraints\MaxCount': + return new TypeGuess('collection', array(), Guess::LOW_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Time': + return new TypeGuess('time', array('input'=>'string'), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Url': + return new TypeGuess('url', array(), Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\True': + case 'Symfony\Component\Validator\Constraints\False': + return new TypeGuess('checkbox', array(), Guess::MEDIUM_CONFIDENCE); + } + + return null; + } + + /** + * Guesses whether a field is required based on the given constraint + * + * @param Constraint $constraint The constraint to guess for + * + * @return Guess The guess whether the field is required + */ + public function guessRequiredForConstraint(Constraint $constraint) + { + switch (get_class($constraint)) { + case 'Symfony\Component\Validator\Constraints\NotNull': + case 'Symfony\Component\Validator\Constraints\NotBlank': + case 'Symfony\Component\Validator\Constraints\True': + return new ValueGuess(true, Guess::HIGH_CONFIDENCE); + } + + return null; + } + + /** + * Guesses a field's maximum length based on the given constraint + * + * @param Constraint $constraint The constraint to guess for + * + * @return Guess The guess for the maximum length + */ + public function guessMaxLengthForConstraint(Constraint $constraint) + { + switch (get_class($constraint)) { + case 'Symfony\Component\Validator\Constraints\MaxLength': + return new ValueGuess($constraint->limit, Guess::HIGH_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Type': + if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) { + return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); + } + break; + + case 'Symfony\Component\Validator\Constraints\Max': + return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE); + } + + return null; + } + + /** + * Guesses a field's pattern based on the given constraint + * + * @param Constraint $constraint The constraint to guess for + * + * @return Guess The guess for the pattern + */ + public function guessPatternForConstraint(Constraint $constraint) + { + switch (get_class($constraint)) { + case 'Symfony\Component\Validator\Constraints\MinLength': + return new ValueGuess(sprintf('.{%s,}', (string) $constraint->limit), Guess::LOW_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Regex': + $htmlPattern = $constraint->getHtmlPattern(); + + if (null !== $htmlPattern) { + return new ValueGuess($htmlPattern, Guess::HIGH_CONFIDENCE); + } + break; + + case 'Symfony\Component\Validator\Constraints\Min': + return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->limit)), Guess::LOW_CONFIDENCE); + + case 'Symfony\Component\Validator\Constraints\Type': + if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) { + return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); + } + break; + } + + return null; + } + + /** + * Iterates over the constraints of a property, executes a constraints on + * them and returns the best guess + * + * @param string $class The class to read the constraints from + * @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 + * can be guessed. + * + * @return Guess The guessed value with the highest confidence + */ + protected function guess($class, $property, \Closure $closure, $defaultValue = null) + { + $guesses = array(); + $classMetadata = $this->metadataFactory->getClassMetadata($class); + + if ($classMetadata->hasMemberMetadatas($property)) { + $memberMetadatas = $classMetadata->getMemberMetadatas($property); + + foreach ($memberMetadatas as $memberMetadata) { + $constraints = $memberMetadata->getConstraints(); + + foreach ($constraints as $constraint) { + if ($guess = $closure($constraint)) { + $guesses[] = $guess; + } + } + } + + if (null !== $defaultValue) { + $guesses[] = new ValueGuess($defaultValue, Guess::LOW_CONFIDENCE); + } + } + + return Guess::getBestGuess($guesses); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php new file mode 100755 index 0000000000..7b96efb4d6 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Exception\ErrorMappingException; + +/** + * @author Bernhard Schussek + */ +class MappingRule +{ + /** + * @var FormInterface + */ + private $origin; + + /** + * @var string + */ + private $propertyPath; + + /** + * @var string + */ + private $targetPath; + + public function __construct(FormInterface $origin, $propertyPath, $targetPath) + { + $this->origin = $origin; + $this->propertyPath = $propertyPath; + $this->targetPath = $targetPath; + } + + /** + * @return FormInterface + */ + public function getOrigin() + { + return $this->origin; + } + + /** + * Matches a property path against the rule path. + * + * If the rule matches, the form mapped by the rule is returned. + * Otherwise this method returns false. + * + * @param string $propertyPath The property path to match against the rule. + * + * @return null|FormInterface The mapped form or null. + */ + public function match($propertyPath) + { + if ($propertyPath === (string) $this->propertyPath) { + return $this->getTarget(); + } + + return null; + } + + /** + * Matches a property path against a prefix of the rule path. + * + * @param string $propertyPath The property path to match against the rule. + * + * @return Boolean Whether the property path is a prefix of the rule or not. + */ + public function isPrefix($propertyPath) + { + $length = strlen($propertyPath); + $prefix = substr($this->propertyPath, 0, $length); + $next = isset($this->propertyPath[$length]) ? $this->propertyPath[$length] : null; + + return $prefix === $propertyPath && ('[' === $next || '.' === $next); + } + + /** + * @return FormInterface + * + * @throws ErrorMappingException + */ + public function getTarget() + { + $childNames = explode('.', $this->targetPath); + $target = $this->origin; + + foreach ($childNames as $childName) { + if (!$target->has($childName)) { + throw new ErrorMappingException(sprintf('The child "%s" of "%s" mapped by the rule "%s" in "%s" does not exist.', $childName, $target->getName(), $this->targetPath, $this->origin->getName())); + } + $target = $target->get($childName); + } + + return $target; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php new file mode 100755 index 0000000000..8f487bcc15 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Util\PropertyPath; + +/** + * @author Bernhard Schussek + */ +class RelativePath extends PropertyPath +{ + /** + * @var FormInterface + */ + private $root; + + /** + * @param FormInterface $root + * @param string $propertyPath + */ + public function __construct(FormInterface $root, $propertyPath) + { + parent::__construct($propertyPath); + + $this->root = $root; + } + + /** + * @return FormInterface + */ + public function getRoot() + { + return $this->root; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php new file mode 100755 index 0000000000..9ac6bb69b3 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -0,0 +1,295 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Util\VirtualFormAwareIterator; +use Symfony\Component\Form\Util\PropertyPathIterator; +use Symfony\Component\Form\Util\PropertyPathBuilder; +use Symfony\Component\Form\Util\PropertyPathIteratorInterface; +use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationPathIterator; +use Symfony\Component\Form\FormError; +use Symfony\Component\Validator\ConstraintViolation; + +/** + * @author Bernhard Schussek + */ +class ViolationMapper implements ViolationMapperInterface +{ + /** + * @var Boolean + */ + private $allowNonSynchronized; + + /** + * {@inheritdoc} + */ + public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false) + { + $this->allowNonSynchronized = $allowNonSynchronized; + + // The scope is the currently found most specific form that + // an error should be mapped to. After setting the scope, the + // mapper will try to continue to find more specific matches in + // the children of scope. If it cannot, the error will be + // mapped to this scope. + $scope = null; + + $violationPath = null; + $relativePath = null; + $match = false; + + // Don't create a ViolationPath instance for empty property paths + if (strlen($violation->getPropertyPath()) > 0) { + $violationPath = new ViolationPath($violation->getPropertyPath()); + $relativePath = $this->reconstructPath($violationPath, $form); + } + + // This case happens if the violation path is empty and thus + // the violation should be mapped to the root form + if (null === $violationPath) { + $scope = $form; + } + + // In general, mapping happens from the root form to the leaf forms + // First, the rules of the root form are applied to determine + // the subsequent descendant. The rules of this descendant are then + // applied to find the next and so on, until we have found the + // most specific form that matches the violation. + + // If any of the forms found in this process is not synchronized, + // mapping is aborted. Non-synchronized forms could not reverse + // transform the value entered by the user, thus any further violations + // caused by the (invalid) reverse transformed value should be + // ignored. + + if (null !== $relativePath) { + // Set the scope to the root of the relative path + // This root will usually be $form. If the path contains + // an unmapped form though, the last unmapped form found + // will be the root of the path. + $scope = $relativePath->getRoot(); + $it = new PropertyPathIterator($relativePath); + + while ($this->acceptsErrors($scope) && null !== ($child = $this->matchChild($scope, $it))) { + $scope = $child; + $it->next(); + $match = true; + } + } + + // This case happens if an error happened in the data under a + // virtual form that does not match any of the children of + // the virtual form. + if (null !== $violationPath && !$match) { + // If we could not map the error to anything more specific + // than the root element, map it to the innermost directly + // mapped form of the violation path + // e.g. "children[foo].children[bar].data.baz" + // Here the innermost directly mapped child is "bar" + + $scope = $form; + $it = new ViolationPathIterator($violationPath); + + while ($this->acceptsErrors($scope) && $it->valid() && $it->mapsForm()) { + if (!$scope->has($it->current())) { + // Break if we find a reference to a non-existing child + break; + } + + $scope = $scope->get($it->current()); + $it->next(); + } + } + + // Follow dot rules until we have the final target + $mapping = $scope->getConfig()->getOption('error_mapping'); + + while ($this->acceptsErrors($scope) && isset($mapping['.'])) { + $dotRule = new MappingRule($scope, '.', $mapping['.']); + $scope = $dotRule->getTarget(); + $mapping = $scope->getConfig()->getOption('error_mapping'); + } + + // Only add the error if the form is synchronized + if ($this->acceptsErrors($scope)) { + $scope->addError(new FormError( + $violation->getMessageTemplate(), + $violation->getMessageParameters(), + $violation->getMessagePluralization() + )); + } + } + + /** + * Tries to match the beginning of the property path at the + * current position against the children of the scope. + * + * If a matching child is found, it is returned. Otherwise + * null is returned. + * + * @param FormInterface $form The form to search. + * @param PropertyPathIteratorInterface $it The iterator at its current position. + * + * @return null|FormInterface The found match or null. + */ + private function matchChild(FormInterface $form, PropertyPathIteratorInterface $it) + { + // Remember at what property path underneath "data" + // we are looking. Check if there is a child with that + // path, otherwise increase path by one more piece + $chunk = ''; + $foundChild = null; + $foundAtIndex = 0; + + // Construct mapping rules for the given form + $rules = array(); + + foreach ($form->getConfig()->getOption('error_mapping') as $propertyPath => $targetPath) { + // Dot rules are considered at the very end + if ('.' !== $propertyPath) { + $rules[] = new MappingRule($form, $propertyPath, $targetPath); + } + } + + // Ignore virtual forms when iterating the children + $childIterator = new \RecursiveIteratorIterator( + new VirtualFormAwareIterator($form->all()) + ); + + // Make the path longer until we find a matching child + while (true) { + if (!$it->valid()) { + return null; + } + + if ($it->isIndex()) { + $chunk .= '[' . $it->current() . ']'; + } else { + $chunk .= ('' === $chunk ? '' : '.') . $it->current(); + } + + // Test mapping rules as long as we have any + foreach ($rules as $key => $rule) { + /* @var MappingRule $rule */ + + // Mapping rule matches completely, terminate. + if (null !== ($form = $rule->match($chunk))) { + return $form; + } + + // Keep only rules that have $chunk as prefix + if (!$rule->isPrefix($chunk)) { + unset($rules[$key]); + } + } + + // Test children unless we already found one + if (null === $foundChild) { + foreach ($childIterator as $child) { + /* @var FormInterface $child */ + $childPath = (string) $child->getPropertyPath(); + + // Child found, mark as return value + if ($chunk === $childPath) { + $foundChild = $child; + $foundAtIndex = $it->key(); + } + } + } + + // Add element to the chunk + $it->next(); + + // If we reached the end of the path or if there are no + // more matching mapping rules, return the found child + if (null !== $foundChild && (!$it->valid() || count($rules) === 0)) { + // Reset index in case we tried to find mapping + // rules further down the path + $it->seek($foundAtIndex); + + return $foundChild; + } + } + + return null; + } + + /** + * Reconstructs a property path from a violation path and a form tree. + * + * @param ViolationPath $violationPath The violation path. + * @param FormInterface $origin The root form of the tree. + * + * @return RelativePath The reconstructed path. + */ + private function reconstructPath(ViolationPath $violationPath, FormInterface $origin) + { + $propertyPathBuilder = new PropertyPathBuilder($violationPath); + $it = $violationPath->getIterator(); + $scope = $origin; + + // Remember the current index in the builder + $i = 0; + + // Expand elements that map to a form (like "children[address]") + for ($it->rewind(); $it->valid() && $it->mapsForm(); $it->next()) { + if (!$scope->has($it->current())) { + // Scope relates to a form that does not exist + // Bail out + break; + } + + // Process child form + $scope = $scope->get($it->current()); + + if ($scope->getConfig()->getVirtual()) { + // Form is virtual + // Cut the piece out of the property path and proceed + $propertyPathBuilder->remove($i); + } elseif (!$scope->getConfig()->getMapped()) { + // Form is not mapped + // Set the form as new origin and strip everything + // we have so far in the path + $origin = $scope; + $propertyPathBuilder->remove(0, $i + 1); + $i = 0; + } else { + /* @var \Symfony\Component\Form\Util\PropertyPathInterface $propertyPath */ + $propertyPath = $scope->getPropertyPath(); + + if (null === $propertyPath) { + // Property path of a mapped form is null + // Should not happen, bail out + break; + } + + $propertyPathBuilder->replace($i, 1, $propertyPath); + $i += $propertyPath->getLength(); + } + } + + $finalPath = $propertyPathBuilder->getPropertyPath(); + + return null !== $finalPath ? new RelativePath($origin, $finalPath) : null; + } + + /** + * @param FormInterface $form + * + * @return Boolean + */ + private function acceptsErrors(FormInterface $form) + { + return $this->allowNonSynchronized || $form->isSynchronized(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php new file mode 100755 index 0000000000..eb8907f1af --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Validator\ConstraintViolation; + +/** + * @author Bernhard Schussek + */ +interface ViolationMapperInterface +{ + /** + * Maps a constraint violation to a form in the form tree under + * the given form. + * + * @param ConstraintViolation $violation The violation to map. + * @param FormInterface $form The root form of the tree + * to map it to. + * @param Boolean $allowNonSynchronized Whether to allow + * mapping to non-synchronized forms. + */ + public function mapViolation(ConstraintViolation $violation, FormInterface $form, $allowNonSynchronized = false); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php new file mode 100755 index 0000000000..65cbda6b18 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php @@ -0,0 +1,249 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Util\PropertyPathInterface; + +/** + * @author Bernhard Schussek + */ +class ViolationPath implements \IteratorAggregate, PropertyPathInterface +{ + /** + * @var array + */ + private $elements = array(); + + /** + * @var array + */ + private $isIndex = array(); + + /** + * @var array + */ + private $mapsForm = array(); + + /** + * @var string + */ + private $pathAsString = ''; + + /** + * @var integer + */ + private $length = 0; + + /** + * Creates a new violation path from a string. + * + * @param string $violationPath The property path of a {@link ConstraintViolation} + * object. + */ + public function __construct($violationPath) + { + $path = new PropertyPath($violationPath); + $elements = $path->getElements(); + $data = false; + + for ($i = 0, $l = count($elements); $i < $l; ++$i) { + if (!$data) { + // The element "data" has not yet been passed + if ('children' === $elements[$i] && $path->isProperty($i)) { + // Skip element "children" + ++$i; + + // Next element must exist and must be an index + // Otherwise consider this the end of the path + if ($i >= $l || !$path->isIndex($i)) { + break; + } + + $this->elements[] = $elements[$i]; + $this->isIndex[] = true; + $this->mapsForm[] = true; + } elseif ('data' === $elements[$i] && $path->isProperty($i)) { + // Skip element "data" + ++$i; + + // End of path + if ($i >= $l) { + break; + } + + $this->elements[] = $elements[$i]; + $this->isIndex[] = $path->isIndex($i); + $this->mapsForm[] = false; + $data = true; + } else { + // Neither "children" nor "data" property found + // Consider this the end of the path + break; + } + } else { + // Already after the "data" element + // Pick everything as is + $this->elements[] = $elements[$i]; + $this->isIndex[] = $path->isIndex($i); + $this->mapsForm[] = false; + } + } + + $this->length = count($this->elements); + + $this->buildString(); + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + return $this->pathAsString; + } + + /** + * {@inheritdoc} + */ + public function getLength() + { + return $this->length; + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + if ($this->length <= 1) { + return null; + } + + $parent = clone $this; + + --$parent->length; + array_pop($parent->elements); + array_pop($parent->isIndex); + array_pop($parent->mapsForm); + + $parent->buildString(); + + return $parent; + } + + /** + * {@inheritdoc} + */ + public function getElements() + { + return $this->elements; + } + + /** + * {@inheritdoc} + */ + public function getElement($index) + { + if (!isset($this->elements[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path'); + } + + return $this->elements[$index]; + } + + /** + * {@inheritdoc} + */ + public function isProperty($index) + { + if (!isset($this->isIndex[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path'); + } + + return !$this->isIndex[$index]; + } + + /** + * {@inheritdoc} + */ + public function isIndex($index) + { + if (!isset($this->isIndex[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path'); + } + + return $this->isIndex[$index]; + } + + /** + * Returns whether an element maps directly to a form. + * + * Consider the following violation path: + * + * + * children[address].children[office].data.street + * + * + * In this example, "address" and "office" map to forms, while + * "street does not. + * + * @param integer $index The element index. + * + * @return Boolean Whether the element maps to a form. + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function mapsForm($index) + { + if (!isset($this->mapsForm[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the violation path'); + } + + return $this->mapsForm[$index]; + } + + /** + * Returns a new iterator for this path + * + * @return ViolationPathIterator + */ + public function getIterator() + { + return new ViolationPathIterator($this); + } + + /** + * Builds the string representation from the elements. + */ + private function buildString() + { + $this->pathAsString = ''; + $data = false; + + foreach ($this->elements as $index => $element) { + if ($this->mapsForm[$index]) { + $this->pathAsString .= ".children[$element]"; + } elseif (!$data) { + $this->pathAsString .= '.data' . ($this->isIndex[$index] ? "[$element]" : ".$element"); + $data = true; + } else { + $this->pathAsString .= $this->isIndex[$index] ? "[$element]" : ".$element"; + } + } + + if ('' !== $this->pathAsString) { + // remove leading dot + $this->pathAsString = substr($this->pathAsString, 1); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPathIterator.php b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPathIterator.php new file mode 100755 index 0000000000..531da861eb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPathIterator.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\Util\PropertyPathIterator; + +/** + * @author Bernhard Schussek + */ +class ViolationPathIterator extends PropertyPathIterator +{ + public function __construct(ViolationPath $violationPath) + { + parent::__construct($violationPath); + } + + public function mapsForm() + { + return $this->path->mapsForm($this->key()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Form.php b/vendor/symfony/form/Symfony/Component/Form/Form.php new file mode 100755 index 0000000000..8f115e963c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Form.php @@ -0,0 +1,1074 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\AlreadyBoundException; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\Util\FormUtil; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\HttpFoundation\Request; + +/** + * Form represents a form. + * + * To implement your own form fields, you need to have a thorough understanding + * of the data flow within a form. A form stores its data in three different + * representations: + * + * (1) the "model" format required by the form's object + * (2) the "normalized" format for internal processing + * (3) the "view" format used for display + * + * A date field, for example, may store a date as "Y-m-d" string (1) in the + * object. To facilitate processing in the field, this value is normalized + * to a DateTime object (2). In the HTML representation of your form, a + * localized string (3) is presented to and modified by the user. + * + * In most cases, format (1) and format (2) will be the same. For example, + * a checkbox field uses a Boolean value for both internal processing and + * storage in the object. In these cases you simply need to set a value + * transformer to convert between formats (2) and (3). You can do this by + * calling addViewTransformer(). + * + * In some cases though it makes sense to make format (1) configurable. To + * demonstrate this, let's extend our above date field to store the value + * either as "Y-m-d" string or as timestamp. Internally we still want to + * use a DateTime object for processing. To convert the data from string/integer + * to DateTime you can set a normalization transformer by calling + * addNormTransformer(). The normalized data is then converted to the displayed + * data as described before. + * + * The conversions (1) -> (2) -> (3) use the transform methods of the transformers. + * The conversions (3) -> (2) -> (1) use the reverseTransform methods of the transformers. + * + * @author Fabien Potencier + * @author Bernhard Schussek + */ +class Form implements \IteratorAggregate, FormInterface +{ + /** + * The form's configuration + * @var FormConfigInterface + */ + private $config; + + /** + * The parent of this form + * @var FormInterface + */ + private $parent; + + /** + * The children of this form + * @var array An array of FormInterface instances + */ + private $children = array(); + + /** + * The errors of this form + * @var array An array of FormError instances + */ + private $errors = array(); + + /** + * Whether this form is bound + * @var Boolean + */ + private $bound = false; + + /** + * The form data in model format + * @var mixed + */ + private $modelData; + + /** + * The form data in normalized format + * @var mixed + */ + private $normData; + + /** + * The form data in view format + * @var mixed + */ + private $viewData; + + /** + * The bound values that don't belong to any children + * @var array + */ + private $extraData = array(); + + /** + * Whether the data in model, normalized and view format is + * synchronized. Data may not be synchronized if transformation errors + * occur. + * @var Boolean + */ + private $synchronized = true; + + /** + * Whether the form's data has been initialized. + * + * When the data is initialized with its default value, that default value + * is passed through the transformer chain in order to synchronize the + * model, normalized and view format for the first time. This is done + * lazily in order to save performance when {@link setData()} is called + * manually, making the initialization with the configured default value + * superfluous. + * + * @var Boolean + */ + private $initialized = false; + + /** + * Whether setData() is currently being called. + * @var Boolean + */ + private $lockSetData = false; + + /** + * Creates a new form based on the given configuration. + * + * @param FormConfigInterface $config The form configuration. + * + * @throws FormException if a data mapper is not provided for a compound form + */ + public function __construct(FormConfigInterface $config) + { + // Compound forms always need a data mapper, otherwise calls to + // `setData` and `add` will not lead to the correct population of + // the child forms. + if ($config->getCompound() && !$config->getDataMapper()) { + throw new FormException('Compound forms need a data mapper'); + } + + $this->config = $config; + } + + public function __clone() + { + foreach ($this->children as $key => $child) { + $this->children[$key] = clone $child; + } + } + + /** + * {@inheritdoc} + */ + public function getConfig() + { + return $this->config; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->config->getName(); + } + + /** + * {@inheritdoc} + */ + public function getPropertyPath() + { + if (null !== $this->config->getPropertyPath()) { + return $this->config->getPropertyPath(); + } + + if (null === $this->getName() || '' === $this->getName()) { + return null; + } + + if ($this->parent && null === $this->parent->getConfig()->getDataClass()) { + return new PropertyPath('[' . $this->getName() . ']'); + } + + return new PropertyPath($this->getName()); + } + + /** + * Returns the types used by this form. + * + * @return array An array of FormTypeInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::getType()} instead. + */ + public function getTypes() + { + $types = array(); + + for ($type = $this->config->getType(); null !== $type; $type = $type->getParent()) { + array_unshift($types, $type->getInnerType()); + } + + return $types; + } + + /** + * {@inheritdoc} + */ + public function isRequired() + { + if (null === $this->parent || $this->parent->isRequired()) { + return $this->config->getRequired(); + } + + return false; + } + + /** + * {@inheritDoc} + */ + public function isDisabled() + { + if (null === $this->parent || !$this->parent->isDisabled()) { + return $this->config->getDisabled(); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function setParent(FormInterface $parent = null) + { + if ($this->bound) { + throw new AlreadyBoundException('You cannot set the parent of a bound form'); + } + + if (null !== $parent && '' === $this->config->getName()) { + throw new FormException('A form with an empty name cannot have a parent form.'); + } + + $this->parent = $parent; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns whether the form has a parent. + * + * @return Boolean + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getParent()} or inverse {@link isRoot()} instead. + */ + public function hasParent() + { + return null !== $this->parent; + } + + /** + * {@inheritdoc} + */ + public function getRoot() + { + return $this->parent ? $this->parent->getRoot() : $this; + } + + /** + * {@inheritdoc} + */ + public function isRoot() + { + return null === $this->parent; + } + + /** + * Returns whether the form has an attribute with the given name. + * + * @param string $name The name of the attribute. + * + * @return Boolean Whether the attribute exists. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::hasAttribute()} instead. + */ + public function hasAttribute($name) + { + return $this->config->hasAttribute($name); + } + + /** + * Returns the value of the attributes with the given name. + * + * @param string $name The name of the attribute + * + * @return mixed The attribute value. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::getAttribute()} instead. + */ + public function getAttribute($name) + { + return $this->config->getAttribute($name); + } + + /** + * {@inheritdoc} + */ + public function setData($modelData) + { + // If the form is bound while disabled, it is set to bound, but the data is not + // changed. In such cases (i.e. when the form is not initialized yet) don't + // abort this method. + if ($this->bound && $this->initialized) { + throw new AlreadyBoundException('You cannot change the data of a bound form'); + } + + // Don't allow modifications of the configured data if the data is locked + if ($this->config->getDataLocked() && $modelData !== $this->config->getData()) { + return $this; + } + + if (is_object($modelData) && !$this->config->getByReference()) { + $modelData = clone $modelData; + } + + if ($this->lockSetData) { + throw new FormException('A cycle was detected. Listeners to the PRE_SET_DATA event must not call setData(). You should call setData() on the FormEvent object instead.'); + } + + $this->lockSetData = true; + $dispatcher = $this->config->getEventDispatcher(); + + // Hook to change content of the data + if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) { + $event = new FormEvent($this, $modelData); + $dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event); + // BC until 2.3 + $dispatcher->dispatch(FormEvents::SET_DATA, $event); + $modelData = $event->getData(); + } + + // Treat data as strings unless a value transformer exists + if (!$this->config->getViewTransformers() && !$this->config->getModelTransformers() && is_scalar($modelData)) { + $modelData = (string) $modelData; + } + + // Synchronize representations - must not change the content! + $normData = $this->modelToNorm($modelData); + $viewData = $this->normToView($normData); + + // Validate if view data matches data class (unless empty) + if (!FormUtil::isEmpty($viewData)) { + $dataClass = $this->config->getDataClass(); + + $actualType = is_object($viewData) ? 'an instance of class ' . get_class($viewData) : ' a(n) ' . gettype($viewData); + + if (null === $dataClass && is_object($viewData) && !$viewData instanceof \ArrayAccess) { + $expectedType = 'scalar, array or an instance of \ArrayAccess'; + + throw new FormException( + 'The form\'s view data is expected to be of type ' . $expectedType . ', ' . + 'but is ' . $actualType . '. You ' . + 'can avoid this error by setting the "data_class" option to ' . + '"' . get_class($viewData) . '" or by adding a view transformer ' . + 'that transforms ' . $actualType . ' to ' . $expectedType . '.' + ); + } + + if (null !== $dataClass && !$viewData instanceof $dataClass) { + throw new FormException( + 'The form\'s view data is expected to be an instance of class ' . + $dataClass . ', but is '. $actualType . '. You can avoid this error ' . + 'by setting the "data_class" option to null or by adding a view ' . + 'transformer that transforms ' . $actualType . ' to an instance of ' . + $dataClass . '.' + ); + } + } + + $this->modelData = $modelData; + $this->normData = $normData; + $this->viewData = $viewData; + $this->initialized = true; + $this->lockSetData = false; + + // It is not necessary to invoke this method if the form doesn't have children, + // even if the form is compound. + if (count($this->children) > 0) { + // Update child forms from the data + $this->config->getDataMapper()->mapDataToForms($viewData, $this->children); + } + + if ($dispatcher->hasListeners(FormEvents::POST_SET_DATA)) { + $event = new FormEvent($this, $modelData); + $dispatcher->dispatch(FormEvents::POST_SET_DATA, $event); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getData() + { + if (!$this->initialized) { + $this->setData($this->config->getData()); + } + + return $this->modelData; + } + + /** + * {@inheritdoc} + */ + public function getNormData() + { + if (!$this->initialized) { + $this->setData($this->config->getData()); + } + + return $this->normData; + } + + /** + * {@inheritdoc} + */ + public function getViewData() + { + if (!$this->initialized) { + $this->setData($this->config->getData()); + } + + return $this->viewData; + } + + /** + * Alias of {@link getViewData()}. + * + * @return string + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getViewData()} instead. + */ + public function getClientData() + { + return $this->getViewData(); + } + + /** + * {@inheritdoc} + */ + public function getExtraData() + { + return $this->extraData; + } + + /** + * {@inheritdoc} + */ + public function bind($submittedData) + { + if ($this->bound) { + throw new AlreadyBoundException('A form can only be bound once'); + } + + if ($this->isDisabled()) { + $this->bound = true; + + return $this; + } + + // The data must be initialized if it was not initialized yet. + // This is necessary to guarantee that the *_SET_DATA listeners + // are always invoked before bind() takes place. + if (!$this->initialized) { + $this->setData($this->config->getData()); + } + + // Don't convert NULL to a string here in order to determine later + // whether an empty value has been submitted or whether no value has + // been submitted at all. This is important for processing checkboxes + // and radio buttons with empty values. + if (is_scalar($submittedData)) { + $submittedData = (string) $submittedData; + } + + // Initialize errors in the very beginning so that we don't lose any + // errors added during listeners + $this->errors = array(); + + $dispatcher = $this->config->getEventDispatcher(); + + // Hook to change content of the data bound by the browser + if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) { + $event = new FormEvent($this, $submittedData); + $dispatcher->dispatch(FormEvents::PRE_BIND, $event); + // BC until 2.3 + $dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event); + $submittedData = $event->getData(); + } + + // Check whether the form is compound. + // This check is preferrable over checking the number of children, + // since forms without children may also be compound. + // (think of empty collection forms) + if ($this->config->getCompound()) { + if (!is_array($submittedData)) { + $submittedData = array(); + } + + foreach ($this->children as $name => $child) { + $child->bind(isset($submittedData[$name]) ? $submittedData[$name] : null); + unset($submittedData[$name]); + } + + $this->extraData = $submittedData; + + // If the form is compound, the default data in view format + // is reused. The data of the children is merged into this + // default data using the data mapper. + $viewData = $this->viewData; + } else { + // If the form is not compound, the submitted data is also the data in view format. + $viewData = $submittedData; + } + + if (FormUtil::isEmpty($viewData)) { + $emptyData = $this->config->getEmptyData(); + + if ($emptyData instanceof \Closure) { + /* @var \Closure $emptyData */ + $emptyData = $emptyData($this, $viewData); + } + + $viewData = $emptyData; + } + + // Merge form data from children into existing view data + // It is not necessary to invoke this method if the form has no children, + // even if it is compound. + if (count($this->children) > 0) { + $this->config->getDataMapper()->mapFormsToData($this->children, $viewData); + } + + $modelData = null; + $normData = null; + + try { + // Normalize data to unified representation + $normData = $this->viewToNorm($viewData); + + // Hook to change content of the data into the normalized + // representation + if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) { + $event = new FormEvent($this, $normData); + $dispatcher->dispatch(FormEvents::BIND, $event); + // BC until 2.3 + $dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event); + $normData = $event->getData(); + } + + // Synchronize representations - must not change the content! + $modelData = $this->normToModel($normData); + $viewData = $this->normToView($normData); + } catch (TransformationFailedException $e) { + $this->synchronized = false; + } + + $this->bound = true; + $this->modelData = $modelData; + $this->normData = $normData; + $this->viewData = $viewData; + + if ($dispatcher->hasListeners(FormEvents::POST_BIND)) { + $event = new FormEvent($this, $viewData); + $dispatcher->dispatch(FormEvents::POST_BIND, $event); + } + + foreach ($this->config->getValidators() as $validator) { + $validator->validate($this); + } + + return $this; + } + + /** + * Binds a request to the form. + * + * If the request method is POST, PUT or GET, the data is bound to the form, + * transformed and written into the form data (an object or an array). + * + * @param Request $request The request to bind to the form + * + * @return Form This form + * + * @throws FormException if the method of the request is not one of GET, POST or PUT + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link FormConfigInterface::bind()} instead. + */ + public function bindRequest(Request $request) + { + return $this->bind($request); + } + + /** + * {@inheritdoc} + */ + public function addError(FormError $error) + { + if ($this->parent && $this->getErrorBubbling()) { + $this->parent->addError($error); + } else { + $this->errors[] = $error; + } + + return $this; + } + + /** + * Returns whether errors bubble up to the parent. + * + * @return Boolean + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::getErrorBubbling()} instead. + */ + public function getErrorBubbling() + { + return $this->config->getErrorBubbling(); + } + + /** + * {@inheritdoc} + */ + public function isBound() + { + return $this->bound; + } + + /** + * {@inheritdoc} + */ + public function isSynchronized() + { + return $this->synchronized; + } + + /** + * {@inheritdoc} + */ + public function isEmpty() + { + foreach ($this->children as $child) { + if (!$child->isEmpty()) { + return false; + } + } + + return FormUtil::isEmpty($this->modelData) || + // arrays, countables + 0 === count($this->modelData) || + // traversables that are not countable + ($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData)); + } + + /** + * {@inheritdoc} + */ + public function isValid() + { + if (!$this->bound) { + throw new \LogicException('You cannot call isValid() on a form that is not bound.'); + } + + if (count($this->errors) > 0) { + return false; + } + + if (!$this->isDisabled()) { + foreach ($this->children as $child) { + if (!$child->isValid()) { + return false; + } + } + } + + return true; + } + + /** + * Returns whether there are errors associated with this form. + * + * @return Boolean + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Count + * {@link getErrors()} instead. + */ + public function hasErrors() + { + return count($this->errors) > 0; + } + + /** + * {@inheritdoc} + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Returns a string representation of all form errors (including children errors). + * + * This method should only be used to help debug a form. + * + * @param integer $level The indentation level (used internally) + * + * @return string A string representation of all errors + */ + public function getErrorsAsString($level = 0) + { + $errors = ''; + foreach ($this->errors as $error) { + $errors .= str_repeat(' ', $level).'ERROR: '.$error->getMessage()."\n"; + } + + foreach ($this->children as $key => $child) { + $errors .= str_repeat(' ', $level).$key.":\n"; + if ($err = $child->getErrorsAsString($level + 4)) { + $errors .= $err; + } else { + $errors .= str_repeat(' ', $level + 4)."No errors\n"; + } + } + + return $errors; + } + + /** + * Returns the DataTransformers. + * + * @return array An array of DataTransformerInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::getModelTransformers()} instead. + */ + public function getNormTransformers() + { + return $this->config->getModelTransformers(); + } + + /** + * Returns the DataTransformers. + * + * @return array An array of DataTransformerInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getConfig()} and {@link FormConfigInterface::getViewTransformers()} instead. + */ + public function getClientTransformers() + { + return $this->config->getViewTransformers(); + } + + /** + * {@inheritdoc} + */ + public function all() + { + return $this->children; + } + + /** + * Returns all children in this group. + * + * @return array + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link all()} instead. + */ + public function getChildren() + { + return $this->all(); + } + + /** + * Returns whether the form has children. + * + * @return Boolean + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link count()} instead. + */ + public function hasChildren() + { + return count($this->children) > 0; + } + + /** + * {@inheritdoc} + */ + public function add(FormInterface $child) + { + if ($this->bound) { + throw new AlreadyBoundException('You cannot add children to a bound form'); + } + + if (!$this->config->getCompound()) { + throw new FormException('You cannot add children to a simple form. Maybe you should set the option "compound" to true?'); + } + + // Obtain the view data + $viewData = null; + + // If setData() is currently being called, there is no need to call + // mapDataToForms() here, as mapDataToForms() is called at the end + // of setData() anyway. Not doing this check leads to an endless + // recursion when initializing the form lazily and an event listener + // (such as ResizeFormListener) adds fields depending on the data: + // + // * setData() is called, the form is not initialized yet + // * add() is called by the listener (setData() is not complete, so + // the form is still not initialized) + // * getViewData() is called + // * setData() is called since the form is not initialized yet + // * ... endless recursion ... + if (!$this->lockSetData) { + $viewData = $this->getViewData(); + } + + $this->children[$child->getName()] = $child; + + $child->setParent($this); + + if (!$this->lockSetData) { + $this->config->getDataMapper()->mapDataToForms($viewData, array($child)); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + if ($this->bound) { + throw new AlreadyBoundException('You cannot remove children from a bound form'); + } + + if (isset($this->children[$name])) { + $this->children[$name]->setParent(null); + + unset($this->children[$name]); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + return isset($this->children[$name]); + } + + /** + * {@inheritdoc} + */ + public function get($name) + { + if (isset($this->children[$name])) { + return $this->children[$name]; + } + + throw new \OutOfBoundsException(sprintf('Child "%s" does not exist.', $name)); + } + + /** + * Returns whether a child with the given name exists (implements the \ArrayAccess interface). + * + * @param string $name The name of the child + * + * @return Boolean + */ + public function offsetExists($name) + { + return $this->has($name); + } + + /** + * Returns the child with the given name (implements the \ArrayAccess interface). + * + * @param string $name The name of the child + * + * @return FormInterface The child form + * + * @throws \OutOfBoundsException If the named child does not exist. + */ + public function offsetGet($name) + { + return $this->get($name); + } + + /** + * Adds a child to the form (implements the \ArrayAccess interface). + * + * @param string $name Ignored. The name of the child is used. + * @param FormInterface $child The child to be added. + * + * @throws AlreadyBoundException If the form has already been bound. + * @throws FormException When trying to add a child to a non-compound form. + * + * @see self::add() + */ + public function offsetSet($name, $child) + { + $this->add($child); + } + + /** + * Removes the child with the given name from the form (implements the \ArrayAccess interface). + * + * @param string $name The name of the child to remove + * + * @throws AlreadyBoundException If the form has already been bound. + */ + public function offsetUnset($name) + { + $this->remove($name); + } + + /** + * Returns the iterator for this group. + * + * @return \ArrayIterator + */ + public function getIterator() + { + return new \ArrayIterator($this->children); + } + + /** + * Returns the number of form children (implements the \Countable interface). + * + * @return integer The number of embedded form children + */ + public function count() + { + return count($this->children); + } + + /** + * {@inheritdoc} + */ + public function createView(FormView $parent = null) + { + if (null === $parent && $this->parent) { + $parent = $this->parent->createView(); + } + + return $this->config->getType()->createView($this, $parent); + } + + /** + * Normalizes the value if a normalization transformer is set. + * + * @param mixed $value The value to transform + * + * @return mixed + */ + private function modelToNorm($value) + { + foreach ($this->config->getModelTransformers() as $transformer) { + $value = $transformer->transform($value); + } + + return $value; + } + + /** + * Reverse transforms a value if a normalization transformer is set. + * + * @param string $value The value to reverse transform + * + * @return mixed + */ + private function normToModel($value) + { + $transformers = $this->config->getModelTransformers(); + + for ($i = count($transformers) - 1; $i >= 0; --$i) { + $value = $transformers[$i]->reverseTransform($value); + } + + return $value; + } + + /** + * Transforms the value if a value transformer is set. + * + * @param mixed $value The value to transform + * + * @return mixed + */ + private function normToView($value) + { + // Scalar values should be converted to strings to + // facilitate differentiation between empty ("") and zero (0). + // Only do this for simple forms, as the resulting value in + // compound forms is passed to the data mapper and thus should + // not be converted to a string before. + if (!$this->config->getViewTransformers() && !$this->config->getCompound()) { + return null === $value || is_scalar($value) ? (string) $value : $value; + } + + foreach ($this->config->getViewTransformers() as $transformer) { + $value = $transformer->transform($value); + } + + return $value; + } + + /** + * Reverse transforms a value if a value transformer is set. + * + * @param string $value The value to reverse transform + * + * @return mixed + */ + private function viewToNorm($value) + { + $transformers = $this->config->getViewTransformers(); + + if (!$transformers) { + return '' === $value ? null : $value; + } + + for ($i = count($transformers) - 1; $i >= 0; --$i) { + $value = $transformers[$i]->reverseTransform($value); + } + + return $value; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormBuilder.php b/vendor/symfony/form/Symfony/Component/Form/FormBuilder.php new file mode 100755 index 0000000000..9d23ff565f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormBuilder.php @@ -0,0 +1,306 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * A builder for creating {@link Form} instances. + * + * @author Bernhard Schussek + */ +class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormBuilderInterface +{ + /** + * The form factory. + * + * @var FormFactoryInterface + */ + private $factory; + + /** + * The children of the form builder. + * + * @var array + */ + private $children = array(); + + /** + * The data of children who haven't been converted to form builders yet. + * + * @var array + */ + private $unresolvedChildren = array(); + + /** + * The parent of this builder. + * + * @var FormBuilder + */ + private $parent; + + /** + * Creates a new form builder. + * + * @param string $name + * @param string $dataClass + * @param EventDispatcherInterface $dispatcher + * @param FormFactoryInterface $factory + * @param array $options + */ + public function __construct($name, $dataClass, EventDispatcherInterface $dispatcher, FormFactoryInterface $factory, array $options = array()) + { + parent::__construct($name, $dataClass, $dispatcher, $options); + + $this->factory = $factory; + } + + /** + * {@inheritdoc} + */ + public function getFormFactory() + { + return $this->factory; + } + + /** + * {@inheritdoc} + */ + public function add($child, $type = null, array $options = array()) + { + if ($this->locked) { + throw new FormException('The form builder cannot be modified anymore.'); + } + + if ($child instanceof self) { + $child->setParent($this); + $this->children[$child->getName()] = $child; + + // In case an unresolved child with the same name exists + unset($this->unresolvedChildren[$child->getName()]); + + return $this; + } + + if (!is_string($child)) { + throw new UnexpectedTypeException($child, 'string or Symfony\Component\Form\FormBuilder'); + } + + if (null !== $type && !is_string($type) && !$type instanceof FormTypeInterface) { + throw new UnexpectedTypeException($type, 'string or Symfony\Component\Form\FormTypeInterface'); + } + + // Add to "children" to maintain order + $this->children[$child] = null; + $this->unresolvedChildren[$child] = array( + 'type' => $type, + 'options' => $options, + ); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function create($name, $type = null, array $options = array()) + { + if ($this->locked) { + throw new FormException('The form builder cannot be modified anymore.'); + } + + if (null === $type && null === $this->getDataClass()) { + $type = 'text'; + } + + if (null !== $type) { + return $this->factory->createNamedBuilder($name, $type, null, $options, $this); + } + + return $this->factory->createBuilderForProperty($this->getDataClass(), $name, null, $options, $this); + } + + /** + * {@inheritdoc} + */ + public function get($name) + { + if (isset($this->unresolvedChildren[$name])) { + return $this->resolveChild($name); + } + + if (isset($this->children[$name])) { + return $this->children[$name]; + } + + throw new FormException(sprintf('The child with the name "%s" does not exist.', $name)); + } + + /** + * {@inheritdoc} + */ + public function remove($name) + { + if ($this->locked) { + throw new FormException('The form builder cannot be modified anymore.'); + } + + unset($this->unresolvedChildren[$name]); + + if (array_key_exists($name, $this->children)) { + if ($this->children[$name] instanceof self) { + $this->children[$name]->setParent(null); + } + unset($this->children[$name]); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function has($name) + { + if (isset($this->unresolvedChildren[$name])) { + return true; + } + + if (isset($this->children[$name])) { + return true; + } + + return false; + } + + /** + * {@inheritdoc} + */ + public function all() + { + $this->resolveChildren(); + + return $this->children; + } + + /** + * {@inheritdoc} + */ + public function count() + { + return count($this->children); + } + + /** + * {@inheritdoc} + */ + public function getForm() + { + $this->resolveChildren(); + + $form = new Form($this->getFormConfig()); + + foreach ($this->children as $child) { + $form->add($child->getForm()); + } + + return $form; + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return $this->parent; + } + + /** + * {@inheritdoc} + */ + public function setParent(FormBuilderInterface $parent = null) + { + if ($this->locked) { + throw new FormException('The form builder cannot be modified anymore.'); + } + + $this->parent = $parent; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function hasParent() + { + return null !== $this->parent; + } + + /** + * Converts an unresolved child into a {@link FormBuilder} instance. + * + * @param string $name The name of the unresolved child. + * + * @return FormBuilder The created instance. + */ + private function resolveChild($name) + { + $info = $this->unresolvedChildren[$name]; + $child = $this->create($name, $info['type'], $info['options']); + $this->children[$name] = $child; + unset($this->unresolvedChildren[$name]); + + return $child; + } + + /** + * Converts all unresolved children into {@link FormBuilder} instances. + */ + private function resolveChildren() + { + foreach ($this->unresolvedChildren as $name => $info) { + $this->children[$name] = $this->create($name, $info['type'], $info['options']); + } + + $this->unresolvedChildren = array(); + } + + /** + * {@inheritdoc} + */ + public function getIterator() + { + return new \ArrayIterator($this->children); + } + + /** + * Returns the types used by this builder. + * + * @return array An array of FormTypeInterface + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link FormConfigInterface::getType()} instead. + */ + public function getTypes() + { + $types = array(); + + for ($type = $this->getType(); null !== $type; $type = $type->getParent()) { + array_unshift($types, $type->getInnerType()); + } + + return $types; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormBuilderInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormBuilderInterface.php new file mode 100755 index 0000000000..034a65a5a2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormBuilderInterface.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface +{ + /** + * Adds a new field to this group. A field must have a unique name within + * the group. Otherwise the existing field is overwritten. + * + * If you add a nested group, this group should also be represented in the + * object hierarchy. + * + * @param string|FormBuilderInterface $child + * @param string|FormTypeInterface $type + * @param array $options + * + * @return FormBuilderInterface The builder object. + */ + public function add($child, $type = null, array $options = array()); + + /** + * Creates a form builder. + * + * @param string $name The name of the form or the name of the property + * @param string|FormTypeInterface $type The type of the form or null if name is a property + * @param array $options The options + * + * @return FormBuilderInterface The created builder. + */ + public function create($name, $type = null, array $options = array()); + + /** + * Returns a child by name. + * + * @param string $name The name of the child + * + * @return FormBuilderInterface The builder for the child + * + * @throws Exception\FormException if the given child does not exist + */ + public function get($name); + /** + * Removes the field with the given name. + * + * @param string $name + * + * @return FormBuilderInterface The builder object. + */ + public function remove($name); + + /** + * Returns whether a field with the given name exists. + * + * @param string $name + * + * @return Boolean + */ + public function has($name); + + /** + * Returns the children. + * + * @return array + */ + public function all(); + + /** + * Returns the associated form factory. + * + * @return FormFactoryInterface The factory + */ + public function getFormFactory(); + + /** + * Creates the form. + * + * @return Form The form + */ + public function getForm(); + + /** + * Sets the parent builder. + * + * @param FormBuilderInterface $parent The parent builder + * + * @return FormBuilderInterface The builder object. + */ + public function setParent(FormBuilderInterface $parent = null); + + /** + * Returns the parent builder. + * + * @return FormBuilderInterface The parent builder + */ + public function getParent(); + + /** + * Returns whether the builder has a parent. + * + * @return Boolean + */ + public function hasParent(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilder.php b/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilder.php new file mode 100755 index 0000000000..9a21df4642 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilder.php @@ -0,0 +1,888 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Util\PropertyPathInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\EventDispatcher\ImmutableEventDispatcher; + +/** + * A basic form configuration. + * + * @author Bernhard Schussek + */ +class FormConfigBuilder implements FormConfigBuilderInterface +{ + /** + * @var Boolean + */ + protected $locked = false; + + /** + * @var EventDispatcherInterface + */ + private $dispatcher; + + /** + * @var string + */ + private $name; + + /** + * @var PropertyPathInterface + */ + private $propertyPath; + + /** + * @var Boolean + */ + private $mapped = true; + + /** + * @var Boolean + */ + private $byReference = true; + + /** + * @var Boolean + */ + private $virtual = false; + + /** + * @var Boolean + */ + private $compound = false; + + /** + * @var ResolvedFormTypeInterface + */ + private $type; + + /** + * @var array + */ + private $viewTransformers = array(); + + /** + * @var array + */ + private $modelTransformers = array(); + + /** + * @var DataMapperInterface + */ + private $dataMapper; + + /** + * @var array + */ + private $validators = array(); + + /** + * @var Boolean + */ + private $required = true; + + /** + * @var Boolean + */ + private $disabled = false; + + /** + * @var Boolean + */ + private $errorBubbling = false; + + /** + * @var mixed + */ + private $emptyData; + + /** + * @var array + */ + private $attributes = array(); + + /** + * @var mixed + */ + private $data; + + /** + * @var string + */ + private $dataClass; + + /** + * @var Boolean + */ + private $dataLocked; + + /** + * @var array + */ + private $options; + + /** + * Creates an empty form configuration. + * + * @param string $name The form name + * @param string $dataClass The class of the form's data + * @param EventDispatcherInterface $dispatcher The event dispatcher + * @param array $options The form options + * + * @throws \InvalidArgumentException If the data class is not a valid class or if + * the name contains invalid characters. + */ + public function __construct($name, $dataClass, EventDispatcherInterface $dispatcher, array $options = array()) + { + $name = (string) $name; + + self::validateName($name); + + if (null !== $dataClass && !class_exists($dataClass)) { + throw new \InvalidArgumentException(sprintf('The data class "%s" is not a valid class.', $dataClass)); + } + + $this->name = $name; + $this->dataClass = $dataClass; + $this->dispatcher = $dispatcher; + $this->options = $options; + } + + /** + * {@inheritdoc} + */ + public function addEventListener($eventName, $listener, $priority = 0) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->dispatcher->addListener($eventName, $listener, $priority); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addEventSubscriber(EventSubscriberInterface $subscriber) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->dispatcher->addSubscriber($subscriber); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addValidator(FormValidatorInterface $validator) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->validators[] = $validator; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + if ($forcePrepend) { + array_unshift($this->viewTransformers, $viewTransformer); + } else { + $this->viewTransformers[] = $viewTransformer; + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function resetViewTransformers() + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->viewTransformers = array(); + + return $this; + } + + /** + * Alias of {@link addViewTransformer()}. + * + * @param DataTransformerInterface $viewTransformer + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link addViewTransformer()} instead. + */ + public function appendClientTransformer(DataTransformerInterface $viewTransformer) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->addViewTransformer($viewTransformer); + } + + /** + * Prepends a transformer to the client transformer chain. + * + * @param DataTransformerInterface $viewTransformer + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function prependClientTransformer(DataTransformerInterface $viewTransformer) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->addViewTransformer($viewTransformer, true); + } + + /** + * Alias of {@link resetViewTransformers()}. + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link resetViewTransformers()} instead. + */ + public function resetClientTransformers() + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->resetViewTransformers(); + } + + /** + * {@inheritdoc} + */ + public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + if ($forceAppend) { + $this->modelTransformers[] = $modelTransformer; + } else { + array_unshift($this->modelTransformers, $modelTransformer); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function resetModelTransformers() + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->modelTransformers = array(); + + return $this; + } + + /** + * Appends a transformer to the normalization transformer chain + * + * @param DataTransformerInterface $modelTransformer + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function appendNormTransformer(DataTransformerInterface $modelTransformer) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->addModelTransformer($modelTransformer, true); + } + + /** + * Alias of {@link addModelTransformer()}. + * + * @param DataTransformerInterface $modelTransformer + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link addModelTransformer()} instead. + */ + public function prependNormTransformer(DataTransformerInterface $modelTransformer) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->addModelTransformer($modelTransformer); + } + + /** + * Alias of {@link resetModelTransformers()}. + * + * @return FormConfigBuilder The configuration object. + * + * @throws FormException if the form configuration is locked + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link resetModelTransformers()} instead. + */ + public function resetNormTransformers() + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + return $this->resetModelTransformers(); + } + + /** + * {@inheritdoc} + */ + public function getEventDispatcher() + { + return $this->dispatcher; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->name; + } + + /** + * {@inheritdoc} + */ + public function getPropertyPath() + { + return $this->propertyPath; + } + + /** + * {@inheritdoc} + */ + public function getMapped() + { + return $this->mapped; + } + + /** + * {@inheritdoc} + */ + public function getByReference() + { + return $this->byReference; + } + + /** + * {@inheritdoc} + */ + public function getVirtual() + { + return $this->virtual; + } + + /** + * {@inheritdoc} + */ + public function getCompound() + { + return $this->compound; + } + + /** + * {@inheritdoc} + */ + public function getType() + { + return $this->type; + } + + /** + * {@inheritdoc} + */ + public function getViewTransformers() + { + return $this->viewTransformers; + } + + /** + * Alias of {@link getViewTransformers()}. + * + * @return array The view transformers. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getViewTransformers()} instead. + */ + public function getClientTransformers() + { + return $this->getViewTransformers(); + } + + /** + * {@inheritdoc} + */ + public function getModelTransformers() + { + return $this->modelTransformers; + } + + /** + * Alias of {@link getModelTransformers()}. + * + * @return array The model transformers. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link getModelTransformers()} instead. + */ + public function getNormTransformers() + { + return $this->getModelTransformers(); + } + + /** + * {@inheritdoc} + */ + public function getDataMapper() + { + return $this->dataMapper; + } + + /** + * {@inheritdoc} + */ + public function getValidators() + { + return $this->validators; + } + + /** + * {@inheritdoc} + */ + public function getRequired() + { + return $this->required; + } + + /** + * {@inheritdoc} + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * {@inheritdoc} + */ + public function getErrorBubbling() + { + return $this->errorBubbling; + } + + /** + * {@inheritdoc} + */ + public function getEmptyData() + { + return $this->emptyData; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function hasAttribute($name) + { + return isset($this->attributes[$name]); + } + + /** + * {@inheritdoc} + */ + public function getAttribute($name, $default = null) + { + return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; + } + + /** + * {@inheritdoc} + */ + public function getData() + { + return $this->data; + } + + /** + * {@inheritdoc} + */ + public function getDataClass() + { + return $this->dataClass; + } + + /** + * {@inheritdoc} + */ + public function getDataLocked() + { + return $this->dataLocked; + } + + /** + * {@inheritdoc} + */ + public function getOptions() + { + return $this->options; + } + + /** + * {@inheritdoc} + */ + public function hasOption($name) + { + return isset($this->options[$name]); + } + + /** + * {@inheritdoc} + */ + public function getOption($name, $default = null) + { + return isset($this->options[$name]) ? $this->options[$name] : $default; + } + + /** + * {@inheritdoc} + */ + public function setAttribute($name, $value) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->attributes[$name] = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setAttributes(array $attributes) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->attributes = $attributes; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setDataMapper(DataMapperInterface $dataMapper = null) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->dataMapper = $dataMapper; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setDisabled($disabled) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->disabled = (Boolean) $disabled; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setEmptyData($emptyData) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->emptyData = $emptyData; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setErrorBubbling($errorBubbling) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->errorBubbling = null === $errorBubbling ? null : (Boolean) $errorBubbling; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setRequired($required) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->required = (Boolean) $required; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setPropertyPath($propertyPath) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + if (null !== $propertyPath && !$propertyPath instanceof PropertyPathInterface) { + $propertyPath = new PropertyPath($propertyPath); + } + + $this->propertyPath = $propertyPath; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setMapped($mapped) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->mapped = $mapped; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setByReference($byReference) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->byReference = $byReference; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setVirtual($virtual) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->virtual = $virtual; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setCompound($compound) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->compound = $compound; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setType(ResolvedFormTypeInterface $type) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->type = $type; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setData($data) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->data = $data; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function setDataLocked($locked) + { + if ($this->locked) { + throw new FormException('The config builder cannot be modified anymore.'); + } + + $this->dataLocked = $locked; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormConfig() + { + // This method should be idempotent, so clone the builder + $config = clone $this; + $config->locked = true; + + if (!$config->dispatcher instanceof ImmutableEventDispatcher) { + $config->dispatcher = new ImmutableEventDispatcher($config->dispatcher); + } + + return $config; + } + + /** + * Validates whether the given variable is a valid form name. + * + * @param string $name The tested form name. + * + * @throws UnexpectedTypeException If the name is not a string. + * @throws \InvalidArgumentException If the name contains invalid characters. + */ + public static function validateName($name) + { + if (!is_string($name)) { + throw new UnexpectedTypeException($name, 'string'); + } + + if (!self::isValidName($name)) { + throw new \InvalidArgumentException(sprintf( + 'The name "%s" contains illegal characters. Names should start with a letter, digit or underscore and only contain letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":").', + $name + )); + } + } + + /** + * Returns whether the given variable contains a valid form name. + * + * A name is accepted if it + * + * * is empty + * * starts with a letter, digit or underscore + * * contains only letters, digits, numbers, underscores ("_"), + * hyphens ("-") and colons (":") + * + * @param string $name The tested form name. + * + * @return Boolean Whether the name is valid. + */ + public static function isValidName($name) + { + return '' === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\-:]*$/D', $name); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilderInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilderInterface.php new file mode 100755 index 0000000000..35eff8790b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormConfigBuilderInterface.php @@ -0,0 +1,250 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +/** + * @author Bernhard Schussek + */ +interface FormConfigBuilderInterface extends FormConfigInterface +{ + /** + * Adds an event listener to an event on this form. + * + * @param string $eventName The name of the event to listen to. + * @param callable $listener The listener to execute. + * @param integer $priority The priority of the listener. Listeners + * with a higher priority are called before + * listeners with a lower priority. + * + * @return self The configuration object. + */ + public function addEventListener($eventName, $listener, $priority = 0); + + /** + * Adds an event subscriber for events on this form. + * + * @param EventSubscriberInterface $subscriber The subscriber to attach. + * + * @return self The configuration object. + */ + public function addEventSubscriber(EventSubscriberInterface $subscriber); + + /** + * Adds a validator to the form. + * + * @param FormValidatorInterface $validator The validator. + * + * @return self The configuration object. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function addValidator(FormValidatorInterface $validator); + + /** + * Appends / prepends a transformer to the view transformer chain. + * + * The transform method of the transformer is used to convert data from the + * normalized to the view format. + * The reverseTransform method of the transformer is used to convert from the + * view to the normalized format. + * + * @param DataTransformerInterface $viewTransformer + * @param Boolean $forcePrepend if set to true, prepend instead of appending + * + * @return self The configuration object. + */ + public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false); + + /** + * Clears the view transformers. + * + * @return self The configuration object. + */ + public function resetViewTransformers(); + + /** + * Prepends / appends a transformer to the normalization transformer chain. + * + * The transform method of the transformer is used to convert data from the + * model to the normalized format. + * The reverseTransform method of the transformer is used to convert from the + * normalized to the model format. + * + * @param DataTransformerInterface $modelTransformer + * @param Boolean $forceAppend if set to true, append instead of prepending + * + * @return self The configuration object. + */ + public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false); + + /** + * Clears the normalization transformers. + * + * @return self The configuration object. + */ + public function resetModelTransformers(); + + /** + * Sets the value for an attribute. + * + * @param string $name The name of the attribute + * @param string $value The value of the attribute + * + * @return self The configuration object. + */ + public function setAttribute($name, $value); + + /** + * Sets the attributes. + * + * @param array $attributes The attributes. + * + * @return self The configuration object. + */ + public function setAttributes(array $attributes); + + /** + * Sets the data mapper used by the form. + * + * @param DataMapperInterface $dataMapper + * + * @return self The configuration object. + */ + public function setDataMapper(DataMapperInterface $dataMapper = null); + + /** + * Set whether the form is disabled. + * + * @param Boolean $disabled Whether the form is disabled + * + * @return self The configuration object. + */ + public function setDisabled($disabled); + + /** + * Sets the data used for the client data when no value is bound. + * + * @param mixed $emptyData The empty data. + * + * @return self The configuration object. + */ + public function setEmptyData($emptyData); + + /** + * Sets whether errors bubble up to the parent. + * + * @param Boolean $errorBubbling + * + * @return self The configuration object. + */ + public function setErrorBubbling($errorBubbling); + + /** + * Sets whether this field is required to be filled out when bound. + * + * @param Boolean $required + * + * @return self The configuration object. + */ + 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 automatically based on + * the form's name. + * + * @return self The configuration object. + */ + public function setPropertyPath($propertyPath); + + /** + * Sets whether the form should be mapped to an element of its + * parent's data. + * + * @param Boolean $mapped Whether the form should be mapped. + * + * @return self The configuration object. + */ + public function setMapped($mapped); + + /** + * Sets whether the form's data should be modified by reference. + * + * @param Boolean $byReference Whether the data should be + * modified by reference. + * + * @return self The configuration object. + */ + public function setByReference($byReference); + + /** + * Sets whether the form should be virtual. + * + * @param Boolean $virtual Whether the form should be virtual. + * + * @return self The configuration object. + */ + public function setVirtual($virtual); + + /** + * Sets whether the form should be compound. + * + * @param Boolean $compound Whether the form should be compound. + * + * @return self The configuration object. + * + * @see FormConfigInterface::getCompound() + */ + public function setCompound($compound); + + /** + * Set the types. + * + * @param ResolvedFormTypeInterface $type The type of the form. + * + * @return self The configuration object. + */ + public function setType(ResolvedFormTypeInterface $type); + + /** + * Sets the initial data of the form. + * + * @param array $data The data of the form in application format. + * + * @return self The configuration object. + */ + public function setData($data); + + /** + * Locks the form's data to the data passed in the configuration. + * + * A form with locked data is restricted to the data passed in + * this configuration. The data can only be modified then by + * binding the form. + * + * @param Boolean $locked Whether to lock the default data. + * + * @return self The configuration object. + */ + public function setDataLocked($locked); + + /** + * Builds and returns the form configuration. + * + * @return FormConfigInterface + */ + public function getFormConfig(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormConfigInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormConfigInterface.php new file mode 100755 index 0000000000..364d6a60b0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormConfigInterface.php @@ -0,0 +1,220 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * The configuration of a {@link Form} object. + * + * @author Bernhard Schussek + */ +interface FormConfigInterface +{ + /** + * Returns the event dispatcher used to dispatch form events. + * + * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface The dispatcher. + */ + public function getEventDispatcher(); + + /** + * Returns the name of the form used as HTTP parameter. + * + * @return string The form name. + */ + public function getName(); + + /** + * Returns the property path that the form should be mapped to. + * + * @return null|Util\PropertyPathInterface The property path. + */ + public function getPropertyPath(); + + /** + * Returns whether the form should be mapped to an element of its + * parent's data. + * + * @return Boolean Whether the form is mapped. + */ + public function getMapped(); + + /** + * Returns whether the form's data should be modified by reference. + * + * @return Boolean Whether to modify the form's data by reference. + */ + public function getByReference(); + + /** + * Returns whether the form should be virtual. + * + * When mapping data to the children of a form, the data mapper + * should ignore virtual forms and map to the children of the + * virtual form instead. + * + * @return Boolean Whether the form is virtual. + */ + public function getVirtual(); + + /** + * Returns whether the form is compound. + * + * This property is independent of whether the form actually has + * children. A form can be compound and have no children at all, like + * for example an empty collection form. + * + * @return Boolean Whether the form is compound. + */ + public function getCompound(); + + /** + * Returns the form types used to construct the form. + * + * @return ResolvedFormTypeInterface The form's type. + */ + public function getType(); + + /** + * Returns the view transformers of the form. + * + * @return array An array of {@link DataTransformerInterface} instances. + */ + public function getViewTransformers(); + + /** + * Returns the model transformers of the form. + * + * @return array An array of {@link DataTransformerInterface} instances. + */ + public function getModelTransformers(); + + /** + * Returns the data mapper of the form. + * + * @return DataMapperInterface The data mapper. + */ + public function getDataMapper(); + + /** + * Returns the validators of the form. + * + * @return FormValidatorInterface The form validator. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function getValidators(); + + /** + * Returns whether the form is required. + * + * @return Boolean Whether the form is required. + */ + public function getRequired(); + + /** + * Returns whether the form is disabled. + * + * @return Boolean Whether the form is disabled. + */ + public function getDisabled(); + + /** + * Returns whether errors attached to the form will bubble to its parent. + * + * @return Boolean Whether errors will bubble up. + */ + public function getErrorBubbling(); + + /** + * Returns the data that should be returned when the form is empty. + * + * @return mixed The data returned if the form is empty. + */ + public function getEmptyData(); + + /** + * Returns additional attributes of the form. + * + * @return array An array of key-value combinations. + */ + public function getAttributes(); + + /** + * Returns whether the attribute with the given name exists. + * + * @param string $name The attribute name. + * + * @return Boolean Whether the attribute exists. + */ + public function hasAttribute($name); + + /** + * Returns the value of the given attribute. + * + * @param string $name The attribute name. + * @param mixed $default The value returned if the attribute does not exist. + * + * @return mixed The attribute value. + */ + public function getAttribute($name, $default = null); + + /** + * Returns the initial data of the form. + * + * @return mixed The initial form data. + */ + public function getData(); + + /** + * Returns the class of the form data or null if the data is scalar or an array. + * + * @return string The data class or null. + */ + public function getDataClass(); + + /** + * Returns whether the form's data is locked. + * + * A form with locked data is restricted to the data passed in + * this configuration. The data can only be modified then by + * binding the form. + * + * @return Boolean Whether the data is locked. + */ + public function getDataLocked(); + + /** + * Returns all options passed during the construction of the form. + * + * @return array The passed options. + */ + public function getOptions(); + + /** + * Returns whether a specific option exists. + * + * @param string $name The option name, + * + * @return Boolean Whether the option exists. + */ + public function hasOption($name); + + /** + * Returns the value of a specific option. + * + * @param string $name The option name. + * @param mixed $default The value returned if the option does not exist. + * + * @return mixed The option value. + */ + public function getOption($name, $default = null); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormError.php b/vendor/symfony/form/Symfony/Component/Form/FormError.php new file mode 100755 index 0000000000..b336a40388 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormError.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Wraps errors in forms + * + * @author Bernhard Schussek + */ +class FormError +{ + /** + * The template for the error message + * @var string + */ + protected $messageTemplate; + + /** + * The parameters that should be substituted in the message template + * @var array + */ + protected $messageParameters; + + /** + * The value for error message pluralization + * @var integer|null + */ + protected $messagePluralization; + + /** + * Constructor + * + * Any array key in $messageParameters will be used as a placeholder in + * $messageTemplate. + * @see \Symfony\Component\Translation\Translator + * + * @param string $messageTemplate The template for the error message + * @param array $messageParameters The parameters that should be + * substituted in the message template. + * @param integer|null $messagePluralization The value for error message pluralization + */ + public function __construct($messageTemplate, array $messageParameters = array(), $messagePluralization = null) + { + $this->messageTemplate = $messageTemplate; + $this->messageParameters = $messageParameters; + $this->messagePluralization = $messagePluralization; + } + + /** + * Returns the error message + * + * @return string + */ + public function getMessage() + { + return strtr($this->messageTemplate, $this->messageParameters); + } + + /** + * Returns the error message template + * + * @return string + */ + public function getMessageTemplate() + { + return $this->messageTemplate; + } + + /** + * Returns the parameters to be inserted in the message template + * + * @return array + */ + public function getMessageParameters() + { + return $this->messageParameters; + } + + /** + * Returns the value for error message pluralization. + * + * @return integer|null + */ + public function getMessagePluralization() + { + return $this->messagePluralization; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormEvent.php b/vendor/symfony/form/Symfony/Component/Form/FormEvent.php new file mode 100755 index 0000000000..ed3fc77006 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormEvent.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Event\FilterDataEvent; + +/** + * @author Bernhard Schussek + */ +class FormEvent extends FilterDataEvent +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormEvents.php b/vendor/symfony/form/Symfony/Component/Form/FormEvents.php new file mode 100755 index 0000000000..6ddfe3e8e4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormEvents.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +final class FormEvents +{ + const PRE_BIND = 'form.pre_bind'; + + const BIND = 'form.bind'; + + const POST_BIND = 'form.post_bind'; + + const PRE_SET_DATA = 'form.pre_set_data'; + + const POST_SET_DATA = 'form.post_set_data'; + + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link PRE_BIND} instead. + */ + const BIND_CLIENT_DATA = 'form.bind_client_data'; + + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link BIND} instead. + */ + const BIND_NORM_DATA = 'form.bind_norm_data'; + + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + * Use {@link PRE_SET_DATA} instead. + */ + const SET_DATA = 'form.set_data'; + + private function __construct() + { + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormExtensionInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormExtensionInterface.php new file mode 100755 index 0000000000..5347c451d2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormExtensionInterface.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Interface for extensions which provide types, type extensions and a guesser. + */ +interface FormExtensionInterface +{ + /** + * Returns a type by name. + * + * @param string $name The name of the type + * + * @return FormTypeInterface The type + * + * @throws Exception\FormException if the given type is not supported by this extension + */ + public function getType($name); + + /** + * Returns whether the given type is supported. + * + * @param string $name The name of the type + * + * @return Boolean Whether the type is supported by this extension + */ + public function hasType($name); + + /** + * Returns the extensions for the given type. + * + * @param string $name The name of the type + * + * @return array An array of extensions as FormTypeExtensionInterface instances + */ + public function getTypeExtensions($name); + + /** + * Returns whether this extension provides type extensions for the given type. + * + * @param string $name The name of the type + * + * @return Boolean Whether the given type has extensions + */ + public function hasTypeExtensions($name); + + /** + * Returns the type guesser provided by this extension. + * + * @return FormTypeGuesserInterface|null The type guesser + */ + public function getTypeGuesser(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormFactory.php b/vendor/symfony/form/Symfony/Component/Form/FormFactory.php new file mode 100755 index 0000000000..2d06e59be4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormFactory.php @@ -0,0 +1,218 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +class FormFactory implements FormFactoryInterface +{ + /** + * @var FormRegistryInterface + */ + private $registry; + + /** + * @var ResolvedFormTypeFactoryInterface + */ + private $resolvedTypeFactory; + + public function __construct(FormRegistryInterface $registry, ResolvedFormTypeFactoryInterface $resolvedTypeFactory) + { + $this->registry = $registry; + $this->resolvedTypeFactory = $resolvedTypeFactory; + } + + /** + * {@inheritdoc} + */ + public function create($type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + return $this->createBuilder($type, $data, $options, $parent)->getForm(); + } + + /** + * {@inheritdoc} + */ + public function createNamed($name, $type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + return $this->createNamedBuilder($name, $type, $data, $options, $parent)->getForm(); + } + + /** + * {@inheritdoc} + */ + public function createForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + return $this->createBuilderForProperty($class, $property, $data, $options, $parent)->getForm(); + } + + /** + * {@inheritdoc} + */ + public function createBuilder($type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + $name = $type instanceof FormTypeInterface || $type instanceof ResolvedFormTypeInterface + ? $type->getName() + : $type; + + return $this->createNamedBuilder($name, $type, $data, $options, $parent); + } + + /** + * {@inheritdoc} + */ + public function createNamedBuilder($name, $type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + if (null !== $data && !array_key_exists('data', $options)) { + $options['data'] = $data; + } + + if ($type instanceof FormTypeInterface) { + $type = $this->resolveType($type); + } elseif (is_string($type)) { + $type = $this->registry->getType($type); + } elseif (!$type instanceof ResolvedFormTypeInterface) { + throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface'); + } + + return $type->createBuilder($this, $name, $options, $parent); + } + + /** + * {@inheritdoc} + */ + public function createBuilderForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null) + { + if (null === $guesser = $this->registry->getTypeGuesser()) { + return $this->createNamedBuilder($property, 'text', $data, $options, $parent); + } + + $typeGuess = $guesser->guessType($class, $property); + $maxLengthGuess = $guesser->guessMaxLength($class, $property); + // Keep $minLengthGuess for BC until Symfony 2.3 + $minLengthGuess = $guesser->guessMinLength($class, $property); + $requiredGuess = $guesser->guessRequired($class, $property); + $patternGuess = $guesser->guessPattern($class, $property); + + $type = $typeGuess ? $typeGuess->getType() : 'text'; + + $maxLength = $maxLengthGuess ? $maxLengthGuess->getValue() : null; + $minLength = $minLengthGuess ? $minLengthGuess->getValue() : null; + $pattern = $patternGuess ? $patternGuess->getValue() : null; + + // overrides $minLength, if set + if (null !== $pattern) { + $options = array_merge(array('pattern' => $pattern), $options); + } + + if (null !== $maxLength) { + $options = array_merge(array('max_length' => $maxLength), $options); + } + + if (null !== $minLength && $minLength > 0) { + $options = array_merge(array('pattern' => '.{'.$minLength.','.$maxLength.'}'), $options); + } + + if ($requiredGuess) { + $options = array_merge(array('required' => $requiredGuess->getValue()), $options); + } + + // user options may override guessed options + if ($typeGuess) { + $options = array_merge($typeGuess->getOptions(), $options); + } + + return $this->createNamedBuilder($property, $type, $data, $options, $parent); + } + + /** + * Returns whether the given type is supported. + * + * @param string $name The name of the type + * + * @return Boolean Whether the type is supported + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link FormRegistryInterface::hasType()} instead. + */ + public function hasType($name) + { + return $this->registry->hasType($name); + } + + /** + * Adds a type. + * + * @param FormTypeInterface $type The type + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * form extensions or type registration in the Dependency + * Injection Container instead. + */ + public function addType(FormTypeInterface $type) + { + $parentType = $type->getParent(); + + $this->registry->addType($this->resolvedTypeFactory->createResolvedType( + $type, + array(), + $parentType ? $this->registry->getType($parentType) : null + )); + } + + /** + * Returns a type by name. + * + * This methods registers the type extensions from the form extensions. + * + * @param string $name The name of the type + * + * @return FormTypeInterface The type + * + * @throws Exception\FormException if the type can not be retrieved from any extension + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link FormRegistryInterface::getType()} instead. + */ + public function getType($name) + { + return $this->registry->getType($name)->getInnerType(); + } + + /** + * Wraps a type into a ResolvedFormTypeInterface implementation and connects + * it with its parent type. + * + * @param FormTypeInterface $type The type to resolve. + * + * @return ResolvedFormTypeInterface The resolved type. + */ + private function resolveType(FormTypeInterface $type) + { + $parentType = $type->getParent(); + + if ($parentType instanceof FormTypeInterface) { + $parentType = $this->resolveType($parentType); + } elseif (null !== $parentType) { + $parentType = $this->registry->getType($parentType); + } + + return $this->resolvedTypeFactory->createResolvedType( + $type, + // Type extensions are not supported for unregistered type instances, + // i.e. type instances that are passed to the FormFactory directly, + // nor for their parents, if getParent() also returns a type instance. + array(), + $parentType + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilder.php b/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilder.php new file mode 100755 index 0000000000..10383e841c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilder.php @@ -0,0 +1,162 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * The default implementation of FormFactoryBuilderInterface. + * + * @author Bernhard Schussek + */ +class FormFactoryBuilder implements FormFactoryBuilderInterface +{ + /** + * @var ResolvedFormTypeFactoryInterface + */ + private $resolvedTypeFactory; + + /** + * @var array + */ + private $extensions = array(); + + /** + * @var array + */ + private $types = array(); + + /** + * @var array + */ + private $typeExtensions = array(); + + /** + * @var array + */ + private $typeGuessers = array(); + + /** + * {@inheritdoc} + */ + public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory) + { + $this->resolvedTypeFactory = $resolvedTypeFactory; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addExtension(FormExtensionInterface $extension) + { + $this->extensions[] = $extension; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addExtensions(array $extensions) + { + $this->extensions = array_merge($this->extensions, $extensions); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addType(FormTypeInterface $type) + { + $this->types[$type->getName()] = $type; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addTypes(array $types) + { + foreach ($types as $type) { + $this->types[$type->getName()] = $type; + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addTypeExtension(FormTypeExtensionInterface $typeExtension) + { + $this->typeExtensions[$typeExtension->getExtendedType()][] = $typeExtension; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addTypeExtensions(array $typeExtensions) + { + foreach ($typeExtensions as $typeExtension) { + $this->typeExtensions[$typeExtension->getExtendedType()][] = $typeExtension; + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser) + { + $this->typeGuessers[] = $typeGuesser; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function addTypeGuessers(array $typeGuessers) + { + $this->typeGuessers = array_merge($this->typeGuessers, $typeGuessers); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormFactory() + { + $extensions = $this->extensions; + + if (count($this->types) > 0 || count($this->typeExtensions) > 0 || count($this->typeGuessers) > 0) { + if (count($this->typeGuessers) > 1) { + $typeGuesser = new FormTypeGuesserChain($this->typeGuessers); + } else { + $typeGuesser = isset($this->typeGuessers[0]) ? $this->typeGuessers[0] : null; + } + + $extensions[] = new PreloadedExtension($this->types, $this->typeExtensions, $typeGuesser); + } + + $resolvedTypeFactory = $this->resolvedTypeFactory ?: new ResolvedFormTypeFactory(); + $registry = new FormRegistry($extensions, $resolvedTypeFactory); + + return new FormFactory($registry, $resolvedTypeFactory); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilderInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilderInterface.php new file mode 100755 index 0000000000..9370c573a6 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormFactoryBuilderInterface.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * A builder for FormFactoryInterface objects. + * + * @author Bernhard Schussek + */ +interface FormFactoryBuilderInterface +{ + /** + * Sets the factory for creating ResolvedFormTypeInterface instances. + * + * @param ResolvedFormTypeFactoryInterface $resolvedTypeFactory + * + * @return FormFactoryBuilderInterface The builder. + */ + public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory); + + /** + * Adds an extension to be loaded by the factory. + * + * @param FormExtensionInterface $extension The extension. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addExtension(FormExtensionInterface $extension); + + /** + * Adds a list of extensions to be loaded by the factory. + * + * @param array $extensions The extensions. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addExtensions(array $extensions); + + /** + * Adds a form type to the factory. + * + * @param FormTypeInterface $type The form type. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addType(FormTypeInterface $type); + + /** + * Adds a list of form types to the factory. + * + * @param array $types The form types. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addTypes(array $types); + + /** + * Adds a form type extension to the factory. + * + * @param FormTypeExtensionInterface $typeExtension The form type extension. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addTypeExtension(FormTypeExtensionInterface $typeExtension); + + /** + * Adds a list of form type extensions to the factory. + * + * @param array $typeExtensions The form type extensions. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addTypeExtensions(array $typeExtensions); + + /** + * Adds a type guesser to the factory. + * + * @param FormTypeGuesserInterface $typeGuesser The type guesser. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser); + + /** + * Adds a list of type guessers to the factory. + * + * @param array $typeGuessers The type guessers. + * + * @return FormFactoryBuilderInterface The builder. + */ + public function addTypeGuessers(array $typeGuessers); + + /** + * Builds and returns the factory. + * + * @return FormFactoryInterface The form factory. + */ + public function getFormFactory(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormFactoryInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormFactoryInterface.php new file mode 100755 index 0000000000..fc90068479 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormFactoryInterface.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +interface FormFactoryInterface +{ + /** + * Returns a form. + * + * @see createBuilder() + * + * @param string|FormTypeInterface $type The type of the form + * @param mixed $data The initial data + * @param array $options The options + * @param FormBuilderInterface $parent The parent builder + * + * @return FormInterface The form named after the type + * + * @throws Exception\FormException if any given option is not applicable to the given type + */ + public function create($type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Returns a form. + * + * @see createNamedBuilder() + * + * @param string $name The name of the form + * @param string|FormTypeInterface $type The type of the form + * @param mixed $data The initial data + * @param array $options The options + * @param FormBuilderInterface $parent The parent builder + * + * @return FormInterface The form + * + * @throws Exception\FormException if any given option is not applicable to the given type + */ + public function createNamed($name, $type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Returns a form for a property of a class. + * + * @see createBuilderForProperty() + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * @param mixed $data The initial data + * @param array $options The options for the builder + * @param FormBuilderInterface $parent The parent builder + * + * @return FormInterface The form named after the property + * + * @throws Exception\FormException if any given option is not applicable to the form type + */ + public function createForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Returns a form builder. + * + * @param string|FormTypeInterface $type The type of the form + * @param mixed $data The initial data + * @param array $options The options + * @param FormBuilderInterface $parent The parent builder + * + * @return FormBuilderInterface The form builder + * + * @throws Exception\FormException if any given option is not applicable to the given type + */ + public function createBuilder($type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Returns a form builder. + * + * @param string $name The name of the form + * @param string|FormTypeInterface $type The type of the form + * @param mixed $data The initial data + * @param array $options The options + * @param FormBuilderInterface $parent The parent builder + * + * @return FormBuilderInterface The form builder + * + * @throws Exception\FormException if any given option is not applicable to the given type + */ + public function createNamedBuilder($name, $type = 'form', $data = null, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Returns a form builder for a property of a class. + * + * If any of the 'max_length', 'required' and type options can be guessed, + * and are not provided in the options argument, the guessed value is used. + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * @param mixed $data The initial data + * @param array $options The options for the builder + * @param FormBuilderInterface $parent The parent builder + * + * @return FormBuilderInterface The form builder named after the property + * + * @throws Exception\FormException if any given option is not applicable to the form type + */ + public function createBuilderForProperty($class, $property, $data = null, array $options = array(), FormBuilderInterface $parent = null); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormInterface.php new file mode 100755 index 0000000000..9051aba51e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormInterface.php @@ -0,0 +1,257 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * A form group bundling multiple forms in a hierarchical structure. + * + * @author Bernhard Schussek + */ +interface FormInterface extends \ArrayAccess, \Traversable, \Countable +{ + /** + * Sets the parent form. + * + * @param FormInterface|null $parent The parent form or null if it's the root. + * + * @return FormInterface The form instance + * + * @throws Exception\AlreadyBoundException If the form has already been bound. + * @throws Exception\FormException When trying to set a parent for a form with + * an empty name. + */ + public function setParent(FormInterface $parent = null); + + /** + * Returns the parent form. + * + * @return FormInterface|null The parent form or null if there is none. + */ + public function getParent(); + + /** + * Adds a child to the form. + * + * @param FormInterface $child The FormInterface to add as a child + * + * @return FormInterface The form instance + * + * @throws Exception\AlreadyBoundException If the form has already been bound. + * @throws Exception\FormException When trying to add a child to a non-compound form. + */ + public function add(FormInterface $child); + + /** + * Returns the child with the given name. + * + * @param string $name The name of the child + * + * @return FormInterface The child form + * + * @throws \OutOfBoundsException If the named child does not exist. + */ + public function get($name); + + /** + * Returns whether a child with the given name exists. + * + * @param string $name The name of the child + * + * @return Boolean + */ + public function has($name); + + /** + * Removes a child from the form. + * + * @param string $name The name of the child to remove + * + * @return FormInterface The form instance + * + * @throws Exception\AlreadyBoundException If the form has already been bound. + */ + public function remove($name); + + /** + * Returns all children in this group. + * + * @return array An array of FormInterface instances + */ + public function all(); + + /** + * Returns all errors. + * + * @return array An array of FormError instances that occurred during binding + */ + public function getErrors(); + + /** + * Updates the form with default data. + * + * @param mixed $modelData The data formatted as expected for the underlying object + * + * @return FormInterface The form instance + * + * @throws Exception\AlreadyBoundException If the form has already been bound. + * @throws Exception\FormException If listeners try to call setData in a cycle. Or if + * the view data does not match the expected type + * according to {@link FormConfigInterface::getDataClass}. + */ + public function setData($modelData); + + /** + * Returns the data in the format needed for the underlying object. + * + * @return mixed + */ + public function getData(); + + /** + * Returns the normalized data of the field. + * + * @return mixed When the field is not bound, the default data is returned. + * When the field is bound, the normalized bound data is + * returned if the field is valid, null otherwise. + */ + public function getNormData(); + + /** + * Returns the data transformed by the value transformer. + * + * @return mixed + */ + public function getViewData(); + + /** + * Returns the extra data. + * + * @return array The bound data which do not belong to a child + */ + public function getExtraData(); + + /** + * Returns the form's configuration. + * + * @return FormConfigInterface The configuration. + */ + public function getConfig(); + + /** + * Returns whether the field is bound. + * + * @return Boolean true if the form is bound to input values, false otherwise + */ + public function isBound(); + + /** + * Returns the name by which the form is identified in forms. + * + * @return string The name of the form. + */ + public function getName(); + + /** + * Returns the property path that the form is mapped to. + * + * @return Util\PropertyPathInterface The property path. + */ + public function getPropertyPath(); + + /** + * Adds an error to this form. + * + * @param FormError $error + * + * @return FormInterface The form instance + */ + public function addError(FormError $error); + + /** + * Returns whether the form and all children are valid. + * + * @return Boolean + */ + public function isValid(); + + /** + * Returns whether the form is required to be filled out. + * + * If the form has a parent and the parent is not required, this method + * will always return false. Otherwise the value set with setRequired() + * is returned. + * + * @return Boolean + */ + public function isRequired(); + + /** + * Returns whether this form is disabled. + * + * The content of a disabled form is displayed, but not allowed to be + * modified. The validation of modified disabled forms should fail. + * + * Forms whose parents are disabled are considered disabled regardless of + * their own state. + * + * @return Boolean + */ + public function isDisabled(); + + /** + * Returns whether the form is empty. + * + * @return Boolean + */ + public function isEmpty(); + + /** + * Returns whether the data in the different formats is synchronized. + * + * @return Boolean + */ + public function isSynchronized(); + + /** + * Binds data to the form, transforms and validates it. + * + * @param null|string|array $submittedData The data + * + * @return FormInterface The form instance + * + * @throws Exception\AlreadyBoundException If the form has already been bound. + */ + public function bind($submittedData); + + /** + * Returns the root of the form tree. + * + * @return FormInterface The root of the tree + */ + public function getRoot(); + + /** + * Returns whether the field is the root of the form tree. + * + * @return Boolean + */ + public function isRoot(); + + /** + * Creates a view. + * + * @param FormView $parent The parent view + * + * @return FormView The view + */ + public function createView(FormView $parent = null); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormRegistry.php b/vendor/symfony/form/Symfony/Component/Form/FormRegistry.php new file mode 100755 index 0000000000..7823a77f01 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormRegistry.php @@ -0,0 +1,186 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\Form\Exception\FormException; + +/** + * The central registry of the Form component. + * + * @author Bernhard Schussek + */ +class FormRegistry implements FormRegistryInterface +{ + /** + * Extensions + * @var array An array of FormExtensionInterface + */ + private $extensions = array(); + + /** + * @var array + */ + private $types = array(); + + /** + * @var FormTypeGuesserInterface|false|null + */ + private $guesser = false; + + /** + * @var ResolvedFormTypeFactoryInterface + */ + private $resolvedTypeFactory; + + /** + * Constructor. + * + * @param array $extensions An array of FormExtensionInterface + * @param ResolvedFormTypeFactoryInterface $resolvedTypeFactory The factory for resolved form types. + * + * @throws UnexpectedTypeException if any extension does not implement FormExtensionInterface + */ + public function __construct(array $extensions, ResolvedFormTypeFactoryInterface $resolvedTypeFactory) + { + foreach ($extensions as $extension) { + if (!$extension instanceof FormExtensionInterface) { + throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormExtensionInterface'); + } + } + + $this->extensions = $extensions; + $this->resolvedTypeFactory = $resolvedTypeFactory; + } + + /** + * {@inheritdoc} + */ + public function addType(ResolvedFormTypeInterface $type) + { + $this->types[$type->getName()] = $type; + } + + /** + * {@inheritdoc} + */ + public function getType($name) + { + if (!is_string($name)) { + throw new UnexpectedTypeException($name, 'string'); + } + + if (!isset($this->types[$name])) { + /** @var FormTypeInterface $type */ + $type = null; + + foreach ($this->extensions as $extension) { + /* @var FormExtensionInterface $extension */ + if ($extension->hasType($name)) { + $type = $extension->getType($name); + break; + } + } + + if (!$type) { + throw new FormException(sprintf('Could not load type "%s"', $name)); + } + + $this->resolveAndAddType($type); + } + + return $this->types[$name]; + } + + /** + * Wraps a type into a ResolvedFormTypeInterface implementation and connects + * it with its parent type. + * + * @param FormTypeInterface $type The type to resolve. + * + * @return ResolvedFormTypeInterface The resolved type. + */ + private function resolveAndAddType(FormTypeInterface $type) + { + $parentType = $type->getParent(); + + if ($parentType instanceof FormTypeInterface) { + $this->resolveAndAddType($parentType); + $parentType = $parentType->getName(); + } + + $typeExtensions = array(); + + foreach ($this->extensions as $extension) { + /* @var FormExtensionInterface $extension */ + $typeExtensions = array_merge( + $typeExtensions, + $extension->getTypeExtensions($type->getName()) + ); + } + + $this->addType($this->resolvedTypeFactory->createResolvedType( + $type, + $typeExtensions, + $parentType ? $this->getType($parentType) : null + )); + } + + /** + * {@inheritdoc} + */ + public function hasType($name) + { + if (isset($this->types[$name])) { + return true; + } + + try { + $this->getType($name); + } catch (FormException $e) { + return false; + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function getTypeGuesser() + { + if (false === $this->guesser) { + $guessers = array(); + + foreach ($this->extensions as $extension) { + /* @var FormExtensionInterface $extension */ + $guesser = $extension->getTypeGuesser(); + + if ($guesser) { + $guessers[] = $guesser; + } + } + + $this->guesser = !empty($guessers) ? new FormTypeGuesserChain($guessers) : null; + } + + return $this->guesser; + } + + /** + * {@inheritdoc} + */ + public function getExtensions() + { + return $this->extensions; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormRegistryInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormRegistryInterface.php new file mode 100755 index 0000000000..49915ad68a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormRegistryInterface.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * The central registry of the Form component. + * + * @author Bernhard Schussek + */ +interface FormRegistryInterface +{ + /** + * Adds a form type. + * + * @param ResolvedFormTypeInterface $type The type + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * form extensions or type registration in the Dependency + * Injection Container instead. + */ + public function addType(ResolvedFormTypeInterface $type); + + /** + * Returns a form type by name. + * + * This methods registers the type extensions from the form extensions. + * + * @param string $name The name of the type + * + * @return ResolvedFormTypeInterface The type + * + * @throws Exception\UnexpectedTypeException if the passed name is not a string + * @throws Exception\FormException if the type can not be retrieved from any extension + */ + public function getType($name); + + /** + * Returns whether the given form type is supported. + * + * @param string $name The name of the type + * + * @return Boolean Whether the type is supported + */ + public function hasType($name); + + /** + * Returns the guesser responsible for guessing types. + * + * @return FormTypeGuesserInterface|null + */ + public function getTypeGuesser(); + + /** + * Returns the extensions loaded by the framework. + * + * @return array + */ + public function getExtensions(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormRenderer.php b/vendor/symfony/form/Symfony/Component/Form/FormRenderer.php new file mode 100755 index 0000000000..5ace682561 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormRenderer.php @@ -0,0 +1,285 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; + +/** + * Renders a form into HTML using a rendering engine. + * + * @author Bernhard Schussek + */ +class FormRenderer implements FormRendererInterface +{ + const CACHE_KEY_VAR = 'unique_block_prefix'; + + /** + * @var FormRendererEngineInterface + */ + private $engine; + + /** + * @var CsrfProviderInterface + */ + private $csrfProvider; + + /** + * @var array + */ + private $blockNameHierarchyMap = array(); + + /** + * @var array + */ + private $hierarchyLevelMap = array(); + + /** + * @var array + */ + private $variableStack = array(); + + public function __construct(FormRendererEngineInterface $engine, CsrfProviderInterface $csrfProvider = null) + { + $this->engine = $engine; + $this->csrfProvider = $csrfProvider; + } + + /** + * {@inheritdoc} + */ + public function getEngine() + { + return $this->engine; + } + + /** + * {@inheritdoc} + */ + public function setTheme(FormView $view, $themes) + { + $this->engine->setTheme($view, $themes); + } + + /** + * {@inheritdoc} + */ + public function renderCsrfToken($intention) + { + if (null === $this->csrfProvider) { + throw new \BadMethodCallException('CSRF token can only be generated if a CsrfProviderInterface is injected in the constructor.'); + } + + return $this->csrfProvider->generateCsrfToken($intention); + } + + /** + * {@inheritdoc} + */ + public function renderBlock(FormView $view, $blockName, array $variables = array()) + { + if (0 == count($this->variableStack)) { + throw new FormException('This method should only be called while rendering a form element.'); + } + + $viewCacheKey = $view->vars[self::CACHE_KEY_VAR]; + $scopeVariables = end($this->variableStack[$viewCacheKey]); + + $resource = $this->engine->getResourceForBlockName($view, $blockName); + + if (!$resource) { + throw new FormException(sprintf('No block "%s" found while rendering the form.', $blockName)); + } + + // Merge the passed with the existing attributes + if (isset($variables['attr']) && isset($scopeVariables['attr'])) { + $variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']); + } + + // Merge the passed with the exist *label* attributes + if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) { + $variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']); + } + + // Do not use array_replace_recursive(), otherwise array variables + // cannot be overwritten + $variables = array_replace($scopeVariables, $variables); + + $this->variableStack[$viewCacheKey][] = $variables; + + // Do the rendering + $html = $this->engine->renderBlock($view, $resource, $blockName, $variables); + + // Clear the stack + array_pop($this->variableStack[$viewCacheKey]); + + return $html; + } + + /** + * {@inheritdoc} + */ + public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $variables = array()) + { + $renderOnlyOnce = 'row' === $blockNameSuffix || 'widget' === $blockNameSuffix; + + if ($renderOnlyOnce && $view->isRendered()) { + return ''; + } + + // The cache key for storing the variables and types + $viewCacheKey = $view->vars[self::CACHE_KEY_VAR]; + $viewAndSuffixCacheKey = $viewCacheKey . $blockNameSuffix; + + // In templates, we have to deal with two kinds of block hierarchies: + // + // +---------+ +---------+ + // | Theme B | -------> | Theme A | + // +---------+ +---------+ + // + // form_widget -------> form_widget + // ^ + // | + // choice_widget -----> choice_widget + // + // The first kind of hierarchy is the theme hierarchy. This allows to + // override the block "choice_widget" from Theme A in the extending + // Theme B. This kind of inheritance needs to be supported by the + // template engine and, for example, offers "parent()" or similar + // functions to fall back from the custom to the parent implementation. + // + // The second kind of hierarchy is the form type hierarchy. This allows + // to implement a custom "choice_widget" block (no matter in which theme), + // or to fallback to the block of the parent type, which would be + // "form_widget" in this example (again, no matter in which theme). + // If the designer wants to explicitly fallback to "form_widget" in his + // custom "choice_widget", for example because he only wants to wrap + // a
around the original implementation, he can simply call the + // widget() function again to render the block for the parent type. + // + // The second kind is implemented in the following blocks. + if (!isset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey])) { + // INITIAL CALL + // Calculate the hierarchy of template blocks and start on + // the bottom level of the hierarchy (= "__
" block) + $blockNameHierarchy = array(); + foreach ($view->vars['block_prefixes'] as $blockNamePrefix) { + $blockNameHierarchy[] = $blockNamePrefix . '_' . $blockNameSuffix; + } + $hierarchyLevel = count($blockNameHierarchy) - 1; + + $hierarchyInit = true; + } else { + // RECURSIVE CALL + // If a block recursively calls searchAndRenderBlock() again, resume rendering + // using the parent type in the hierarchy. + $blockNameHierarchy = $this->blockNameHierarchyMap[$viewAndSuffixCacheKey]; + $hierarchyLevel = $this->hierarchyLevelMap[$viewAndSuffixCacheKey] - 1; + + $hierarchyInit = false; + } + + // The variables are cached globally for a view (instead of for the + // current suffix) + if (!isset($this->variableStack[$viewCacheKey])) { + // The default variable scope contains all view variables, merged with + // the variables passed explicitly to the helper + $scopeVariables = $view->vars; + + $varInit = true; + } else { + // Reuse the current scope and merge it with the explicitly passed variables + $scopeVariables = end($this->variableStack[$viewCacheKey]); + + $varInit = false; + } + + // Load the resource where this block can be found + $resource = $this->engine->getResourceForBlockNameHierarchy($view, $blockNameHierarchy, $hierarchyLevel); + + // Update the current hierarchy level to the one at which the resource was + // found. For example, if looking for "choice_widget", but only a resource + // is found for its parent "form_widget", then the level is updated here + // to the parent level. + $hierarchyLevel = $this->engine->getResourceHierarchyLevel($view, $blockNameHierarchy, $hierarchyLevel); + + // The actually existing block name in $resource + $blockName = $blockNameHierarchy[$hierarchyLevel]; + + // Escape if no resource exists for this block + if (!$resource) { + throw new FormException(sprintf( + 'Unable to render the form as none of the following blocks exist: "%s".', + implode('", "', array_reverse($blockNameHierarchy)) + )); + } + + // Merge the passed with the existing attributes + if (isset($variables['attr']) && isset($scopeVariables['attr'])) { + $variables['attr'] = array_replace($scopeVariables['attr'], $variables['attr']); + } + + // Merge the passed with the exist *label* attributes + if (isset($variables['label_attr']) && isset($scopeVariables['label_attr'])) { + $variables['label_attr'] = array_replace($scopeVariables['label_attr'], $variables['label_attr']); + } + + // Do not use array_replace_recursive(), otherwise array variables + // cannot be overwritten + $variables = array_replace($scopeVariables, $variables); + + // In order to make recursive calls possible, we need to store the block hierarchy, + // the current level of the hierarchy and the variables so that this method can + // resume rendering one level higher of the hierarchy when it is called recursively. + // + // We need to store these values in maps (associative arrays) because within a + // call to widget() another call to widget() can be made, but for a different view + // object. These nested calls should not override each other. + $this->blockNameHierarchyMap[$viewAndSuffixCacheKey] = $blockNameHierarchy; + $this->hierarchyLevelMap[$viewAndSuffixCacheKey] = $hierarchyLevel; + + // We also need to store the variables for the view so that we can render other + // blocks for the same view using the same variables as in the outer block. + $this->variableStack[$viewCacheKey][] = $variables; + + // Do the rendering + $html = $this->engine->renderBlock($view, $resource, $blockName, $variables); + + // Clear the stack + array_pop($this->variableStack[$viewCacheKey]); + + // Clear the caches if they were filled for the first time within + // this function call + if ($hierarchyInit) { + unset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey]); + unset($this->hierarchyLevelMap[$viewAndSuffixCacheKey]); + } + + if ($varInit) { + unset($this->variableStack[$viewCacheKey]); + } + + if ($renderOnlyOnce) { + $view->setRendered(); + } + + return $html; + } + + /** + * {@inheritdoc} + */ + public function humanize($text) + { + return ucfirst(trim(strtolower(preg_replace('/[_\s]+/', ' ', $text)))); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormRendererEngineInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormRendererEngineInterface.php new file mode 100755 index 0000000000..e06824ec95 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormRendererEngineInterface.php @@ -0,0 +1,150 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Adapter for rendering form templates with a specific templating engine. + * + * @author Bernhard Schussek + */ +interface FormRendererEngineInterface +{ + /** + * Sets the theme(s) to be used for rendering a view and its children. + * + * @param FormView $view The view to assign the theme(s) to. + * @param mixed $themes The theme(s). The type of these themes + * is open to the implementation. + */ + public function setTheme(FormView $view, $themes); + + /** + * Returns the resource for a block name. + * + * The resource is first searched in the themes attached to $view, then + * in the themes of its parent view and so on, until a resource was found. + * + * The type of the resource is decided by the implementation. The resource + * is later passed to {@link renderBlock()} by the rendering algorithm. + * + * @param FormView $view The view for determining the used 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. + * + * @return mixed The renderer resource or false, if none was found. + */ + public function getResourceForBlockName(FormView $view, $blockName); + + /** + * Returns the resource for a block hierarchy. + * + * A block hierarchy is an array which starts with the root of the hierarchy + * and continues with the child of that root, the child of that child etc. + * The following is an example for a block hierarchy: + * + * + * form_widget + * text_widget + * url_widget + * + * + * In this example, "url_widget" is the most specific block, while the other + * blocks are its ancestors in the hierarchy. + * + * The second parameter $hierarchyLevel determines the level of the hierarchy + * that should be rendered. For example, if $hierarchyLevel is 2 for the + * above hierarchy, the engine will first look for the block "url_widget", + * then, if that does not exist, for the block "text_widget" etc. + * + * The type of the resource is decided by the implementation. The resource + * is later passed to {@link renderBlock()} by the rendering algorithm. + * + * @param FormView $view The view for determining the + * used themes. 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 at the beginning. + * @param integer $hierarchyLevel The level in the hierarchy at + * which to start looking. Level 0 + * indicates the root block, i.e. + * the first element of + * $blockNameHierarchy. + * + * @return mixed The renderer resource or false, if none was found. + */ + public function getResourceForBlockNameHierarchy(FormView $view, array $blockNameHierarchy, $hierarchyLevel); + + /** + * Returns the hierarchy level at which a resource can be found. + * + * A block hierarchy is an array which starts with the root of the hierarchy + * and continues with the child of that root, the child of that child etc. + * The following is an example for a block hierarchy: + * + * + * form_widget + * text_widget + * url_widget + * + * + * The second parameter $hierarchyLevel determines the level of the hierarchy + * that should be rendered. + * + * If we call this method with the hierarchy level 2, the engine will first + * look for a resource for block "url_widget". If such a resource exists, + * the method returns 2. Otherwise it tries to find a resource for block + * "text_widget" (at level 1) and, again, returns 1 if a resource was found. + * The method continues to look for resources until the root level was + * reached and nothing was found. In this case false is returned. + * + * The type of the resource is decided by the implementation. The resource + * is later passed to {@link renderBlock()} by the rendering algorithm. + * + * @param FormView $view The view for determining the + * used themes. 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 at the beginning. + * @param integer $hierarchyLevel The level in the hierarchy at + * which to start looking. Level 0 + * indicates the root block, i.e. + * the first element of + * $blockNameHierarchy. + * + * @return integer|Boolean The hierarchy level or false, if no resource was found. + */ + public function getResourceHierarchyLevel(FormView $view, array $blockNameHierarchy, $hierarchyLevel); + + /** + * Renders a block in the given renderer resource. + * + * The resource can be obtained by calling {@link getResourceForBlock()} + * or {@link getResourceForBlockHierarchy()}. The type of the resource is + * decided by the implementation. + * + * @param FormView $view The view to render. + * @param mixed $resource The renderer resource. + * @param string $blockName The name of the block to render. + * @param array $variables The variables to pass to the template. + * + * @return string The HTML markup. + */ + public function renderBlock(FormView $view, $resource, $blockName, array $variables = array()); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormRendererInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormRendererInterface.php new file mode 100755 index 0000000000..848e7125ca --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormRendererInterface.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Renders a form into HTML. + * + * @author Bernhard Schussek + */ +interface FormRendererInterface +{ + /** + * Returns the engine used by this renderer. + * + * @return FormRendererEngineInterface The renderer engine. + */ + public function getEngine(); + + /** + * Sets the theme(s) to be used for rendering a view and its children. + * + * @param FormView $view The view to assign the theme(s) to. + * @param mixed $themes The theme(s). The type of these themes + * is open to the implementation. + */ + public function setTheme(FormView $view, $themes); + + /** + * Renders a named block of the form theme. + * + * @param FormView $view The view for which to render the block. + * @param string $blockName The name of the block. + * @param array $variables The variables to pass to the template. + * + * @return string The HTML markup + */ + public function renderBlock(FormView $view, $blockName, array $variables = array()); + + /** + * Searches and renders a block for a given name suffix. + * + * The block is searched by combining the block names stored in the + * form view with the given suffix. If a block name is found, that + * block is rendered. + * + * If this method is called recursively, the block search is continued + * where a block was found before. + * + * @param FormView $view The view for which to render the block. + * @param string $blockNameSuffix The suffix of the block name. + * @param array $variables The variables to pass to the template. + * + * @return string The HTML markup + */ + public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $variables = array()); + + /** + * Renders a CSRF token. + * + * Use this helper for CSRF protection without the overhead of creating a + * form. + * + * + * + * + * + * Check the token in your action using the same intention. + * + * + * $csrfProvider = $this->get('form.csrf_provider'); + * if (!$csrfProvider->isCsrfTokenValid('rm_user_'.$user->getId(), $token)) { + * throw new \RuntimeException('CSRF attack detected.'); + * } + * + * + * @param string $intention The intention of the protected action + * + * @return string A CSRF token + */ + public function renderCsrfToken($intention); + + /** + * Makes a technical name human readable. + * + * Sequences of underscores are replaced by single spaces. The first letter + * of the resulting string is capitalized, while all other letters are + * turned to lowercase. + * + * @param string $text The text to humanize. + * + * @return string The humanized text. + */ + public function humanize($text); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormTypeExtensionInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormTypeExtensionInterface.php new file mode 100755 index 0000000000..9866b28b64 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormTypeExtensionInterface.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +interface FormTypeExtensionInterface +{ + /** + * Builds the form. + * + * This method is called after the extended type has built the form to + * further modify it. + * + * @see FormTypeInterface::buildForm() + * + * @param FormBuilderInterface $builder The form builder + * @param array $options The options + */ + public function buildForm(FormBuilderInterface $builder, array $options); + + /** + * Builds the view. + * + * This method is called after the extended type has built the view to + * further modify it. + * + * @see FormTypeInterface::buildView() + * + * @param FormView $view The view + * @param FormInterface $form The form + * @param array $options The options + */ + public function buildView(FormView $view, FormInterface $form, array $options); + + /** + * Finishes the view. + * + * This method is called after the extended type has finished the view to + * further modify it. + * + * @see FormTypeInterface::finishView() + * + * @param FormView $view The view + * @param FormInterface $form The form + * @param array $options The options + */ + public function finishView(FormView $view, FormInterface $form, array $options); + + /** + * Overrides the default options from the extended type. + * + * @param OptionsResolverInterface $resolver The resolver for the options. + */ + public function setDefaultOptions(OptionsResolverInterface $resolver); + + /** + * Returns the name of the type being extended. + * + * @return string The name of the type being extended + */ + public function getExtendedType(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserChain.php b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserChain.php new file mode 100755 index 0000000000..608709de87 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserChain.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Guess\Guess; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +class FormTypeGuesserChain implements FormTypeGuesserInterface +{ + private $guessers = array(); + + /** + * Constructor. + * + * @param array $guessers Guessers as instances of FormTypeGuesserInterface + * + * @throws UnexpectedTypeException if any guesser does not implement FormTypeGuesserInterface + */ + public function __construct(array $guessers) + { + foreach ($guessers as $guesser) { + if (!$guesser instanceof FormTypeGuesserInterface) { + throw new UnexpectedTypeException($guesser, 'Symfony\Component\Form\FormTypeGuesserInterface'); + } + + if ($guesser instanceof self) { + $this->guessers = array_merge($this->guessers, $guesser->guessers); + } else { + $this->guessers[] = $guesser; + } + } + } + + /** + * {@inheritDoc} + */ + public function guessType($class, $property) + { + return $this->guess(function ($guesser) use ($class, $property) { + return $guesser->guessType($class, $property); + }); + } + + /** + * {@inheritDoc} + */ + public function guessRequired($class, $property) + { + return $this->guess(function ($guesser) use ($class, $property) { + return $guesser->guessRequired($class, $property); + }); + } + + /** + * {@inheritDoc} + */ + public function guessMaxLength($class, $property) + { + return $this->guess(function ($guesser) use ($class, $property) { + return $guesser->guessMaxLength($class, $property); + }); + } + + /** + * {@inheritDoc} + */ + public function guessMinLength($class, $property) + { + return $this->guess(function ($guesser) use ($class, $property) { + return $guesser->guessMinLength($class, $property); + }); + } + + /** + * {@inheritDoc} + */ + public function guessPattern($class, $property) + { + return $this->guess(function ($guesser) use ($class, $property) { + return $guesser->guessPattern($class, $property); + }); + } + + /** + * Executes a closure for each guesser and returns the best guess from the + * return values + * + * @param \Closure $closure The closure to execute. Accepts a guesser + * as argument and should return a Guess instance + * + * @return Guess The guess with the highest confidence + */ + private function guess(\Closure $closure) + { + $guesses = array(); + + foreach ($this->guessers as $guesser) { + if ($guess = $closure($guesser)) { + $guesses[] = $guess; + } + } + + return Guess::getBestGuess($guesses); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php new file mode 100755 index 0000000000..d5b570f33c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormTypeGuesserInterface.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +interface FormTypeGuesserInterface +{ + /** + * Returns a field guess for a property name of a class + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * + * @return Guess\TypeGuess A guess for the field's type and options + */ + public function guessType($class, $property); + + /** + * Returns a guess whether a property of a class is required + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * + * @return Guess\Guess A guess for the field's required setting + */ + public function guessRequired($class, $property); + + /** + * Returns a guess about the field's maximum length + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * + * @return Guess\Guess A guess for the field's maximum length + */ + public function guessMaxLength($class, $property); + + /** + * Returns a guess about the field's minimum length + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * + * @return Guess\Guess A guess for the field's minimum length + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function guessMinLength($class, $property); + + /** + * Returns a guess about the field's pattern + * + * - When you have a min value, you guess a min length of this min (LOW_CONFIDENCE) , lines below + * - If this value is a float type, this is wrong so you guess null with MEDIUM_CONFIDENCE to override the previous guess. + * Example: + * You want a float greater than 5, 4.512313 is not valid but length(4.512314) > length(5) + * @link https://github.com/symfony/symfony/pull/3927 + * + * @param string $class The fully qualified class name + * @param string $property The name of the property to guess for + * + * @return Guess\Guess A guess for the field's required pattern + */ + public function guessPattern($class, $property); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormTypeInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormTypeInterface.php new file mode 100755 index 0000000000..bcef73c6d7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormTypeInterface.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +interface FormTypeInterface +{ + /** + * Builds the form. + * + * This method is called for each type in the hierarchy starting form the + * top most type. Type extensions can further modify the form. + * + * @see FormTypeExtensionInterface::buildForm() + * + * @param FormBuilderInterface $builder The form builder + * @param array $options The options + */ + public function buildForm(FormBuilderInterface $builder, array $options); + + /** + * Builds the form view. + * + * This method is called for each type in the hierarchy starting form the + * top most type. Type extensions can further modify the view. + * + * A view of a form is built before the views of the child forms are built. + * This means that you cannot access child views in this method. If you need + * to do so, move your logic to {@link finishView()} instead. + * + * @see FormTypeExtensionInterface::buildView() + * + * @param FormView $view The view + * @param FormInterface $form The form + * @param array $options The options + */ + public function buildView(FormView $view, FormInterface $form, array $options); + + /** + * Finishes the form view. + * + * This method gets called for each type in the hierarchy starting form the + * top most type. Type extensions can further modify the view. + * + * When this method is called, views of the form's children have already + * been built and finished and can be accessed. You should only implement + * such logic in this method that actually accesses child views. For everything + * else you are recommended to implement {@link buildView()} instead. + * + * @see FormTypeExtensionInterface::finishView() + * + * @param FormView $view The view + * @param FormInterface $form The form + * @param array $options The options + */ + public function finishView(FormView $view, FormInterface $form, array $options); + + /** + * Sets the default options for this type. + * + * @param OptionsResolverInterface $resolver The resolver for the options. + */ + public function setDefaultOptions(OptionsResolverInterface $resolver); + + /** + * Returns the name of the parent type. + * + * You can also return a type instance from this method, although doing so + * is discouraged because it leads to a performance penalty. The support + * for returning type instances may be dropped from future releases. + * + * @return string|null|FormTypeInterface The name of the parent type if any, null otherwise. + */ + public function getParent(); + + /** + * Returns the name of this type. + * + * @return string The name of this type + */ + public function getName(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormValidatorInterface.php b/vendor/symfony/form/Symfony/Component/Form/FormValidatorInterface.php new file mode 100755 index 0000000000..2fdd51f831 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormValidatorInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * This interface is deprecated. You should use a FormEvents::POST_BIND event + * listener instead. + * + * @author Bernhard Schussek + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ +interface FormValidatorInterface +{ + /** + * @deprecated Deprecated since version 2.1, to be removed in 2.3. + */ + public function validate(FormInterface $form); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/FormView.php b/vendor/symfony/form/Symfony/Component/Form/FormView.php new file mode 100755 index 0000000000..84eb19843c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/FormView.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +class FormView implements \ArrayAccess, \IteratorAggregate, \Countable +{ + /** + * The variables assigned to this view. + * @var array + */ + public $vars = array( + 'value' => null, + 'attr' => array(), + ); + + /** + * The parent view. + * @var FormView + */ + public $parent; + + /** + * The child views. + * @var array + */ + public $children = array(); + + /** + * Is the form attached to this renderer rendered? + * + * Rendering happens when either the widget or the row method was called. + * Row implicitly includes widget, however certain rendering mechanisms + * have to skip widget rendering when a row is rendered. + * + * @var Boolean + */ + private $rendered = false; + + public function __construct(FormView $parent = null) + { + $this->parent = $parent; + } + + /** + * Returns the name of the form. + * + * @return string The form name. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead which contains an + * entry named "name". + */ + public function getName() + { + return $this->vars['name']; + } + + /** + * @param string $name + * @param mixed $value + * + * @return FormView The current view + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead. + */ + public function set($name, $value) + { + $this->vars[$name] = $value; + + return $this; + } + + /** + * @param $name + * + * @return Boolean + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead. + */ + public function has($name) + { + return array_key_exists($name, $this->vars); + } + + /** + * @param $name + * @param $default + * + * @return mixed + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead. + */ + public function get($name, $default = null) + { + if (false === $this->has($name)) { + return $default; + } + + return $this->vars[$name]; + } + + /** + * @return array + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead. + */ + public function all() + { + return $this->vars; + } + + /** + * Returns the values of all view variables. + * + * @return array The values of all variables. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead. + */ + public function getVars() + { + return $this->vars; + } + + /** + * Sets the value for an attribute. + * + * @param string $name The name of the attribute + * @param string $value The value + * + * @return FormView The current view + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link vars} instead which contains an + * entry named "attr". + */ + public function setAttribute($name, $value) + { + $this->vars['attr'][$name] = $value; + + return $this; + } + + /** + * Returns whether the view was already rendered. + * + * @return Boolean Whether this view's widget is rendered. + */ + public function isRendered() + { + $hasChildren = 0 < count($this->children); + + if (true === $this->rendered || !$hasChildren) { + return $this->rendered; + } + + if ($hasChildren) { + foreach ($this->children as $child) { + if (!$child->isRendered()) { + return false; + } + } + + return $this->rendered = true; + } + + return false; + } + + /** + * Marks the view as rendered. + * + * @return FormView The view object. + */ + public function setRendered() + { + $this->rendered = true; + + return $this; + } + + /** + * Sets the parent view. + * + * @param FormView $parent The parent view. + * + * @return FormView The view object. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link parent} instead. + */ + public function setParent(FormView $parent = null) + { + $this->parent = $parent; + + return $this; + } + + /** + * Returns the parent view. + * + * @return FormView The parent view. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link parent} instead. + */ + public function getParent() + { + return $this->parent; + } + + /** + * Returns whether this view has a parent. + * + * @return Boolean Whether this view has a parent + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link parent} instead. + */ + public function hasParent() + { + return null !== $this->parent; + } + + /** + * Sets the children view. + * + * @param array $children The children as instances of FormView + * + * @return FormView The current view + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link children} instead. + */ + public function setChildren(array $children) + { + $this->children = $children; + + return $this; + } + + /** + * Returns the children. + * + * @return array The children as instances of FormView + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link children} instead. + */ + public function getChildren() + { + return $this->children; + } + + /** + * Returns a given child. + * + * @param string $name The name of the child + * + * @return FormView The child view + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access + * the public property {@link children} instead. + */ + public function getChild($name) + { + return $this->children[$name]; + } + + /** + * Returns whether this view has any children. + * + * @return Boolean Whether the view has children. + * + * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use + * {@link count()} instead. + */ + public function hasChildren() + { + return count($this->children) > 0; + } + + /** + * Returns a child by name (implements \ArrayAccess). + * + * @param string $name The child name + * + * @return FormView The child view + */ + public function offsetGet($name) + { + return $this->children[$name]; + } + + /** + * Returns whether the given child exists (implements \ArrayAccess). + * + * @param string $name The child name + * + * @return Boolean Whether the child view exists + */ + public function offsetExists($name) + { + return isset($this->children[$name]); + } + + /** + * Implements \ArrayAccess. + * + * @throws \BadMethodCallException always as setting a child by name is not allowed + */ + public function offsetSet($name, $value) + { + throw new \BadMethodCallException('Not supported'); + } + + /** + * Removes a child (implements \ArrayAccess). + * + * @param string $name The child name + */ + public function offsetUnset($name) + { + unset($this->children[$name]); + } + + /** + * Returns an iterator to iterate over children (implements \IteratorAggregate) + * + * @return \ArrayIterator The iterator + */ + public function getIterator() + { + return new \ArrayIterator($this->children); + } + + /** + * Implements \Countable. + * + * @return integer The number of children views + */ + public function count() + { + return count($this->children); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Forms.php b/vendor/symfony/form/Symfony/Component/Form/Forms.php new file mode 100755 index 0000000000..c949c1f48a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Forms.php @@ -0,0 +1,185 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Extension\Core\CoreExtension; + +/** + * Entry point of the Form component. + * + * Use this class to conveniently create new form factories: + * + * + * use Symfony\Component\Form\Forms; + * + * $formFactory = Forms::createFormFactory(); + * + * $form = $formFactory->createBuilder() + * ->add('firstName', 'text') + * ->add('lastName', 'text') + * ->add('age', 'integer') + * ->add('gender', 'choice', array( + * 'choices' => array('m' => 'Male', 'f' => 'Female'), + * )) + * ->getForm(); + * + * + * You can also add custom extensions to the form factory: + * + * + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new AcmeExtension()) + * ->getFormFactory(); + * + * + * If you create custom form types or type extensions, it is + * generally recommended to create your own extensions that lazily + * load these types and type extensions. In projects where performance + * does not matter that much, you can also pass them directly to the + * form factory: + * + * + * $formFactory = Forms::createFormFactoryBuilder() + * ->addType(new PersonType()) + * ->addType(new PhoneNumberType()) + * ->addTypeExtension(new FormTypeHelpTextExtension()) + * ->getFormFactory(); + * + * + * Support for CSRF protection is provided by the CsrfExtension. + * This extension needs a CSRF provider with a strong secret + * (e.g. a 20 character long random string). The default + * implementation for this is DefaultCsrfProvider: + * + * + * use Symfony\Component\Form\Extension\Csrf\CsrfExtension; + * use Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider; + * + * $secret = 'V8a5Z97e...'; + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new CsrfExtension(new DefaultCsrfProvider($secret))) + * ->getFormFactory(); + * + * + * Support for the HttpFoundation is provided by the + * HttpFoundationExtension. You are also advised to load the CSRF + * extension with the driver for HttpFoundation's Session class: + * + * + * use Symfony\Component\HttpFoundation\Session\Session; + * use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension; + * use Symfony\Component\Form\Extension\Csrf\CsrfExtension; + * use Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider; + * + * $session = new Session(); + * $secret = 'V8a5Z97e...'; + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new HttpFoundationExtension()) + * ->addExtension(new CsrfExtension(new SessionCsrfProvider($session, $secret))) + * ->getFormFactory(); + * + * + * Support for the Validator component is provided by ValidatorExtension. + * This extension needs a validator object to function properly: + * + * + * use Symfony\Component\Validator\Validation; + * use Symfony\Component\Form\Extension\Validator\ValidatorExtension; + * + * $validator = Validation::createValidator(); + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new ValidatorExtension($validator)) + * ->getFormFactory(); + * + * + * Support for the Templating component is provided by TemplatingExtension. + * This extension needs a PhpEngine object for rendering forms. As second + * argument you should pass the names of the default themes. Here is an + * example for using the default layout with "
" tags: + * + * + * use Symfony\Component\Form\Extension\Templating\TemplatingExtension; + * + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new TemplatingExtension($engine, null, array( + * 'FrameworkBundle:Form', + * ))) + * ->getFormFactory(); + * + * + * The next example shows how to include the "
" layout: + * + * + * use Symfony\Component\Form\Extension\Templating\TemplatingExtension; + * + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new TemplatingExtension($engine, null, array( + * 'FrameworkBundle:Form', + * 'FrameworkBundle:FormTable', + * ))) + * ->getFormFactory(); + * + * + * If you also loaded the CsrfExtension, you should pass the CSRF provider + * to the extension so that you can render CSRF tokens in your templates + * more easily: + * + * + * use Symfony\Component\Form\Extension\Csrf\CsrfExtension; + * use Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider; + * use Symfony\Component\Form\Extension\Templating\TemplatingExtension; + * + * + * $secret = 'V8a5Z97e...'; + * $csrfProvider = new DefaultCsrfProvider($secret); + * $formFactory = Forms::createFormFactoryBuilder() + * ->addExtension(new CsrfExtension($csrfProvider)) + * ->addExtension(new TemplatingExtension($engine, $csrfProvider, array( + * 'FrameworkBundle:Form', + * ))) + * ->getFormFactory(); + * + * + * @author Bernhard Schussek + */ +final class Forms +{ + /** + * Creates a form factory with the default configuration. + * + * @return FormFactoryInterface The form factory. + */ + public static function createFormFactory() + { + return self::createFormFactoryBuilder()->getFormFactory(); + } + + /** + * Creates a form factory builder with the default configuration. + * + * @return FormFactoryBuilderInterface The form factory builder. + */ + public static function createFormFactoryBuilder() + { + $builder = new FormFactoryBuilder(); + $builder->addExtension(new CoreExtension()); + + return $builder; + } + + /** + * This class cannot be instantiated. + */ + private function __construct() + { + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Guess/Guess.php b/vendor/symfony/form/Symfony/Component/Form/Guess/Guess.php new file mode 100755 index 0000000000..f24407dd73 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Guess/Guess.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Guess; + +/** + * Base class for guesses made by TypeGuesserInterface implementation + * + * Each instance contains a confidence value about the correctness of the guess. + * Thus an instance with confidence HIGH_CONFIDENCE is more likely to be + * correct than an instance with confidence LOW_CONFIDENCE. + * + * @author Bernhard Schussek + */ +abstract class Guess +{ + /** + * Marks an instance with a value that is extremely likely to be correct + * @var integer + */ + const VERY_HIGH_CONFIDENCE = 3; + + /** + * Marks an instance with a value that is very likely to be correct + * @var integer + */ + const HIGH_CONFIDENCE = 2; + + /** + * Marks an instance with a value that is likely to be correct + * @var integer + */ + const MEDIUM_CONFIDENCE = 1; + + /** + * Marks an instance with a value that may be correct + * @var integer + */ + const LOW_CONFIDENCE = 0; + + /** + * The confidence about the correctness of the value + * + * One of VERY_HIGH_CONFIDENCE, HIGH_CONFIDENCE, MEDIUM_CONFIDENCE + * and LOW_CONFIDENCE. + * + * @var integer + */ + private $confidence; + + /** + * Returns the guess most likely to be correct from a list of guesses + * + * If there are multiple guesses with the same, highest confidence, the + * returned guess is any of them. + * + * @param array $guesses A list of guesses + * + * @return Guess The guess with the highest confidence + */ + public static function getBestGuess(array $guesses) + { + $result = null; + $maxConfidence = -1; + + foreach ($guesses as $guess) { + if ($maxConfidence < $confidence = $guess->getConfidence()) { + $maxConfidence = $confidence; + $result = $guess; + } + } + + return $result; + } + + /** + * Constructor + * + * @param integer $confidence The confidence + * + * @throws \InvalidArgumentException if the given value of confidence is unknown + */ + public function __construct($confidence) + { + if (self::VERY_HIGH_CONFIDENCE !== $confidence && self::HIGH_CONFIDENCE !== $confidence && + self::MEDIUM_CONFIDENCE !== $confidence && self::LOW_CONFIDENCE !== $confidence) { + throw new \InvalidArgumentException('The confidence should be one of the constants defined in Guess.'); + } + + $this->confidence = $confidence; + } + + /** + * Returns the confidence that the guessed value is correct + * + * @return integer One of the constants VERY_HIGH_CONFIDENCE, + * HIGH_CONFIDENCE, MEDIUM_CONFIDENCE and LOW_CONFIDENCE + */ + public function getConfidence() + { + return $this->confidence; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Guess/TypeGuess.php b/vendor/symfony/form/Symfony/Component/Form/Guess/TypeGuess.php new file mode 100755 index 0000000000..3241e603df --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Guess/TypeGuess.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Guess; + +/** + * Contains a guessed class name and a list of options for creating an instance + * of that class + * + * @author Bernhard Schussek + */ +class TypeGuess extends Guess +{ + /** + * The guessed field type + * @var string + */ + private $type; + + /** + * The guessed options for creating an instance of the guessed class + * @var array + */ + private $options; + + /** + * Constructor + * + * @param string $type The guessed field type + * @param array $options The options for creating instances of the + * guessed class + * @param integer $confidence The confidence that the guessed class name + * is correct + */ + public function __construct($type, array $options, $confidence) + { + parent::__construct($confidence); + + $this->type = $type; + $this->options = $options; + } + + /** + * Returns the guessed field type + * + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Returns the guessed options for creating instances of the guessed type + * + * @return array + */ + public function getOptions() + { + return $this->options; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Guess/ValueGuess.php b/vendor/symfony/form/Symfony/Component/Form/Guess/ValueGuess.php new file mode 100755 index 0000000000..2e3333ba5b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Guess/ValueGuess.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Guess; + +/** + * Contains a guessed value + * + * @author Bernhard Schussek + */ +class ValueGuess extends Guess +{ + /** + * The guessed value + * @var array + */ + private $value; + + /** + * Constructor + * + * @param string $value The guessed value + * @param integer $confidence The confidence that the guessed class name + * is correct + */ + public function __construct($value, $confidence) + { + parent::__construct($confidence); + + $this->value = $value; + } + + /** + * Returns the guessed value + * + * @return mixed + */ + public function getValue() + { + return $this->value; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/LICENSE b/vendor/symfony/form/Symfony/Component/Form/LICENSE new file mode 100755 index 0000000000..cdffe7aebc --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2012 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/form/Symfony/Component/Form/PreloadedExtension.php b/vendor/symfony/form/Symfony/Component/Form/PreloadedExtension.php new file mode 100755 index 0000000000..9219d8f22d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/PreloadedExtension.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; + +/** + * A form extension with preloaded types, type exceptions and type guessers. + * + * @author Bernhard Schussek + */ +class PreloadedExtension implements FormExtensionInterface +{ + /** + * @var array + */ + private $types = array(); + + /** + * @var array + */ + private $typeExtensions = array(); + + /** + * @var FormTypeGuesserInterface + */ + private $typeGuesser; + + /** + * Creates a new preloaded extension. + * + * @param array $types The types that the extension should support. + * @param array $typeExtensions The type extensions that the extension should support. + * @param FormTypeGuesserInterface|null $typeGuesser The guesser that the extension should support. + */ + public function __construct(array $types, array $typeExtensions, FormTypeGuesserInterface $typeGuesser = null) + { + $this->types = $types; + $this->typeExtensions = $typeExtensions; + $this->typeGuesser = $typeGuesser; + } + + /** + * {@inheritdoc} + */ + public function getType($name) + { + if (!isset($this->types[$name])) { + throw new FormException(sprintf('The type "%s" can not be loaded by this extension', $name)); + } + + return $this->types[$name]; + } + + /** + * {@inheritdoc} + */ + public function hasType($name) + { + return isset($this->types[$name]); + } + + /** + * {@inheritdoc} + */ + public function getTypeExtensions($name) + { + return isset($this->typeExtensions[$name]) + ? $this->typeExtensions[$name] + : array(); + } + + /** + * {@inheritdoc} + */ + public function hasTypeExtensions($name) + { + return !empty($this->typeExtensions[$name]); + } + + /** + * {@inheritdoc} + */ + public function getTypeGuesser() + { + return $this->typeGuesser; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/README.md b/vendor/symfony/form/Symfony/Component/Form/README.md new file mode 100755 index 0000000000..f6ddf031aa --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/README.md @@ -0,0 +1,29 @@ +Form Component +============== + +Form provides tools for defining forms, rendering and binding request data to +related models. Furthermore it provides integration with the Validation +component. + +Resources +--------- + +Silex integration: + +https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/FormServiceProvider.php + +Documentation: + +http://symfony.com/doc/2.0/book/forms.html + +Resources +--------- + +You can run the unit tests with the following command: + + phpunit + +If you also want to run the unit tests that depend on other Symfony +Components, install dev dependencies before running PHPUnit: + + php composer.phar install --dev diff --git a/vendor/symfony/form/Symfony/Component/Form/ResolvedFormType.php b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormType.php new file mode 100755 index 0000000000..04dc865a5e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormType.php @@ -0,0 +1,252 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Exception\FormException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\OptionsResolver\OptionsResolver; + +/** + * A wrapper for a form type and its extensions. + * + * @author Bernhard Schussek + */ +class ResolvedFormType implements ResolvedFormTypeInterface +{ + /** + * @var FormTypeInterface + */ + private $innerType; + + /** + * @var array + */ + private $typeExtensions; + + /** + * @var ResolvedFormTypeInterface + */ + private $parent; + + /** + * @var OptionsResolver + */ + private $optionsResolver; + + public function __construct(FormTypeInterface $innerType, array $typeExtensions = array(), ResolvedFormTypeInterface $parent = null) + { + if (!preg_match('/^[a-z0-9_]*$/i', $innerType->getName())) { + throw new FormException(sprintf( + 'The "%s" form type name ("%s") is not valid. Names must only contain letters, numbers, and "_".', + get_class($innerType), + $innerType->getName() + )); + } + + foreach ($typeExtensions as $extension) { + if (!$extension instanceof FormTypeExtensionInterface) { + throw new UnexpectedTypeException($extension, 'Symfony\Component\Form\FormTypeExtensionInterface'); + } + } + + // BC + if ($innerType instanceof AbstractType) { + /* @var AbstractType $innerType */ + $innerType->setExtensions($typeExtensions); + } + + $this->innerType = $innerType; + $this->typeExtensions = $typeExtensions; + $this->parent = $parent; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return $this->innerType->getName(); + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + return $this->parent; + } + + /** + * {@inheritdoc} + */ + public function getInnerType() + { + return $this->innerType; + } + + /** + * {@inheritdoc} + */ + public function getTypeExtensions() + { + // BC + if ($this->innerType instanceof AbstractType) { + return $this->innerType->getExtensions(); + } + + return $this->typeExtensions; + } + + /** + * {@inheritdoc} + */ + public function createBuilder(FormFactoryInterface $factory, $name, array $options = array(), FormBuilderInterface $parent = null) + { + $options = $this->getOptionsResolver()->resolve($options); + + // Should be decoupled from the specific option at some point + $dataClass = isset($options['data_class']) ? $options['data_class'] : null; + + $builder = new FormBuilder($name, $dataClass, new EventDispatcher(), $factory, $options); + $builder->setType($this); + $builder->setParent($parent); + + $this->buildForm($builder, $options); + + return $builder; + } + + /** + * {@inheritdoc} + */ + public function createView(FormInterface $form, FormView $parent = null) + { + $options = $form->getConfig()->getOptions(); + + $view = new FormView($parent); + + $this->buildView($view, $form, $options); + + foreach ($form as $name => $child) { + /* @var FormInterface $child */ + $view->children[$name] = $child->createView($view); + } + + $this->finishView($view, $form, $options); + + return $view; + } + + /** + * Configures a form builder for the type hierarchy. + * + * This method is protected in order to allow implementing classes + * to change or call it in re-implementations of {@link createBuilder()}. + * + * @param FormBuilderInterface $builder The builder to configure. + * @param array $options The options used for the configuration. + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + if (null !== $this->parent) { + $this->parent->buildForm($builder, $options); + } + + $this->innerType->buildForm($builder, $options); + + foreach ($this->typeExtensions as $extension) { + /* @var FormTypeExtensionInterface $extension */ + $extension->buildForm($builder, $options); + } + } + + /** + * Configures a form view for the type hierarchy. + * + * This method is protected in order to allow implementing classes + * to change or call it in re-implementations of {@link createView()}. + * + * It is called before the children of the view are built. + * + * @param FormView $view The form view to configure. + * @param FormInterface $form The form corresponding to the view. + * @param array $options The options used for the configuration. + */ + public function buildView(FormView $view, FormInterface $form, array $options) + { + if (null !== $this->parent) { + $this->parent->buildView($view, $form, $options); + } + + $this->innerType->buildView($view, $form, $options); + + foreach ($this->typeExtensions as $extension) { + /* @var FormTypeExtensionInterface $extension */ + $extension->buildView($view, $form, $options); + } + } + + /** + * Finishes a form view for the type hierarchy. + * + * This method is protected in order to allow implementing classes + * to change or call it in re-implementations of {@link createView()}. + * + * It is called after the children of the view have been built. + * + * @param FormView $view The form view to configure. + * @param FormInterface $form The form corresponding to the view. + * @param array $options The options used for the configuration. + */ + public function finishView(FormView $view, FormInterface $form, array $options) + { + if (null !== $this->parent) { + $this->parent->finishView($view, $form, $options); + } + + $this->innerType->finishView($view, $form, $options); + + foreach ($this->typeExtensions as $extension) { + /* @var FormTypeExtensionInterface $extension */ + $extension->finishView($view, $form, $options); + } + } + + /** + * Returns the configured options resolver used for this type. + * + * This method is protected in order to allow implementing classes + * to change or call it in re-implementations of {@link createBuilder()}. + * + * @return \Symfony\Component\OptionsResolver\OptionsResolverInterface The options resolver. + */ + public function getOptionsResolver() + { + if (null === $this->optionsResolver) { + if (null !== $this->parent) { + $this->optionsResolver = clone $this->parent->getOptionsResolver(); + } else { + $this->optionsResolver = new OptionsResolver(); + } + + $this->innerType->setDefaultOptions($this->optionsResolver); + + foreach ($this->typeExtensions as $extension) { + /* @var FormTypeExtensionInterface $extension */ + $extension->setDefaultOptions($this->optionsResolver); + } + } + + return $this->optionsResolver; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactory.php b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactory.php new file mode 100755 index 0000000000..d93d1c06df --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactory.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * @author Bernhard Schussek + */ +class ResolvedFormTypeFactory implements ResolvedFormTypeFactoryInterface +{ + /** + * {@inheritdoc} + */ + public function createResolvedType(FormTypeInterface $type, array $typeExtensions, ResolvedFormTypeInterface $parent = null) + { + return new ResolvedFormType($type, $typeExtensions, $parent); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php new file mode 100755 index 0000000000..fb2aa4acce --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Creates ResolvedFormTypeInterface instances. + * + * This interface allows you to use your custom ResolvedFormTypeInterface + * implementation, within which you can customize the concrete FormBuilderInterface + * implementations or FormView subclasses that are used by the framework. + * + * @author Bernhard Schussek + */ +interface ResolvedFormTypeFactoryInterface +{ + /** + * Resolves a form type. + * + * @param FormTypeInterface $type + * @param array $typeExtensions + * @param ResolvedFormTypeInterface $parent + * + * @return ResolvedFormTypeInterface + * + * @throws Exception\UnexpectedTypeException if the types parent {@link FormTypeInterface::getParent()} is not a string + * @throws Exception\FormException if the types parent can not be retrieved from any extension + */ + public function createResolvedType(FormTypeInterface $type, array $typeExtensions, ResolvedFormTypeInterface $parent = null); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeInterface.php b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeInterface.php new file mode 100755 index 0000000000..c6333d543f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/ResolvedFormTypeInterface.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * A wrapper for a form type and its extensions. + * + * @author Bernhard Schussek + */ +interface ResolvedFormTypeInterface +{ + /** + * Returns the name of the type. + * + * @return string The type name. + */ + public function getName(); + + /** + * Returns the parent type. + * + * @return ResolvedFormTypeInterface The parent type or null. + */ + public function getParent(); + + /** + * Returns the wrapped form type. + * + * @return FormTypeInterface The wrapped form type. + */ + public function getInnerType(); + + /** + * Returns the extensions of the wrapped form type. + * + * @return array An array of {@link FormTypeExtensionInterface} instances. + */ + public function getTypeExtensions(); + + /** + * Creates a new form builder for this type. + * + * @param FormFactoryInterface $factory The form factory. + * @param string $name The name for the builder. + * @param array $options The builder options. + * @param FormBuilderInterface $parent The parent builder object or null. + * + * @return FormBuilderInterface The created form builder. + */ + public function createBuilder(FormFactoryInterface $factory, $name, array $options = array(), FormBuilderInterface $parent = null); + + /** + * Creates a new form view for a form of this type. + * + * @param FormInterface $form The form to create a view for. + * @param FormView $parent The parent view or null. + * + * @return FormView The created form view. + */ + public function createView(FormInterface $form, FormView $parent = null); + + /** + * Configures a form builder for the type hierarchy. + * + * @param FormBuilderInterface $builder The builder to configure. + * @param array $options The options used for the configuration. + */ + public function buildForm(FormBuilderInterface $builder, array $options); + + /** + * Configures a form view for the type hierarchy. + * + * It is called before the children of the view are built. + * + * @param FormView $view The form view to configure. + * @param FormInterface $form The form corresponding to the view. + * @param array $options The options used for the configuration. + */ + public function buildView(FormView $view, FormInterface $form, array $options); + + /** + * Finishes a form view for the type hierarchy. + * + * It is called after the children of the view have been built. + * + * @param FormView $view The form view to configure. + * @param FormInterface $form The form corresponding to the view. + * @param array $options The options used for the configuration. + */ + public function finishView(FormView $view, FormInterface $form, array $options); + + /** + * Returns the configured options resolver used for this type. + * + * @return \Symfony\Component\OptionsResolver\OptionsResolverInterface The options resolver. + */ + public function getOptionsResolver(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/config/validation.xml b/vendor/symfony/form/Symfony/Component/Form/Resources/config/validation.xml new file mode 100755 index 0000000000..2f2364bde4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/config/validation.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.bg.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.bg.xlf new file mode 100755 index 0000000000..6f00bde940 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.bg.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Тази форма не трябва да съдържа допълнителни полета. + + + The uploaded file was too large. Please try to upload a smaller file. + Каченият файл е твърде голям. Моля, опитайте да качите по-малък файл. + + + The CSRF token is invalid. Please try to resubmit the form. + Невалиден CSRF токен. Моля, опитайте да изпратите формата отново. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ca.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ca.xlf new file mode 100755 index 0000000000..c33bbab8f0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ca.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Aquest formulari no hauria de contenir camps addicionals. + + + The uploaded file was too large. Please try to upload a smaller file. + L'arxiu pujat és massa gran. Per favor, pugi un arxiu més petit. + + + The CSRF token is invalid. Please try to resubmit the form. + El token CSRF no és vàlid. Per favor, provi d'enviar novament el formulari + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.cs.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.cs.xlf new file mode 100755 index 0000000000..776da49481 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.cs.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Tato skupina polí nesmí obsahovat další pole. + + + The uploaded file was too large. Please try to upload a smaller file. + Nahraný soubor je příliš velký. Nahrajte prosím menší soubor. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF token je neplatný. Zkuste prosím znovu odeslat formulář. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.da.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.da.xlf new file mode 100755 index 0000000000..9663cb6f17 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.da.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Feltgruppen må ikke indeholde ekstra felter. + + + The uploaded file was too large. Please try to upload a smaller file. + Den oploadede fil var for stor. Opload venligst en mindre fil. + + + The CSRF token is invalid. + CSRF nøglen er ugyldig. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.de.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.de.xlf new file mode 100755 index 0000000000..c801d67706 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.de.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Dieses Formular sollte keine zusätzlichen Felder enthalten. + + + The uploaded file was too large. Please try to upload a smaller file. + Die hochgeladene Datei ist zu groß. Versuchen Sie bitte eine kleinere Datei hochzuladen. + + + The CSRF token is invalid. Please try to resubmit the form. + Das CSRF-Token ist ungültig. Versuchen Sie bitte das Formular erneut zu senden. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.en.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.en.xlf new file mode 100755 index 0000000000..b8542d319d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.en.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + This form should not contain extra fields. + + + The uploaded file was too large. Please try to upload a smaller file. + The uploaded file was too large. Please try to upload a smaller file. + + + The CSRF token is invalid. Please try to resubmit the form. + The CSRF token is invalid. Please try to resubmit the form. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.es.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.es.xlf new file mode 100755 index 0000000000..ebfacfd487 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.es.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Este formulario no debería contener campos adicionales. + + + The uploaded file was too large. Please try to upload a smaller file. + El archivo subido es demasiado grande. Por favor, suba un archivo más pequeño. + + + The CSRF token is invalid. Please try to resubmit the form. + El token CSRF no es válido. Por favor, pruebe de enviar nuevamente el formulario + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.et.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.et.xlf new file mode 100755 index 0000000000..1a9867fa20 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.et.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Väljade grupp ei tohiks sisalda lisaväljasid. + + + The uploaded file was too large. Please try to upload a smaller file. + Üleslaaditud fail oli liiga suur. Palun proovi uuesti väiksema failiga. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF-märgis on vigane. Palun proovi vormi uuesti esitada. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.eu.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.eu.xlf new file mode 100755 index 0000000000..a07f786c72 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.eu.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Formulario honek ez luke aparteko eremurik eduki behar. + + + The uploaded file was too large. Please try to upload a smaller file. + Igotako fitxategia handiegia da. Mesedez saiatu fitxategi txikiago bat igotzen. + + + The CSRF token is invalid. + CSFR tokena ez da egokia. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fa.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fa.xlf new file mode 100755 index 0000000000..468d2f6fdd --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fa.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + این فرم نباید فیلد اضافی داشته باشد. + + + The uploaded file was too large. Please try to upload a smaller file. + فایل بارگذاری شده بسیار بزرگ است. لطفا فایل کوچکتری را بارگزاری کنید. + + + The CSRF token is invalid. Please try to resubmit the form. + مقدار CSRF نامعتبر است. لطفا فرم را مجددا ارسال فرمایید.. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fi.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fi.xlf new file mode 100755 index 0000000000..d223bb05ca --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fi.xlf @@ -0,0 +1,19 @@ + + + + + + This field group should not contain extra fields. + Tämä kenttäryhmä ei voi sisältää ylimääräisiä kenttiä. + + + The uploaded file was too large. Please try to upload a smaller file. + Ladattu tiedosto on liian iso. Ole hyvä ja lataa pienempi tiedosto. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF tarkiste on virheellinen. Olen hyvä ja yritä lähettää lomake uudestaan. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fr.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fr.xlf new file mode 100755 index 0000000000..21f9010143 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.fr.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ce formulaire ne doit pas contenir des champs supplémentaires. + + + The uploaded file was too large. Please try to upload a smaller file. + Le fichier téléchargé est trop volumineux. Merci d'essayer d'envoyer un fichier plus petit. + + + The CSRF token is invalid. Please try to resubmit the form. + Le jeton CSRF est invalide. Veuillez renvoyer le formulaire. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.he.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.he.xlf new file mode 100755 index 0000000000..5198738d3f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.he.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + הטופס לא צריך להכיל שדות נוספים. + + + The uploaded file was too large. Please try to upload a smaller file. + הקובץ שהועלה גדול מדי. נסה להעלות קובץ קטן יותר. + + + The CSRF token is invalid. + אסימון CSRF אינו חוקי. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hr.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hr.xlf new file mode 100755 index 0000000000..8d0bd29201 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hr.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ovaj obrazac ne smije sadržavati dodatna polja. + + + The uploaded file was too large. Please try to upload a smaller file. + Prenesena datoteka je prevelika. Molim pokušajte prenijeti manju datoteku. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF vrijednost nije ispravna. Pokušajte ponovo poslati obrazac. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hu.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hu.xlf new file mode 100755 index 0000000000..d1491e7e2a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hu.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ez a mezőcsoport nem tartalmazhat extra mezőket. + + + The uploaded file was too large. Please try to upload a smaller file. + A feltöltött fájl túl nagy. Kérem próbáljon egy kisebb fájlt feltölteni. + + + The CSRF token is invalid. Please try to resubmit the form. + Érvénytelen CSRF token. Kérem próbálja újra elküldeni az űrlapot. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hy.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hy.xlf new file mode 100755 index 0000000000..5a6091f890 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.hy.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Այս ձևը չպետք է պարունակի լրացուցիչ տողեր. + + + The uploaded file was too large. Please try to upload a smaller file. + Վերբեռնված ֆայլը չափազանց մեծ է: Խնդրվում է վերբեռնել ավելի փոքր չափսի ֆայլ. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF արժեքը անթույլատրելի է: Փորձեք նորից ուղարկել ձևը. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.id.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.id.xlf new file mode 100755 index 0000000000..b067d98474 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.id.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Gabungan kolom tidak boleh mengandung kolom tambahan. + + + The uploaded file was too large. Please try to upload a smaller file. + Berkas yang di unggah terlalu besar. Silahkan coba unggah berkas yang lebih kecil. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF-Token tidak sah. Silahkan coba kirim ulang formulir. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.it.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.it.xlf new file mode 100755 index 0000000000..aa15264d9f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.it.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Questo form non dovrebbe contenere nessun campo extra. + + + The uploaded file was too large. Please try to upload a smaller file. + Il file caricato è troppo grande. Per favore caricare un file più piccolo. + + + The CSRF token is invalid. Please try to resubmit the form. + Il token CSRF non è valido. Provare a reinviare il form. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ja.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ja.xlf new file mode 100755 index 0000000000..4559af1769 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ja.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + フィールドグループに追加のフィールドを含んではなりません. + + + The uploaded file was too large. Please try to upload a smaller file. + アップロードされたファイルが大きすぎます。小さなファイルで再度アップロードしてください. + + + The CSRF token is invalid. + CSRFトークンが無効です. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lb.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lb.xlf new file mode 100755 index 0000000000..a111ffe395 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lb.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Dës Feldergrupp sollt keng zousätzlech Felder enthalen. + + + The uploaded file was too large. Please try to upload a smaller file. + De geschécktene Fichier ass ze grouss. Versicht wann ech gelift ee méi klenge Fichier eropzelueden. + + + The CSRF token is invalid. Please try to resubmit the form. + Den CSRF-Token ass ongëlteg. Versicht wann ech gelift de Formulaire nach eng Kéier ze schécken. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lt.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lt.xlf new file mode 100755 index 0000000000..25f30887bc --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.lt.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Forma negali turėti papildomų laukų. + + + The uploaded file was too large. Please try to upload a smaller file. + Įkelta byla yra per didelė. bandykite įkelti mažesnę. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF kodas nepriimtinas. Bandykite siųsti formos užklausą dar kartą. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.mn.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.mn.xlf new file mode 100755 index 0000000000..002b01c175 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.mn.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Форм нэмэлт талбар багтаах боломжгүй. + + + The uploaded file was too large. Please try to upload a smaller file. + Upload хийсэн файл хэтэрхий том байна. Бага хэмжээтэй файл оруулна уу. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF token буруу байна. Формоо дахин илгээнэ үү. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nb.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nb.xlf new file mode 100755 index 0000000000..5e36bd5fec --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nb.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Feltgruppen må ikke inneholde ekstra felter. + + + The uploaded file was too large. Please try to upload a smaller file. + Den opplastede file var for stor. Vennligst last opp en mindre fil. + + + The CSRF token is invalid. + CSRF nøkkelen er ugyldig. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nl.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nl.xlf new file mode 100755 index 0000000000..3d737d79c1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.nl.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Dit formulier mag geen extra velden bevatten. + + + The uploaded file was too large. Please try to upload a smaller file. + Het geüploade bestand is te groot. Probeer een kleiner bestand te uploaden. + + + The CSRF token is invalid. Please try to resubmit the form. + De CSRF-token is ongeldig. Probeer het formulier opnieuw te versturen. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pl.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pl.xlf new file mode 100755 index 0000000000..64def2a691 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pl.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ten formularz nie powinien zawierać dodatkowych pól. + + + The uploaded file was too large. Please try to upload a smaller file. + Wgrany plik był za duży. Proszę spróbować wgrać mniejszy plik. + + + The CSRF token is invalid. Please try to resubmit the form. + Token CSRF jest nieprawidłowy. Proszę spróbować wysłać formularz ponownie. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt.xlf new file mode 100755 index 0000000000..554a810c68 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Este formulário não deveria conter campos extra. + + + The uploaded file was too large. Please try to upload a smaller file. + O arquivo enviado é muito grande. Por favor, tente enviar um ficheiro mais pequeno. + + + The CSRF token is invalid. Please try to resubmit the form. + O token CSRF é inválido. Por favor submeta o formulário novamente. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf new file mode 100755 index 0000000000..9ae4d71912 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.pt_BR.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Este formulário não deve conter campos adicionais. + + + The uploaded file was too large. Please try to upload a smaller file. + O arquivo enviado é muito grande. Por favor, tente enviar um arquivo menor. + + + The CSRF token is invalid. Please try to resubmit the form. + O token CSRF é inválido. Por favor, tente reenviar o formulário. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ro.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ro.xlf new file mode 100755 index 0000000000..25abab3b6f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ro.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Aceast formular nu ar trebui să conțină câmpuri suplimentare. + + + The uploaded file was too large. Please try to upload a smaller file. + Fișierul încărcat a fost prea mare. Vă rugăm sa încărcați un fișier mai mic. + + + The CSRF token is invalid. Please try to resubmit the form. + Token-ul CSRF este invalid. Vă rugăm să trimiteți formularul incă o dată. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ru.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ru.xlf new file mode 100755 index 0000000000..8d829f1b46 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ru.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Эта форма не должна содержать дополнительных полей. + + + The uploaded file was too large. Please try to upload a smaller file. + Загруженный файл слишком большой. Пожалуйста, попробуйте загрузить файл меньшего размера. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF значение недопустимо. Пожалуйста, попробуйте повторить отправку формы. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sk.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sk.xlf new file mode 100755 index 0000000000..638d0cc4a0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sk.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Polia by nemali obsahovať ďalšie prvky. + + + The uploaded file was too large. Please try to upload a smaller file. + Odoslaný súbor je príliš veľký. Prosím odošlite súbor s menšou veľkosťou. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF token je neplatný. Prosím skúste znovu odoslať formulár. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sl.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sl.xlf new file mode 100755 index 0000000000..103124d0a8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sl.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + To področje ne sme vsebovati dodatnih polj. + + + The uploaded file was too large. Please try to upload a smaller file. + Naložena datoteka je prevelika. Prosim, poizkusite naložiti manjšo. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF vrednost je napačna. Prosimo, ponovno pošljite obrazec. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf new file mode 100755 index 0000000000..ff7f550adf --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Cyrl.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Овај формулар не треба да садржи додатна поља. + + + The uploaded file was too large. Please try to upload a smaller file. + Отпремљена датотека је била превелика. Молим покушајте отпремање мање датотеке. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF вредност је невалидна. Покушајте поново. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf new file mode 100755 index 0000000000..6c4be35857 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sr_Latn.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ovaj formular ne treba da sadrži dodatna polja. + + + The uploaded file was too large. Please try to upload a smaller file. + Otpremljena datoteka je bila prevelika. Molim pokušajte otpremanje manje datoteke. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF vrednost je nevalidna. Pokušajte ponovo. + + + + \ No newline at end of file diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sv.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sv.xlf new file mode 100755 index 0000000000..4e2518b16b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.sv.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Formuläret kan inte innehålla extra fält. + + + The uploaded file was too large. Please try to upload a smaller file. + Den uppladdade filen var för stor. Försök ladda upp en mindre fil. + + + The CSRF token is invalid. + CSRF-symbolen är inte giltig. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ua.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ua.xlf new file mode 100755 index 0000000000..4c739face5 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.ua.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + Ця форма не повинна містити додаткових полів. + + + The uploaded file was too large. Please try to upload a smaller file. + Завантажений файл занадто великий. Будь-ласка, спробуйте завантажити файл меншого розміру. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF значення недопустиме. Будь-ласка, спробуйте відправити форму знову. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf new file mode 100755 index 0000000000..8bdf7fb5ca --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Resources/translations/validators.zh_CN.xlf @@ -0,0 +1,19 @@ + + + + + + This form should not contain extra fields. + 该表单中不可有额外字段. + + + The uploaded file was too large. Please try to upload a smaller file. + 上传文件太大, 请重新尝试上传一个较小的文件. + + + The CSRF token is invalid. Please try to resubmit the form. + CSRF 验证符无效, 请重新提交. + + + + diff --git a/vendor/symfony/form/Symfony/Component/Form/ReversedTransformer.php b/vendor/symfony/form/Symfony/Component/Form/ReversedTransformer.php new file mode 100755 index 0000000000..7069705feb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/ReversedTransformer.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +/** + * Reverses a transformer + * + * When the transform() method is called, the reversed transformer's + * reverseTransform() method is called and vice versa. + * + * @author Bernhard Schussek + */ +class ReversedTransformer implements DataTransformerInterface +{ + /** + * The reversed transformer + * @var DataTransformerInterface + */ + protected $reversedTransformer; + + /** + * Reverses this transformer + * + * @param DataTransformerInterface $reversedTransformer + */ + public function __construct(DataTransformerInterface $reversedTransformer) + { + $this->reversedTransformer = $reversedTransformer; + } + + /** + * {@inheritDoc} + */ + public function transform($value) + { + return $this->reversedTransformer->reverseTransform($value); + } + + /** + * {@inheritDoc} + */ + public function reverseTransform($value) + { + return $this->reversedTransformer->transform($value); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php new file mode 100755 index 0000000000..576d7890da --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php @@ -0,0 +1,612 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Tests\Fixtures\AlternatingRowType; + +abstract class AbstractDivLayoutTest extends AbstractLayoutTest +{ + public function testRow() + { + $form = $this->factory->createNamed('name', 'text'); + $form->addError(new FormError('Error!')); + $view = $form->createView(); + $html = $this->renderRow($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name"] + /following-sibling::ul + [./li[.="[trans]Error![/trans]"]] + [count(./li)=1] + /following-sibling::input[@id="name"] + ] +' + ); + } + + public function testRowOverrideVariables() + { + $view = $this->factory->createNamed('name', 'text')->createView(); + $html = $this->renderRow($view, array( + 'attr' => array('class' => 'my&class'), + 'label' => 'foo&bar', + 'label_attr' => array('class' => 'my&label&class'), + )); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name"][@class="my&label&class required"][.="[trans]foo&bar[/trans]"] + /following-sibling::input[@id="name"][@class="my&class"] + ] +' + ); + } + + public function testRepeatedRow() + { + $form = $this->factory->createNamed('name', 'repeated'); + $form->addError(new FormError('Error!')); + $view = $form->createView(); + $html = $this->renderRow($view); + + // The errors of the form are not rendered by intention! + // In practice, repeated fields cannot have errors as all errors + // on them are mapped to the first child. + // (see RepeatedTypeValidatorExtension) + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name_first"] + /following-sibling::input[@id="name_first"] + ] +/following-sibling::div + [ + ./label[@for="name_second"] + /following-sibling::input[@id="name_second"] + ] +' + ); + } + + public function testRest() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('field1', 'text') + ->add('field2', 'repeated') + ->add('field3', 'text') + ->add('field4', 'text') + ->getForm() + ->createView(); + + // Render field2 row -> does not implicitly call renderWidget because + // it is a repeated field! + $this->renderRow($view['field2']); + + // Render field3 widget + $this->renderWidget($view['field3']); + + // Rest should only contain field1 and field4 + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name_field1"] + /following-sibling::input[@type="text"][@id="name_field1"] + ] +/following-sibling::div + [ + ./label[@for="name_field4"] + /following-sibling::input[@type="text"][@id="name_field4"] + ] + [count(../div)=2] + [count(..//label)=2] + [count(..//input)=3] +/following-sibling::input + [@type="hidden"] + [@id="name__token"] +' + ); + } + + public function testRestWithChildrenForms() + { + $child1 = $this->factory->createNamedBuilder('child1', 'form') + ->add('field1', 'text') + ->add('field2', 'text') + ->getForm(); + + $child2 = $this->factory->createNamedBuilder('child2', 'form') + ->add('field1', 'text') + ->add('field2', 'text') + ->getForm(); + + $view = $this->factory->createNamedBuilder('parent', 'form') + ->getForm() + ->add($child1) + ->add($child2) + ->createView(); + + // Render child1.field1 row + $this->renderRow($view['child1']['field1']); + + // Render child2.field2 widget (remember that widget don't render label) + $this->renderWidget($view['child2']['field2']); + + // Rest should only contain child1.field2 and child2.field1 + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[not(@for)] + /following-sibling::div[@id="parent_child1"] + [ + ./div + [ + ./label[@for="parent_child1_field2"] + /following-sibling::input[@id="parent_child1_field2"] + ] + ] + ] + +/following-sibling::div + [ + ./label[not(@for)] + /following-sibling::div[@id="parent_child2"] + [ + ./div + [ + ./label[@for="parent_child2_field1"] + /following-sibling::input[@id="parent_child2_field1"] + ] + ] + ] + [count(//label)=4] + [count(//input[@type="text"])=2] +/following-sibling::input[@type="hidden"][@id="parent__token"] +' + ); + } + + public function testRestAndRepeatedWithRow() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('first', 'text') + ->add('password', 'repeated') + ->getForm() + ->createView(); + + $this->renderRow($view['password']); + + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name_first"] + /following-sibling::input[@type="text"][@id="name_first"] + ] + [count(.//input)=1] +/following-sibling::input + [@type="hidden"] + [@id="name__token"] +' + ); + } + + public function testRestAndRepeatedWithRowPerChild() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('first', 'text') + ->add('password', 'repeated') + ->getForm() + ->createView(); + + $this->renderRow($view['password']['first']); + $this->renderRow($view['password']['second']); + + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name_first"] + /following-sibling::input[@type="text"][@id="name_first"] + ] + [count(.//input)=1] + [count(.//label)=1] +/following-sibling::input + [@type="hidden"] + [@id="name__token"] +' + ); + } + + public function testRestAndRepeatedWithWidgetPerChild() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('first', 'text') + ->add('password', 'repeated') + ->getForm() + ->createView(); + + // The password form is considered as rendered as all its children + // are rendered + $this->renderWidget($view['password']['first']); + $this->renderWidget($view['password']['second']); + + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name_first"] + /following-sibling::input[@type="text"][@id="name_first"] + ] + [count(//input)=2] + [count(//label)=1] +/following-sibling::input + [@type="hidden"] + [@id="name__token"] +' + ); + } + + public function testCollection() + { + $form = $this->factory->createNamed('name', 'collection', array('a', 'b'), array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div[./input[@type="text"][@value="a"]] + /following-sibling::div[./input[@type="text"][@value="b"]] + ] + [count(./div[./input])=2] +' + ); + } + + // https://github.com/symfony/symfony/issues/5038 + public function testCollectionWithAlternatingRowTypes() + { + $data = array( + array('title' => 'a'), + array('title' => 'b'), + ); + $form = $this->factory->createNamed('name', 'collection', $data, array( + 'type' => new AlternatingRowType(), + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div[./div/div/input[@type="text"][@value="a"]] + /following-sibling::div[./div/div/textarea[.="b"]] + ] + [count(./div[./div/div/input])=1] + [count(./div[./div/div/textarea])=1] +' + ); + } + + public function testEmptyCollection() + { + $form = $this->factory->createNamed('name', 'collection', array(), array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [./input[@type="hidden"][@id="name__token"]] + [count(./div)=0] +' + ); + } + + public function testCollectionRow() + { + $collection = $this->factory->createNamedBuilder( + 'collection', + 'collection', + array('a', 'b'), + array('type' => 'text') + ); + + $form = $this->factory->createNamedBuilder('form', 'form') + ->add($collection) + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [ + ./label[not(@for)] + /following-sibling::div + [ + ./div + [ + ./label[@for="form_collection_0"] + /following-sibling::input[@type="text"][@value="a"] + ] + /following-sibling::div + [ + ./label[@for="form_collection_1"] + /following-sibling::input[@type="text"][@value="b"] + ] + ] + ] + /following-sibling::input[@type="hidden"][@id="form__token"] + ] + [count(.//input)=3] +' + ); + } + + public function testForm() + { + $form = $this->factory->createNamedBuilder('name', 'form') + ->add('firstName', 'text') + ->add('lastName', 'text') + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [ + ./label[@for="name_firstName"] + /following-sibling::input[@type="text"][@id="name_firstName"] + ] + /following-sibling::div + [ + ./label[@for="name_lastName"] + /following-sibling::input[@type="text"][@id="name_lastName"] + ] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(.//input)=3] +' + ); + } + + // https://github.com/symfony/symfony/issues/2308 + public function testNestedFormError() + { + $form = $this->factory->createNamedBuilder('name', 'form') + ->add($this->factory + ->createNamedBuilder('child', 'form', null, array('error_bubbling' => false)) + ->add('grandChild', 'form') + ) + ->getForm(); + + $form->get('child')->addError(new FormError('Error!')); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div/label + /following-sibling::ul[./li[.="[trans]Error![/trans]"]] + ] + [count(.//li[.="[trans]Error![/trans]"])=1] +' + ); + } + + public function testCsrf() + { + $this->csrfProvider->expects($this->any()) + ->method('generateCsrfToken') + ->will($this->returnValue('foo&bar')); + + $form = $this->factory->createNamedBuilder('name', 'form') + ->add($this->factory + // No CSRF protection on nested forms + ->createNamedBuilder('child', 'form') + ->add($this->factory->createNamedBuilder('grandchild', 'text')) + ) + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + /following-sibling::input[@type="hidden"][@id="name__token"][@value="foo&bar"] + ] + [count(.//input[@type="hidden"])=1] +' + ); + } + + public function testRepeated() + { + $form = $this->factory->createNamed('name', 'repeated', 'foobar', array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [ + ./label[@for="name_first"] + /following-sibling::input[@type="text"][@id="name_first"] + ] + /following-sibling::div + [ + ./label[@for="name_second"] + /following-sibling::input[@type="text"][@id="name_second"] + ] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(.//input)=3] +' + ); + } + + public function testRepeatedWithCustomOptions() + { + $form = $this->factory->createNamed('name', 'repeated', null, array( + // the global required value cannot be overridden + 'first_options' => array('label' => 'Test', 'required' => false), + 'second_options' => array('label' => 'Test2') + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [ + ./label[@for="name_first"][.="[trans]Test[/trans]"] + /following-sibling::input[@type="text"][@id="name_first"][@required="required"] + ] + /following-sibling::div + [ + ./label[@for="name_second"][.="[trans]Test2[/trans]"] + /following-sibling::input[@type="text"][@id="name_second"][@required="required"] + ] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(.//input)=3] +' + ); + } + + public function testSearchInputName() + { + $form = $this->factory->createNamedBuilder('full', 'form') + ->add('name', 'search') + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [ + ./label[@for="full_name"] + /following-sibling::input[@type="search"][@id="full_name"][@name="full[name]"] + ] + /following-sibling::input[@type="hidden"][@id="full__token"] + ] + [count(//input)=2] +' + ); + } + + public function testLabelHasNoId() + { + $form = $this->factory->createNamed('name', 'text'); + $html = $this->renderRow($form->createView()); + + $this->assertMatchesXpath($html, +'/div + [ + ./label[@for="name"][not(@id)] + /following-sibling::input[@id="name"] + ] +' + ); + } + + /** + * @dataProvider themeBlockInheritanceProvider + */ + public function testThemeBlockInheritance($theme) + { + $view = $this->factory + ->createNamed('name', 'email') + ->createView() + ; + + $this->setTheme($view, $theme); + + $this->assertMatchesXpath( + $this->renderWidget($view), + '/input[@type="email"][@rel="theme"]' + ); + } + + /** + * @dataProvider themeInheritanceProvider + */ + public function testThemeInheritance($parentTheme, $childTheme) + { + $child = $this->factory->createNamedBuilder('child', 'form') + ->add('field', 'text') + ->getForm(); + + $view = $this->factory->createNamedBuilder('parent', 'form') + ->add('field', 'text') + ->getForm() + ->add($child) + ->createView() + ; + + $this->setTheme($view, $parentTheme); + $this->setTheme($view['child'], $childTheme); + + $this->assertWidgetMatchesXpath($view, array(), +'/div + [ + ./div + [ + ./label[.="parent"] + /following-sibling::input[@type="text"] + ] + /following-sibling::div + [ + ./label[.="child"] + /following-sibling::div + [ + ./div + [ + ./label[.="child"] + /following-sibling::input[@type="text"] + ] + ] + ] + /following-sibling::input[@type="hidden"] + ] +' + ); + } + + /** + * The block "_name_child_label" should be overridden in the theme of the + * implemented driver. + */ + public function testCollectionRowWithCustomBlock() + { + $collection = array('one', 'two', 'three'); + $form = $this->factory->createNamedBuilder('name', 'collection', $collection) + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div[./label[.="Custom label: [trans]0[/trans]"]] + /following-sibling::div[./label[.="Custom label: [trans]1[/trans]"]] + /following-sibling::div[./label[.="Custom label: [trans]2[/trans]"]] + ] +' + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractExtensionTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractExtensionTest.php new file mode 100755 index 0000000000..c16cb22121 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractExtensionTest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\AbstractExtension; +use Symfony\Component\Form\Tests\Fixtures\FooType; + +class AbstractExtensionTest extends \PHPUnit_Framework_TestCase +{ + public function testHasType() + { + $loader = new ConcreteExtension(); + $this->assertTrue($loader->hasType('foo')); + $this->assertFalse($loader->hasType('bar')); + } + + public function testGetType() + { + $loader = new ConcreteExtension(); + $this->assertInstanceOf('Symfony\Component\Form\Tests\Fixtures\FooType', $loader->getType('foo')); + } +} + +class ConcreteExtension extends AbstractExtension +{ + protected function loadTypes() + { + return array(new FooType()); + } + + protected function loadTypeGuesser() + { + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractFormTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractFormTest.php new file mode 100755 index 0000000000..4581ad9d72 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractFormTest.php @@ -0,0 +1,143 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var EventDispatcherInterface + */ + protected $dispatcher; + + /** + * @var \Symfony\Component\Form\FormFactoryInterface + */ + protected $factory; + + /** + * @var \Symfony\Component\Form\FormInterface + */ + protected $form; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + // We need an actual dispatcher to bind the deprecated + // bindRequest() method + $this->dispatcher = new EventDispatcher(); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->form = $this->createForm(); + } + + protected function tearDown() + { + $this->dispatcher = null; + $this->factory = null; + $this->form = null; + } + + /** + * @return \Symfony\Component\Form\FormInterface + */ + abstract protected function createForm(); + + /** + * @param string $name + * @param EventDispatcherInterface $dispatcher + * @param string $dataClass + * + * @return FormBuilder + */ + protected function getBuilder($name = 'name', EventDispatcherInterface $dispatcher = null, $dataClass = null) + { + return new FormBuilder($name, $dataClass, $dispatcher ?: $this->dispatcher, $this->factory); + } + + /** + * @param string $name + * + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getMockForm($name = 'name') + { + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + + $form->expects($this->any()) + ->method('getName') + ->will($this->returnValue($name)); + + return $form; + } + + /** + * @param string $name + * + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getValidForm($name) + { + $form = $this->getMockForm($name); + + $form->expects($this->any()) + ->method('isValid') + ->will($this->returnValue(true)); + + return $form; + } + + /** + * @param string $name + * + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getInvalidForm($name) + { + $form = $this->getMockForm($name); + + $form->expects($this->any()) + ->method('isValid') + ->will($this->returnValue(false)); + + return $form; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getDataTransformer() + { + return $this->getMock('Symfony\Component\Form\DataTransformerInterface'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getFormValidator() + { + return $this->getMock('Symfony\Component\Form\FormValidatorInterface'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractLayoutTest.php new file mode 100755 index 0000000000..aa3d46bf2e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -0,0 +1,1762 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\Extension\Csrf\CsrfExtension; + +abstract class AbstractLayoutTest extends FormIntegrationTestCase +{ + protected $csrfProvider; + + protected $factory; + + protected function setUp() + { + if (!extension_loaded('intl')) { + $this->markTestSkipped('The "intl" extension is not available'); + } + + \Locale::setDefault('en'); + + $this->csrfProvider = $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface'); + + parent::setUp(); + } + + protected function getExtensions() + { + return array( + new CsrfExtension($this->csrfProvider), + ); + } + + protected function tearDown() + { + $this->csrfProvider = null; + $this->factory = null; + } + + protected function assertXpathNodeValue(\DomElement $element, $expression, $nodeValue) + { + $xpath = new \DOMXPath($element->ownerDocument); + $nodeList = $xpath->evaluate($expression); + $this->assertEquals(1, $nodeList->length); + $this->assertEquals($nodeValue, $nodeList->item(0)->nodeValue); + } + + protected function assertMatchesXpath($html, $expression, $count = 1) + { + $dom = new \DomDocument('UTF-8'); + try { + // Wrap in node so we can load HTML with multiple tags at + // the top level + $dom->loadXml(''.$html.''); + } catch (\Exception $e) { + $this->fail(sprintf( + "Failed loading HTML:\n\n%s\n\nError: %s", + $html, + $e->getMessage() + )); + } + $xpath = new \DOMXPath($dom); + $nodeList = $xpath->evaluate('/root'.$expression); + + if ($nodeList->length != $count) { + $dom->formatOutput = true; + $this->fail(sprintf( + "Failed asserting that \n\n%s\n\nmatches exactly %s. Matches %s in \n\n%s", + $expression, + $count == 1 ? 'once' : $count . ' times', + $nodeList->length == 1 ? 'once' : $nodeList->length . ' times', + // strip away and + substr($dom->saveHTML(), 6, -8) + )); + } + } + + protected function assertWidgetMatchesXpath(FormView $view, array $vars, $xpath) + { + // include ampersands everywhere to validate escaping + $html = $this->renderWidget($view, array_merge(array( + 'id' => 'my&id', + 'attr' => array('class' => 'my&class'), + ), $vars)); + + $xpath = trim($xpath).' + [@id="my&id"] + [@class="my&class"]'; + + $this->assertMatchesXpath($html, $xpath); + } + + abstract protected function renderEnctype(FormView $view); + + abstract protected function renderLabel(FormView $view, $label = null, array $vars = array()); + + abstract protected function renderErrors(FormView $view); + + abstract protected function renderWidget(FormView $view, array $vars = array()); + + abstract protected function renderRow(FormView $view, array $vars = array()); + + abstract protected function renderRest(FormView $view, array $vars = array()); + + abstract protected function setTheme(FormView $view, array $themes); + + public function testEnctype() + { + $form = $this->factory->createNamedBuilder('name', 'form') + ->add('file', 'file') + ->getForm(); + + $this->assertEquals('enctype="multipart/form-data"', $this->renderEnctype($form->createView())); + } + + public function testNoEnctype() + { + $form = $this->factory->createNamedBuilder('name', 'form') + ->add('text', 'text') + ->getForm(); + + $this->assertEquals('', $this->renderEnctype($form->createView())); + } + + public function testLabel() + { + $form = $this->factory->createNamed('name', 'text'); + $view = $form->createView(); + $this->renderWidget($view, array('label' => 'foo')); + $html = $this->renderLabel($view); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [.="[trans]Name[/trans]"] +' + ); + } + + public function testLabelOnForm() + { + $form = $this->factory->createNamed('name', 'date'); + $view = $form->createView(); + $this->renderWidget($view, array('label' => 'foo')); + $html = $this->renderLabel($view); + + $this->assertMatchesXpath($html, +'/label + [@class="required"] + [.="[trans]Name[/trans]"] +' + ); + } + + public function testLabelWithCustomTextPassedAsOption() + { + $form = $this->factory->createNamed('name', 'text', null, array( + 'label' => 'Custom label', + )); + $html = $this->renderLabel($form->createView()); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [.="[trans]Custom label[/trans]"] +' + ); + } + + public function testLabelWithCustomTextPassedDirectly() + { + $form = $this->factory->createNamed('name', 'text'); + $html = $this->renderLabel($form->createView(), 'Custom label'); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [.="[trans]Custom label[/trans]"] +' + ); + } + + public function testLabelWithCustomTextPassedAsOptionAndDirectly() + { + $form = $this->factory->createNamed('name', 'text', null, array( + 'label' => 'Custom label', + )); + $html = $this->renderLabel($form->createView(), 'Overridden label'); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [.="[trans]Overridden label[/trans]"] +' + ); + } + + public function testLabelDoesNotRenderFieldAttributes() + { + $form = $this->factory->createNamed('name', 'text'); + $html = $this->renderLabel($form->createView(), null, array( + 'attr' => array( + 'class' => 'my&class' + ), + )); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [@class="required"] +' + ); + } + + public function testLabelWithCustomAttributesPassedDirectly() + { + $form = $this->factory->createNamed('name', 'text'); + $html = $this->renderLabel($form->createView(), null, array( + 'label_attr' => array( + 'class' => 'my&class' + ), + )); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [@class="my&class required"] +' + ); + } + + public function testLabelWithCustomTextAndCustomAttributesPassedDirectly() + { + $form = $this->factory->createNamed('name', 'text'); + $html = $this->renderLabel($form->createView(), 'Custom label', array( + 'label_attr' => array( + 'class' => 'my&class' + ), + )); + + $this->assertMatchesXpath($html, +'/label + [@for="name"] + [@class="my&class required"] + [.="[trans]Custom label[/trans]"] +' + ); + } + + // https://github.com/symfony/symfony/issues/5029 + public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly() + { + $form = $this->factory->createNamed('name', 'text', null, array( + 'label' => 'Custom label', + )); + $html = $this->renderLabel($form->createView(), null, array( + 'label_attr' => array( + 'class' => 'my&class' + ), + )); + + $this->assertMatchesXpath($html, + '/label + [@for="name"] + [@class="my&class required"] + [.="[trans]Custom label[/trans]"] +' + ); + } + + public function testErrors() + { + $form = $this->factory->createNamed('name', 'text'); + $form->addError(new FormError('Error 1')); + $form->addError(new FormError('Error 2')); + $view = $form->createView(); + $html = $this->renderErrors($view); + + $this->assertMatchesXpath($html, +'/ul + [ + ./li[.="[trans]Error 1[/trans]"] + /following-sibling::li[.="[trans]Error 2[/trans]"] + ] + [count(./li)=2] +' + ); + } + + public function testWidgetById() + { + $form = $this->factory->createNamed('text_id', 'text'); + $html = $this->renderWidget($form->createView()); + + $this->assertMatchesXpath($html, +'/div + [ + ./input + [@type="text"] + [@id="text_id"] + ] + [@id="container"] +' + ); + } + + public function testCheckedCheckbox() + { + $form = $this->factory->createNamed('name', 'checkbox', true); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="checkbox"] + [@name="name"] + [@checked="checked"] + [@value="1"] +' + ); + } + + public function testUncheckedCheckbox() + { + $form = $this->factory->createNamed('name', 'checkbox', false); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="checkbox"] + [@name="name"] + [not(@checked)] +' + ); + } + + public function testCheckboxWithValue() + { + $form = $this->factory->createNamed('name', 'checkbox', false, array( + 'value' => 'foo&bar', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="checkbox"] + [@name="name"] + [@value="foo&bar"] +' + ); + } + + public function testSingleChoice() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=2] +' + ); + } + + public function testSingleChoiceWithPreferred() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'preferred_choices' => array('&b'), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array('separator' => '-- sep --'), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + /following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceWithPreferredAndNoSeparator() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'preferred_choices' => array('&b'), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array('separator' => null), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + ] + [count(./option)=2] +' + ); + } + + public function testSingleChoiceWithPreferredAndBlankSeparator() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'preferred_choices' => array('&b'), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array('separator' => ''), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + /following-sibling::option[@disabled="disabled"][not(@selected)][.=""] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testChoiceWithOnlyPreferred() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'preferred_choices' => array('&a', '&b'), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [count(./option)=2] +' + ); + } + + public function testSingleChoiceNonRequired() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'required' => false, + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [not(@required)] + [ + ./option[@value=""][.="[trans][/trans]"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceNonRequiredNoneSelected() + { + $form = $this->factory->createNamed('name', 'choice', null, array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'required' => false, + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [not(@required)] + [ + ./option[@value=""][.="[trans][/trans]"] + /following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceWithNonRequiredEmptyValue() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => false, + 'expanded' => false, + 'required' => false, + 'empty_value' => 'Select&Anything&Not&Me', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [not(@required)] + [ + ./option[@value=""][not(@selected)][.="[trans]Select&Anything&Not&Me[/trans]"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceRequiredWithEmptyValue() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'required' => true, + 'multiple' => false, + 'expanded' => false, + 'empty_value' => 'Test&Me' + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value=""][.="[trans]Test&Me[/trans]"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceRequiredWithEmptyValueViaView() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'required' => true, + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array('empty_value' => ''), +'/select + [@name="name"] + [@required="required"] + [ + ./option[@value=""][.="[trans][/trans]"] + /following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=3] +' + ); + } + + public function testSingleChoiceGrouped() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array( + 'Group&1' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'Group&2' => array('&c' => 'Choice&C'), + ), + 'multiple' => false, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [./optgroup[@label="[trans]Group&1[/trans]"] + [ + ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=2] + ] + [./optgroup[@label="[trans]Group&2[/trans]"] + [./option[@value="&c"][not(@selected)][.="[trans]Choice&C[/trans]"]] + [count(./option)=1] + ] + [count(./optgroup)=2] +' + ); + } + + public function testMultipleChoice() + { + $form = $this->factory->createNamed('name', 'choice', array('&a'), array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => true, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name[]"] + [@multiple="multiple"] + [ + ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=2] +' + ); + } + + public function testMultipleChoiceSkipEmptyValue() + { + $form = $this->factory->createNamed('name', 'choice', array('&a'), array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => true, + 'expanded' => false, + 'empty_value' => 'Test&Me' + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name[]"] + [@multiple="multiple"] + [ + ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=2] +' + ); + } + + public function testMultipleChoiceNonRequired() + { + $form = $this->factory->createNamed('name', 'choice', array('&a'), array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'required' => false, + 'multiple' => true, + 'expanded' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name[]"] + [@multiple="multiple"] + [ + ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"] + /following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"] + ] + [count(./option)=2] +' + ); + } + + public function testSingleChoiceExpanded() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => false, + 'expanded' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked] + /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"] + /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)] + /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(./input)=3] +' + ); + } + + public function testSingleChoiceExpandedSkipEmptyValue() + { + $form = $this->factory->createNamed('name', 'choice', '&a', array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), + 'multiple' => false, + 'expanded' => true, + 'empty_value' => 'Test&Me' + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input[@type="radio"][@name="name"][@id="name_0"][@checked] + /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"] + /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][not(@checked)] + /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(./input)=3] +' + ); + } + + public function testSingleChoiceExpandedWithBooleanValue() + { + $form = $this->factory->createNamed('name', 'choice', true, array( + 'choices' => array('1' => 'Choice&A', '0' => 'Choice&B'), + 'multiple' => false, + 'expanded' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input[@type="radio"][@name="name"][@id="name_0"][@checked] + /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"] + /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][not(@checked)] + /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(./input)=3] +' + ); + } + + public function testMultipleChoiceExpanded() + { + $form = $this->factory->createNamed('name', 'choice', array('&a', '&c'), array( + 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B', '&c' => 'Choice&C'), + 'multiple' => true, + 'expanded' => true, + 'required' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)] + /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"] + /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)] + /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"] + /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)] + /following-sibling::label[@for="name_2"][.="[trans]Choice&C[/trans]"] + /following-sibling::input[@type="hidden"][@id="name__token"] + ] + [count(./input)=4] +' + ); + } + + public function testCountry() + { + $form = $this->factory->createNamed('name', 'country', 'AT'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [./option[@value="AT"][@selected="selected"][.="[trans]Austria[/trans]"]] + [count(./option)>200] +' + ); + } + + public function testCountryWithEmptyValue() + { + $form = $this->factory->createNamed('name', 'country', 'AT', array( + 'empty_value' => 'Select&Country', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [./option[@value=""][not(@selected)][.="[trans]Select&Country[/trans]"]] + [./option[@value="AT"][@selected="selected"][.="[trans]Austria[/trans]"]] + [count(./option)>201] +' + ); + } + + public function testDateTime() + { + $form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array( + 'input' => 'string', + 'with_seconds' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [@id="name_date"] + [ + ./select + [@id="name_date_month"] + [./option[@value="2"][@selected="selected"]] + /following-sibling::select + [@id="name_date_day"] + [./option[@value="3"][@selected="selected"]] + /following-sibling::select + [@id="name_date_year"] + [./option[@value="2011"][@selected="selected"]] + ] + /following-sibling::div + [@id="name_time"] + [ + ./select + [@id="name_time_hour"] + [./option[@value="4"][@selected="selected"]] + /following-sibling::select + [@id="name_time_minute"] + [./option[@value="5"][@selected="selected"]] + ] + ] + [count(.//select)=5] +' + ); + } + + public function testDateTimeWithEmptyValueGlobal() + { + $form = $this->factory->createNamed('name', 'datetime', null, array( + 'input' => 'string', + 'empty_value' => 'Change&Me', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [@id="name_date"] + [ + ./select + [@id="name_date_month"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_date_day"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_date_year"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + ] + /following-sibling::div + [@id="name_time"] + [ + ./select + [@id="name_time_hour"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_time_minute"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + ] + ] + [count(.//select)=5] +' + ); + } + + public function testDateTimeWithEmptyValueOnTime() + { + $data = array('year' => '2011', 'month' => '2', 'day' => '3', 'hour' => '', 'minute' => ''); + + $form = $this->factory->createNamed('name', 'datetime', $data, array( + 'input' => 'array', + 'empty_value' => array('hour' => 'Change&Me', 'minute' => 'Change&Me'), + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [@id="name_date"] + [ + ./select + [@id="name_date_month"] + [./option[@value="2"][@selected="selected"]] + /following-sibling::select + [@id="name_date_day"] + [./option[@value="3"][@selected="selected"]] + /following-sibling::select + [@id="name_date_year"] + [./option[@value="2011"][@selected="selected"]] + ] + /following-sibling::div + [@id="name_time"] + [ + ./select + [@id="name_time_hour"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_time_minute"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + ] + ] + [count(.//select)=5] +' + ); + } + + public function testDateTimeWithSeconds() + { + $form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array( + 'input' => 'string', + 'with_seconds' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./div + [@id="name_date"] + [ + ./select + [@id="name_date_month"] + [./option[@value="2"][@selected="selected"]] + /following-sibling::select + [@id="name_date_day"] + [./option[@value="3"][@selected="selected"]] + /following-sibling::select + [@id="name_date_year"] + [./option[@value="2011"][@selected="selected"]] + ] + /following-sibling::div + [@id="name_time"] + [ + ./select + [@id="name_time_hour"] + [./option[@value="4"][@selected="selected"]] + /following-sibling::select + [@id="name_time_minute"] + [./option[@value="5"][@selected="selected"]] + /following-sibling::select + [@id="name_time_second"] + [./option[@value="6"][@selected="selected"]] + ] + ] + [count(.//select)=6] +' + ); + } + + public function testDateTimeSingleText() + { + $form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array( + 'input' => 'string', + 'date_widget' => 'single_text', + 'time_widget' => 'single_text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input + [@type="date"] + [@id="name_date"] + [@name="name[date]"] + [@value="2011-02-03"] + /following-sibling::input + [@type="time"] + [@id="name_time"] + [@name="name[time]"] + [@value="04:05"] + ] +' + ); + } + + public function testDateTimeWithWidgetSingleText() + { + $form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array( + 'input' => 'string', + 'widget' => 'single_text', + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="datetime"] + [@name="name"] + [@value="2011-02-03T04:05:06Z"] +' + ); + } + + public function testDateTimeWithWidgetSingleTextIgnoreDateAndTimeWidgets() + { + $form = $this->factory->createNamed('name', 'datetime', '2011-02-03 04:05:06', array( + 'input' => 'string', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + 'widget' => 'single_text', + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="datetime"] + [@name="name"] + [@value="2011-02-03T04:05:06Z"] +' + ); + } + + public function testDateChoice() + { + $form = $this->factory->createNamed('name', 'date', '2011-02-03', array( + 'input' => 'string', + 'widget' => 'choice', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_month"] + [./option[@value="2"][@selected="selected"]] + /following-sibling::select + [@id="name_day"] + [./option[@value="3"][@selected="selected"]] + /following-sibling::select + [@id="name_year"] + [./option[@value="2011"][@selected="selected"]] + ] + [count(./select)=3] +' + ); + } + + public function testDateChoiceWithEmptyValueGlobal() + { + $form = $this->factory->createNamed('name', 'date', null, array( + 'input' => 'string', + 'widget' => 'choice', + 'empty_value' => 'Change&Me', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_month"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_day"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + /following-sibling::select + [@id="name_year"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + ] + [count(./select)=3] +' + ); + } + + public function testDateChoiceWithEmptyValueOnYear() + { + $form = $this->factory->createNamed('name', 'date', null, array( + 'input' => 'string', + 'widget' => 'choice', + 'required' => false, + 'empty_value' => array('year' => 'Change&Me'), + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_month"] + [./option[@value="1"]] + /following-sibling::select + [@id="name_day"] + [./option[@value="1"]] + /following-sibling::select + [@id="name_year"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + ] + [count(./select)=3] +' + ); + } + + public function testDateText() + { + $form = $this->factory->createNamed('name', 'date', '2011-02-03', array( + 'input' => 'string', + 'widget' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input + [@id="name_month"] + [@type="text"] + [@value="2"] + /following-sibling::input + [@id="name_day"] + [@type="text"] + [@value="3"] + /following-sibling::input + [@id="name_year"] + [@type="text"] + [@value="2011"] + ] + [count(./input)=3] +' + ); + } + + public function testDateSingleText() + { + $form = $this->factory->createNamed('name', 'date', '2011-02-03', array( + 'input' => 'string', + 'widget' => 'single_text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="date"] + [@name="name"] + [@value="2011-02-03"] +' + ); + } + + public function testDateErrorBubbling() + { + $child = $this->factory->createNamed('date', 'date'); + $form = $this->factory->createNamed('form', 'form')->add($child); + $child->addError(new FormError('Error!')); + $view = $form->createView(); + + $this->assertEmpty($this->renderErrors($view)); + $this->assertNotEmpty($this->renderErrors($view['date'])); + } + + public function testBirthDay() + { + $form = $this->factory->createNamed('name', 'birthday', '2000-02-03', array( + 'input' => 'string', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_month"] + [./option[@value="2"][@selected="selected"]] + /following-sibling::select + [@id="name_day"] + [./option[@value="3"][@selected="selected"]] + /following-sibling::select + [@id="name_year"] + [./option[@value="2000"][@selected="selected"]] + ] + [count(./select)=3] +' + ); + } + + public function testBirthDayWithEmptyValue() + { + $form = $this->factory->createNamed('name', 'birthday', '1950-01-01', array( + 'input' => 'string', + 'empty_value' => '', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_month"] + [./option[@value=""][.="[trans][/trans]"]] + [./option[@value="1"][@selected="selected"]] + /following-sibling::select + [@id="name_day"] + [./option[@value=""][.="[trans][/trans]"]] + [./option[@value="1"][@selected="selected"]] + /following-sibling::select + [@id="name_year"] + [./option[@value=""][.="[trans][/trans]"]] + [./option[@value="1950"][@selected="selected"]] + ] + [count(./select)=3] +' + ); + } + + public function testEmail() + { + $form = $this->factory->createNamed('name', 'email', 'foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="email"] + [@name="name"] + [@value="foo&bar"] + [not(@maxlength)] +' + ); + } + + public function testEmailWithMaxLength() + { + $form = $this->factory->createNamed('name', 'email', 'foo&bar', array( + 'max_length' => 123, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="email"] + [@name="name"] + [@value="foo&bar"] + [@maxlength="123"] +' + ); + } + + public function testFile() + { + $form = $this->factory->createNamed('name', 'file'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="file"] +' + ); + } + + public function testHidden() + { + $form = $this->factory->createNamed('name', 'hidden', 'foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="hidden"] + [@name="name"] + [@value="foo&bar"] +' + ); + } + + public function testReadOnly() + { + $form = $this->factory->createNamed('name', 'text', null, array( + 'read_only' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@readonly="readonly"] +' + ); + } + + public function testDisabled() + { + $form = $this->factory->createNamed('name', 'text', null, array( + 'disabled' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@disabled="disabled"] +' + ); + } + + public function testInteger() + { + $form = $this->factory->createNamed('name', 'integer', 123); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="number"] + [@name="name"] + [@value="123"] +' + ); + } + + public function testLanguage() + { + $form = $this->factory->createNamed('name', 'language', 'de'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [./option[@value="de"][@selected="selected"][.="[trans]German[/trans]"]] + [count(./option)>200] +' + ); + } + + public function testLocale() + { + $form = $this->factory->createNamed('name', 'locale', 'de_AT'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [./option[@value="de_AT"][@selected="selected"][.="[trans]German (Austria)[/trans]"]] + [count(./option)>200] +' + ); + } + + public function testMoney() + { + $form = $this->factory->createNamed('name', 'money', 1234.56, array( + 'currency' => 'EUR', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@value="1234.56"] + [contains(.., "€")] +' + ); + } + + public function testNumber() + { + $form = $this->factory->createNamed('name', 'number', 1234.56); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@value="1234.56"] +' + ); + } + + public function testPassword() + { + $form = $this->factory->createNamed('name', 'password', 'foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="password"] + [@name="name"] +' + ); + } + + public function testPasswordBoundNotAlwaysEmpty() + { + $form = $this->factory->createNamed('name', 'password', null, array( + 'always_empty' => false, + )); + $form->bind('foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="password"] + [@name="name"] + [@value="foo&bar"] +' + ); + } + + public function testPasswordWithMaxLength() + { + $form = $this->factory->createNamed('name', 'password', 'foo&bar', array( + 'max_length' => 123, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="password"] + [@name="name"] + [@maxlength="123"] +' + ); + } + + public function testPercent() + { + $form = $this->factory->createNamed('name', 'percent', 0.1); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@value="10"] + [contains(.., "%")] +' + ); + } + + public function testCheckedRadio() + { + $form = $this->factory->createNamed('name', 'radio', true); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="radio"] + [@name="name"] + [@checked="checked"] + [@value="1"] +' + ); + } + + public function testUncheckedRadio() + { + $form = $this->factory->createNamed('name', 'radio', false); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="radio"] + [@name="name"] + [not(@checked)] +' + ); + } + + public function testRadioWithValue() + { + $form = $this->factory->createNamed('name', 'radio', false, array( + 'value' => 'foo&bar', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="radio"] + [@name="name"] + [@value="foo&bar"] +' + ); + } + + public function testTextarea() + { + $form = $this->factory->createNamed('name', 'textarea', 'foo&bar', array( + 'pattern' => 'foo', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/textarea + [@name="name"] + [not(@pattern)] + [.="foo&bar"] +' + ); + } + + public function testText() + { + $form = $this->factory->createNamed('name', 'text', 'foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@value="foo&bar"] + [not(@maxlength)] +' + ); + } + + public function testTextWithMaxLength() + { + $form = $this->factory->createNamed('name', 'text', 'foo&bar', array( + 'max_length' => 123, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="text"] + [@name="name"] + [@value="foo&bar"] + [@maxlength="123"] +' + ); + } + + public function testSearch() + { + $form = $this->factory->createNamed('name', 'search', 'foo&bar'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="search"] + [@name="name"] + [@value="foo&bar"] + [not(@maxlength)] +' + ); + } + + public function testTime() + { + $form = $this->factory->createNamed('name', 'time', '04:05:06', array( + 'input' => 'string', + 'with_seconds' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_hour"] + [@size="1"] + [./option[@value="4"][@selected="selected"]] + /following-sibling::select + [@id="name_minute"] + [@size="1"] + [./option[@value="5"][@selected="selected"]] + ] + [count(./select)=2] +' + ); + } + + public function testTimeWithSeconds() + { + $form = $this->factory->createNamed('name', 'time', '04:05:06', array( + 'input' => 'string', + 'with_seconds' => true, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_hour"] + [@size="1"] + [./option[@value="4"][@selected="selected"]] + [count(./option)>23] + /following-sibling::select + [@id="name_minute"] + [@size="1"] + [./option[@value="5"][@selected="selected"]] + [count(./option)>59] + /following-sibling::select + [@id="name_second"] + [@size="1"] + [./option[@value="6"][@selected="selected"]] + [count(./option)>59] + ] + [count(./select)=3] +' + ); + } + + public function testTimeText() + { + $form = $this->factory->createNamed('name', 'time', '04:05:06', array( + 'input' => 'string', + 'widget' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./input + [@type="text"] + [@id="name_hour"] + [@name="name[hour]"] + [@value="04"] + [@size="1"] + [@required="required"] + /following-sibling::input + [@type="text"] + [@id="name_minute"] + [@name="name[minute]"] + [@value="05"] + [@size="1"] + [@required="required"] + ] + [count(./input)=2] +' + ); + } + + public function testTimeSingleText() + { + $form = $this->factory->createNamed('name', 'time', '04:05:06', array( + 'input' => 'string', + 'widget' => 'single_text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="time"] + [@name="name"] + [@value="04:05"] +' + ); + } + + public function testTimeWithEmptyValueGlobal() + { + $form = $this->factory->createNamed('name', 'time', null, array( + 'input' => 'string', + 'empty_value' => 'Change&Me', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_hour"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + [count(./option)>24] + /following-sibling::select + [@id="name_minute"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + [count(./option)>60] + ] + [count(./select)=2] +' + ); + } + + public function testTimeWithEmptyValueOnYear() + { + $form = $this->factory->createNamed('name', 'time', null, array( + 'input' => 'string', + 'required' => false, + 'empty_value' => array('hour' => 'Change&Me'), + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/div + [ + ./select + [@id="name_hour"] + [./option[@value=""][.="[trans]Change&Me[/trans]"]] + [count(./option)>24] + /following-sibling::select + [@id="name_minute"] + [./option[@value="1"]] + [count(./option)>59] + ] + [count(./select)=2] +' + ); + } + + public function testTimeErrorBubbling() + { + $child = $this->factory->createNamed('time', 'time'); + $form = $this->factory->createNamed('form', 'form')->add($child); + $child->addError(new FormError('Error!')); + $view = $form->createView(); + + $this->assertEmpty($this->renderErrors($view)); + $this->assertNotEmpty($this->renderErrors($view['time'])); + } + + public function testTimezone() + { + $form = $this->factory->createNamed('name', 'timezone', 'Europe/Vienna'); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [@name="name"] + [@required="required"] + [./optgroup + [@label="[trans]Europe[/trans]"] + [./option[@value="Europe/Vienna"][@selected="selected"][.="[trans]Vienna[/trans]"]] + ] + [count(./optgroup)>10] + [count(.//option)>200] +' + ); + } + + public function testTimezoneWithEmptyValue() + { + $form = $this->factory->createNamed('name', 'timezone', null, array( + 'empty_value' => 'Select&Timezone', + 'required' => false, + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/select + [./option[@value=""][.="[trans]Select&Timezone[/trans]"]] + [count(./optgroup)>10] + [count(.//option)>201] +' + ); + } + + public function testUrl() + { + $url = 'http://www.google.com?foo1=bar1&foo2=bar2'; + $form = $this->factory->createNamed('name', 'url', $url); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/input + [@type="url"] + [@name="name"] + [@value="http://www.google.com?foo1=bar1&foo2=bar2"] +' + ); + } + + public function testCollectionPrototype() + { + $form = $this->factory->createNamedBuilder('name', 'form', array('items' => array('one', 'two', 'three'))) + ->add('items', 'collection', array('allow_add' => true)) + ->getForm() + ->createView(); + + $html = $this->renderWidget($form); + + $this->assertMatchesXpath($html, + '//div[@id="name_items"][@data-prototype] + | + //table[@id="name_items"][@data-prototype] + +' + ); + } + + public function testEmptyRootFormName() + { + $form = $this->factory->createNamedBuilder('', 'form') + ->add('child', 'text') + ->getForm(); + + $this->assertMatchesXpath($this->renderWidget($form->createView()), + '//input[@type="hidden"][@id="_token"][@name="_token"] + | + //input[@type="text"][@id="child"][@name="child"]' + , 2); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php new file mode 100755 index 0000000000..c21c712c5c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php @@ -0,0 +1,365 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormError; + +abstract class AbstractTableLayoutTest extends AbstractLayoutTest +{ + public function testRow() + { + $form = $this->factory->createNamed('name', 'text'); + $form->addError(new FormError('Error!')); + $view = $form->createView(); + $html = $this->renderRow($view); + + $this->assertMatchesXpath($html, +'/tr + [ + ./td + [./label[@for="name"]] + /following-sibling::td + [ + ./ul + [./li[.="[trans]Error![/trans]"]] + [count(./li)=1] + /following-sibling::input[@id="name"] + ] + ] +' + ); + } + + public function testRepeatedRow() + { + $form = $this->factory->createNamed('name', 'repeated'); + $html = $this->renderRow($form->createView()); + + $this->assertMatchesXpath($html, +'/tr + [ + ./td + [./label[@for="name_first"]] + /following-sibling::td + [./input[@id="name_first"]] + ] +/following-sibling::tr + [ + ./td + [./label[@for="name_second"]] + /following-sibling::td + [./input[@id="name_second"]] + ] +/following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + [count(../tr)=3] +' + ); + } + + public function testRepeatedRowWithErrors() + { + $form = $this->factory->createNamed('name', 'repeated'); + $form->addError(new FormError('Error!')); + $view = $form->createView(); + $html = $this->renderRow($view); + + // The errors of the form are not rendered by intention! + // In practice, repeated fields cannot have errors as all errors + // on them are mapped to the first child. + // (see RepeatedTypeValidatorExtension) + + $this->assertMatchesXpath($html, +'/tr + [ + ./td + [./label[@for="name_first"]] + /following-sibling::td + [./input[@id="name_first"]] + ] +/following-sibling::tr + [ + ./td + [./label[@for="name_second"]] + /following-sibling::td + [./input[@id="name_second"]] + ] +/following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + [count(../tr)=3] +' + ); + } + + public function testRest() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('field1', 'text') + ->add('field2', 'repeated') + ->add('field3', 'text') + ->add('field4', 'text') + ->getForm() + ->createView(); + + // Render field2 row -> does not implicitly call renderWidget because + // it is a repeated field! + $this->renderRow($view['field2']); + + // Render field3 widget + $this->renderWidget($view['field3']); + + // Rest should only contain field1 and field4 + $html = $this->renderRest($view); + + $this->assertMatchesXpath($html, +'/tr + [ + ./td + [./label[@for="name_field1"]] + /following-sibling::td + [./input[@id="name_field1"]] + ] +/following-sibling::tr + [ + ./td + [./label[@for="name_field4"]] + /following-sibling::td + [./input[@id="name_field4"]] + ] + [count(../tr)=3] + [count(..//label)=2] + [count(..//input)=3] +/following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] +' + ); + } + + public function testCollection() + { + $form = $this->factory->createNamed('name', 'collection', array('a', 'b'), array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr[./td/input[@type="text"][@value="a"]] + /following-sibling::tr[./td/input[@type="text"][@value="b"]] + /following-sibling::tr[@style="display: none"][./td[@colspan="2"]/input[@type="hidden"][@id="name__token"]] + ] + [count(./tr[./td/input])=3] +' + ); + } + + public function testEmptyCollection() + { + $form = $this->factory->createNamed('name', 'collection', array(), array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [./tr[@style="display: none"][./td[@colspan="2"]/input[@type="hidden"][@id="name__token"]]] + [count(./tr[./td/input])=1] +' + ); + } + + public function testForm() + { + $view = $this->factory->createNamedBuilder('name', 'form') + ->add('firstName', 'text') + ->add('lastName', 'text') + ->getForm() + ->createView(); + + $this->assertWidgetMatchesXpath($view, array(), +'/table + [ + ./tr + [ + ./td + [./label[@for="name_firstName"]] + /following-sibling::td + [./input[@id="name_firstName"]] + ] + /following-sibling::tr + [ + ./td + [./label[@for="name_lastName"]] + /following-sibling::td + [./input[@id="name_lastName"]] + ] + /following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + ] + [count(.//input)=3] +' + ); + } + + // https://github.com/symfony/symfony/issues/2308 + public function testNestedFormError() + { + $form = $this->factory->createNamedBuilder('name', 'form') + ->add($this->factory + ->createNamedBuilder('child', 'form', null, array('error_bubbling' => false)) + ->add('grandChild', 'form') + ) + ->getForm(); + + $form->get('child')->addError(new FormError('Error!')); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr/td/ul[./li[.="[trans]Error![/trans]"]] + /following-sibling::table[@id="name_child"] + ] + [count(.//li[.="[trans]Error![/trans]"])=1] +' + ); + } + + public function testCsrf() + { + $this->csrfProvider->expects($this->any()) + ->method('generateCsrfToken') + ->will($this->returnValue('foo&bar')); + + $form = $this->factory->createNamedBuilder('name', 'form') + ->add($this->factory + // No CSRF protection on nested forms + ->createNamedBuilder('child', 'form') + ->add($this->factory->createNamedBuilder('grandchild', 'text')) + ) + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + ] + [count(.//input[@type="hidden"])=1] +' + ); + } + + public function testRepeated() + { + $form = $this->factory->createNamed('name', 'repeated', 'foobar', array( + 'type' => 'text', + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr + [ + ./td + [./label[@for="name_first"]] + /following-sibling::td + [./input[@type="text"][@id="name_first"]] + ] + /following-sibling::tr + [ + ./td + [./label[@for="name_second"]] + /following-sibling::td + [./input[@type="text"][@id="name_second"]] + ] + /following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + ] + [count(.//input)=3] +' + ); + } + + public function testRepeatedWithCustomOptions() + { + $form = $this->factory->createNamed('name', 'repeated', 'foobar', array( + 'type' => 'password', + 'first_options' => array('label' => 'Test', 'required' => false), + 'second_options' => array('label' => 'Test2') + )); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr + [ + ./td + [./label[@for="name_first"][.="[trans]Test[/trans]"]] + /following-sibling::td + [./input[@type="password"][@id="name_first"][@required="required"]] + ] + /following-sibling::tr + [ + ./td + [./label[@for="name_second"][.="[trans]Test2[/trans]"]] + /following-sibling::td + [./input[@type="password"][@id="name_second"][@required="required"]] + ] + /following-sibling::tr[@style="display: none"] + [./td[@colspan="2"]/input + [@type="hidden"] + [@id="name__token"] + ] + ] + [count(.//input)=3] +' + ); + } + + /** + * The block "_name_child_label" should be overridden in the theme of the + * implemented driver. + */ + public function testCollectionRowWithCustomBlock() + { + $collection = array('one', 'two', 'three'); + $form = $this->factory->createNamedBuilder('name', 'collection', $collection) + ->getForm(); + + $this->assertWidgetMatchesXpath($form->createView(), array(), +'/table + [ + ./tr[./td/label[.="Custom label: [trans]0[/trans]"]] + /following-sibling::tr[./td/label[.="Custom label: [trans]1[/trans]"]] + /following-sibling::tr[./td/label[.="Custom label: [trans]2[/trans]"]] + ] +' + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php new file mode 100755 index 0000000000..b0191c5369 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +/** + * @author Bernhard Schussek + */ +class CompoundFormPerformanceTest extends FormPerformanceTestCase +{ + /** + * Create a compound form multiple times, as happens in a collection form + * + * @group benchmark + */ + public function testArrayBasedForm() + { + $this->setMaxRunningTime(1); + + for ($i = 0; $i < 40; ++$i) { + $form = $this->factory->createBuilder('form') + ->add('firstName', 'text') + ->add('lastName', 'text') + ->add('gender', 'choice', array( + 'choices' => array('male' => 'Male', 'female' => 'Female'), + 'required' => false, + )) + ->add('age', 'number') + ->add('birthDate', 'birthday') + ->add('city', 'choice', array( + // simulate 300 different cities + 'choices' => range(1, 300), + )) + ->getForm(); + + // load the form into a view + $form->createView(); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormTest.php new file mode 100755 index 0000000000..32349ba54e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/CompoundFormTest.php @@ -0,0 +1,581 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\File\UploadedFile; +use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer; + +class CompoundFormTest extends AbstractFormTest +{ + public function testValidIfAllChildrenAreValid() + { + $this->form->add($this->getValidForm('firstName')); + $this->form->add($this->getValidForm('lastName')); + + $this->form->bind(array( + 'firstName' => 'Bernhard', + 'lastName' => 'Schussek', + )); + + $this->assertTrue($this->form->isValid()); + } + + public function testInvalidIfChildrenIsInvalid() + { + $this->form->add($this->getValidForm('firstName')); + $this->form->add($this->getInvalidForm('lastName')); + + $this->form->bind(array( + 'firstName' => 'Bernhard', + 'lastName' => 'Schussek', + )); + + $this->assertFalse($this->form->isValid()); + } + + public function testBindForwardsNullIfValueIsMissing() + { + $child = $this->getMockForm('firstName'); + + $this->form->add($child); + + $child->expects($this->once()) + ->method('bind') + ->with($this->equalTo(null)); + + $this->form->bind(array()); + } + + public function testCloneChildren() + { + $child = $this->getBuilder('child')->getForm(); + $this->form->add($child); + + $clone = clone $this->form; + + $this->assertNotSame($this->form, $clone); + $this->assertNotSame($child, $clone['child']); + } + + public function testNotEmptyIfChildNotEmpty() + { + $child = $this->getMockForm(); + $child->expects($this->once()) + ->method('isEmpty') + ->will($this->returnValue(false)); + + $this->form->setData(null); + $this->form->add($child); + + $this->assertFalse($this->form->isEmpty()); + } + + public function testValidIfBoundAndDisabledWithChildren() + { + $this->factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('name', 'text', null, array()) + ->will($this->returnValue($this->getBuilder('name'))); + + $form = $this->getBuilder('person') + ->setDisabled(true) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->add('name', 'text') + ->getForm(); + $form->bind(array('name' => 'Jacques Doe')); + + $this->assertTrue($form->isValid()); + } + + public function testNotValidIfChildNotValid() + { + $child = $this->getMockForm(); + $child->expects($this->once()) + ->method('isValid') + ->will($this->returnValue(false)); + + $this->form->add($child); + $this->form->bind(array()); + + $this->assertFalse($this->form->isValid()); + } + + public function testHasChildren() + { + $this->form->add($this->getBuilder()->getForm()); + + $this->assertTrue($this->form->hasChildren()); + } + + public function testHasNoChildren() + { + $this->assertFalse($this->form->hasChildren()); + } + + public function testAdd() + { + $child = $this->getBuilder('foo')->getForm(); + $this->form->add($child); + + $this->assertSame($this->form, $child->getParent()); + $this->assertSame(array('foo' => $child), $this->form->all()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\AlreadyBoundException + */ + public function testAddThrowsExceptionIfAlreadyBound() + { + $this->form->bind(array()); + $this->form->add($this->getBuilder('foo')->getForm()); + } + + public function testRemove() + { + $child = $this->getBuilder('foo')->getForm(); + $this->form->add($child); + $this->form->remove('foo'); + + $this->assertNull($child->getParent()); + $this->assertFalse($this->form->hasChildren()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\AlreadyBoundException + */ + public function testRemoveThrowsExceptionIfAlreadyBound() + { + $this->form->add($this->getBuilder('foo')->setCompound(false)->getForm()); + $this->form->bind(array('foo' => 'bar')); + $this->form->remove('foo'); + } + + public function testRemoveIgnoresUnknownName() + { + $this->form->remove('notexisting'); + } + + public function testArrayAccess() + { + $child = $this->getBuilder('foo')->getForm(); + + $this->form[] = $child; + + $this->assertTrue(isset($this->form['foo'])); + $this->assertSame($child, $this->form['foo']); + + unset($this->form['foo']); + + $this->assertFalse(isset($this->form['foo'])); + } + + public function testCountable() + { + $this->form->add($this->getBuilder('foo')->getForm()); + $this->form->add($this->getBuilder('bar')->getForm()); + + $this->assertCount(2, $this->form); + } + + public function testIterator() + { + $this->form->add($this->getBuilder('foo')->getForm()); + $this->form->add($this->getBuilder('bar')->getForm()); + + $this->assertSame($this->form->all(), iterator_to_array($this->form)); + } + + public function testAddMapsViewDataToForm() + { + $mapper = $this->getDataMapper(); + $form = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($mapper) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => 'bar', + ))) + ->setData('foo') + ->getForm(); + + $child = $this->getBuilder()->getForm(); + $mapper->expects($this->once()) + ->method('mapDataToForms') + ->with('bar', array($child)); + + $form->add($child); + } + + public function testSetDataMapsViewDataToChildren() + { + $mapper = $this->getDataMapper(); + $form = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($mapper) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => 'bar', + ))) + ->getForm(); + + $form->add($child1 = $this->getBuilder('firstName')->getForm()); + $form->add($child2 = $this->getBuilder('lastName')->getForm()); + + $mapper->expects($this->once()) + ->method('mapDataToForms') + ->with('bar', array('firstName' => $child1, 'lastName' => $child2)); + + $form->setData('foo'); + } + + public function testBindMapsBoundChildrenOntoExistingViewData() + { + $test = $this; + $mapper = $this->getDataMapper(); + $form = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($mapper) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => 'bar', + ))) + ->setData('foo') + ->getForm(); + + $form->add($child1 = $this->getBuilder('firstName')->setCompound(false)->getForm()); + $form->add($child2 = $this->getBuilder('lastName')->setCompound(false)->getForm()); + + $mapper->expects($this->once()) + ->method('mapFormsToData') + ->with(array('firstName' => $child1, 'lastName' => $child2), 'bar') + ->will($this->returnCallback(function ($children, $bar) use ($test) { + $test->assertEquals('Bernhard', $children['firstName']->getData()); + $test->assertEquals('Schussek', $children['lastName']->getData()); + })); + + $form->bind(array( + 'firstName' => 'Bernhard', + 'lastName' => 'Schussek', + )); + } + + /* + * https://github.com/symfony/symfony/issues/4480 + */ + public function testBindRestoresViewDataIfCompoundAndEmpty() + { + $mapper = $this->getDataMapper(); + $object = new \stdClass(); + $form = $this->getBuilder('name', null, 'stdClass') + ->setCompound(true) + ->setDataMapper($mapper) + ->setData($object) + ->getForm(); + + $form->bind(array()); + + $this->assertSame($object, $form->getData()); + } + + public function testBindMapsBoundChildrenOntoEmptyData() + { + $mapper = $this->getDataMapper(); + $object = new \stdClass(); + $form = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($mapper) + ->setEmptyData($object) + ->setData(null) + ->getForm(); + + $form->add($child = $this->getBuilder('name')->setCompound(false)->getForm()); + + $mapper->expects($this->once()) + ->method('mapFormsToData') + ->with(array('name' => $child), $object); + + $form->bind(array( + 'name' => 'Bernhard', + )); + } + + public function requestMethodProvider() + { + return array( + array('POST'), + array('PUT'), + array('DELETE'), + array('PATCH'), + ); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindPostOrPutRequest($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $path = tempnam(sys_get_temp_dir(), 'sf2'); + touch($path); + + $values = array( + 'author' => array( + 'name' => 'Bernhard', + 'image' => array('filename' => 'foobar.png'), + ), + ); + + $files = array( + 'author' => array( + 'error' => array('image' => UPLOAD_ERR_OK), + 'name' => array('image' => 'upload.png'), + 'size' => array('image' => 123), + 'tmp_name' => array('image' => $path), + 'type' => array('image' => 'image/png'), + ), + ); + + $request = new Request(array(), $values, array(), array(), $files, array( + 'REQUEST_METHOD' => $method, + )); + + $form = $this->getBuilder('author') + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + $form->add($this->getBuilder('name')->getForm()); + $form->add($this->getBuilder('image')->getForm()); + + $form->bindRequest($request); + + $file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK); + + $this->assertEquals('Bernhard', $form['name']->getData()); + $this->assertEquals($file, $form['image']->getData()); + + unlink($path); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindPostOrPutRequestWithEmptyRootFormName($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $path = tempnam(sys_get_temp_dir(), 'sf2'); + touch($path); + + $values = array( + 'name' => 'Bernhard', + 'extra' => 'data', + ); + + $files = array( + 'image' => array( + 'error' => UPLOAD_ERR_OK, + 'name' => 'upload.png', + 'size' => 123, + 'tmp_name' => $path, + 'type' => 'image/png', + ), + ); + + $request = new Request(array(), $values, array(), array(), $files, array( + 'REQUEST_METHOD' => $method, + )); + + $form = $this->getBuilder('') + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + $form->add($this->getBuilder('name')->getForm()); + $form->add($this->getBuilder('image')->getForm()); + + $form->bindRequest($request); + + $file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK); + + $this->assertEquals('Bernhard', $form['name']->getData()); + $this->assertEquals($file, $form['image']->getData()); + $this->assertEquals(array('extra' => 'data'), $form->getExtraData()); + + unlink($path); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindPostOrPutRequestWithSingleChildForm($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $path = tempnam(sys_get_temp_dir(), 'sf2'); + touch($path); + + $files = array( + 'image' => array( + 'error' => UPLOAD_ERR_OK, + 'name' => 'upload.png', + 'size' => 123, + 'tmp_name' => $path, + 'type' => 'image/png', + ), + ); + + $request = new Request(array(), array(), array(), array(), $files, array( + 'REQUEST_METHOD' => $method, + )); + + $form = $this->getBuilder('image') + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + + $form->bindRequest($request); + + $file = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK); + + $this->assertEquals($file, $form->getData()); + + unlink($path); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindPostOrPutRequestWithSingleChildFormUploadedFile($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $path = tempnam(sys_get_temp_dir(), 'sf2'); + touch($path); + + $values = array( + 'name' => 'Bernhard', + ); + + $request = new Request(array(), $values, array(), array(), array(), array( + 'REQUEST_METHOD' => $method, + )); + + $form = $this->getBuilder('name') + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + + $form->bindRequest($request); + + $this->assertEquals('Bernhard', $form->getData()); + + unlink($path); + } + + public function testBindGetRequest() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $values = array( + 'author' => array( + 'firstName' => 'Bernhard', + 'lastName' => 'Schussek', + ), + ); + + $request = new Request($values, array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $form = $this->getBuilder('author') + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + $form->add($this->getBuilder('firstName')->getForm()); + $form->add($this->getBuilder('lastName')->getForm()); + + $form->bindRequest($request); + + $this->assertEquals('Bernhard', $form['firstName']->getData()); + $this->assertEquals('Schussek', $form['lastName']->getData()); + } + + public function testBindGetRequestWithEmptyRootFormName() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $values = array( + 'firstName' => 'Bernhard', + 'lastName' => 'Schussek', + 'extra' => 'data' + ); + + $request = new Request($values, array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $form = $this->getBuilder('') + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->addEventSubscriber(new BindRequestListener()) + ->getForm(); + $form->add($this->getBuilder('firstName')->getForm()); + $form->add($this->getBuilder('lastName')->getForm()); + + $form->bindRequest($request); + + $this->assertEquals('Bernhard', $form['firstName']->getData()); + $this->assertEquals('Schussek', $form['lastName']->getData()); + $this->assertEquals(array('extra' => 'data'), $form->getExtraData()); + } + + public function testGetErrorsAsStringDeep() + { + $parent = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + + $this->form->addError(new FormError('Error!')); + + $parent->add($this->form); + $parent->add($this->getBuilder('foo')->getForm()); + + $this->assertEquals("name:\n ERROR: Error!\nfoo:\n No errors\n", $parent->getErrorsAsString()); + } + + protected function createForm() + { + return $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php new file mode 100755 index 0000000000..63eae9bf7f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php @@ -0,0 +1,200 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class ChoiceListTest extends \PHPUnit_Framework_TestCase +{ + private $obj1; + + private $obj2; + + private $obj3; + + private $obj4; + + private $list; + + protected function setUp() + { + parent::setUp(); + + $this->obj1 = new \stdClass(); + $this->obj2 = new \stdClass(); + $this->obj3 = new \stdClass(); + $this->obj4 = new \stdClass(); + + $this->list = new ChoiceList( + array( + 'Group 1' => array($this->obj1, $this->obj2), + 'Group 2' => array($this->obj3, $this->obj4), + ), + array( + 'Group 1' => array('A', 'B'), + 'Group 2' => array('C', 'D'), + ), + array($this->obj2, $this->obj3) + ); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->obj1 = null; + $this->obj2 = null; + $this->obj3 = null; + $this->obj4 = null; + $this->list = null; + } + + public function testInitArray() + { + $this->list = new ChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4), + array('A', 'B', 'C', 'D'), + array($this->obj2) + ); + + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); + $this->assertEquals(array(1 => new ChoiceView($this->obj2, '1', 'B')), $this->list->getPreferredViews()); + $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews()); + } + + /** + * Necessary for interoperability with MongoDB cursors or ORM relations as + * choices parameter. A choice itself that is an object implementing \Traversable + * is not treated as hierarchical structure, but as-is. + */ + public function testInitNestedTraversable() + { + $traversableChoice = new \ArrayIterator(array($this->obj3, $this->obj4)); + + $this->list = new ChoiceList( + new \ArrayIterator(array( + 'Group' => array($this->obj1, $this->obj2), + 'Not a Group' => $traversableChoice + )), + array( + 'Group' => array('A', 'B'), + 'Not a Group' => 'C', + ), + array($this->obj2) + ); + + $this->assertSame(array($this->obj1, $this->obj2, $traversableChoice), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2'), $this->list->getValues()); + $this->assertEquals(array( + 'Group' => array(1 => new ChoiceView($this->obj2, '1', 'B')) + ), $this->list->getPreferredViews()); + $this->assertEquals(array( + 'Group' => array(0 => new ChoiceView($this->obj1, '0', 'A')), + 2 => new ChoiceView($traversableChoice, '2', 'C') + ), $this->list->getRemainingViews()); + } + + public function testInitNestedArray() + { + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); + $this->assertEquals(array( + 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + ), $this->list->getPreferredViews()); + $this->assertEquals(array( + 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), + 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')) + ), $this->list->getRemainingViews()); + } + + public function testGetIndicesForChoices() + { + $choices = array($this->obj2, $this->obj3); + $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); + } + + public function testGetIndicesForChoicesIgnoresNonExistingChoices() + { + $choices = array($this->obj2, $this->obj3, 'foobar'); + $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); + } + + public function testGetIndicesForValues() + { + // values and indices are always the same + $values = array('1', '2'); + $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); + } + + public function testGetIndicesForValuesIgnoresNonExistingValues() + { + $values = array('1', '2', '5'); + $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); + } + + public function testGetChoicesForValues() + { + $values = array('1', '2'); + $this->assertSame(array($this->obj2, $this->obj3), $this->list->getChoicesForValues($values)); + } + + public function testGetChoicesForValuesCorrectOrderingOfResult() + { + $values = array('2', '1'); + $this->assertSame(array($this->obj3, $this->obj2), $this->list->getChoicesForValues($values)); + } + + public function testGetChoicesForValuesIgnoresNonExistingValues() + { + $values = array('1', '2', '5'); + $this->assertSame(array($this->obj2, $this->obj3), $this->list->getChoicesForValues($values)); + } + + public function testGetValuesForChoices() + { + $choices = array($this->obj2, $this->obj3); + $this->assertSame(array('1', '2'), $this->list->getValuesForChoices($choices)); + } + + public function testGetValuesForChoicesIgnoresNonExistingChoices() + { + $choices = array($this->obj2, $this->obj3, 'foobar'); + $this->assertSame(array('1', '2'), $this->list->getValuesForChoices($choices)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testNonMatchingLabels() + { + $this->list = new ChoiceList( + array($this->obj1, $this->obj2), + array('A') + ); + } + + public function testLabelsContainingNull() + { + $this->list = new ChoiceList( + array($this->obj1, $this->obj2), + array('A', null) + ); + + $this->assertEquals( + array(0 => new ChoiceView($this->obj1, '0', 'A'), 1 => new ChoiceView($this->obj2, '1', null)), + $this->list->getRemainingViews() + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php new file mode 100755 index 0000000000..628ac60ad8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; +use Symfony\Component\Form\Extension\Core\ChoiceList\LazyChoiceList; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class LazyChoiceListTest extends \PHPUnit_Framework_TestCase +{ + private $list; + + protected function setUp() + { + parent::setUp(); + + $this->list = new LazyChoiceListTest_Impl(new SimpleChoiceList(array( + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + ), array('b'))); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->list = null; + } + + public function testGetChoices() + { + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getChoices()); + } + + public function testGetValues() + { + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getValues()); + } + + public function testGetPreferredViews() + { + $this->assertEquals(array(1 => new ChoiceView('b', 'b', 'B')), $this->list->getPreferredViews()); + } + + public function testGetRemainingViews() + { + $this->assertEquals(array(0 => new ChoiceView('a', 'a', 'A'), 2 => new ChoiceView('c', 'c', 'C')), $this->list->getRemainingViews()); + } + + public function testGetIndicesForChoices() + { + $choices = array('b', 'c'); + $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); + } + + public function testGetIndicesForValues() + { + $values = array('b', 'c'); + $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); + } + + public function testGetChoicesForValues() + { + $values = array('b', 'c'); + $this->assertSame(array('b', 'c'), $this->list->getChoicesForValues($values)); + } + + public function testGetValuesForChoices() + { + $choices = array('b', 'c'); + $this->assertSame(array('b', 'c'), $this->list->getValuesForChoices($choices)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\FormException + */ + public function testLoadChoiceListShouldReturnChoiceList() + { + $list = new LazyChoiceListTest_InvalidImpl(); + + $list->getChoices(); + } +} + +class LazyChoiceListTest_Impl extends LazyChoiceList +{ + private $choiceList; + + public function __construct($choiceList) + { + $this->choiceList = $choiceList; + } + + protected function loadChoiceList() + { + return $this->choiceList; + } +} + +class LazyChoiceListTest_InvalidImpl extends LazyChoiceList +{ + protected function loadChoiceList() + { + return new \stdClass(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php new file mode 100755 index 0000000000..12f22d2d1f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php @@ -0,0 +1,209 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class ObjectChoiceListTest_EntityWithToString +{ + private $property; + + public function __construct($property) + { + $this->property = $property; + } + + public function __toString() + { + return $this->property; + } +} + +class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase +{ + private $obj1; + + private $obj2; + + private $obj3; + + private $obj4; + + private $list; + + protected function setUp() + { + parent::setUp(); + + $this->obj1 = (object) array('name' => 'A'); + $this->obj2 = (object) array('name' => 'B'); + $this->obj3 = (object) array('name' => 'C'); + $this->obj4 = (object) array('name' => 'D'); + + $this->list = new ObjectChoiceList( + array( + 'Group 1' => array($this->obj1, $this->obj2), + 'Group 2' => array($this->obj3, $this->obj4), + ), + 'name', + array($this->obj2, $this->obj3) + ); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->obj1 = null; + $this->obj2 = null; + $this->obj3 = null; + $this->obj4 = null; + $this->list = null; + } + + public function testInitArray() + { + $this->list = new ObjectChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4), + 'name', + array($this->obj2) + ); + + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); + $this->assertEquals(array(1 => new ChoiceView($this->obj2, '1', 'B')), $this->list->getPreferredViews()); + $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews()); + } + + public function testInitNestedArray() + { + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); + $this->assertEquals(array( + 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + ), $this->list->getPreferredViews()); + $this->assertEquals(array( + 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), + 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')) + ), $this->list->getRemainingViews()); + } + + public function testInitArrayWithGroupPath() + { + $this->obj1 = (object) array('name' => 'A', 'category' => 'Group 1'); + $this->obj2 = (object) array('name' => 'B', 'category' => 'Group 1'); + $this->obj3 = (object) array('name' => 'C', 'category' => 'Group 2'); + $this->obj4 = (object) array('name' => 'D', 'category' => 'Group 2'); + + // Objects with NULL groups are not grouped + $obj5 = (object) array('name' => 'E', 'category' => null); + + // Objects without the group property are not grouped either + // see https://github.com/symfony/symfony/commit/d9b7abb7c7a0f28e0ce970afc5e305dce5dccddf + $obj6 = (object) array('name' => 'F'); + + $this->list = new ObjectChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4, $obj5, $obj6), + 'name', + array($this->obj2, $this->obj3), + 'category' + ); + + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4, $obj5, $obj6), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3', '4', '5'), $this->list->getValues()); + $this->assertEquals(array( + 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + ), $this->list->getPreferredViews()); + $this->assertEquals(array( + 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), + 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')), + 4 => new ChoiceView($obj5, '4', 'E'), + 5 => new ChoiceView($obj6, '5', 'F'), + ), $this->list->getRemainingViews()); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInitArrayWithGroupPathThrowsExceptionIfNestedArray() + { + $this->obj1 = (object) array('name' => 'A', 'category' => 'Group 1'); + $this->obj2 = (object) array('name' => 'B', 'category' => 'Group 1'); + $this->obj3 = (object) array('name' => 'C', 'category' => 'Group 2'); + $this->obj4 = (object) array('name' => 'D', 'category' => 'Group 2'); + + new ObjectChoiceList( + array( + 'Group 1' => array($this->obj1, $this->obj2), + 'Group 2' => array($this->obj3, $this->obj4), + ), + 'name', + array($this->obj2, $this->obj3), + 'category' + ); + } + + public function testInitArrayWithValuePath() + { + $this->obj1 = (object) array('name' => 'A', 'id' => 10); + $this->obj2 = (object) array('name' => 'B', 'id' => 20); + $this->obj3 = (object) array('name' => 'C', 'id' => 30); + $this->obj4 = (object) array('name' => 'D', 'id' => 40); + + $this->list = new ObjectChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4), + 'name', + array($this->obj2, $this->obj3), + null, + 'id' + ); + + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('10', '20', '30', '40'), $this->list->getValues()); + $this->assertEquals(array(1 => new ChoiceView($this->obj2, '20', 'B'), 2 => new ChoiceView($this->obj3, '30', 'C')), $this->list->getPreferredViews()); + $this->assertEquals(array(0 => new ChoiceView($this->obj1, '10', 'A'), 3 => new ChoiceView($this->obj4, '40', 'D')), $this->list->getRemainingViews()); + } + + public function testInitArrayUsesToString() + { + $this->obj1 = new ObjectChoiceListTest_EntityWithToString('A'); + $this->obj2 = new ObjectChoiceListTest_EntityWithToString('B'); + $this->obj3 = new ObjectChoiceListTest_EntityWithToString('C'); + $this->obj4 = new ObjectChoiceListTest_EntityWithToString('D'); + + $this->list = new ObjectChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4) + ); + + $this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices()); + $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); + $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 1 => new ChoiceView($this->obj2, '1', 'B'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\FormException + */ + public function testInitArrayThrowsExceptionIfToStringNotFound() + { + $this->obj1 = new ObjectChoiceListTest_EntityWithToString('A'); + $this->obj2 = new ObjectChoiceListTest_EntityWithToString('B'); + $this->obj3 = (object) array('name' => 'C'); + $this->obj4 = new ObjectChoiceListTest_EntityWithToString('D'); + + new ObjectChoiceList( + array($this->obj1, $this->obj2, $this->obj3, $this->obj4) + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php new file mode 100755 index 0000000000..69d27a18fd --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php @@ -0,0 +1,188 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\ChoiceList; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList; +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class SimpleChoiceListTest extends \PHPUnit_Framework_TestCase +{ + private $list; + + private $numericList; + + protected function setUp() + { + parent::setUp(); + + $choices = array( + 'Group 1' => array('a' => 'A', 'b' => 'B'), + 'Group 2' => array('c' => 'C', 'd' => 'D'), + ); + $numericChoices = array( + 'Group 1' => array(0 => 'A', 1 => 'B'), + 'Group 2' => array(2 => 'C', 3 => 'D'), + ); + + $this->list = new SimpleChoiceList($choices, array('b', 'c')); + + // Use COPY_CHOICE strategy to test for the various associated problems + $this->numericList = new SimpleChoiceList($numericChoices, array(1, 2)); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->list = null; + $this->numericList = null; + } + + public function testInitArray() + { + $choices = array('a' => 'A', 'b' => 'B', 'c' => 'C'); + $this->list = new SimpleChoiceList($choices, array('b')); + + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getChoices()); + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getValues()); + $this->assertEquals(array(1 => new ChoiceView('b', 'b', 'B')), $this->list->getPreferredViews()); + $this->assertEquals(array(0 => new ChoiceView('a', 'a', 'A'), 2 => new ChoiceView('c', 'c', 'C')), $this->list->getRemainingViews()); + } + + public function testInitNestedArray() + { + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $this->list->getChoices()); + $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $this->list->getValues()); + $this->assertEquals(array( + 'Group 1' => array(1 => new ChoiceView('b', 'b', 'B')), + 'Group 2' => array(2 => new ChoiceView('c', 'c', 'C')) + ), $this->list->getPreferredViews()); + $this->assertEquals(array( + 'Group 1' => array(0 => new ChoiceView('a', 'a', 'A')), + 'Group 2' => array(3 => new ChoiceView('d', 'd', 'D')) + ), $this->list->getRemainingViews()); + } + + public function testGetIndicesForChoices() + { + $choices = array('b', 'c'); + $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); + } + + public function testGetIndicesForChoicesIgnoresNonExistingChoices() + { + $choices = array('b', 'c', 'foobar'); + $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); + } + + public function testGetIndicesForChoicesDealsWithNumericChoices() + { + // Pass choices as strings although they are integers + $choices = array('0', '1'); + $this->assertSame(array(0, 1), $this->numericList->getIndicesForChoices($choices)); + } + + public function testGetIndicesForValues() + { + $values = array('b', 'c'); + $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); + } + + public function testGetIndicesForValuesIgnoresNonExistingValues() + { + $values = array('b', 'c', '100'); + $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); + } + + public function testGetIndicesForValuesDealsWithNumericValues() + { + // Pass values as strings although they are integers + $values = array('0', '1'); + $this->assertSame(array(0, 1), $this->numericList->getIndicesForValues($values)); + } + + public function testGetChoicesForValues() + { + $values = array('b', 'c'); + $this->assertSame(array('b', 'c'), $this->list->getChoicesForValues($values)); + } + + public function testGetChoicesForValuesIgnoresNonExistingValues() + { + $values = array('b', 'c', '100'); + $this->assertSame(array('b', 'c'), $this->list->getChoicesForValues($values)); + } + + public function testGetChoicesForValuesDealsWithNumericValues() + { + // Pass values as strings although they are integers + $values = array('0', '1'); + $this->assertSame(array(0, 1), $this->numericList->getChoicesForValues($values)); + } + + public function testGetValuesForChoices() + { + $choices = array('b', 'c'); + $this->assertSame(array('b', 'c'), $this->list->getValuesForChoices($choices)); + } + + public function testGetValuesForChoicesIgnoresNonExistingValues() + { + $choices = array('b', 'c', 'foobar'); + $this->assertSame(array('b', 'c'), $this->list->getValuesForChoices($choices)); + } + + public function testGetValuesForChoicesDealsWithNumericValues() + { + // Pass values as strings although they are integers + $values = array('0', '1'); + + $this->assertSame(array('0', '1'), $this->numericList->getValuesForChoices($values)); + } + + /** + * @dataProvider dirtyValuesProvider + */ + public function testGetValuesForChoicesDealsWithDirtyValues($choice, $value) + { + $choices = array( + '0' => 'Zero', + '1' => 'One', + '' => 'Empty', + '1.23' => 'Float', + 'foo' => 'Foo', + 'foo10' => 'Foo 10', + ); + + // use COPY_CHOICE strategy to test the problems + $this->list = new SimpleChoiceList($choices, array()); + + $this->assertSame(array($value), $this->list->getValuesForChoices(array($choice))); + } + + public function dirtyValuesProvider() + { + return array( + array(0, '0'), + array('0', '0'), + array('1', '1'), + array(false, '0'), + array(true, '1'), + array('', ''), + array(null, ''), + array('1.23', '1.23'), + array('foo', 'foo'), + array('foo10', 'foo10'), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php new file mode 100755 index 0000000000..05d2fe1577 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php @@ -0,0 +1,376 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataMapper; + +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormConfigBuilder; +use Symfony\Component\Form\FormConfigInterface; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper; + +class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var PropertyPathMapper + */ + private $mapper; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dispatcher; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\Event')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->mapper = new PropertyPathMapper(); + } + + /** + * @param $path + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getPropertyPath($path) + { + return $this->getMockBuilder('Symfony\Component\Form\Util\PropertyPath') + ->setConstructorArgs(array($path)) + ->setMethods(array('getValue', 'setValue')) + ->getMock(); + } + + /** + * @param FormConfigInterface $config + * @param Boolean $synchronized + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getForm(FormConfigInterface $config, $synchronized = true) + { + $form = $this->getMockBuilder('Symfony\Component\Form\Form') + ->setConstructorArgs(array($config)) + ->setMethods(array('isSynchronized')) + ->getMock(); + + $form->expects($this->any()) + ->method('isSynchronized') + ->will($this->returnValue($synchronized)); + + return $form; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + public function testMapDataToFormsPassesObjectRefIfByReference() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->once()) + ->method('getValue') + ->with($car) + ->will($this->returnValue($engine)); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $form = $this->getForm($config); + + $this->mapper->mapDataToForms($car, array($form)); + + // Can't use isIdentical() above because mocks always clone their + // arguments which can't be disabled in PHPUnit 3.6 + $this->assertSame($engine, $form->getData()); + } + + public function testMapDataToFormsPassesObjectCloneIfNotByReference() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->once()) + ->method('getValue') + ->with($car) + ->will($this->returnValue($engine)); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(false); + $config->setPropertyPath($propertyPath); + $form = $this->getForm($config); + + $this->mapper->mapDataToForms($car, array($form)); + + $this->assertNotSame($engine, $form->getData()); + $this->assertEquals($engine, $form->getData()); + } + + public function testMapDataToFormsIgnoresEmptyPropertyPath() + { + $car = new \stdClass(); + + $config = new FormConfigBuilder(null, '\stdClass', $this->dispatcher); + $config->setByReference(true); + $form = $this->getForm($config); + + $this->assertNull($form->getPropertyPath()); + + $this->mapper->mapDataToForms($car, array($form)); + + $this->assertNull($form->getData()); + } + + public function testMapDataToFormsIgnoresUnmapped() + { + $car = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('getValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setMapped(false); + $config->setPropertyPath($propertyPath); + $form = $this->getForm($config); + + $this->mapper->mapDataToForms($car, array($form)); + + $this->assertNull($form->getData()); + } + + public function testMapDataToFormsIgnoresEmptyData() + { + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('getValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $form = $this->getForm($config); + + $this->mapper->mapDataToForms(null, array($form)); + + $this->assertNull($form->getData()); + } + + public function testMapDataToFormsSkipsVirtualForms() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->once()) + ->method('getValue') + ->with($car) + ->will($this->returnValue($engine)); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setVirtual(true); + $config->setCompound(true); + $config->setDataMapper($this->getDataMapper()); + $form = $this->getForm($config); + + $config = new FormConfigBuilder('engine', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $child = $this->getForm($config); + + $form->add($child); + + $this->mapper->mapDataToForms($car, array($form)); + + $this->assertNull($form->getData()); + $this->assertSame($engine, $child->getData()); + } + + public function testMapFormsToDataWritesBackIfNotByReference() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->once()) + ->method('setValue') + ->with($car, $engine); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(false); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataWritesBackIfByReferenceButNoReference() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->once()) + ->method('setValue') + ->with($car, $engine); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataWritesBackIfByReferenceAndReference() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + // $car already contains the reference of $engine + $propertyPath->expects($this->once()) + ->method('getValue') + ->with($car) + ->will($this->returnValue($engine)); + + $propertyPath->expects($this->never()) + ->method('setValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataIgnoresUnmapped() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('setValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $config->setMapped(false); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataIgnoresEmptyData() + { + $car = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('setValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData(null); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataIgnoresUnsynchronized() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('setValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $form = $this->getForm($config, false); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataIgnoresDisabled() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $propertyPath = $this->getPropertyPath('engine'); + + $propertyPath->expects($this->never()) + ->method('setValue'); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($propertyPath); + $config->setData($engine); + $config->setDisabled(true); + $form = $this->getForm($config); + + $this->mapper->mapFormsToData(array($form), $car); + } + + public function testMapFormsToDataSkipsVirtualForms() + { + $car = new \stdClass(); + $engine = new \stdClass(); + $parentPath = $this->getPropertyPath('name'); + $childPath = $this->getPropertyPath('engine'); + + $parentPath->expects($this->never()) + ->method('getValue'); + $parentPath->expects($this->never()) + ->method('setValue'); + + $childPath->expects($this->once()) + ->method('setValue') + ->with($car, $engine); + + $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher); + $config->setPropertyPath($parentPath); + $config->setVirtual(true); + $config->setCompound(true); + $config->setDataMapper($this->getDataMapper()); + $form = $this->getForm($config); + + $config = new FormConfigBuilder('engine', '\stdClass', $this->dispatcher); + $config->setByReference(true); + $config->setPropertyPath($childPath); + $config->setData($engine); + $child = $this->getForm($config); + + $form->add($child); + + $this->mapper->mapFormsToData(array($form), $car); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php new file mode 100755 index 0000000000..0ac8f44bae --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php @@ -0,0 +1,149 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\ArrayToPartsTransformer; + +class ArrayToPartsTransformerTest extends \PHPUnit_Framework_TestCase +{ + private $transformer; + + protected function setUp() + { + $this->transformer = new ArrayToPartsTransformer(array( + 'first' => array('a', 'b', 'c'), + 'second' => array('d', 'e', 'f'), + )); + } + + protected function tearDown() + { + $this->transformer = null; + } + + public function testTransform() + { + $input = array( + 'a' => '1', + 'b' => '2', + 'c' => '3', + 'd' => '4', + 'e' => '5', + 'f' => '6', + ); + + $output = array( + 'first' => array( + 'a' => '1', + 'b' => '2', + 'c' => '3', + ), + 'second' => array( + 'd' => '4', + 'e' => '5', + 'f' => '6', + ), + ); + + $this->assertSame($output, $this->transformer->transform($input)); + } + + public function testTransform_empty() + { + $output = array( + 'first' => null, + 'second' => null, + ); + + $this->assertSame($output, $this->transformer->transform(null)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformRequiresArray() + { + $this->transformer->transform('12345'); + } + + public function testReverseTransform() + { + $input = array( + 'first' => array( + 'a' => '1', + 'b' => '2', + 'c' => '3', + ), + 'second' => array( + 'd' => '4', + 'e' => '5', + 'f' => '6', + ), + ); + + $output = array( + 'a' => '1', + 'b' => '2', + 'c' => '3', + 'd' => '4', + 'e' => '5', + 'f' => '6', + ); + + $this->assertSame($output, $this->transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyEmpty() + { + $input = array( + 'first' => '', + 'second' => '', + ); + + $this->assertNull($this->transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyNull() + { + $input = array( + 'first' => null, + 'second' => null, + ); + + $this->assertNull($this->transformer->reverseTransform($input)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyNull() + { + $input = array( + 'first' => array( + 'a' => '1', + 'b' => '2', + 'c' => '3', + ), + 'second' => null, + ); + + $this->transformer->reverseTransform($input); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformRequiresArray() + { + $this->transformer->reverseTransform('12345'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BooleanToStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BooleanToStringTransformerTest.php new file mode 100755 index 0000000000..cabdf76f2b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BooleanToStringTransformerTest.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\BooleanToStringTransformer; + +class BooleanToStringTransformerTest extends \PHPUnit_Framework_TestCase +{ + const TRUE_VALUE = '1'; + + protected $transformer; + + protected function setUp() + { + $this->transformer = new BooleanToStringTransformer(self::TRUE_VALUE); + } + + protected function tearDown() + { + $this->transformer = null; + } + + public function testTransform() + { + $this->assertEquals(self::TRUE_VALUE, $this->transformer->transform(true)); + $this->assertNull($this->transformer->transform(false)); + $this->assertNull($this->transformer->transform(null)); + } + + public function testTransformExpectsBoolean() + { + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $this->transformer->transform('1'); + } + + public function testReverseTransformExpectsString() + { + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $this->transformer->reverseTransform(1); + } + + public function testReverseTransform() + { + $this->assertTrue($this->transformer->reverseTransform(self::TRUE_VALUE)); + $this->assertTrue($this->transformer->reverseTransform('foobar')); + $this->assertTrue($this->transformer->reverseTransform('')); + $this->assertFalse($this->transformer->reverseTransform(null)); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoiceToValueTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoiceToValueTransformerTest.php new file mode 100755 index 0000000000..844e1ff356 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoiceToValueTransformerTest.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer; + +class ChoiceToValueTransformerTest extends \PHPUnit_Framework_TestCase +{ + protected $transformer; + + protected function setUp() + { + $list = new SimpleChoiceList(array('' => 'A', 0 => 'B', 1 => 'C')); + $this->transformer = new ChoiceToValueTransformer($list); + } + + protected function tearDown() + { + $this->transformer = null; + } + + public function transformProvider() + { + return array( + // more extensive test set can be found in FormUtilTest + array(0, '0'), + array(false, '0'), + array('', ''), + ); + } + + /** + * @dataProvider transformProvider + */ + public function testTransform($in, $out) + { + $this->assertSame($out, $this->transformer->transform($in)); + } + + public function reverseTransformProvider() + { + return array( + // values are expected to be valid choice keys already and stay + // the same + array('0', 0), + array('', null), + array(null, null), + ); + } + + /** + * @dataProvider reverseTransformProvider + */ + public function testReverseTransform($in, $out) + { + $this->assertSame($out, $this->transformer->reverseTransform($in)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformExpectsScalar() + { + $this->transformer->reverseTransform(array()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoicesToValuesTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoicesToValuesTransformerTest.php new file mode 100755 index 0000000000..215b89baad --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ChoicesToValuesTransformerTest.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; + +use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer; + +class ChoicesToValuesTransformerTest extends \PHPUnit_Framework_TestCase +{ + protected $transformer; + + protected function setUp() + { + $list = new SimpleChoiceList(array(0 => 'A', 1 => 'B', 2 => 'C')); + $this->transformer = new ChoicesToValuesTransformer($list); + } + + protected function tearDown() + { + $this->transformer = null; + } + + public function testTransform() + { + // Value strategy in SimpleChoiceList is to copy and convert to string + $in = array(0, 1, 2); + $out = array('0', '1', '2'); + + $this->assertSame($out, $this->transformer->transform($in)); + } + + public function testTransformNull() + { + $this->assertSame(array(), $this->transformer->transform(null)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformExpectsArray() + { + $this->transformer->transform('foobar'); + } + + public function testReverseTransform() + { + // values are expected to be valid choices and stay the same + $in = array('0', '1', '2'); + $out = array(0, 1, 2); + + $this->assertSame($out, $this->transformer->reverseTransform($in)); + } + + public function testReverseTransformNull() + { + $this->assertSame(array(), $this->transformer->reverseTransform(null)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformExpectsArray() + { + $this->transformer->reverseTransform('foobar'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php new file mode 100755 index 0000000000..2ee2f22db0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DataTransformerChainTest.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DataTransformerChain; + +class DataTransformerChainTest extends \PHPUnit_Framework_TestCase +{ + public function testTransform() + { + $transformer1 = $this->getMock('Symfony\Component\Form\DataTransformerInterface'); + $transformer1->expects($this->once()) + ->method('transform') + ->with($this->identicalTo('foo')) + ->will($this->returnValue('bar')); + $transformer2 = $this->getMock('Symfony\Component\Form\DataTransformerInterface'); + $transformer2->expects($this->once()) + ->method('transform') + ->with($this->identicalTo('bar')) + ->will($this->returnValue('baz')); + + $chain = new DataTransformerChain(array($transformer1, $transformer2)); + + $this->assertEquals('baz', $chain->transform('foo')); + } + + public function testReverseTransform() + { + $transformer2 = $this->getMock('Symfony\Component\Form\DataTransformerInterface'); + $transformer2->expects($this->once()) + ->method('reverseTransform') + ->with($this->identicalTo('foo')) + ->will($this->returnValue('bar')); + $transformer1 = $this->getMock('Symfony\Component\Form\DataTransformerInterface'); + $transformer1->expects($this->once()) + ->method('reverseTransform') + ->with($this->identicalTo('bar')) + ->will($this->returnValue('baz')); + + $chain = new DataTransformerChain(array($transformer1, $transformer2)); + + $this->assertEquals('baz', $chain->reverseTransform('foo')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeTestCase.php new file mode 100755 index 0000000000..e9596b3efb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeTestCase.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +abstract class DateTimeTestCase extends LocalizedTestCase +{ + public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual) + { + self::assertEquals($expected->format('c'), $actual->format('c')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php new file mode 100755 index 0000000000..82234d28ba --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php @@ -0,0 +1,512 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer; + +class DateTimeToArrayTransformerTest extends DateTimeTestCase +{ + public function testTransform() + { + $transformer = new DateTimeToArrayTransformer('UTC', 'UTC'); + + $input = new \DateTime('2010-02-03 04:05:06 UTC'); + + $output = array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + ); + + $this->assertSame($output, $transformer->transform($input)); + } + + public function testTransform_empty() + { + $transformer = new DateTimeToArrayTransformer(); + + $output = array( + 'year' => '', + 'month' => '', + 'day' => '', + 'hour' => '', + 'minute' => '', + 'second' => '', + ); + + $this->assertSame($output, $transformer->transform(null)); + } + + public function testTransform_empty_withFields() + { + $transformer = new DateTimeToArrayTransformer(null, null, array('year', 'minute', 'second')); + + $output = array( + 'year' => '', + 'minute' => '', + 'second' => '', + ); + + $this->assertSame($output, $transformer->transform(null)); + } + + public function testTransform_withFields() + { + $transformer = new DateTimeToArrayTransformer('UTC', 'UTC', array('year', 'month', 'minute', 'second')); + + $input = new \DateTime('2010-02-03 04:05:06 UTC'); + + $output = array( + 'year' => '2010', + 'month' => '2', + 'minute' => '5', + 'second' => '6', + ); + + $this->assertSame($output, $transformer->transform($input)); + } + + public function testTransform_withPadding() + { + $transformer = new DateTimeToArrayTransformer('UTC', 'UTC', null, true); + + $input = new \DateTime('2010-02-03 04:05:06 UTC'); + + $output = array( + 'year' => '2010', + 'month' => '02', + 'day' => '03', + 'hour' => '04', + 'minute' => '05', + 'second' => '06', + ); + + $this->assertSame($output, $transformer->transform($input)); + } + + public function testTransform_differentTimezones() + { + $transformer = new DateTimeToArrayTransformer('America/New_York', 'Asia/Hong_Kong'); + + $input = new \DateTime('2010-02-03 04:05:06 America/New_York'); + + $dateTime = new \DateTime('2010-02-03 04:05:06 America/New_York'); + $dateTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + $output = array( + 'year' => (string) (int) $dateTime->format('Y'), + 'month' => (string) (int) $dateTime->format('m'), + 'day' => (string) (int) $dateTime->format('d'), + 'hour' => (string) (int) $dateTime->format('H'), + 'minute' => (string) (int) $dateTime->format('i'), + 'second' => (string) (int) $dateTime->format('s'), + ); + + $this->assertSame($output, $transformer->transform($input)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformRequiresDateTime() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform('12345'); + } + + public function testReverseTransform() + { + $transformer = new DateTimeToArrayTransformer('UTC', 'UTC'); + + $input = array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + ); + + $output = new \DateTime('2010-02-03 04:05:06 UTC'); + + $this->assertDateTimeEquals($output, $transformer->reverseTransform($input)); + } + + public function testReverseTransformWithSomeZero() + { + $transformer = new DateTimeToArrayTransformer('UTC', 'UTC'); + + $input = array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '0', + 'second' => '0', + ); + + $output = new \DateTime('2010-02-03 04:00:00 UTC'); + + $this->assertDateTimeEquals($output, $transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyEmpty() + { + $transformer = new DateTimeToArrayTransformer(); + + $input = array( + 'year' => '', + 'month' => '', + 'day' => '', + 'hour' => '', + 'minute' => '', + 'second' => '', + ); + + $this->assertNull($transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyEmpty_subsetOfFields() + { + $transformer = new DateTimeToArrayTransformer(null, null, array('year', 'month', 'day')); + + $input = array( + 'year' => '', + 'month' => '', + 'day' => '', + ); + + $this->assertNull($transformer->reverseTransform($input)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_year() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_month() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_day() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_hour() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_minute() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyEmpty_second() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + )); + } + + public function testReverseTransform_null() + { + $transformer = new DateTimeToArrayTransformer(); + + $this->assertNull($transformer->reverseTransform(null)); + } + + public function testReverseTransform_differentTimezones() + { + $transformer = new DateTimeToArrayTransformer('America/New_York', 'Asia/Hong_Kong'); + + $input = array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + ); + + $output = new \DateTime('2010-02-03 04:05:06 Asia/Hong_Kong'); + $output->setTimezone(new \DateTimeZone('America/New_York')); + + $this->assertDateTimeEquals($output, $transformer->reverseTransform($input)); + } + + public function testReverseTransformToDifferentTimezone() + { + $transformer = new DateTimeToArrayTransformer('Asia/Hong_Kong', 'UTC'); + + $input = array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + ); + + $output = new \DateTime('2010-02-03 04:05:06 UTC'); + $output->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $this->assertDateTimeEquals($output, $transformer->reverseTransform($input)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformRequiresArray() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform('12345'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeYear() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '-1', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeMonth() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '-1', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeDay() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '-1', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeHour() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '-1', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeMinute() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '-1', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNegativeSecond() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '-1', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithInvalidMonth() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '13', + 'day' => '3', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithInvalidDay() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => '31', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithStringDay() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => '2', + 'day' => 'bazinga', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithStringMonth() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => '2010', + 'month' => 'bazinga', + 'day' => '31', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithStringYear() + { + $transformer = new DateTimeToArrayTransformer(); + $transformer->reverseTransform(array( + 'year' => 'bazinga', + 'month' => '2', + 'day' => '31', + 'hour' => '4', + 'minute' => '5', + 'second' => '6', + )); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php new file mode 100755 index 0000000000..f776f5e12d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php @@ -0,0 +1,276 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToLocalizedStringTransformer; + +class DateTimeToLocalizedStringTransformerTest extends DateTimeTestCase +{ + protected $dateTime; + protected $dateTimeWithoutSeconds; + + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + + $this->dateTime = new \DateTime('2010-02-03 04:05:06 UTC'); + $this->dateTimeWithoutSeconds = new \DateTime('2010-02-03 04:05:00 UTC'); + } + + protected function tearDown() + { + $this->dateTime = null; + $this->dateTimeWithoutSeconds = null; + } + + public static function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) + { + if ($expected instanceof \DateTime && $actual instanceof \DateTime) { + $expected = $expected->format('c'); + $actual = $actual->format('c'); + } + + parent::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase); + } + + public function dataProvider() + { + return array( + array(\IntlDateFormatter::SHORT, null, null, '03.02.10 04:05', '2010-02-03 04:05:00 UTC'), + array(\IntlDateFormatter::MEDIUM, null, null, '03.02.2010 04:05', '2010-02-03 04:05:00 UTC'), + array(\IntlDateFormatter::LONG, null, null, '03. Februar 2010 04:05', '2010-02-03 04:05:00 UTC'), + array(\IntlDateFormatter::FULL, null, null, 'Mittwoch, 03. Februar 2010 04:05', '2010-02-03 04:05:00 UTC'), + array(\IntlDateFormatter::SHORT, \IntlDateFormatter::NONE, null, '03.02.10', '2010-02-03 00:00:00 UTC'), + array(\IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, null, '03.02.2010', '2010-02-03 00:00:00 UTC'), + array(\IntlDateFormatter::LONG, \IntlDateFormatter::NONE, null, '03. Februar 2010', '2010-02-03 00:00:00 UTC'), + array(\IntlDateFormatter::FULL, \IntlDateFormatter::NONE, null, 'Mittwoch, 03. Februar 2010', '2010-02-03 00:00:00 UTC'), + array(null, \IntlDateFormatter::SHORT, null, '03.02.2010 04:05', '2010-02-03 04:05:00 UTC'), + array(null, \IntlDateFormatter::MEDIUM, null, '03.02.2010 04:05:06', '2010-02-03 04:05:06 UTC'), + array(null, \IntlDateFormatter::LONG, null, + '03.02.2010 04:05:06 GMT' . ($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''), + '2010-02-03 04:05:06 UTC'), + // see below for extra test case for time format FULL + array(\IntlDateFormatter::NONE, \IntlDateFormatter::SHORT, null, '04:05', '1970-01-01 04:05:00 UTC'), + array(\IntlDateFormatter::NONE, \IntlDateFormatter::MEDIUM, null, '04:05:06', '1970-01-01 04:05:06 UTC'), + array(\IntlDateFormatter::NONE, \IntlDateFormatter::LONG, null, + '04:05:06 GMT' . ($this->isLowerThanIcuVersion('4.8') ? '+00:00' : ''), + '1970-01-01 04:05:06 UTC'), + array(null, null, 'yyyy-MM-dd HH:mm:00', '2010-02-03 04:05:00', '2010-02-03 04:05:00 UTC'), + array(null, null, 'yyyy-MM-dd HH:mm', '2010-02-03 04:05', '2010-02-03 04:05:00 UTC'), + array(null, null, 'yyyy-MM-dd HH', '2010-02-03 04', '2010-02-03 04:00:00 UTC'), + array(null, null, 'yyyy-MM-dd', '2010-02-03', '2010-02-03 00:00:00 UTC'), + array(null, null, 'yyyy-MM', '2010-02', '2010-02-01 00:00:00 UTC'), + array(null, null, 'yyyy', '2010', '2010-01-01 00:00:00 UTC'), + array(null, null, 'dd-MM-yyyy', '03-02-2010', '2010-02-03 00:00:00 UTC'), + array(null, null, 'HH:mm:ss', '04:05:06', '1970-01-01 04:05:06 UTC'), + array(null, null, 'HH:mm:00', '04:05:00', '1970-01-01 04:05:00 UTC'), + array(null, null, 'HH:mm', '04:05', '1970-01-01 04:05:00 UTC'), + array(null, null, 'HH', '04', '1970-01-01 04:00:00 UTC'), + ); + } + + /** + * @dataProvider dataProvider + */ + public function testTransform($dateFormat, $timeFormat, $pattern, $output, $input) + { + $transformer = new DateTimeToLocalizedStringTransformer( + 'UTC', + 'UTC', + $dateFormat, + $timeFormat, + \IntlDateFormatter::GREGORIAN, + $pattern + ); + + $input = new \DateTime($input); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransformFullTime() + { + if ($this->isLowerThanIcuVersion('4.0')) { + $this->markTestSkipped('Please upgrade ICU version to 4.0+'); + } + + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', null, \IntlDateFormatter::FULL); + + $expected = $this->isLowerThanIcuVersion('4.8') ? '03.02.2010 04:05:06 GMT+00:00' : '03.02.2010 04:05:06 GMT'; + + $this->assertEquals($expected, $transformer->transform($this->dateTime)); + } + + public function testTransformToDifferentLocale() + { + \Locale::setDefault('en_US'); + + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC'); + + $this->assertEquals('Feb 3, 2010 4:05 AM', $transformer->transform($this->dateTime)); + } + + public function testTransform_empty() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + + $this->assertSame('', $transformer->transform(null)); + } + + public function testTransform_differentTimezones() + { + $transformer = new DateTimeToLocalizedStringTransformer('America/New_York', 'Asia/Hong_Kong'); + + $input = new \DateTime('2010-02-03 04:05:06 America/New_York'); + + $dateTime = clone $input; + $dateTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $this->assertEquals($dateTime->format('d.m.Y H:i'), $transformer->transform($input)); + } + + public function testTransform_differentPatterns() + { + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, \IntlDateFormatter::GREGORIAN, 'MM*yyyy*dd HH|mm|ss'); + + $this->assertEquals('02*2010*03 04|05|06', $transformer->transform($this->dateTime)); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformRequiresValidDateTime() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + $transformer->transform('2010-01-01'); + } + + public function testTransformWrapsIntlErrors() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + + // HOW TO REPRODUCE? + + //$this->setExpectedException('Symfony\Component\Form\Extension\Core\DataTransformer\Transdate_formationFailedException'); + + //$transformer->transform(1.5); + } + + /** + * @dataProvider dataProvider + */ + public function testReverseTransform($dateFormat, $timeFormat, $pattern, $input, $output) + { + $transformer = new DateTimeToLocalizedStringTransformer( + 'UTC', + 'UTC', + $dateFormat, + $timeFormat, + \IntlDateFormatter::GREGORIAN, + $pattern + ); + + $output = new \DateTime($output); + + $this->assertEquals($output, $transformer->reverseTransform($input)); + } + + public function testReverseTransformFullTime() + { + if ($this->isLowerThanIcuVersion('4.0')) { + $this->markTestSkipped('Please upgrade ICU version to 4.0+'); + } + + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', null, \IntlDateFormatter::FULL); + + $this->assertDateTimeEquals($this->dateTime, $transformer->reverseTransform('03.02.2010 04:05:06 GMT+00:00')); + } + + public function testReverseTransformFromDifferentLocale() + { + \Locale::setDefault('en_US'); + + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC'); + + $this->assertDateTimeEquals($this->dateTimeWithoutSeconds, $transformer->reverseTransform('Feb 3, 2010 04:05 AM')); + } + + public function testReverseTransform_differentTimezones() + { + $transformer = new DateTimeToLocalizedStringTransformer('America/New_York', 'Asia/Hong_Kong'); + + $dateTime = new \DateTime('2010-02-03 04:05:00 Asia/Hong_Kong'); + $dateTime->setTimezone(new \DateTimeZone('America/New_York')); + + $this->assertDateTimeEquals($dateTime, $transformer->reverseTransform('03.02.2010 04:05')); + } + + public function testReverseTransform_differentPatterns() + { + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, \IntlDateFormatter::GREGORIAN, 'MM*yyyy*dd HH|mm|ss'); + + $this->assertDateTimeEquals($this->dateTime, $transformer->reverseTransform('02*2010*03 04|05|06')); + } + + public function testReverseTransform_empty() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + + $this->assertNull($transformer->reverseTransform('')); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformRequiresString() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + $transformer->reverseTransform(12345); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWrapsIntlErrors() + { + $transformer = new DateTimeToLocalizedStringTransformer(); + $transformer->reverseTransform('12345'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testValidateDateFormatOption() + { + new DateTimeToLocalizedStringTransformer(null, null, 'foobar'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testValidateTimeFormatOption() + { + new DateTimeToLocalizedStringTransformer(null, null, null, 'foobar'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNonExistingDate() + { + $transformer = new DateTimeToLocalizedStringTransformer('UTC', 'UTC', \IntlDateFormatter::SHORT); + + $this->assertDateTimeEquals($this->dateTimeWithoutSeconds, $transformer->reverseTransform('31.04.10 04:05')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php new file mode 100755 index 0000000000..40195cb517 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToRfc3339Transformer; + +class DateTimeToRfc3339TransformerTest extends DateTimeTestCase +{ + protected $dateTime; + protected $dateTimeWithoutSeconds; + + protected function setUp() + { + parent::setUp(); + + $this->dateTime = new \DateTime('2010-02-03 04:05:06 UTC'); + $this->dateTimeWithoutSeconds = new \DateTime('2010-02-03 04:05:00 UTC'); + } + + protected function tearDown() + { + $this->dateTime = null; + $this->dateTimeWithoutSeconds = null; + } + + public static function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE) + { + if ($expected instanceof \DateTime && $actual instanceof \DateTime) { + $expected = $expected->format('c'); + $actual = $actual->format('c'); + } + + parent::assertEquals($expected, $actual, $message, $delta, $maxDepth, $canonicalize, $ignoreCase); + } + + public function allProvider() + { + return array( + array('UTC', 'UTC', '2010-02-03 04:05:06 UTC', '2010-02-03T04:05:06Z'), + array('UTC', 'UTC', null, ''), + array('America/New_York', 'Asia/Hong_Kong', '2010-02-03 04:05:06 America/New_York', '2010-02-03T17:05:06+08:00'), + array('America/New_York', 'Asia/Hong_Kong', null, ''), + array('UTC', 'Asia/Hong_Kong', '2010-02-03 04:05:06 UTC', '2010-02-03T12:05:06+08:00'), + array('America/New_York', 'UTC', '2010-02-03 04:05:06 America/New_York', '2010-02-03T09:05:06Z'), + ); + } + + public function transformProvider() + { + return $this->allProvider(); + } + + public function reverseTransformProvider() + { + return array_merge($this->allProvider(), array( + // format without seconds, as appears in some browsers + array('UTC', 'UTC', '2010-02-03 04:05:00 UTC', '2010-02-03T04:05Z'), + array('America/New_York', 'Asia/Hong_Kong', '2010-02-03 04:05:00 America/New_York', '2010-02-03T17:05+08:00'), + )); + } + + /** + * @dataProvider transformProvider + */ + public function testTransform($fromTz, $toTz, $from, $to) + { + $transformer = new DateTimeToRfc3339Transformer($fromTz, $toTz); + + $this->assertSame($to, $transformer->transform(null !== $from ? new \DateTime($from) : null)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformRequiresValidDateTime() + { + $transformer = new DateTimeToRfc3339Transformer(); + $transformer->transform('2010-01-01'); + } + + /** + * @dataProvider reverseTransformProvider + */ + public function testReverseTransform($toTz, $fromTz, $to, $from) + { + $transformer = new DateTimeToRfc3339Transformer($toTz, $fromTz); + + if (null !== $to) { + $this->assertDateTimeEquals(new \DateTime($to), $transformer->reverseTransform($from)); + } else { + $this->assertSame($to, $transformer->reverseTransform($from)); + } + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformRequiresString() + { + $transformer = new DateTimeToRfc3339Transformer(); + $transformer->reverseTransform(12345); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformWithNonExistingDate() + { + $transformer = new DateTimeToRfc3339Transformer('UTC', 'UTC'); + + var_dump($transformer->reverseTransform('2010-04-31T04:05Z')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php new file mode 100755 index 0000000000..804549fd80 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php @@ -0,0 +1,172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer; + +class DateTimeToStringTransformerTest extends DateTimeTestCase +{ + public function dataProvider() + { + return array( + array('Y-m-d H:i:s', '2010-02-03 16:05:06', '2010-02-03 16:05:06 UTC'), + array('Y-m-d H:i:00', '2010-02-03 16:05:00', '2010-02-03 16:05:00 UTC'), + array('Y-m-d H:i', '2010-02-03 16:05', '2010-02-03 16:05:00 UTC'), + array('Y-m-d H', '2010-02-03 16', '2010-02-03 16:00:00 UTC'), + array('Y-m-d', '2010-02-03', '2010-02-03 00:00:00 UTC'), + array('Y-m', '2010-02', '2010-02-01 00:00:00 UTC'), + array('Y', '2010', '2010-01-01 00:00:00 UTC'), + array('d-m-Y', '03-02-2010', '2010-02-03 00:00:00 UTC'), + array('H:i:s', '16:05:06', '1970-01-01 16:05:06 UTC'), + array('H:i:00', '16:05:00', '1970-01-01 16:05:00 UTC'), + array('H:i', '16:05', '1970-01-01 16:05:00 UTC'), + array('H', '16', '1970-01-01 16:00:00 UTC'), + + // different day representations + array('Y-m-j', '2010-02-3', '2010-02-03 00:00:00 UTC'), + array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC'), + array('z', '33', '1970-02-03 00:00:00 UTC'), + + // not bijective + //array('Y-m-D', '2010-02-Wed', '2010-02-03 00:00:00 UTC'), + //array('Y-m-l', '2010-02-Wednesday', '2010-02-03 00:00:00 UTC'), + + // different month representations + array('Y-n-d', '2010-2-03', '2010-02-03 00:00:00 UTC'), + array('Y-M-d', '2010-Feb-03', '2010-02-03 00:00:00 UTC'), + array('Y-F-d', '2010-February-03', '2010-02-03 00:00:00 UTC'), + + // different year representations + array('y-m-d', '10-02-03', '2010-02-03 00:00:00 UTC'), + + // different time representations + array('G:i:s', '16:05:06', '1970-01-01 16:05:06 UTC'), + array('g:i:s a', '4:05:06 pm', '1970-01-01 16:05:06 UTC'), + array('h:i:s a', '04:05:06 pm', '1970-01-01 16:05:06 UTC'), + + // seconds since unix + array('U', '1265213106', '2010-02-03 16:05:06 UTC'), + ); + } + + /** + * @dataProvider dataProvider + */ + public function testTransform($format, $output, $input) + { + $transformer = new DateTimeToStringTransformer('UTC', 'UTC', $format); + + $input = new \DateTime($input); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransform_empty() + { + $transformer = new DateTimeToStringTransformer(); + + $this->assertSame('', $transformer->transform(null)); + } + + public function testTransform_differentTimezones() + { + $transformer = new DateTimeToStringTransformer('Asia/Hong_Kong', 'America/New_York', 'Y-m-d H:i:s'); + + $input = new \DateTime('2010-02-03 12:05:06 America/New_York'); + $output = $input->format('Y-m-d H:i:s'); + $input->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransformExpectsDateTime() + { + $transformer = new DateTimeToStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->transform('1234'); + } + + /** + * @dataProvider dataProvider + */ + public function testReverseTransformBeforePhp538($format, $input, $output) + { + $reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format, false); + + $output = new \DateTime($output); + + $this->assertDateTimeEquals($output, $reverseTransformer->reverseTransform($input)); + } + + /** + * @dataProvider dataProvider + */ + public function testReverseTransformAsOfPhp538($format, $input, $output) + { + if (version_compare(phpversion(), '5.3.8', '<')) { + $this->markTestSkipped('Requires PHP 5.3.8 or newer'); + } + + $reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format); + + $output = new \DateTime($output); + + $this->assertDateTimeEquals($output, $reverseTransformer->reverseTransform($input)); + } + + public function testReverseTransform_empty() + { + $reverseTransformer = new DateTimeToStringTransformer(); + + $this->assertNull($reverseTransformer->reverseTransform('')); + } + + public function testReverseTransform_differentTimezones() + { + $reverseTransformer = new DateTimeToStringTransformer('America/New_York', 'Asia/Hong_Kong', 'Y-m-d H:i:s'); + + $output = new \DateTime('2010-02-03 16:05:06 Asia/Hong_Kong'); + $input = $output->format('Y-m-d H:i:s'); + $output->setTimeZone(new \DateTimeZone('America/New_York')); + + $this->assertDateTimeEquals($output, $reverseTransformer->reverseTransform($input)); + } + + public function testReverseTransformExpectsString() + { + $reverseTransformer = new DateTimeToStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $reverseTransformer->reverseTransform(1234); + } + + public function testReverseTransformExpectsValidDateString() + { + $reverseTransformer = new DateTimeToStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\TransformationFailedException'); + + $reverseTransformer->reverseTransform('2010-2010-2010'); + } + + public function testReverseTransformWithNonExistingDate() + { + $reverseTransformer = new DateTimeToStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\TransformationFailedException'); + + $reverseTransformer->reverseTransform('2010-04-31'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToTimestampTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToTimestampTransformerTest.php new file mode 100755 index 0000000000..3307fb195e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToTimestampTransformerTest.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; + +class DateTimeToTimestampTransformerTest extends DateTimeTestCase +{ + public function testTransform() + { + $transformer = new DateTimeToTimestampTransformer('UTC', 'UTC'); + + $input = new \DateTime('2010-02-03 04:05:06 UTC'); + $output = $input->format('U'); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransform_empty() + { + $transformer = new DateTimeToTimestampTransformer(); + + $this->assertNull($transformer->transform(null)); + } + + public function testTransform_differentTimezones() + { + $transformer = new DateTimeToTimestampTransformer('Asia/Hong_Kong', 'America/New_York'); + + $input = new \DateTime('2010-02-03 04:05:06 America/New_York'); + $output = $input->format('U'); + $input->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransformFromDifferentTimezone() + { + $transformer = new DateTimeToTimestampTransformer('Asia/Hong_Kong', 'UTC'); + + $input = new \DateTime('2010-02-03 04:05:06 Asia/Hong_Kong'); + + $dateTime = clone $input; + $dateTime->setTimezone(new \DateTimeZone('UTC')); + $output = $dateTime->format('U'); + + $this->assertEquals($output, $transformer->transform($input)); + } + + public function testTransformExpectsDateTime() + { + $transformer = new DateTimeToTimestampTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->transform('1234'); + } + + public function testReverseTransform() + { + $reverseTransformer = new DateTimeToTimestampTransformer('UTC', 'UTC'); + + $output = new \DateTime('2010-02-03 04:05:06 UTC'); + $input = $output->format('U'); + + $this->assertDateTimeEquals($output, $reverseTransformer->reverseTransform($input)); + } + + public function testReverseTransform_empty() + { + $reverseTransformer = new DateTimeToTimestampTransformer(); + + $this->assertNull($reverseTransformer->reverseTransform(null)); + } + + public function testReverseTransform_differentTimezones() + { + $reverseTransformer = new DateTimeToTimestampTransformer('Asia/Hong_Kong', 'America/New_York'); + + $output = new \DateTime('2010-02-03 04:05:06 America/New_York'); + $input = $output->format('U'); + $output->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $this->assertDateTimeEquals($output, $reverseTransformer->reverseTransform($input)); + } + + public function testReverseTransformExpectsValidTimestamp() + { + $reverseTransformer = new DateTimeToTimestampTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $reverseTransformer->reverseTransform('2010-2010-2010'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php new file mode 100755 index 0000000000..a33f24003c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\IntegerToLocalizedStringTransformer; + +class IntegerToLocalizedStringTransformerTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + } + + public function testReverseTransform() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $this->assertEquals(1, $transformer->reverseTransform('1')); + $this->assertEquals(1, $transformer->reverseTransform('1,5')); + $this->assertEquals(1234, $transformer->reverseTransform('1234,5')); + $this->assertEquals(12345, $transformer->reverseTransform('12345,912')); + } + + public function testReverseTransform_empty() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $this->assertNull($transformer->reverseTransform('')); + } + + public function testReverseTransformWithGrouping() + { + $transformer = new IntegerToLocalizedStringTransformer(null, true); + + $this->assertEquals(1234, $transformer->reverseTransform('1.234,5')); + $this->assertEquals(12345, $transformer->reverseTransform('12.345,912')); + $this->assertEquals(1234, $transformer->reverseTransform('1234,5')); + $this->assertEquals(12345, $transformer->reverseTransform('12345,912')); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformExpectsString() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform(1); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformExpectsValidNumber() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform('foo'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsNaN() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform('NaN'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsNaN2() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform('nan'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsInfinity() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform('∞'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsNegativeInfinity() + { + $transformer = new IntegerToLocalizedStringTransformer(); + + $transformer->reverseTransform('-∞'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/LocalizedTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/LocalizedTestCase.php new file mode 100755 index 0000000000..494928b7e1 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/LocalizedTestCase.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase +{ + protected static $icuVersion = null; + + protected function setUp() + { + parent::setUp(); + + if (!$this->isIntlExtensionLoaded()) { + $this->markTestSkipped('The "intl" extension is not available'); + } + } + + protected function isIntlExtensionLoaded() + { + return extension_loaded('intl'); + } + + protected function isLowerThanIcuVersion($version) + { + $version = $this->normalizeIcuVersion($version); + $icuVersion = $this->normalizeIcuVersion($this->getIntlExtensionIcuVersion()); + + return $icuVersion < $version; + } + + protected function normalizeIcuVersion($version) + { + return ((float) $version) * 100; + } + + protected function getIntlExtensionIcuVersion() + { + if (isset(self::$icuVersion)) { + return self::$icuVersion; + } + + if (!$this->isIntlExtensionLoaded()) { + throw new \RuntimeException('The intl extension is not available'); + } + + if (defined('INTL_ICU_VERSION')) { + return INTL_ICU_VERSION; + } + + $reflector = new \ReflectionExtension('intl'); + + ob_start(); + $reflector->info(); + $output = ob_get_clean(); + + preg_match('/^ICU version => (.*)$/m', $output, $matches); + self::$icuVersion = $matches[1]; + + return self::$icuVersion; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php new file mode 100755 index 0000000000..be7b3d47f8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedStringTransformer; + +class MoneyToLocalizedStringTransformerTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + } + + public function testTransform() + { + $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100); + + $this->assertEquals('1,23', $transformer->transform(123)); + } + + public function testTransformExpectsNumeric() + { + $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->transform('abcd'); + } + + public function testTransform_empty() + { + $transformer = new MoneyToLocalizedStringTransformer(); + + $this->assertSame('', $transformer->transform(null)); + } + + public function testReverseTransform() + { + $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100); + + $this->assertEquals(123, $transformer->reverseTransform('1,23')); + } + + public function testReverseTransformExpectsString() + { + $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->reverseTransform(12345); + } + + public function testReverseTransform_empty() + { + $transformer = new MoneyToLocalizedStringTransformer(); + + $this->assertNull($transformer->reverseTransform('')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php new file mode 100755 index 0000000000..96ece87f30 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php @@ -0,0 +1,289 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer; + +class NumberToLocalizedStringTransformerTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + } + + public function testTransform() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertEquals('1', $transformer->transform(1)); + $this->assertEquals('1,5', $transformer->transform(1.5)); + $this->assertEquals('1234,5', $transformer->transform(1234.5)); + $this->assertEquals('12345,912', $transformer->transform(12345.9123)); + } + + public function testTransform_empty() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertSame('', $transformer->transform(null)); + } + + public function testTransformWithGrouping() + { + $transformer = new NumberToLocalizedStringTransformer(null, true); + + $this->assertEquals('1.234,5', $transformer->transform(1234.5)); + $this->assertEquals('12.345,912', $transformer->transform(12345.9123)); + } + + public function testTransformWithPrecision() + { + $transformer = new NumberToLocalizedStringTransformer(2); + + $this->assertEquals('1234,50', $transformer->transform(1234.5)); + $this->assertEquals('678,92', $transformer->transform(678.916)); + } + + public function testTransformWithRoundingMode() + { + $transformer = new NumberToLocalizedStringTransformer(null, null, NumberToLocalizedStringTransformer::ROUND_DOWN); + $this->assertEquals('1234,547', $transformer->transform(1234.547), '->transform() only applies rounding mode if precision set'); + + $transformer = new NumberToLocalizedStringTransformer(2, null, NumberToLocalizedStringTransformer::ROUND_DOWN); + $this->assertEquals('1234,54', $transformer->transform(1234.547), '->transform() rounding-mode works'); + + } + + public function testReverseTransform() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertEquals(1, $transformer->reverseTransform('1')); + $this->assertEquals(1.5, $transformer->reverseTransform('1,5')); + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + $this->assertEquals(12345.912, $transformer->reverseTransform('12345,912')); + } + + public function testReverseTransform_empty() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertNull($transformer->reverseTransform('')); + } + + public function testReverseTransformWithGrouping() + { + $transformer = new NumberToLocalizedStringTransformer(null, true); + + // completely valid format + $this->assertEquals(1234.5, $transformer->reverseTransform('1.234,5')); + $this->assertEquals(12345.912, $transformer->reverseTransform('12.345,912')); + // omit group separator + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + $this->assertEquals(12345.912, $transformer->reverseTransform('12345,912')); + } + + public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsNotDot() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + \Locale::setDefault('fr'); + $transformer = new NumberToLocalizedStringTransformer(null, true); + + // completely valid format + $this->assertEquals(1234.5, $transformer->reverseTransform('1 234,5')); + // accept dots + $this->assertEquals(1234.5, $transformer->reverseTransform('1 234.5')); + // omit group separator + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + $this->assertEquals(1234.5, $transformer->reverseTransform('1234.5')); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + $transformer = new NumberToLocalizedStringTransformer(null, true); + + $transformer->reverseTransform('1.234.5'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot_noGroupSep() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + $transformer = new NumberToLocalizedStringTransformer(null, true); + + $transformer->reverseTransform('1234.5'); + } + + public function testDecimalSeparatorMayBeDotIfGroupingSeparatorIsDotButNoGroupingUsed() + { + \Locale::setDefault('fr'); + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + $this->assertEquals(1234.5, $transformer->reverseTransform('1234.5')); + } + + public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsNotComma() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + \Locale::setDefault('ak'); + $transformer = new NumberToLocalizedStringTransformer(null, true); + + // completely valid format + $this->assertEquals(1234.5, $transformer->reverseTransform('1 234.5')); + // accept commas + $this->assertEquals(1234.5, $transformer->reverseTransform('1 234,5')); + // omit group separator + $this->assertEquals(1234.5, $transformer->reverseTransform('1234.5')); + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + \Locale::setDefault('en'); + $transformer = new NumberToLocalizedStringTransformer(null, true); + + $transformer->reverseTransform('1,234,5'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testDecimalSeparatorMayNotBeCommaIfGroupingSeparatorIsComma_noGroupSep() + { + if ($this->isLowerThanIcuVersion('4.7')) { + $this->markTestSkipped('Please upgrade ICU version to 4.7+'); + } + + \Locale::setDefault('en'); + $transformer = new NumberToLocalizedStringTransformer(null, true); + + $transformer->reverseTransform('1234,5'); + } + + public function testDecimalSeparatorMayBeCommaIfGroupingSeparatorIsCommaButNoGroupingUsed() + { + \Locale::setDefault('en'); + $transformer = new NumberToLocalizedStringTransformer(); + + $this->assertEquals(1234.5, $transformer->reverseTransform('1234,5')); + $this->assertEquals(1234.5, $transformer->reverseTransform('1234.5')); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testTransformExpectsNumeric() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->transform('foo'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformExpectsString() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform(1); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformExpectsValidNumber() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('foo'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + * @link https://github.com/symfony/symfony/issues/3161 + */ + public function testReverseTransformDisallowsNaN() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('NaN'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsNaN2() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('nan'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsInfinity() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('∞'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsInfinity2() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('∞,123'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransformDisallowsNegativeInfinity() + { + $transformer = new NumberToLocalizedStringTransformer(); + + $transformer->reverseTransform('-∞'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php new file mode 100755 index 0000000000..2b38d46575 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/PercentToLocalizedStringTransformerTest.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\PercentToLocalizedStringTransformer; + +class PercentToLocalizedStringTransformerTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + } + + public function testTransform() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->assertEquals('10', $transformer->transform(0.1)); + $this->assertEquals('15', $transformer->transform(0.15)); + $this->assertEquals('12', $transformer->transform(0.1234)); + $this->assertEquals('200', $transformer->transform(2)); + } + + public function testTransform_empty() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->assertEquals('', $transformer->transform(null)); + } + + public function testTransformWithInteger() + { + $transformer = new PercentToLocalizedStringTransformer(null, 'integer'); + + $this->assertEquals('0', $transformer->transform(0.1)); + $this->assertEquals('1', $transformer->transform(1)); + $this->assertEquals('15', $transformer->transform(15)); + $this->assertEquals('16', $transformer->transform(15.9)); + } + + public function testTransformWithPrecision() + { + $transformer = new PercentToLocalizedStringTransformer(2); + + $this->assertEquals('12,34', $transformer->transform(0.1234)); + } + + public function testReverseTransform() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->assertEquals(0.1, $transformer->reverseTransform('10')); + $this->assertEquals(0.15, $transformer->reverseTransform('15')); + $this->assertEquals(0.12, $transformer->reverseTransform('12')); + $this->assertEquals(2, $transformer->reverseTransform('200')); + } + + public function testReverseTransform_empty() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->assertNull($transformer->reverseTransform('')); + } + + public function testReverseTransformWithInteger() + { + $transformer = new PercentToLocalizedStringTransformer(null, 'integer'); + + $this->assertEquals(10, $transformer->reverseTransform('10')); + $this->assertEquals(15, $transformer->reverseTransform('15')); + $this->assertEquals(12, $transformer->reverseTransform('12')); + $this->assertEquals(200, $transformer->reverseTransform('200')); + } + + public function testReverseTransformWithPrecision() + { + $transformer = new PercentToLocalizedStringTransformer(2); + + $this->assertEquals(0.1234, $transformer->reverseTransform('12,34')); + } + + public function testTransformExpectsNumeric() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->transform('foo'); + } + + public function testReverseTransformExpectsString() + { + $transformer = new PercentToLocalizedStringTransformer(); + + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + + $transformer->reverseTransform(1); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php new file mode 100755 index 0000000000..520a4dc5f2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer; + +use Symfony\Component\Form\Extension\Core\DataTransformer\ValueToDuplicatesTransformer; + +class ValueToDuplicatesTransformerTest extends \PHPUnit_Framework_TestCase +{ + private $transformer; + + protected function setUp() + { + $this->transformer = new ValueToDuplicatesTransformer(array('a', 'b', 'c')); + } + + protected function tearDown() + { + $this->transformer = null; + } + + public function testTransform() + { + $output = array( + 'a' => 'Foo', + 'b' => 'Foo', + 'c' => 'Foo', + ); + + $this->assertSame($output, $this->transformer->transform('Foo')); + } + + public function testTransform_empty() + { + $output = array( + 'a' => null, + 'b' => null, + 'c' => null, + ); + + $this->assertSame($output, $this->transformer->transform(null)); + } + + public function testReverseTransform() + { + $input = array( + 'a' => 'Foo', + 'b' => 'Foo', + 'c' => 'Foo', + ); + + $this->assertSame('Foo', $this->transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyEmpty() + { + $input = array( + 'a' => '', + 'b' => '', + 'c' => '', + ); + + $this->assertNull($this->transformer->reverseTransform($input)); + } + + public function testReverseTransform_completelyNull() + { + $input = array( + 'a' => null, + 'b' => null, + 'c' => null, + ); + + $this->assertNull($this->transformer->reverseTransform($input)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_partiallyNull() + { + $input = array( + 'a' => 'Foo', + 'b' => 'Foo', + 'c' => null, + ); + + $this->transformer->reverseTransform($input); + } + + /** + * @expectedException Symfony\Component\Form\Exception\TransformationFailedException + */ + public function testReverseTransform_differences() + { + $input = array( + 'a' => 'Foo', + 'b' => 'Bar', + 'c' => 'Foo', + ); + + $this->transformer->reverseTransform($input); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testReverseTransformRequiresArray() + { + $this->transformer->reverseTransform('12345'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php new file mode 100755 index 0000000000..9f2d0d21a6 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Core\EventListener\FixRadioInputListener; +use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList; + +class FixRadioInputListenerTest extends \PHPUnit_Framework_TestCase +{ + private $listener; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + parent::setUp(); + + $list = new SimpleChoiceList(array(0 => 'A', 1 => 'B')); + $this->listener = new FixRadioInputListener($list); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->listener = null; + } + + public function testFixRadio() + { + $data = '1'; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $this->listener->preBind($event); + + $this->assertEquals(array(1 => '1'), $event->getData()); + } + + public function testFixZero() + { + $data = '0'; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $this->listener->preBind($event); + + $this->assertEquals(array(0 => '0'), $event->getData()); + } + + public function testIgnoreEmptyString() + { + $data = ''; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $this->listener->preBind($event); + + $this->assertEquals(array(), $event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php new file mode 100755 index 0000000000..ab0bdf3a44 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener; + +class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + } + + public function testFixHttpUrl() + { + $data = "www.symfony.com"; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $filter = new FixUrlProtocolListener('http'); + $filter->onBind($event); + + $this->assertEquals('http://www.symfony.com', $event->getData()); + } + + public function testSkipKnownUrl() + { + $data = "http://www.symfony.com"; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $filter = new FixUrlProtocolListener('http'); + $filter->onBind($event); + + $this->assertEquals('http://www.symfony.com', $event->getData()); + } + + public function testSkipOtherProtocol() + { + $data = "ftp://www.symfony.com"; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $filter = new FixUrlProtocolListener('http'); + $filter->onBind($event); + + $this->assertEquals('ftp://www.symfony.com', $event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/Fixtures/randomhash b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/Fixtures/randomhash new file mode 100755 index 0000000000..b636f4b8df Binary files /dev/null and b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/Fixtures/randomhash differ diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayObjectTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayObjectTest.php new file mode 100755 index 0000000000..6f46c9d7fa --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayObjectTest.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormBuilder; + +class MergeCollectionListenerArrayObjectTest extends MergeCollectionListenerTest +{ + protected function getData(array $data) + { + return new \ArrayObject($data); + } + + protected function getBuilder($name = 'name') + { + return new FormBuilder($name, '\ArrayObject', $this->dispatcher, $this->factory); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayTest.php new file mode 100755 index 0000000000..c0f3d59734 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerArrayTest.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormBuilder; + +class MergeCollectionListenerArrayTest extends MergeCollectionListenerTest +{ + protected function getData(array $data) + { + return $data; + } + + protected function getBuilder($name = 'name') + { + return new FormBuilder($name, null, $this->dispatcher, $this->factory); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php new file mode 100755 index 0000000000..5eb6c7b9fd --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerCustomArrayObjectTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\Tests\Fixtures\CustomArrayObject; +use Symfony\Component\Form\FormBuilder; + +class MergeCollectionListenerCustomArrayObjectTest extends MergeCollectionListenerTest +{ + protected function getData(array $data) + { + return new CustomArrayObject($data); + } + + protected function getBuilder($name = 'name') + { + return new FormBuilder($name, 'Symfony\Component\Form\Tests\Fixtures\CustomArrayObject', $this->dispatcher, $this->factory); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php new file mode 100755 index 0000000000..78a0c01fac --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php @@ -0,0 +1,259 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Core\EventListener\MergeCollectionListener; + +abstract class MergeCollectionListenerTest extends \PHPUnit_Framework_TestCase +{ + protected $dispatcher; + protected $factory; + protected $form; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->form = $this->getForm('axes'); + } + + protected function tearDown() + { + $this->dispatcher = null; + $this->factory = null; + $this->form = null; + } + + abstract protected function getBuilder($name = 'name'); + + protected function getForm($name = 'name', $propertyPath = null) + { + $propertyPath = $propertyPath ?: $name; + + return $this->getBuilder($name)->setAttribute('property_path', $propertyPath)->getForm(); + } + + protected function getMockForm() + { + return $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + } + + public function getBooleanMatrix1() + { + return array( + array(true), + array(false), + ); + } + + public function getBooleanMatrix2() + { + return array( + array(true, true), + array(true, false), + array(false, true), + array(false, false), + ); + } + + abstract protected function getData(array $data); + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testAddExtraEntriesIfAllowAdd($allowDelete) + { + $originalData = $this->getData(array(1 => 'second')); + $newData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $listener = new MergeCollectionListener(true, $allowDelete); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + // The original object was modified + if (is_object($originalData)) { + $this->assertSame($originalData, $event->getData()); + } + + // The original object matches the new object + $this->assertEquals($newData, $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testAddExtraEntriesIfAllowAddDontOverwriteExistingIndices($allowDelete) + { + $originalData = $this->getData(array(1 => 'first')); + $newData = $this->getData(array(0 => 'first', 1 => 'second')); + + $listener = new MergeCollectionListener(true, $allowDelete); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + // The original object was modified + if (is_object($originalData)) { + $this->assertSame($originalData, $event->getData()); + } + + // The original object matches the new object + $this->assertEquals($this->getData(array(1 => 'first', 2 => 'second')), $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testDoNothingIfNotAllowAdd($allowDelete) + { + $originalDataArray = array(1 => 'second'); + $originalData = $this->getData($originalDataArray); + $newData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $listener = new MergeCollectionListener(false, $allowDelete); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + // We still have the original object + if (is_object($originalData)) { + $this->assertSame($originalData, $event->getData()); + } + + // Nothing was removed + $this->assertEquals($this->getData($originalDataArray), $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testRemoveMissingEntriesIfAllowDelete($allowAdd) + { + $originalData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + $newData = $this->getData(array(1 => 'second')); + + $listener = new MergeCollectionListener($allowAdd, true); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + // The original object was modified + if (is_object($originalData)) { + $this->assertSame($originalData, $event->getData()); + } + + // The original object matches the new object + $this->assertEquals($newData, $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testDoNothingIfNotAllowDelete($allowAdd) + { + $originalDataArray = array(0 => 'first', 1 => 'second', 2 => 'third'); + $originalData = $this->getData($originalDataArray); + $newData = $this->getData(array(1 => 'second')); + + $listener = new MergeCollectionListener($allowAdd, false); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + // We still have the original object + if (is_object($originalData)) { + $this->assertSame($originalData, $event->getData()); + } + + // Nothing was removed + $this->assertEquals($this->getData($originalDataArray), $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix2 + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testRequireArrayOrTraversable($allowAdd, $allowDelete) + { + $newData = 'no array or traversable'; + $event = new FormEvent($this->form, $newData); + $listener = new MergeCollectionListener($allowAdd, $allowDelete); + $listener->onBind($event); + } + + public function testDealWithNullData() + { + $originalData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + $newData = null; + + $listener = new MergeCollectionListener(false, false); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + $this->assertSame($originalData, $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testDealWithNullOriginalDataIfAllowAdd($allowDelete) + { + $originalData = null; + $newData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $listener = new MergeCollectionListener(true, $allowDelete); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + $this->assertSame($newData, $event->getData()); + } + + /** + * @dataProvider getBooleanMatrix1 + */ + public function testDontDealWithNullOriginalDataIfNotAllowAdd($allowDelete) + { + $originalData = null; + $newData = $this->getData(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $listener = new MergeCollectionListener(false, $allowDelete); + + $this->form->setData($originalData); + + $event = new FormEvent($this->form, $newData); + $listener->onBind($event); + + $this->assertNull($event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php new file mode 100755 index 0000000000..ba83360e09 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php @@ -0,0 +1,255 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener; +use Symfony\Component\Form\FormBuilder; + +class ResizeFormListenerTest extends \PHPUnit_Framework_TestCase +{ + private $dispatcher; + private $factory; + private $form; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->form = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + } + + protected function tearDown() + { + $this->dispatcher = null; + $this->factory = null; + $this->form = null; + } + + protected function getBuilder($name = 'name') + { + return new FormBuilder($name, null, $this->dispatcher, $this->factory); + } + + protected function getForm($name = 'name') + { + return $this->getBuilder($name)->getForm(); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + protected function getMockForm() + { + return $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + } + + public function testPreSetDataResizesForm() + { + $this->form->add($this->getForm('0')); + $this->form->add($this->getForm('1')); + + $this->factory->expects($this->at(0)) + ->method('createNamed') + ->with(1, 'text', null, array('property_path' => '[1]', 'max_length' => 10)) + ->will($this->returnValue($this->getForm('1'))); + $this->factory->expects($this->at(1)) + ->method('createNamed') + ->with(2, 'text', null, array('property_path' => '[2]', 'max_length' => 10)) + ->will($this->returnValue($this->getForm('2'))); + + $data = array(1 => 'string', 2 => 'string'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array('max_length' => '10'), false, false); + $listener->preSetData($event); + + $this->assertFalse($this->form->has('0')); + $this->assertTrue($this->form->has('1')); + $this->assertTrue($this->form->has('2')); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testPreSetDataRequiresArrayOrTraversable() + { + $data = 'no array or traversable'; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->preSetData($event); + } + + public function testPreSetDataDealsWithNullData() + { + $this->factory->expects($this->never())->method('createNamed'); + + $data = null; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->preSetData($event); + } + + public function testPreBindResizesUpIfAllowAdd() + { + $this->form->add($this->getForm('0')); + + $this->factory->expects($this->once()) + ->method('createNamed') + ->with(1, 'text', null, array('property_path' => '[1]', 'max_length' => 10)) + ->will($this->returnValue($this->getForm('1'))); + + $data = array(0 => 'string', 1 => 'string'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array('max_length' => 10), true, false); + $listener->preBind($event); + + $this->assertTrue($this->form->has('0')); + $this->assertTrue($this->form->has('1')); + } + + public function testPreBindResizesDownIfAllowDelete() + { + $this->form->add($this->getForm('0')); + $this->form->add($this->getForm('1')); + + $data = array(0 => 'string'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->preBind($event); + + $this->assertTrue($this->form->has('0')); + $this->assertFalse($this->form->has('1')); + } + + // fix for https://github.com/symfony/symfony/pull/493 + public function testPreBindRemovesZeroKeys() + { + $this->form->add($this->getForm('0')); + + $data = array(); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->preBind($event); + + $this->assertFalse($this->form->has('0')); + } + + public function testPreBindDoesNothingIfNotAllowAddNorAllowDelete() + { + $this->form->add($this->getForm('0')); + $this->form->add($this->getForm('1')); + + $data = array(0 => 'string', 2 => 'string'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->preBind($event); + + $this->assertTrue($this->form->has('0')); + $this->assertTrue($this->form->has('1')); + $this->assertFalse($this->form->has('2')); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testPreBindRequiresArrayOrTraversable() + { + $data = 'no array or traversable'; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->preBind($event); + } + + public function testPreBindDealsWithNullData() + { + $this->form->add($this->getForm('1')); + + $data = null; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->preBind($event); + + $this->assertFalse($this->form->has('1')); + } + + // fixes https://github.com/symfony/symfony/pull/40 + public function testPreBindDealsWithEmptyData() + { + $this->form->add($this->getForm('1')); + + $data = ''; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->preBind($event); + + $this->assertFalse($this->form->has('1')); + } + + public function testOnBindNormDataRemovesEntriesMissingInTheFormIfAllowDelete() + { + $this->form->add($this->getForm('1')); + + $data = array(0 => 'first', 1 => 'second', 2 => 'third'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->onBind($event); + + $this->assertEquals(array(1 => 'second'), $event->getData()); + } + + public function testOnBindNormDataDoesNothingIfNotAllowDelete() + { + $this->form->add($this->getForm('1')); + + $data = array(0 => 'first', 1 => 'second', 2 => 'third'); + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->onBind($event); + + $this->assertEquals($data, $event->getData()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testOnBindNormDataRequiresArrayOrTraversable() + { + $data = 'no array or traversable'; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, false); + $listener->onBind($event); + } + + public function testOnBindNormDataDealsWithNullData() + { + $this->form->add($this->getForm('1')); + + $data = null; + $event = new FormEvent($this->form, $data); + $listener = new ResizeFormListener($this->factory, 'text', array(), false, true); + $listener->onBind($event); + + $this->assertEquals(array(), $event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php new file mode 100755 index 0000000000..e5c3f96ef4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\Extension\Core\EventListener\TrimListener; + +class TrimListenerTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + } + + public function testTrim() + { + $data = " Foo! "; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $filter = new TrimListener(); + $filter->preBind($event); + + $this->assertEquals('Foo!', $event->getData()); + } + + public function testTrimSkipNonStrings() + { + $data = 1234; + $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $event = new FormEvent($form, $data); + + $filter = new TrimListener(); + $filter->preBind($event); + + $this->assertSame(1234, $event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php new file mode 100755 index 0000000000..16a71d8f20 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\CallbackTransformer; + +class CheckboxTypeTest extends TypeTestCase +{ + public function testPassValueToView() + { + $form = $this->factory->create('checkbox', null, array('value' => 'foobar')); + $view = $form->createView(); + + $this->assertEquals('foobar', $view->vars['value']); + } + + public function testCheckedIfDataTrue() + { + $form = $this->factory->create('checkbox'); + $form->setData(true); + $view = $form->createView(); + + $this->assertTrue($view->vars['checked']); + } + + public function testCheckedIfDataTrueWithEmptyValue() + { + $form = $this->factory->create('checkbox', null, array('value' => '')); + $form->setData(true); + $view = $form->createView(); + + $this->assertTrue($view->vars['checked']); + } + + public function testNotCheckedIfDataFalse() + { + $form = $this->factory->create('checkbox'); + $form->setData(false); + $view = $form->createView(); + + $this->assertFalse($view->vars['checked']); + } + + public function testBindWithValueChecked() + { + $form = $this->factory->create('checkbox', null, array( + 'value' => 'foobar', + )); + $form->bind('foobar'); + + $this->assertTrue($form->getData()); + $this->assertEquals('foobar', $form->getViewData()); + } + + public function testBindWithRandomValueChecked() + { + $form = $this->factory->create('checkbox', null, array( + 'value' => 'foobar', + )); + $form->bind('krixikraxi'); + + $this->assertTrue($form->getData()); + $this->assertEquals('foobar', $form->getViewData()); + } + + public function testBindWithValueUnchecked() + { + $form = $this->factory->create('checkbox', null, array( + 'value' => 'foobar', + )); + $form->bind(null); + + $this->assertFalse($form->getData()); + $this->assertNull($form->getViewData()); + } + + public function testBindWithEmptyValueChecked() + { + $form = $this->factory->create('checkbox', null, array( + 'value' => '', + )); + $form->bind(''); + + $this->assertTrue($form->getData()); + $this->assertSame('', $form->getViewData()); + } + + public function testBindWithEmptyValueUnchecked() + { + $form = $this->factory->create('checkbox', null, array( + 'value' => '', + )); + $form->bind(null); + + $this->assertFalse($form->getData()); + $this->assertNull($form->getViewData()); + } + + /** + * @dataProvider provideTransformedData + */ + public function testTransformedData($data, $expected) + { + // present a binary status field as a checkbox + $transformer = new CallbackTransformer( + function ($value) { + return 'expedited' == $value; + }, + function ($value) { + return $value ? 'expedited' : 'standard'; + } + ); + + $form = $this->builder + ->create('expedited_shipping', 'checkbox') + ->addModelTransformer($transformer) + ->getForm(); + $form->setData($data); + $view = $form->createView(); + + $this->assertEquals($expected, $view->vars['checked']); + } + + public function provideTransformedData() + { + return array( + array('expedited', true), + array('standard', false), + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypePerformanceTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypePerformanceTest.php new file mode 100755 index 0000000000..dbb3e0f997 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypePerformanceTest.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Tests\FormPerformanceTestCase; + +/** + * @author Bernhard Schussek + */ +class ChoiceTypePerformanceTest extends FormPerformanceTestCase +{ + /** + * This test case is realistic in collection forms where each + * row contains the same choice field. + * + * @group benchmark + */ + public function testSameChoiceFieldCreatedMultipleTimes() + { + $this->setMaxRunningTime(1); + $choices = range(1, 300); + + for ($i = 0; $i < 100; ++$i) { + $this->factory->create('choice', rand(1, 400), array( + 'choices' => $choices, + )); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php new file mode 100755 index 0000000000..a302e2a9ac --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php @@ -0,0 +1,766 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceList; + +use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList; +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class ChoiceTypeTest extends TypeTestCase +{ + private $choices = array( + 'a' => 'Bernhard', + 'b' => 'Fabien', + 'c' => 'Kris', + 'd' => 'Jon', + 'e' => 'Roman', + ); + + private $numericChoices = array( + 0 => 'Bernhard', + 1 => 'Fabien', + 2 => 'Kris', + 3 => 'Jon', + 4 => 'Roman', + ); + + private $objectChoices; + + protected $groupedChoices = array( + 'Symfony' => array( + 'a' => 'Bernhard', + 'b' => 'Fabien', + 'c' => 'Kris', + ), + 'Doctrine' => array( + 'd' => 'Jon', + 'e' => 'Roman', + ) + ); + + protected function setUp() + { + parent::setUp(); + + $this->objectChoices = array( + (object) array('id' => 1, 'name' => 'Bernhard'), + (object) array('id' => 2, 'name' => 'Fabien'), + (object) array('id' => 3, 'name' => 'Kris'), + (object) array('id' => 4, 'name' => 'Jon'), + (object) array('id' => 5, 'name' => 'Roman'), + ); + } + + protected function tearDown() + { + parent::tearDown(); + + $this->objectChoices = null; + } + + /** + * @expectedException \PHPUnit_Framework_Error + */ + public function testChoicesOptionExpectsArray() + { + $this->factory->create('choice', null, array( + 'choices' => new \ArrayObject(), + )); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testChoiceListOptionExpectsChoiceListInterface() + { + $this->factory->create('choice', null, array( + 'choice_list' => array('foo' => 'foo'), + )); + } + + /** + * expectedException Symfony\Component\Form\Exception\FormException + */ + public function testEitherChoiceListOrChoicesMustBeSet() + { + $this->factory->create('choice', null, array( + )); + } + + public function testExpandedChoicesOptionsTurnIntoChildren() + { + $form = $this->factory->create('choice', null, array( + 'expanded' => true, + 'choices' => $this->choices, + )); + + $this->assertCount($form->count(), $this->choices, 'Each choice should become a new field'); + } + + public function testExpandedChoicesOptionsAreFlattened() + { + $form = $this->factory->create('choice', null, array( + 'expanded' => true, + 'choices' => $this->groupedChoices, + )); + + $flattened = array(); + foreach ($this->groupedChoices as $choices) { + $flattened = array_merge($flattened, array_keys($choices)); + } + + $this->assertCount($form->count(), $flattened, 'Each nested choice should become a new field, not the groups'); + + foreach ($flattened as $value => $choice) { + $this->assertTrue($form->has($value), 'Flattened choice is named after it\'s value'); + } + } + + public function testExpandedCheckboxesAreNeverRequired() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'required' => true, + 'choices' => $this->choices, + )); + + foreach ($form as $child) { + $this->assertFalse($child->isRequired()); + } + } + + public function testExpandedRadiosAreRequiredIfChoiceChildIsRequired() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'required' => true, + 'choices' => $this->choices, + )); + + foreach ($form as $child) { + $this->assertTrue($child->isRequired()); + } + } + + public function testExpandedRadiosAreNotRequiredIfChoiceChildIsNotRequired() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'required' => false, + 'choices' => $this->choices, + )); + + foreach ($form as $child) { + $this->assertFalse($child->isRequired()); + } + } + + public function testBindSingleNonExpanded() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => false, + 'choices' => $this->choices, + )); + + $form->bind('b'); + + $this->assertEquals('b', $form->getData()); + $this->assertEquals('b', $form->getViewData()); + } + + public function testBindSingleNonExpandedObjectChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => false, + 'choice_list' => new ObjectChoiceList( + $this->objectChoices, + // label path + 'name', + array(), + null, + // value path + 'id' + ), + )); + + // "id" value of the second entry + $form->bind('2'); + + $this->assertEquals($this->objectChoices[1], $form->getData()); + $this->assertEquals('2', $form->getViewData()); + } + + public function testBindMultipleNonExpanded() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => false, + 'choices' => $this->choices, + )); + + $form->bind(array('a', 'b')); + + $this->assertEquals(array('a', 'b'), $form->getData()); + $this->assertEquals(array('a', 'b'), $form->getViewData()); + } + + public function testBindMultipleNonExpandedObjectChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => false, + 'choice_list' => new ObjectChoiceList( + $this->objectChoices, + // label path + 'name', + array(), + null, + // value path + 'id' + ), + )); + + $form->bind(array('2', '3')); + + $this->assertEquals(array($this->objectChoices[1], $this->objectChoices[2]), $form->getData()); + $this->assertEquals(array('2', '3'), $form->getViewData()); + } + + public function testBindSingleExpanded() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choices' => $this->choices, + )); + + $form->bind('b'); + + $this->assertSame('b', $form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertTrue($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertSame('b', $form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindSingleExpandedNothingChecked() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choices' => $this->choices, + )); + + $form->bind(null); + + $this->assertNull($form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertFalse($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertNull($form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindSingleExpandedWithFalseDoesNotHaveExtraChildren() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choices' => $this->choices, + )); + + $form->bind(false); + + $this->assertEmpty($form->getExtraData()); + $this->assertNull($form->getData()); + } + + public function testBindSingleExpandedWithEmptyChild() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choices' => array( + '' => 'Empty', + 1 => 'Not empty', + ), + )); + + $form->bind(''); + + $this->assertNull($form->getData()); + $this->assertTrue($form[0]->getData()); + $this->assertFalse($form[1]->getData()); + $this->assertSame('', $form[0]->getViewData()); + $this->assertNull($form[1]->getViewData()); + } + + public function testBindSingleExpandedObjectChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choice_list' => new ObjectChoiceList( + $this->objectChoices, + // label path + 'name', + array(), + null, + // value path + 'id' + ), + )); + + $form->bind('2'); + + $this->assertSame($this->objectChoices[1], $form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertTrue($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertSame('2', $form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindSingleExpandedNumericChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => true, + 'choices' => $this->numericChoices, + )); + + $form->bind('1'); + + $this->assertSame(1, $form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertTrue($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertSame('1', $form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindMultipleExpanded() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'choices' => $this->choices, + )); + + $form->bind(array('a', 'c')); + + $this->assertSame(array('a', 'c'), $form->getData()); + $this->assertTrue($form[0]->getData()); + $this->assertFalse($form[1]->getData()); + $this->assertTrue($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertSame('a', $form[0]->getViewData()); + $this->assertNull($form[1]->getViewData()); + $this->assertSame('c', $form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindMultipleExpandedEmpty() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'choices' => $this->choices, + )); + + $form->bind(array()); + + $this->assertSame(array(), $form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertFalse($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertNull($form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindMultipleExpandedWithEmptyChild() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'choices' => array( + '' => 'Empty', + 1 => 'Not Empty', + 2 => 'Not Empty 2', + ) + )); + + $form->bind(array('', '2')); + + $this->assertSame(array('', 2), $form->getData()); + $this->assertTrue($form[0]->getData()); + $this->assertFalse($form[1]->getData()); + $this->assertTrue($form[2]->getData()); + $this->assertSame('', $form[0]->getViewData()); + $this->assertNull($form[1]->getViewData()); + $this->assertSame('2', $form[2]->getViewData()); + } + + public function testBindMultipleExpandedObjectChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'choice_list' => new ObjectChoiceList( + $this->objectChoices, + // label path + 'name', + array(), + null, + // value path + 'id' + ), + )); + + $form->bind(array('1', '2')); + + $this->assertSame(array($this->objectChoices[0], $this->objectChoices[1]), $form->getData()); + $this->assertTrue($form[0]->getData()); + $this->assertTrue($form[1]->getData()); + $this->assertFalse($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertSame('1', $form[0]->getViewData()); + $this->assertSame('2', $form[1]->getViewData()); + $this->assertNull($form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + public function testBindMultipleExpandedNumericChoices() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => true, + 'choices' => $this->numericChoices, + )); + + $form->bind(array('1', '2')); + + $this->assertSame(array(1, 2), $form->getData()); + $this->assertFalse($form[0]->getData()); + $this->assertTrue($form[1]->getData()); + $this->assertTrue($form[2]->getData()); + $this->assertFalse($form[3]->getData()); + $this->assertFalse($form[4]->getData()); + $this->assertNull($form[0]->getViewData()); + $this->assertSame('1', $form[1]->getViewData()); + $this->assertSame('2', $form[2]->getViewData()); + $this->assertNull($form[3]->getViewData()); + $this->assertNull($form[4]->getViewData()); + } + + /* + * We need this functionality to create choice fields for Boolean types, + * e.g. false => 'No', true => 'Yes' + */ + public function testSetDataSingleNonExpandedAcceptsBoolean() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'expanded' => false, + 'choices' => $this->numericChoices, + )); + + $form->setData(false); + + $this->assertFalse($form->getData()); + $this->assertEquals('0', $form->getViewData()); + } + + public function testSetDataMultipleNonExpandedAcceptsBoolean() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'expanded' => false, + 'choices' => $this->numericChoices, + )); + + $form->setData(array(false, true)); + + $this->assertEquals(array(false, true), $form->getData()); + $this->assertEquals(array('0', '1'), $form->getViewData()); + } + + public function testPassRequiredToView() + { + $form = $this->factory->create('choice', null, array( + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertTrue($view->vars['required']); + } + + public function testPassNonRequiredToView() + { + $form = $this->factory->create('choice', null, array( + 'required' => false, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertFalse($view->vars['required']); + } + + public function testPassMultipleToView() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => true, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertTrue($view->vars['multiple']); + } + + public function testPassExpandedToView() + { + $form = $this->factory->create('choice', null, array( + 'expanded' => true, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertTrue($view->vars['expanded']); + } + + public function testNotPassedEmptyValueToViewIsNull() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertNull($view->vars['empty_value']); + } + + public function testPassEmptyValueToViewIsEmpty() + { + $form = $this->factory->create('choice', null, array( + 'multiple' => false, + 'required' => false, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertEmpty($view->vars['empty_value']); + } + + /** + * @dataProvider getOptionsWithEmptyValue + */ + public function testPassEmptyValueToView($multiple, $expanded, $required, $emptyValue, $viewValue) + { + $form = $this->factory->create('choice', null, array( + 'multiple' => $multiple, + 'expanded' => $expanded, + 'required' => $required, + 'empty_value' => $emptyValue, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertEquals($viewValue, $view->vars['empty_value']); + } + + /** + * @dataProvider getOptionsWithEmptyValue + */ + public function testDontPassEmptyValueIfContainedInChoices($multiple, $expanded, $required, $emptyValue, $viewValue) + { + $form = $this->factory->create('choice', null, array( + 'multiple' => $multiple, + 'expanded' => $expanded, + 'required' => $required, + 'empty_value' => $emptyValue, + 'choices' => array('a' => 'A', '' => 'Empty'), + )); + $view = $form->createView(); + + $this->assertNull($view->vars['empty_value']); + } + + public function getOptionsWithEmptyValue() + { + return array( + array(false, false, false, 'foobar', 'foobar'), + array(true, false, false, 'foobar', null), + array(false, true, false, 'foobar', null), + array(false, false, true, 'foobar', 'foobar'), + array(false, false, true, '', ''), + array(false, false, true, null, null), + array(false, true, true, 'foobar', null), + array(true, true, false, 'foobar', null), + array(true, true, true, 'foobar', null), + ); + } + + public function testPassChoicesToView() + { + $choices = array('a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D'); + $form = $this->factory->create('choice', null, array( + 'choices' => $choices, + )); + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('a', 'a', 'A'), + new ChoiceView('b', 'b', 'B'), + new ChoiceView('c', 'c', 'C'), + new ChoiceView('d', 'd', 'D'), + ), $view->vars['choices']); + } + + public function testPassPreferredChoicesToView() + { + $choices = array('a' => 'A', 'b' => 'B', 'c' => 'C', 'd' => 'D'); + $form = $this->factory->create('choice', null, array( + 'choices' => $choices, + 'preferred_choices' => array('b', 'd'), + )); + $view = $form->createView(); + + $this->assertEquals(array( + 0 => new ChoiceView('a', 'a', 'A'), + 2 => new ChoiceView('c', 'c', 'C'), + ), $view->vars['choices']); + $this->assertEquals(array( + 1 => new ChoiceView('b', 'b', 'B'), + 3 => new ChoiceView('d', 'd', 'D'), + ), $view->vars['preferred_choices']); + } + + public function testPassHierarchicalChoicesToView() + { + $form = $this->factory->create('choice', null, array( + 'choices' => $this->groupedChoices, + 'preferred_choices' => array('b', 'd'), + )); + $view = $form->createView(); + + $this->assertEquals(array( + 'Symfony' => array( + 0 => new ChoiceView('a', 'a', 'Bernhard'), + 2 => new ChoiceView('c', 'c', 'Kris'), + ), + 'Doctrine' => array( + 4 => new ChoiceView('e', 'e', 'Roman'), + ), + ), $view->vars['choices']); + $this->assertEquals(array( + 'Symfony' => array( + 1 => new ChoiceView('b', 'b', 'Fabien'), + ), + 'Doctrine' => array( + 3 => new ChoiceView('d', 'd', 'Jon'), + ), + ), $view->vars['preferred_choices']); + } + + public function testPassChoiceDataToView() + { + $obj1 = (object) array('value' => 'a', 'label' => 'A'); + $obj2 = (object) array('value' => 'b', 'label' => 'B'); + $obj3 = (object) array('value' => 'c', 'label' => 'C'); + $obj4 = (object) array('value' => 'd', 'label' => 'D'); + $form = $this->factory->create('choice', null, array( + 'choice_list' => new ObjectChoiceList(array($obj1, $obj2, $obj3, $obj4), 'label', array(), null, 'value'), + )); + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView($obj1, 'a', 'A'), + new ChoiceView($obj2, 'b', 'B'), + new ChoiceView($obj3, 'c', 'C'), + new ChoiceView($obj4, 'd', 'D'), + ), $view->vars['choices']); + } + + public function testAdjustFullNameForMultipleNonExpanded() + { + $form = $this->factory->createNamed('name', 'choice', null, array( + 'multiple' => true, + 'expanded' => false, + 'choices' => $this->choices, + )); + $view = $form->createView(); + + $this->assertSame('name[]', $view->vars['full_name']); + } + + // https://github.com/symfony/symfony/issues/3298 + public function testInitializeWithEmptyChoices() + { + $this->factory->createNamed('name', 'choice', null, array( + 'choices' => array(), + )); + } + + public function testInitializeWithDefaultObjectChoice() + { + $obj1 = (object) array('value' => 'a', 'label' => 'A'); + $obj2 = (object) array('value' => 'b', 'label' => 'B'); + $obj3 = (object) array('value' => 'c', 'label' => 'C'); + $obj4 = (object) array('value' => 'd', 'label' => 'D'); + + $form = $this->factory->create('choice', null, array( + 'choice_list' => new ObjectChoiceList(array($obj1, $obj2, $obj3, $obj4), 'label', array(), null, 'value'), + // Used to break because "data_class" was inferred, which needs to + // remain null in every case (because it refers to the view format) + 'data' => $obj3, + )); + + // Trigger data initialization + $form->getViewData(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php new file mode 100755 index 0000000000..aa79fa060e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php @@ -0,0 +1,200 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Form; + +class CollectionTypeTest extends TypeTestCase +{ + public function testContainsNoChildByDefault() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + )); + + $this->assertCount(0, $form); + } + + public function testSetDataAdjustsSize() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + 'options' => array( + 'max_length' => 20, + ), + )); + $form->setData(array('foo@foo.com', 'foo@bar.com')); + + $this->assertInstanceOf('Symfony\Component\Form\Form', $form[0]); + $this->assertInstanceOf('Symfony\Component\Form\Form', $form[1]); + $this->assertCount(2, $form); + $this->assertEquals('foo@foo.com', $form[0]->getData()); + $this->assertEquals('foo@bar.com', $form[1]->getData()); + $this->assertEquals(20, $form[0]->getConfig()->getOption('max_length')); + $this->assertEquals(20, $form[1]->getConfig()->getOption('max_length')); + + $form->setData(array('foo@baz.com')); + $this->assertInstanceOf('Symfony\Component\Form\Form', $form[0]); + $this->assertFalse(isset($form[1])); + $this->assertCount(1, $form); + $this->assertEquals('foo@baz.com', $form[0]->getData()); + $this->assertEquals(20, $form[0]->getConfig()->getOption('max_length')); + } + + public function testThrowsExceptionIfObjectIsNotTraversable() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + )); + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + $form->setData(new \stdClass()); + } + + public function testNotResizedIfBoundWithMissingData() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + )); + $form->setData(array('foo@foo.com', 'bar@bar.com')); + $form->bind(array('foo@bar.com')); + + $this->assertTrue($form->has('0')); + $this->assertTrue($form->has('1')); + $this->assertEquals('foo@bar.com', $form[0]->getData()); + $this->assertEquals('', $form[1]->getData()); + } + + public function testResizedDownIfBoundWithMissingDataAndAllowDelete() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + 'allow_delete' => true, + )); + $form->setData(array('foo@foo.com', 'bar@bar.com')); + $form->bind(array('foo@foo.com')); + + $this->assertTrue($form->has('0')); + $this->assertFalse($form->has('1')); + $this->assertEquals('foo@foo.com', $form[0]->getData()); + $this->assertEquals(array('foo@foo.com'), $form->getData()); + } + + public function testNotResizedIfBoundWithExtraData() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + )); + $form->setData(array('foo@bar.com')); + $form->bind(array('foo@foo.com', 'bar@bar.com')); + + $this->assertTrue($form->has('0')); + $this->assertFalse($form->has('1')); + $this->assertEquals('foo@foo.com', $form[0]->getData()); + } + + public function testResizedUpIfBoundWithExtraDataAndAllowAdd() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'text', + 'allow_add' => true, + )); + $form->setData(array('foo@bar.com')); + $form->bind(array('foo@bar.com', 'bar@bar.com')); + + $this->assertTrue($form->has('0')); + $this->assertTrue($form->has('1')); + $this->assertEquals('foo@bar.com', $form[0]->getData()); + $this->assertEquals('bar@bar.com', $form[1]->getData()); + $this->assertEquals(array('foo@bar.com', 'bar@bar.com'), $form->getData()); + } + + public function testAllowAddButNoPrototype() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'form', + 'allow_add' => true, + 'prototype' => false, + )); + + $this->assertFalse($form->has('__name__')); + } + + public function testPrototypeMultipartPropagation() + { + $form = $this->factory + ->create('collection', null, array( + 'type' => 'file', + 'allow_add' => true, + 'prototype' => true, + )) + ; + + $this->assertTrue($form->createView()->vars['multipart']); + } + + public function testGetDataDoesNotContainsProtypeNameBeforeDataAreSet() + { + $form = $this->factory->create('collection', array(), array( + 'type' => 'file', + 'prototype' => true, + 'allow_add' => true, + )); + + $data = $form->getData(); + $this->assertFalse(isset($data['__name__'])); + } + + public function testGetDataDoesNotContainsPrototypeNameAfterDataAreSet() + { + $form = $this->factory->create('collection', array(), array( + 'type' => 'file', + 'allow_add' => true, + 'prototype' => true, + )); + + $form->setData(array('foobar.png')); + $data = $form->getData(); + $this->assertFalse(isset($data['__name__'])); + } + + public function testPrototypeNameOption() + { + $form = $this->factory->create('collection', null, array( + 'type' => 'form', + 'prototype' => true, + 'allow_add' => true, + )); + + $this->assertSame('__name__', $form->getConfig()->getAttribute('prototype')->getName(), '__name__ is the default'); + + $form = $this->factory->create('collection', null, array( + 'type' => 'form', + 'prototype' => true, + 'allow_add' => true, + 'prototype_name' => '__test__', + )); + + $this->assertSame('__test__', $form->getConfig()->getAttribute('prototype')->getName()); + } + + public function testPrototypeDefaultLabel() + { + $form = $this->factory->create('collection', array(), array( + 'type' => 'file', + 'allow_add' => true, + 'prototype' => true, + 'prototype_name' => '__test__', + )); + + $this->assertSame('__test__label__', $form->createView()->vars['prototype']->vars['label']); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php new file mode 100755 index 0000000000..e5c24a38f9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class CountryTypeTest extends LocalizedTestCase +{ + public function testCountriesAreSelectable() + { + \Locale::setDefault('de_AT'); + + $form = $this->factory->create('country'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + // Don't check objects for identity + $this->assertContains(new ChoiceView('DE', 'DE', 'Deutschland'), $choices, '', false, false); + $this->assertContains(new ChoiceView('GB', 'GB', 'Vereinigtes Königreich'), $choices, '', false, false); + $this->assertContains(new ChoiceView('US', 'US', 'Vereinigte Staaten'), $choices, '', false, false); + $this->assertContains(new ChoiceView('FR', 'FR', 'Frankreich'), $choices, '', false, false); + $this->assertContains(new ChoiceView('MY', 'MY', 'Malaysia'), $choices, '', false, false); + } + + public function testUnknownCountryIsNotIncluded() + { + $form = $this->factory->create('country', 'country'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + foreach ($choices as $choice) { + if ('ZZ' === $choice->value) { + $this->fail('Should not contain choice "ZZ"'); + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php new file mode 100755 index 0000000000..e394315f3e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php @@ -0,0 +1,440 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\FormError; + +class DateTimeTypeTest extends LocalizedTestCase +{ + public function testSubmit_dateTime() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + 'input' => 'datetime', + )); + + $form->bind(array( + 'date' => array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ), + 'time' => array( + 'hour' => '3', + 'minute' => '4', + ), + )); + + $dateTime = new \DateTime('2010-06-02 03:04:00 UTC'); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + } + + public function testSubmit_string() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + )); + + $form->bind(array( + 'date' => array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ), + 'time' => array( + 'hour' => '3', + 'minute' => '4', + ), + )); + + $this->assertEquals('2010-06-02 03:04:00', $form->getData()); + } + + public function testSubmit_timestamp() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'timestamp', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + )); + + $form->bind(array( + 'date' => array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ), + 'time' => array( + 'hour' => '3', + 'minute' => '4', + ), + )); + + $dateTime = new \DateTime('2010-06-02 03:04:00 UTC'); + + $this->assertEquals($dateTime->format('U'), $form->getData()); + } + + public function testSubmit_withSeconds() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + 'input' => 'datetime', + 'with_seconds' => true, + )); + + $form->setData(new \DateTime('2010-06-02 03:04:05 UTC')); + + $input = array( + 'date' => array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ), + 'time' => array( + 'hour' => '3', + 'minute' => '4', + 'second' => '5', + ), + ); + + $form->bind($input); + + $this->assertDateTimeEquals(new \DateTime('2010-06-02 03:04:05 UTC'), $form->getData()); + } + + public function testSubmit_differentTimezones() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Pacific/Tahiti', + 'date_widget' => 'choice', + 'time_widget' => 'choice', + 'input' => 'string', + 'with_seconds' => true, + )); + + $dateTime = new \DateTime('2010-06-02 03:04:05 Pacific/Tahiti'); + + $form->bind(array( + 'date' => array( + 'day' => (int) $dateTime->format('d'), + 'month' => (int) $dateTime->format('m'), + 'year' => (int) $dateTime->format('Y'), + ), + 'time' => array( + 'hour' => (int) $dateTime->format('H'), + 'minute' => (int) $dateTime->format('i'), + 'second' => (int) $dateTime->format('s'), + ), + )); + + $dateTime->setTimezone(new \DateTimeZone('America/New_York')); + + $this->assertEquals($dateTime->format('Y-m-d H:i:s'), $form->getData()); + } + + public function testSubmit_differentTimezonesDateTime() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Pacific/Tahiti', + 'widget' => 'single_text', + 'input' => 'datetime', + )); + + $outputTime = new \DateTime('2010-06-02 03:04:00 Pacific/Tahiti'); + + $form->bind('2010-06-02T03:04:00-10:00'); + + $outputTime->setTimezone(new \DateTimeZone('America/New_York')); + + $this->assertDateTimeEquals($outputTime, $form->getData()); + $this->assertEquals('2010-06-02T03:04:00-10:00', $form->getViewData()); + } + + public function testSubmit_stringSingleText() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + 'widget' => 'single_text', + )); + + $form->bind('2010-06-02T03:04:00Z'); + + $this->assertEquals('2010-06-02 03:04:00', $form->getData()); + $this->assertEquals('2010-06-02T03:04:00Z', $form->getViewData()); + } + + public function testSubmit_stringSingleText_withSeconds() + { + $form = $this->factory->create('datetime', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + 'widget' => 'single_text', + 'with_seconds' => true, + )); + + $form->bind('2010-06-02T03:04:05Z'); + + $this->assertEquals('2010-06-02 03:04:05', $form->getData()); + $this->assertEquals('2010-06-02T03:04:05Z', $form->getViewData()); + } + + public function testSubmit_differentPattern() + { + $form = $this->factory->create('datetime', null, array( + 'date_format' => 'MM*yyyy*dd', + 'date_widget' => 'single_text', + 'time_widget' => 'single_text', + 'input' => 'datetime', + )); + + $dateTime = new \DateTime('2010-06-02 03:04'); + + $form->bind(array( + 'date' => '06*2010*02', + 'time' => '03:04', + )); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + } + + // Bug fix + public function testInitializeWithDateTime() + { + // Throws an exception if "data_class" option is not explicitly set + // to null in the type + $this->factory->create('datetime', new \DateTime()); + } + + public function testSingleTextWidgetShouldUseTheRightInputType() + { + $form = $this->factory->create('datetime', null, array( + 'widget' => 'single_text', + )); + + $view = $form->createView(); + $this->assertEquals('datetime', $view->vars['type']); + } + + public function testPassDefaultEmptyValueToViewIfNotRequired() + { + $form = $this->factory->create('datetime', null, array( + 'required' => false, + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('', $view['date']['year']->vars['empty_value']); + $this->assertSame('', $view['date']['month']->vars['empty_value']); + $this->assertSame('', $view['date']['day']->vars['empty_value']); + $this->assertSame('', $view['time']['hour']->vars['empty_value']); + $this->assertSame('', $view['time']['minute']->vars['empty_value']); + $this->assertSame('', $view['time']['second']->vars['empty_value']); + } + + public function testPassNoEmptyValueToViewIfRequired() + { + $form = $this->factory->create('datetime', null, array( + 'required' => true, + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertNull($view['date']['year']->vars['empty_value']); + $this->assertNull($view['date']['month']->vars['empty_value']); + $this->assertNull($view['date']['day']->vars['empty_value']); + $this->assertNull($view['time']['hour']->vars['empty_value']); + $this->assertNull($view['time']['minute']->vars['empty_value']); + $this->assertNull($view['time']['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsString() + { + $form = $this->factory->create('datetime', null, array( + 'empty_value' => 'Empty', + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty', $view['date']['year']->vars['empty_value']); + $this->assertSame('Empty', $view['date']['month']->vars['empty_value']); + $this->assertSame('Empty', $view['date']['day']->vars['empty_value']); + $this->assertSame('Empty', $view['time']['hour']->vars['empty_value']); + $this->assertSame('Empty', $view['time']['minute']->vars['empty_value']); + $this->assertSame('Empty', $view['time']['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsArray() + { + $form = $this->factory->create('datetime', null, array( + 'empty_value' => array( + 'year' => 'Empty year', + 'month' => 'Empty month', + 'day' => 'Empty day', + 'hour' => 'Empty hour', + 'minute' => 'Empty minute', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['date']['year']->vars['empty_value']); + $this->assertSame('Empty month', $view['date']['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['date']['day']->vars['empty_value']); + $this->assertSame('Empty hour', $view['time']['hour']->vars['empty_value']); + $this->assertSame('Empty minute', $view['time']['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['time']['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addEmptyIfNotRequired() + { + $form = $this->factory->create('datetime', null, array( + 'required' => false, + 'empty_value' => array( + 'year' => 'Empty year', + 'day' => 'Empty day', + 'hour' => 'Empty hour', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['date']['year']->vars['empty_value']); + $this->assertSame('', $view['date']['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['date']['day']->vars['empty_value']); + $this->assertSame('Empty hour', $view['time']['hour']->vars['empty_value']); + $this->assertSame('', $view['time']['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['time']['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addNullIfRequired() + { + $form = $this->factory->create('datetime', null, array( + 'required' => true, + 'empty_value' => array( + 'year' => 'Empty year', + 'day' => 'Empty day', + 'hour' => 'Empty hour', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['date']['year']->vars['empty_value']); + $this->assertNull($view['date']['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['date']['day']->vars['empty_value']); + $this->assertSame('Empty hour', $view['time']['hour']->vars['empty_value']); + $this->assertNull($view['time']['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['time']['second']->vars['empty_value']); + } + + public function testPassHtml5TypeIfSingleTextAndHtml5Format() + { + $form = $this->factory->create('datetime', null, array( + 'widget' => 'single_text', + )); + + $view = $form->createView(); + $this->assertSame('datetime', $view->vars['type']); + } + + public function testDontPassHtml5TypeIfNotHtml5Format() + { + $form = $this->factory->create('datetime', null, array( + 'widget' => 'single_text', + 'format' => 'yyyy-MM-dd HH:mm', + )); + + $view = $form->createView(); + $this->assertFalse(isset($view->vars['type'])); + } + + public function testDontPassHtml5TypeIfNotSingleText() + { + $form = $this->factory->create('datetime', null, array( + 'widget' => 'text', + )); + + $view = $form->createView(); + $this->assertFalse(isset($view->vars['type'])); + } + + public function testDateTypeChoiceErrorsBubbleUp() + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('datetime', null); + + $form['date']->addError($error); + + $this->assertSame(array(), $form['date']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + public function testDateTypeSingleTextErrorsBubbleUp() + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('datetime', null, array( + 'date_widget' => 'single_text' + )); + + $form['date']->addError($error); + + $this->assertSame(array(), $form['date']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + public function testTimeTypeChoiceErrorsBubbleUp() + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('datetime', null); + + $form['time']->addError($error); + + $this->assertSame(array(), $form['time']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + public function testTimeTypeSingleTextErrorsBubbleUp() + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('datetime', null, array( + 'time_widget' => 'single_text' + )); + + $form['time']->addError($error); + + $this->assertSame(array(), $form['time']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php new file mode 100755 index 0000000000..fdff501668 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php @@ -0,0 +1,743 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; +use Symfony\Component\Form\FormError; + +class DateTypeTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_AT'); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testInvalidWidgetOption() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'fake_widget', + )); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testInvalidInputOption() + { + $form = $this->factory->create('date', null, array( + 'input' => 'fake_input', + )); + } + + public function testSubmitFromSingleTextDateTimeWithDefaultFormat() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + 'input' => 'datetime', + )); + + $form->bind('2010-06-02'); + + $this->assertDateTimeEquals(new \DateTime('2010-06-02 UTC'), $form->getData()); + $this->assertEquals('2010-06-02', $form->getViewData()); + } + + public function testSubmitFromSingleTextDateTime() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + 'input' => 'datetime', + )); + + $form->bind('2.6.2010'); + + $this->assertDateTimeEquals(new \DateTime('2010-06-02 UTC'), $form->getData()); + $this->assertEquals('02.06.2010', $form->getViewData()); + } + + public function testSubmitFromSingleTextString() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + 'input' => 'string', + )); + + $form->bind('2.6.2010'); + + $this->assertEquals('2010-06-02', $form->getData()); + $this->assertEquals('02.06.2010', $form->getViewData()); + } + + public function testSubmitFromSingleTextTimestamp() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + 'input' => 'timestamp', + )); + + $form->bind('2.6.2010'); + + $dateTime = new \DateTime('2010-06-02 UTC'); + + $this->assertEquals($dateTime->format('U'), $form->getData()); + $this->assertEquals('02.06.2010', $form->getViewData()); + } + + public function testSubmitFromSingleTextRaw() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + 'input' => 'array', + )); + + $form->bind('2.6.2010'); + + $output = array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ); + + $this->assertEquals($output, $form->getData()); + $this->assertEquals('02.06.2010', $form->getViewData()); + } + + public function testSubmitFromText() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'text', + )); + + $text = array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ); + + $form->bind($text); + + $dateTime = new \DateTime('2010-06-02 UTC'); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + $this->assertEquals($text, $form->getViewData()); + } + + public function testSubmitFromChoice() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'choice', + )); + + $text = array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ); + + $form->bind($text); + + $dateTime = new \DateTime('2010-06-02 UTC'); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + $this->assertEquals($text, $form->getViewData()); + } + + public function testSubmitFromChoiceEmpty() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'choice', + 'required' => false, + )); + + $text = array( + 'day' => '', + 'month' => '', + 'year' => '', + ); + + $form->bind($text); + + $this->assertNull($form->getData()); + $this->assertEquals($text, $form->getViewData()); + } + + public function testSubmitFromInputDateTimeDifferentPattern() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'format' => 'MM*yyyy*dd', + 'widget' => 'single_text', + 'input' => 'datetime', + )); + + $form->bind('06*2010*02'); + + $this->assertDateTimeEquals(new \DateTime('2010-06-02 UTC'), $form->getData()); + $this->assertEquals('06*2010*02', $form->getViewData()); + } + + public function testSubmitFromInputStringDifferentPattern() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'format' => 'MM*yyyy*dd', + 'widget' => 'single_text', + 'input' => 'string', + )); + + $form->bind('06*2010*02'); + + $this->assertEquals('2010-06-02', $form->getData()); + $this->assertEquals('06*2010*02', $form->getViewData()); + } + + public function testSubmitFromInputTimestampDifferentPattern() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'format' => 'MM*yyyy*dd', + 'widget' => 'single_text', + 'input' => 'timestamp', + )); + + $form->bind('06*2010*02'); + + $dateTime = new \DateTime('2010-06-02 UTC'); + + $this->assertEquals($dateTime->format('U'), $form->getData()); + $this->assertEquals('06*2010*02', $form->getViewData()); + } + + public function testSubmitFromInputRawDifferentPattern() + { + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'format' => 'MM*yyyy*dd', + 'widget' => 'single_text', + 'input' => 'array', + )); + + $form->bind('06*2010*02'); + + $output = array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + ); + + $this->assertEquals($output, $form->getData()); + $this->assertEquals('06*2010*02', $form->getViewData()); + } + + /** + * This test is to check that the strings '0', '1', '2', '3' are no accepted + * as valid IntlDateFormatter constants for FULL, LONG, MEDIUM or SHORT respectively. + * + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testThrowExceptionIfFormatIsNoPattern() + { + $this->factory->create('date', null, array( + 'format' => '0', + 'widget' => 'single_text', + 'input' => 'string', + )); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testThrowExceptionIfFormatDoesNotContainYearMonthAndDay() + { + $this->factory->create('date', null, array( + 'months' => array(6, 7), + 'format' => 'yy', + )); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testThrowExceptionIfFormatIsNoConstant() + { + $this->factory->create('date', null, array( + 'format' => 105, + )); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testThrowExceptionIfFormatIsInvalid() + { + $this->factory->create('date', null, array( + 'format' => array(), + )); + } + + public function testSetData_differentTimezones() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Pacific/Tahiti', + 'input' => 'string', + 'widget' => 'single_text', + )); + + $form->setData('2010-06-02'); + + $this->assertEquals('01.06.2010', $form->getViewData()); + } + + public function testSetData_differentTimezonesDateTime() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::MEDIUM, + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Pacific/Tahiti', + 'input' => 'datetime', + 'widget' => 'single_text', + )); + + $dateTime = new \DateTime('2010-06-02 America/New_York'); + + $form->setData($dateTime); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + $this->assertEquals('01.06.2010', $form->getViewData()); + } + + public function testYearsOption() + { + $form = $this->factory->create('date', null, array( + 'years' => array(2010, 2011), + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('2010', '2010', '2010'), + new ChoiceView('2011', '2011', '2011'), + ), $view['year']->vars['choices']); + } + + public function testMonthsOption() + { + $form = $this->factory->create('date', null, array( + 'months' => array(6, 7), + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('6', '6', '06'), + new ChoiceView('7', '7', '07'), + ), $view['month']->vars['choices']); + } + + public function testMonthsOptionShortFormat() + { + $form = $this->factory->create('date', null, array( + 'months' => array(1, 4), + 'format' => 'dd.MMM.yy', + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('1', '1', 'Jän'), + new ChoiceView('4', '4', 'Apr') + ), $view['month']->vars['choices']); + } + + public function testMonthsOptionLongFormat() + { + $form = $this->factory->create('date', null, array( + 'months' => array(1, 4), + 'format' => 'dd.MMMM.yy', + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('1', '1', 'Jänner'), + new ChoiceView('4', '4', 'April'), + ), $view['month']->vars['choices']); + } + + public function testMonthsOptionLongFormatWithDifferentTimezone() + { + $form = $this->factory->create('date', null, array( + 'months' => array(1, 4), + 'format' => 'dd.MMMM.yy', + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('1', '1', 'Jänner'), + new ChoiceView('4', '4', 'April'), + ), $view['month']->vars['choices']); + } + + public function testIsDayWithinRangeReturnsTrueIfWithin() + { + $form = $this->factory->create('date', null, array( + 'days' => array(6, 7), + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('6', '6', '06'), + new ChoiceView('7', '7', '07'), + ), $view['day']->vars['choices']); + } + + public function testIsPartiallyFilledReturnsFalseIfSingleText() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'single_text', + )); + + $form->bind('7.6.2010'); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilledReturnsFalseIfChoiceAndCompletelyEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'choice', + )); + + $form->bind(array( + 'day' => '', + 'month' => '', + 'year' => '', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilledReturnsFalseIfChoiceAndCompletelyFilled() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'choice', + )); + + $form->bind(array( + 'day' => '2', + 'month' => '6', + 'year' => '2010', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilledReturnsTrueIfChoiceAndDayEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('date', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'widget' => 'choice', + )); + + $form->bind(array( + 'day' => '', + 'month' => '6', + 'year' => '2010', + )); + + $this->assertTrue($form->isPartiallyFilled()); + } + + public function testPassDatePatternToView() + { + $form = $this->factory->create('date'); + $view = $form->createView(); + + $this->assertSame('{{ day }}.{{ month }}.{{ year }}', $view->vars['date_pattern']); + } + + public function testPassDatePatternToViewDifferentFormat() + { + $form = $this->factory->create('date', null, array( + 'format' => \IntlDateFormatter::LONG, + )); + + $view = $form->createView(); + + $this->assertSame('{{ day }}. {{ month }} {{ year }}', $view->vars['date_pattern']); + } + + public function testPassDatePatternToViewDifferentPattern() + { + $form = $this->factory->create('date', null, array( + 'format' => 'MM*yyyy*dd' + )); + + $view = $form->createView(); + + $this->assertSame('{{ month }}*{{ year }}*{{ day }}', $view->vars['date_pattern']); + } + + public function testDontPassDatePatternIfText() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'single_text', + )); + $view = $form->createView(); + + $this->assertFalse(isset($view->vars['date_pattern'])); + } + + public function testPassWidgetToView() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'single_text', + )); + $view = $form->createView(); + + $this->assertSame('single_text', $view->vars['widget']); + } + + // Bug fix + public function testInitializeWithDateTime() + { + // Throws an exception if "data_class" option is not explicitly set + // to null in the type + $this->factory->create('date', new \DateTime()); + } + + public function testSingleTextWidgetShouldUseTheRightInputType() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'single_text', + )); + + $view = $form->createView(); + $this->assertEquals('date', $view->vars['type']); + } + + public function testPassDefaultEmptyValueToViewIfNotRequired() + { + $form = $this->factory->create('date', null, array( + 'required' => false, + )); + + $view = $form->createView(); + $this->assertSame('', $view['year']->vars['empty_value']); + $this->assertSame('', $view['month']->vars['empty_value']); + $this->assertSame('', $view['day']->vars['empty_value']); + } + + public function testPassNoEmptyValueToViewIfRequired() + { + $form = $this->factory->create('date', null, array( + 'required' => true, + )); + + $view = $form->createView(); + $this->assertNull($view['year']->vars['empty_value']); + $this->assertNull($view['month']->vars['empty_value']); + $this->assertNull($view['day']->vars['empty_value']); + } + + public function testPassEmptyValueAsString() + { + $form = $this->factory->create('date', null, array( + 'empty_value' => 'Empty', + )); + + $view = $form->createView(); + $this->assertSame('Empty', $view['year']->vars['empty_value']); + $this->assertSame('Empty', $view['month']->vars['empty_value']); + $this->assertSame('Empty', $view['day']->vars['empty_value']); + } + + public function testPassEmptyValueAsArray() + { + $form = $this->factory->create('date', null, array( + 'empty_value' => array( + 'year' => 'Empty year', + 'month' => 'Empty month', + 'day' => 'Empty day', + ), + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['year']->vars['empty_value']); + $this->assertSame('Empty month', $view['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['day']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addEmptyIfNotRequired() + { + $form = $this->factory->create('date', null, array( + 'required' => false, + 'empty_value' => array( + 'year' => 'Empty year', + 'day' => 'Empty day', + ), + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['year']->vars['empty_value']); + $this->assertSame('', $view['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['day']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addNullIfRequired() + { + $form = $this->factory->create('date', null, array( + 'required' => true, + 'empty_value' => array( + 'year' => 'Empty year', + 'day' => 'Empty day', + ), + )); + + $view = $form->createView(); + $this->assertSame('Empty year', $view['year']->vars['empty_value']); + $this->assertNull($view['month']->vars['empty_value']); + $this->assertSame('Empty day', $view['day']->vars['empty_value']); + } + + public function testPassHtml5TypeIfSingleTextAndHtml5Format() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'single_text', + )); + + $view = $form->createView(); + $this->assertSame('date', $view->vars['type']); + } + + public function testDontPassHtml5TypeIfNotHtml5Format() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'single_text', + 'format' => \IntlDateFormatter::MEDIUM, + )); + + $view = $form->createView(); + $this->assertFalse(isset($view->vars['type'])); + } + + public function testDontPassHtml5TypeIfNotSingleText() + { + $form = $this->factory->create('date', null, array( + 'widget' => 'text', + )); + + $view = $form->createView(); + $this->assertFalse(isset($view->vars['type'])); + } + + public function provideCompoundWidgets() + { + return array( + array('text'), + array('choice'), + ); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testYearErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('date', null, array( + 'widget' => $widget, + )); + $form['year']->addError($error); + + $this->assertSame(array(), $form['year']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testMonthErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('date', null, array( + 'widget' => $widget, + )); + $form['month']->addError($error); + + $this->assertSame(array(), $form['month']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testDayErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('date', null, array( + 'widget' => $widget, + )); + $form['day']->addError($error); + + $this->assertSame(array(), $form['day']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php new file mode 100755 index 0000000000..68efc0cb20 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class FileTypeTest extends TypeTestCase +{ + // https://github.com/symfony/symfony/pull/5028 + public function testSetData() + { + $form = $this->factory->createBuilder('file')->getForm(); + $data = $this->createUploadedFileMock('abcdef', 'original.jpg', true); + + $form->setData($data); + + $this->assertSame($data, $form->getData()); + } + + public function testBind() + { + $form = $this->factory->createBuilder('file')->getForm(); + $data = $this->createUploadedFileMock('abcdef', 'original.jpg', true); + + $form->bind($data); + + $this->assertSame($data, $form->getData()); + } + + // https://github.com/symfony/symfony/issues/6134 + public function testBindEmpty() + { + $form = $this->factory->createBuilder('file')->getForm(); + + $form->bind(null); + + $this->assertNull($form->getData()); + } + + public function testDontPassValueToView() + { + $form = $this->factory->create('file'); + $form->bind(array( + 'file' => $this->createUploadedFileMock('abcdef', 'original.jpg', true), + )); + $view = $form->createView(); + + $this->assertEquals('', $view->vars['value']); + } + + private function createUploadedFileMock($name, $originalName, $valid) + { + $file = $this + ->getMockBuilder('Symfony\Component\HttpFoundation\File\UploadedFile') + ->disableOriginalConstructor() + ->getMock() + ; + $file + ->expects($this->any()) + ->method('getBasename') + ->will($this->returnValue($name)) + ; + $file + ->expects($this->any()) + ->method('getClientOriginalName') + ->will($this->returnValue($originalName)) + ; + $file + ->expects($this->any()) + ->method('isValid') + ->will($this->returnValue($valid)) + ; + + return $file; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php new file mode 100755 index 0000000000..6fbddeb6a4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -0,0 +1,662 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Form; +use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Tests\Fixtures\Author; +use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer; +use Symfony\Component\Form\FormError; + +class FormTest_AuthorWithoutRefSetter +{ + protected $reference; + + protected $referenceCopy; + + public function __construct($reference) + { + $this->reference = $reference; + $this->referenceCopy = $reference; + } + + // The returned object should be modified by reference without having + // to provide a setReference() method + public function getReference() + { + return $this->reference; + } + + // The returned object is a copy, so setReferenceCopy() must be used + // to update it + public function getReferenceCopy() + { + return is_object($this->referenceCopy) ? clone $this->referenceCopy : $this->referenceCopy; + } + + public function setReferenceCopy($reference) + { + $this->referenceCopy = $reference; + } +} + +class FormTypeTest extends TypeTestCase +{ + public function testPassRequiredAsOption() + { + $form = $this->factory->create('form', null, array('required' => false)); + + $this->assertFalse($form->isRequired()); + + $form = $this->factory->create('form', null, array('required' => true)); + + $this->assertTrue($form->isRequired()); + } + + public function testPassDisabledAsOption() + { + $form = $this->factory->create('form', null, array('disabled' => true)); + + $this->assertTrue($form->isDisabled()); + } + + public function testBoundDataIsTrimmedBeforeTransforming() + { + $form = $this->factory->createBuilder('form') + ->addViewTransformer(new FixedDataTransformer(array( + null => '', + 'reverse[a]' => 'a', + ))) + ->setCompound(false) + ->getForm(); + + $form->bind(' a '); + + $this->assertEquals('a', $form->getViewData()); + $this->assertEquals('reverse[a]', $form->getData()); + } + + public function testBoundDataIsNotTrimmedBeforeTransformingIfNoTrimming() + { + $form = $this->factory->createBuilder('form', null, array('trim' => false)) + ->addViewTransformer(new FixedDataTransformer(array( + null => '', + 'reverse[ a ]' => ' a ', + ))) + ->setCompound(false) + ->getForm(); + + $form->bind(' a '); + + $this->assertEquals(' a ', $form->getViewData()); + $this->assertEquals('reverse[ a ]', $form->getData()); + } + + public function testPassIdAndNameToView() + { + $form = $this->factory->createNamed('name', 'form'); + $view = $form->createView(); + + $this->assertEquals('name', $view->vars['id']); + $this->assertEquals('name', $view->vars['name']); + $this->assertEquals('name', $view->vars['full_name']); + } + + public function testStripLeadingUnderscoresAndDigitsFromId() + { + $form = $this->factory->createNamed('_09name', 'form'); + $view = $form->createView(); + + $this->assertEquals('name', $view->vars['id']); + $this->assertEquals('_09name', $view->vars['name']); + $this->assertEquals('_09name', $view->vars['full_name']); + } + + public function testPassIdAndNameToViewWithParent() + { + $parent = $this->factory->createNamed('parent', 'form'); + $parent->add($this->factory->createNamed('child', 'form')); + $view = $parent->createView(); + + $this->assertEquals('parent_child', $view['child']->vars['id']); + $this->assertEquals('child', $view['child']->vars['name']); + $this->assertEquals('parent[child]', $view['child']->vars['full_name']); + } + + public function testPassIdAndNameToViewWithGrandParent() + { + $parent = $this->factory->createNamed('parent', 'form'); + $parent->add($this->factory->createNamed('child', 'form')); + $parent['child']->add($this->factory->createNamed('grand_child', 'form')); + $view = $parent->createView(); + + $this->assertEquals('parent_child_grand_child', $view['child']['grand_child']->vars['id']); + $this->assertEquals('grand_child', $view['child']['grand_child']->vars['name']); + $this->assertEquals('parent[child][grand_child]', $view['child']['grand_child']->vars['full_name']); + } + + public function testNonReadOnlyFormWithReadOnlyParentBeingReadOnly() + { + $parent = $this->factory->createNamed('parent', 'form', null, array('read_only' => true)); + $child = $this->factory->createNamed('child', 'form'); + $view = $parent->add($child)->createView(); + + $this->assertTrue($view['child']->vars['read_only']); + } + + public function testReadOnlyFormWithNonReadOnlyParentBeingReadOnly() + { + $parent = $this->factory->createNamed('parent', 'form'); + $child = $this->factory->createNamed('child', 'form', null, array('read_only' => true)); + $view = $parent->add($child)->createView(); + + $this->assertTrue($view['child']->vars['read_only']); + } + + public function testNonReadOnlyFormWithNonReadOnlyParentBeingNonReadOnly() + { + $parent = $this->factory->createNamed('parent', 'form'); + $child = $this->factory->createNamed('child', 'form'); + $view = $parent->add($child)->createView(); + + $this->assertFalse($view['child']->vars['read_only']); + } + + public function testPassMaxLengthToView() + { + $form = $this->factory->create('form', null, array('max_length' => 10)); + $view = $form->createView(); + + $this->assertSame(10, $view->vars['max_length']); + } + + public function testPassTranslationDomainToView() + { + $form = $this->factory->create('form', null, array('translation_domain' => 'test')); + $view = $form->createView(); + + $this->assertSame('test', $view->vars['translation_domain']); + } + + public function testNonTranslationDomainFormWithTranslationDomainParentBeingTranslationDomain() + { + $parent = $this->factory->createNamed('parent', 'form', null, array('translation_domain' => 'test')); + $child = $this->factory->createNamed('child', 'form'); + $view = $parent->add($child)->createView(); + + $this->assertEquals('test', $view['child']->vars['translation_domain']); + } + + public function testTranslationDomainFormWithNonTranslationDomainParentBeingTranslationDomain() + { + $parent = $this->factory->createNamed('parent', 'form'); + $child = $this->factory->createNamed('child', 'form', null, array('translation_domain' => 'test')); + $view = $parent->add($child)->createView(); + + $this->assertEquals('test', $view['child']->vars['translation_domain']); + } + + public function testNonTranslationDomainFormWithNonTranslationDomainParentBeingTranslationDomainDefault() + { + $parent = $this->factory->createNamed('parent', 'form'); + $child = $this->factory->createNamed('child', 'form'); + $view = $parent->add($child)->createView(); + + $this->assertEquals('messages', $view['child']->vars['translation_domain']); + } + + public function testPassLabelToView() + { + $form = $this->factory->createNamed('__test___field', 'form', null, array('label' => 'My label')); + $view = $form->createView(); + + $this->assertSame('My label', $view->vars['label']); + } + + public function testDefaultTranslationDomain() + { + $form = $this->factory->create('form'); + $view = $form->createView(); + + $this->assertSame('messages', $view->vars['translation_domain']); + } + + public function testBindWithEmptyDataCreatesObjectIfClassAvailable() + { + $form = $this->factory->create('form', null, array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + 'required' => false, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + $form->add($this->factory->createNamed('lastName', 'text')); + + $form->setData(null); + // partially empty, still an object is created + $form->bind(array('firstName' => 'Bernhard', 'lastName' => '')); + + $author = new Author(); + $author->firstName = 'Bernhard'; + $author->setLastName(''); + + $this->assertEquals($author, $form->getData()); + } + + public function testBindWithEmptyDataCreatesObjectIfInitiallyBoundWithObject() + { + $form = $this->factory->create('form', null, array( + // data class is inferred from the passed object + 'data' => new Author(), + 'required' => false, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + $form->add($this->factory->createNamed('lastName', 'text')); + + $form->setData(null); + // partially empty, still an object is created + $form->bind(array('firstName' => 'Bernhard', 'lastName' => '')); + + $author = new Author(); + $author->firstName = 'Bernhard'; + $author->setLastName(''); + + $this->assertEquals($author, $form->getData()); + } + + public function testBindWithEmptyDataCreatesArrayIfDataClassIsNull() + { + $form = $this->factory->create('form', null, array( + 'data_class' => null, + 'required' => false, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + + $form->setData(null); + $form->bind(array('firstName' => 'Bernhard')); + + $this->assertSame(array('firstName' => 'Bernhard'), $form->getData()); + } + + public function testBindEmptyWithEmptyDataCreatesNoObjectIfNotRequired() + { + $form = $this->factory->create('form', null, array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + 'required' => false, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + $form->add($this->factory->createNamed('lastName', 'text')); + + $form->setData(null); + $form->bind(array('firstName' => '', 'lastName' => '')); + + $this->assertNull($form->getData()); + } + + public function testBindEmptyWithEmptyDataCreatesObjectIfRequired() + { + $form = $this->factory->create('form', null, array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + 'required' => true, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + $form->add($this->factory->createNamed('lastName', 'text')); + + $form->setData(null); + $form->bind(array('firstName' => '', 'lastName' => '')); + + $this->assertEquals(new Author(), $form->getData()); + } + + /* + * We need something to write the field values into + */ + public function testBindWithEmptyDataStoresArrayIfNoClassAvailable() + { + $form = $this->factory->create('form'); + $form->add($this->factory->createNamed('firstName', 'text')); + + $form->setData(null); + $form->bind(array('firstName' => 'Bernhard')); + + $this->assertSame(array('firstName' => 'Bernhard'), $form->getData()); + } + + public function testBindWithEmptyDataPassesEmptyStringToTransformerIfNotCompound() + { + $form = $this->factory->createBuilder('form') + ->addViewTransformer(new FixedDataTransformer(array( + // required for the initial, internal setData(null) + null => 'null', + // required to test that bind(null) is converted to '' + 'empty' => '', + ))) + ->setCompound(false) + ->getForm(); + + $form->bind(null); + + $this->assertSame('empty', $form->getData()); + } + + public function testBindWithEmptyDataUsesEmptyDataOption() + { + $author = new Author(); + + $form = $this->factory->create('form', null, array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + 'empty_data' => $author, + )); + $form->add($this->factory->createNamed('firstName', 'text')); + + $form->bind(array('firstName' => 'Bernhard')); + + $this->assertSame($author, $form->getData()); + $this->assertEquals('Bernhard', $author->firstName); + } + + public function provideZeros() + { + return array( + array(0, '0'), + array('0', '0'), + array('00000', '00000'), + ); + } + + /** + * @dataProvider provideZeros + * @see https://github.com/symfony/symfony/issues/1986 + */ + public function testSetDataThroughParamsWithZero($data, $dataAsString) + { + $form = $this->factory->create('form', null, array( + 'data' => $data, + 'compound' => false, + )); + $view = $form->createView(); + + $this->assertFalse($form->isEmpty()); + + $this->assertSame($dataAsString, $view->vars['value']); + $this->assertSame($dataAsString, $form->getData()); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testAttributesException() + { + $this->factory->create('form', null, array('attr' => '')); + } + + public function testNameCanBeEmptyString() + { + $form = $this->factory->createNamed('', 'form'); + + $this->assertEquals('', $form->getName()); + } + public function testSubformDoesntCallSetters() + { + $author = new FormTest_AuthorWithoutRefSetter(new Author()); + + $builder = $this->factory->createBuilder('form', $author); + $builder->add('reference', 'form', array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + )); + $builder->get('reference')->add('firstName', 'text'); + $form = $builder->getForm(); + + $form->bind(array( + // reference has a getter, but not setter + 'reference' => array( + 'firstName' => 'Foo', + ) + )); + + $this->assertEquals('Foo', $author->getReference()->firstName); + } + + public function testSubformCallsSettersIfTheObjectChanged() + { + // no reference + $author = new FormTest_AuthorWithoutRefSetter(null); + $newReference = new Author(); + + $builder = $this->factory->createBuilder('form', $author); + $builder->add('referenceCopy', 'form', array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + )); + $builder->get('referenceCopy')->add('firstName', 'text'); + $form = $builder->getForm(); + + $form['referenceCopy']->setData($newReference); // new author object + + $form->bind(array( + // referenceCopy has a getter that returns a copy + 'referenceCopy' => array( + 'firstName' => 'Foo', + ) + )); + + $this->assertEquals('Foo', $author->getReferenceCopy()->firstName); + } + + public function testSubformCallsSettersIfByReferenceIsFalse() + { + $author = new FormTest_AuthorWithoutRefSetter(new Author()); + + $builder = $this->factory->createBuilder('form', $author); + $builder->add('referenceCopy', 'form', array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + 'by_reference' => false + )); + $builder->get('referenceCopy')->add('firstName', 'text'); + $form = $builder->getForm(); + + $form->bind(array( + // referenceCopy has a getter that returns a copy + 'referenceCopy' => array( + 'firstName' => 'Foo', + ) + )); + + // firstName can only be updated if setReferenceCopy() was called + $this->assertEquals('Foo', $author->getReferenceCopy()->firstName); + } + + public function testSubformCallsSettersIfReferenceIsScalar() + { + $author = new FormTest_AuthorWithoutRefSetter('scalar'); + + $builder = $this->factory->createBuilder('form', $author); + $builder->add('referenceCopy', 'form'); + $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( + function () {}, + function ($value) { // reverseTransform + return 'foobar'; + } + )); + $form = $builder->getForm(); + + $form->bind(array( + 'referenceCopy' => array(), // doesn't matter actually + )); + + // firstName can only be updated if setReferenceCopy() was called + $this->assertEquals('foobar', $author->getReferenceCopy()); + } + + public function testSubformAlwaysInsertsIntoArrays() + { + $ref1 = new Author(); + $ref2 = new Author(); + $author = array('referenceCopy' => $ref1); + + $builder = $this->factory->createBuilder('form'); + $builder->setData($author); + $builder->add('referenceCopy', 'form'); + $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( + function () {}, + function ($value) use ($ref2) { // reverseTransform + return $ref2; + } + )); + $form = $builder->getForm(); + + $form->bind(array( + 'referenceCopy' => array('a' => 'b'), // doesn't matter actually + )); + + // the new reference was inserted into the array + $author = $form->getData(); + $this->assertSame($ref2, $author['referenceCopy']); + } + + public function testPassMultipartFalseToView() + { + $form = $this->factory->create('form'); + $view = $form->createView(); + + $this->assertFalse($view->vars['multipart']); + } + + public function testPassMultipartTrueIfAnyChildIsMultipartToView() + { + $form = $this->factory->create('form'); + $form->add($this->factory->create('text')); + $form->add($this->factory->create('file')); + $view = $form->createView(); + + $this->assertTrue($view->vars['multipart']); + } + + public function testCreateViewDoNoMarkItAsRendered() + { + $form = $this->factory->create('form'); + $form->add($this->factory->create('form')); + $view = $form->createView(); + + $this->assertFalse($view->isRendered()); + } + + public function testErrorBubblingIfCompound() + { + $form = $this->factory->create('form', null, array( + 'compound' => true, + )); + + $this->assertTrue($form->getConfig()->getErrorBubbling()); + } + + public function testNoErrorBubblingIfNotCompound() + { + $form = $this->factory->create('form', null, array( + 'compound' => false, + )); + + $this->assertFalse($form->getConfig()->getErrorBubbling()); + } + + public function testOverrideErrorBubbling() + { + $form = $this->factory->create('form', null, array( + 'compound' => false, + 'error_bubbling' => true, + )); + + $this->assertTrue($form->getConfig()->getErrorBubbling()); + } + + public function testPropertyPath() + { + $form = $this->factory->create('form', null, array( + 'property_path' => 'foo', + )); + + $this->assertEquals(new PropertyPath('foo'), $form->getPropertyPath()); + $this->assertTrue($form->getConfig()->getMapped()); + } + + public function testPropertyPathNullImpliesDefault() + { + $form = $this->factory->createNamed('name', 'form', null, array( + 'property_path' => null, + )); + + $this->assertEquals(new PropertyPath('name'), $form->getPropertyPath()); + $this->assertTrue($form->getConfig()->getMapped()); + } + + // BC + public function testPropertyPathFalseImpliesDefaultNotMapped() + { + $form = $this->factory->createNamed('name', 'form', null, array( + 'property_path' => false, + )); + + $this->assertEquals(new PropertyPath('name'), $form->getPropertyPath()); + $this->assertFalse($form->getConfig()->getMapped()); + } + + public function testNotMapped() + { + $form = $this->factory->create('form', null, array( + 'property_path' => 'foo', + 'mapped' => false, + )); + + $this->assertEquals(new PropertyPath('foo'), $form->getPropertyPath()); + $this->assertFalse($form->getConfig()->getMapped()); + } + + public function testViewValidUnbound() + { + $form = $this->factory->create('form'); + $view = $form->createView(); + $this->assertTrue($view->vars['valid']); + } + + public function testViewNotValidBound() + { + $form = $this->factory->create('form'); + $form->bind(array()); + $form->addError(new FormError('An error')); + $view = $form->createView(); + $this->assertFalse($view->vars['valid']); + } + + public function testDataOptionSupersedesSetDataCalls() + { + $form = $this->factory->create('form', null, array( + 'data' => 'default', + 'compound' => false, + )); + + $form->setData('foobar'); + + $this->assertSame('default', $form->getData()); + } + + public function testNormDataIsPassedToView() + { + $view = $this->factory->createBuilder('form') + ->addViewTransformer(new FixedDataTransformer(array( + 'foo' => 'bar', + ))) + ->setData('foo') + ->getForm() + ->createView(); + + $this->assertSame('foo', $view->vars['data']); + $this->assertSame('bar', $view->vars['value']); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php new file mode 100755 index 0000000000..435749a16b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class IntegerTypeTest extends LocalizedTestCase +{ + public function testSubmitCastsToInteger() + { + $form = $this->factory->create('integer'); + + $form->bind('1.678'); + + $this->assertSame(1, $form->getData()); + $this->assertSame('1', $form->getViewData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php new file mode 100755 index 0000000000..62ddae7635 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class LanguageTypeTest extends LocalizedTestCase +{ + public function testCountriesAreSelectable() + { + \Locale::setDefault('de_AT'); + + $form = $this->factory->create('language'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + $this->assertContains(new ChoiceView('en', 'en', 'Englisch'), $choices, '', false, false); + $this->assertContains(new ChoiceView('en_GB', 'en_GB', 'Britisches Englisch'), $choices, '', false, false); + $this->assertContains(new ChoiceView('en_US', 'en_US', 'Amerikanisches Englisch'), $choices, '', false, false); + $this->assertContains(new ChoiceView('fr', 'fr', 'Französisch'), $choices, '', false, false); + $this->assertContains(new ChoiceView('my', 'my', 'Birmanisch'), $choices, '', false, false); + } + + public function testMultipleLanguagesIsNotIncluded() + { + $form = $this->factory->create('language', 'language'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + $this->assertNotContains(new ChoiceView('mul', 'mul', 'Mehrsprachig'), $choices, '', false, false); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php new file mode 100755 index 0000000000..d02d2ba60c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class LocaleTypeTest extends LocalizedTestCase +{ + public function testLocalesAreSelectable() + { + \Locale::setDefault('de_AT'); + + $form = $this->factory->create('locale'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + $this->assertContains(new ChoiceView('en', 'en', 'Englisch'), $choices, '', false, false); + $this->assertContains(new ChoiceView('en_GB', 'en_GB', 'Englisch (Vereinigtes Königreich)'), $choices, '', false, false); + $this->assertContains(new ChoiceView('zh_Hant_MO', 'zh_Hant_MO', 'Chinesisch (traditionell, Sonderverwaltungszone Macao)'), $choices, '', false, false); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocalizedTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocalizedTestCase.php new file mode 100755 index 0000000000..1772d8cc55 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/LocalizedTestCase.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +abstract class LocalizedTestCase extends TypeTestCase +{ + protected function setUp() + { + parent::setUp(); + + if (!class_exists('Symfony\Component\Locale\Locale')) { + $this->markTestSkipped('The "Locale" component is not available'); + } + + if (!extension_loaded('intl')) { + $this->markTestSkipped('The "intl" extension is not available'); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php new file mode 100755 index 0000000000..d3e2932c01 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class MoneyTypeTest extends LocalizedTestCase +{ + public function testPassMoneyPatternToView() + { + \Locale::setDefault('de_DE'); + + $form = $this->factory->create('money'); + $view = $form->createView(); + + $this->assertSame('{{ widget }} €', $view->vars['money_pattern']); + } + + public function testMoneyPatternWorksForYen() + { + \Locale::setDefault('en_US'); + + $form = $this->factory->create('money', null, array('currency' => 'JPY')); + $view = $form->createView(); + $this->assertTrue((Boolean) strstr($view->vars['money_pattern'], '¥')); + } + + // https://github.com/symfony/symfony/issues/5458 + public function testPassDifferentPatternsForDifferentCurrencies() + { + \Locale::setDefault('de_DE'); + + $form1 = $this->factory->create('money', null, array('currency' => 'GBP')); + $form2 = $this->factory->create('money', null, array('currency' => 'EUR')); + $view1 = $form1->createView(); + $view2 = $form2->createView(); + + $this->assertSame('{{ widget }} £', $view1->get('money_pattern')); + $this->assertSame('{{ widget }} €', $view2->get('money_pattern')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php new file mode 100755 index 0000000000..a282190520 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class NumberTypeTest extends LocalizedTestCase +{ + protected function setUp() + { + parent::setUp(); + + \Locale::setDefault('de_DE'); + } + + public function testDefaultFormatting() + { + $form = $this->factory->create('number'); + $form->setData('12345.67890'); + $view = $form->createView(); + + $this->assertSame('12345,679', $view->vars['value']); + } + + public function testDefaultFormattingWithGrouping() + { + $form = $this->factory->create('number', null, array('grouping' => true)); + $form->setData('12345.67890'); + $view = $form->createView(); + + $this->assertSame('12.345,679', $view->vars['value']); + } + + public function testDefaultFormattingWithPrecision() + { + $form = $this->factory->create('number', null, array('precision' => 2)); + $form->setData('12345.67890'); + $view = $form->createView(); + + $this->assertSame('12345,68', $view->vars['value']); + } + + public function testDefaultFormattingWithRounding() + { + $form = $this->factory->create('number', null, array('precision' => 0, 'rounding_mode' => \NumberFormatter::ROUND_UP)); + $form->setData('12345.54321'); + $view = $form->createView(); + + $this->assertSame('12346', $view->vars['value']); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php new file mode 100755 index 0000000000..96f1410968 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class PasswordTypeTest extends TypeTestCase +{ + public function testEmptyIfNotBound() + { + $form = $this->factory->create('password'); + $form->setData('pAs5w0rd'); + $view = $form->createView(); + + $this->assertSame('', $view->vars['value']); + } + + public function testEmptyIfBound() + { + $form = $this->factory->create('password'); + $form->bind('pAs5w0rd'); + $view = $form->createView(); + + $this->assertSame('', $view->vars['value']); + } + + public function testNotEmptyIfBoundAndNotAlwaysEmpty() + { + $form = $this->factory->create('password', null, array('always_empty' => false)); + $form->bind('pAs5w0rd'); + $view = $form->createView(); + + $this->assertSame('pAs5w0rd', $view->vars['value']); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php new file mode 100755 index 0000000000..fa644e5c7a --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class RepeatedTypeTest extends TypeTestCase +{ + protected $form; + + protected function setUp() + { + parent::setUp(); + + $this->form = $this->factory->create('repeated', null, array( + 'type' => 'text', + )); + $this->form->setData(null); + } + + public function testSetData() + { + $this->form->setData('foobar'); + + $this->assertEquals('foobar', $this->form['first']->getData()); + $this->assertEquals('foobar', $this->form['second']->getData()); + } + + public function testSetOptions() + { + $form = $this->factory->create('repeated', null, array( + 'type' => 'text', + 'options' => array('label' => 'Global'), + )); + + $this->assertEquals('Global', $form['first']->getConfig()->getOption('label')); + $this->assertEquals('Global', $form['second']->getConfig()->getOption('label')); + $this->assertTrue($form['first']->isRequired()); + $this->assertTrue($form['second']->isRequired()); + } + + public function testSetOptionsPerChild() + { + $form = $this->factory->create('repeated', null, array( + // the global required value cannot be overridden + 'type' => 'text', + 'first_options' => array('label' => 'Test', 'required' => false), + 'second_options' => array('label' => 'Test2') + )); + + $this->assertEquals('Test', $form['first']->getConfig()->getOption('label')); + $this->assertEquals('Test2', $form['second']->getConfig()->getOption('label')); + $this->assertTrue($form['first']->isRequired()); + $this->assertTrue($form['second']->isRequired()); + } + + public function testSetRequired() + { + $form = $this->factory->create('repeated', null, array( + 'required' => false, + 'type' => 'text', + )); + + $this->assertFalse($form['first']->isRequired()); + $this->assertFalse($form['second']->isRequired()); + } + + public function testSetOptionsPerChildAndOverwrite() + { + $form = $this->factory->create('repeated', null, array( + 'type' => 'text', + 'options' => array('label' => 'Label'), + 'second_options' => array('label' => 'Second label') + )); + + $this->assertEquals('Label', $form['first']->getConfig()->getOption('label')); + $this->assertEquals('Second label', $form['second']->getConfig()->getOption('label')); + $this->assertTrue($form['first']->isRequired()); + $this->assertTrue($form['second']->isRequired()); + } + + public function testSubmitUnequal() + { + $input = array('first' => 'foo', 'second' => 'bar'); + + $this->form->bind($input); + + $this->assertEquals('foo', $this->form['first']->getViewData()); + $this->assertEquals('bar', $this->form['second']->getViewData()); + $this->assertFalse($this->form->isSynchronized()); + $this->assertEquals($input, $this->form->getViewData()); + $this->assertNull($this->form->getData()); + } + + public function testSubmitEqual() + { + $input = array('first' => 'foo', 'second' => 'foo'); + + $this->form->bind($input); + + $this->assertEquals('foo', $this->form['first']->getViewData()); + $this->assertEquals('foo', $this->form['second']->getViewData()); + $this->assertTrue($this->form->isSynchronized()); + $this->assertEquals($input, $this->form->getViewData()); + $this->assertEquals('foo', $this->form->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php new file mode 100755 index 0000000000..1f51a9dc35 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php @@ -0,0 +1,564 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; +use Symfony\Component\Form\FormError; + +class TimeTypeTest extends LocalizedTestCase +{ + public function testSubmit_dateTime() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'datetime', + )); + + $input = array( + 'hour' => '3', + 'minute' => '4', + ); + + $form->bind($input); + + $dateTime = new \DateTime('1970-01-01 03:04:00 UTC'); + + $this->assertEquals($dateTime, $form->getData()); + $this->assertEquals($input, $form->getViewData()); + } + + public function testSubmit_string() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + )); + + $input = array( + 'hour' => '3', + 'minute' => '4', + ); + + $form->bind($input); + + $this->assertEquals('03:04:00', $form->getData()); + $this->assertEquals($input, $form->getViewData()); + } + + public function testSubmit_timestamp() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'timestamp', + )); + + $input = array( + 'hour' => '3', + 'minute' => '4', + ); + + $form->bind($input); + + $dateTime = new \DateTime('1970-01-01 03:04:00 UTC'); + + $this->assertEquals($dateTime->format('U'), $form->getData()); + $this->assertEquals($input, $form->getViewData()); + } + + public function testSubmit_array() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'array', + )); + + $input = array( + 'hour' => '3', + 'minute' => '4', + ); + + $form->bind($input); + + $this->assertEquals($input, $form->getData()); + $this->assertEquals($input, $form->getViewData()); + } + + public function testSubmit_datetimeSingleText() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'datetime', + 'widget' => 'single_text', + )); + + $form->bind('03:04'); + + $this->assertEquals(new \DateTime('1970-01-01 03:04:00 UTC'), $form->getData()); + $this->assertEquals('03:04', $form->getViewData()); + } + + public function testSubmit_arraySingleText() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'array', + 'widget' => 'single_text', + )); + + $data = array( + 'hour' => '3', + 'minute' => '4', + ); + + $form->bind('03:04'); + + $this->assertEquals($data, $form->getData()); + $this->assertEquals('03:04', $form->getViewData()); + } + + public function testSubmit_arraySingleTextWithSeconds() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'array', + 'widget' => 'single_text', + 'with_seconds' => true, + )); + + $data = array( + 'hour' => '3', + 'minute' => '4', + 'second' => '5', + ); + + $form->bind('03:04:05'); + + $this->assertEquals($data, $form->getData()); + $this->assertEquals('03:04:05', $form->getViewData()); + } + + public function testSubmit_stringSingleText() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'string', + 'widget' => 'single_text', + )); + + $form->bind('03:04'); + + $this->assertEquals('03:04:00', $form->getData()); + $this->assertEquals('03:04', $form->getViewData()); + } + + public function testSetData_withSeconds() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'UTC', + 'view_timezone' => 'UTC', + 'input' => 'datetime', + 'with_seconds' => true, + )); + + $form->setData(new \DateTime('03:04:05 UTC')); + + $this->assertEquals(array('hour' => 3, 'minute' => 4, 'second' => 5), $form->getViewData()); + } + + public function testSetData_differentTimezones() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Asia/Hong_Kong', + 'input' => 'string', + 'with_seconds' => true, + )); + + $dateTime = new \DateTime('12:04:05'); + $dateTime->setTimezone(new \DateTimeZone('America/New_York')); + + $form->setData($dateTime->format('H:i:s')); + + $outputTime = clone $dateTime; + $outputTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $displayedData = array( + 'hour' => (int) $outputTime->format('H'), + 'minute' => (int) $outputTime->format('i'), + 'second' => (int) $outputTime->format('s') + ); + + $this->assertEquals($displayedData, $form->getViewData()); + } + + public function testSetData_differentTimezonesDateTime() + { + $form = $this->factory->create('time', null, array( + 'model_timezone' => 'America/New_York', + 'view_timezone' => 'Asia/Hong_Kong', + 'input' => 'datetime', + 'with_seconds' => true, + )); + + $dateTime = new \DateTime('12:04:05'); + $dateTime->setTimezone(new \DateTimeZone('America/New_York')); + + $form->setData($dateTime); + + $outputTime = clone $dateTime; + $outputTime->setTimezone(new \DateTimeZone('Asia/Hong_Kong')); + + $displayedData = array( + 'hour' => (int) $outputTime->format('H'), + 'minute' => (int) $outputTime->format('i'), + 'second' => (int) $outputTime->format('s') + ); + + $this->assertDateTimeEquals($dateTime, $form->getData()); + $this->assertEquals($displayedData, $form->getViewData()); + } + + public function testHoursOption() + { + $form = $this->factory->create('time', null, array( + 'hours' => array(6, 7), + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('6', '6', '06'), + new ChoiceView('7', '7', '07'), + ), $view['hour']->vars['choices']); + } + + public function testIsMinuteWithinRange_returnsTrueIfWithin() + { + $form = $this->factory->create('time', null, array( + 'minutes' => array(6, 7), + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('6', '6', '06'), + new ChoiceView('7', '7', '07'), + ), $view['minute']->vars['choices']); + } + + public function testIsSecondWithinRange_returnsTrueIfWithin() + { + $form = $this->factory->create('time', null, array( + 'seconds' => array(6, 7), + 'with_seconds' => true, + )); + + $view = $form->createView(); + + $this->assertEquals(array( + new ChoiceView('6', '6', '06'), + new ChoiceView('7', '7', '07'), + ), $view['second']->vars['choices']); + } + + public function testIsPartiallyFilled_returnsFalseIfCompletelyEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + )); + + $form->bind(array( + 'hour' => '', + 'minute' => '', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsFalseIfCompletelyEmpty_withSeconds() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + 'with_seconds' => true, + )); + + $form->bind(array( + 'hour' => '', + 'minute' => '', + 'second' => '', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsFalseIfCompletelyFilled() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + )); + + $form->bind(array( + 'hour' => '0', + 'minute' => '0', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsFalseIfCompletelyFilled_withSeconds() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + 'with_seconds' => true, + )); + + $form->bind(array( + 'hour' => '0', + 'minute' => '0', + 'second' => '0', + )); + + $this->assertFalse($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsTrueIfChoiceAndHourEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + 'with_seconds' => true, + )); + + $form->bind(array( + 'hour' => '', + 'minute' => '0', + 'second' => '0', + )); + + $this->assertTrue($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsTrueIfChoiceAndMinuteEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + 'with_seconds' => true, + )); + + $form->bind(array( + 'hour' => '0', + 'minute' => '', + 'second' => '0', + )); + + $this->assertTrue($form->isPartiallyFilled()); + } + + public function testIsPartiallyFilled_returnsTrueIfChoiceAndSecondsEmpty() + { + $this->markTestIncomplete('Needs to be reimplemented using validators'); + + $form = $this->factory->create('time', null, array( + 'widget' => 'choice', + 'with_seconds' => true, + )); + + $form->bind(array( + 'hour' => '0', + 'minute' => '0', + 'second' => '', + )); + + $this->assertTrue($form->isPartiallyFilled()); + } + + // Bug fix + public function testInitializeWithDateTime() + { + // Throws an exception if "data_class" option is not explicitly set + // to null in the type + $this->factory->create('time', new \DateTime()); + } + + public function testSingleTextWidgetShouldUseTheRightInputType() + { + $form = $this->factory->create('time', null, array( + 'widget' => 'single_text', + )); + + $view = $form->createView(); + $this->assertEquals('time', $view->vars['type']); + } + + public function testPassDefaultEmptyValueToViewIfNotRequired() + { + $form = $this->factory->create('time', null, array( + 'required' => false, + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('', $view['hour']->vars['empty_value']); + $this->assertSame('', $view['minute']->vars['empty_value']); + $this->assertSame('', $view['second']->vars['empty_value']); + } + + public function testPassNoEmptyValueToViewIfRequired() + { + $form = $this->factory->create('time', null, array( + 'required' => true, + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertNull($view['hour']->vars['empty_value']); + $this->assertNull($view['minute']->vars['empty_value']); + $this->assertNull($view['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsString() + { + $form = $this->factory->create('time', null, array( + 'empty_value' => 'Empty', + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty', $view['hour']->vars['empty_value']); + $this->assertSame('Empty', $view['minute']->vars['empty_value']); + $this->assertSame('Empty', $view['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsArray() + { + $form = $this->factory->create('time', null, array( + 'empty_value' => array( + 'hour' => 'Empty hour', + 'minute' => 'Empty minute', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty hour', $view['hour']->vars['empty_value']); + $this->assertSame('Empty minute', $view['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addEmptyIfNotRequired() + { + $form = $this->factory->create('time', null, array( + 'required' => false, + 'empty_value' => array( + 'hour' => 'Empty hour', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty hour', $view['hour']->vars['empty_value']); + $this->assertSame('', $view['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['second']->vars['empty_value']); + } + + public function testPassEmptyValueAsPartialArray_addNullIfRequired() + { + $form = $this->factory->create('time', null, array( + 'required' => true, + 'empty_value' => array( + 'hour' => 'Empty hour', + 'second' => 'Empty second', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('Empty hour', $view['hour']->vars['empty_value']); + $this->assertNull($view['minute']->vars['empty_value']); + $this->assertSame('Empty second', $view['second']->vars['empty_value']); + } + + public function provideCompoundWidgets() + { + return array( + array('text'), + array('choice'), + ); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testHourErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('time', null, array( + 'widget' => $widget, + )); + $form['hour']->addError($error); + + $this->assertSame(array(), $form['hour']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testMinuteErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('time', null, array( + 'widget' => $widget, + )); + $form['minute']->addError($error); + + $this->assertSame(array(), $form['minute']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } + + /** + * @dataProvider provideCompoundWidgets + */ + public function testSecondErrorsBubbleUp($widget) + { + $error = new FormError('Invalid!'); + $form = $this->factory->create('time', null, array( + 'widget' => $widget, + 'with_seconds' => true, + )); + $form['second']->addError($error); + + $this->assertSame(array(), $form['second']->getErrors()); + $this->assertSame(array($error), $form->getErrors()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php new file mode 100755 index 0000000000..fcb8c7eeb4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\Extension\Core\View\ChoiceView; + +class TimezoneTypeTest extends TypeTestCase +{ + public function testTimezonesAreSelectable() + { + $form = $this->factory->create('timezone'); + $view = $form->createView(); + $choices = $view->vars['choices']; + + $this->assertArrayHasKey('Africa', $choices); + $this->assertContains(new ChoiceView('Africa/Kinshasa', 'Africa/Kinshasa', 'Kinshasa'), $choices['Africa'], '', false, false); + + $this->assertArrayHasKey('America', $choices); + $this->assertContains(new ChoiceView('America/New_York', 'America/New_York', 'New York'), $choices['America'], '', false, false); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php new file mode 100755 index 0000000000..9101e45308 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\Tests\FormIntegrationTestCase; +use Symfony\Component\EventDispatcher\EventDispatcher; + +abstract class TypeTestCase extends FormIntegrationTestCase +{ + /** + * @var FormBuilder + */ + protected $builder; + + /** + * @var EventDispatcher + */ + protected $dispatcher; + + protected function setUp() + { + parent::setUp(); + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory); + } + + public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual) + { + self::assertEquals($expected->format('c'), $actual->format('c')); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php new file mode 100755 index 0000000000..d1fa6dad8d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Core\Type; + +class UrlTypeTest extends LocalizedTestCase +{ + public function testSubmitAddsDefaultProtocolIfNoneIsIncluded() + { + $form = $this->factory->create('url', 'name'); + + $form->bind('www.domain.com'); + + $this->assertSame('http://www.domain.com', $form->getData()); + $this->assertSame('http://www.domain.com', $form->getViewData()); + } + + public function testSubmitAddsNoDefaultProtocolIfAlreadyIncluded() + { + $form = $this->factory->create('url', null, array( + 'default_protocol' => 'http', + )); + + $form->bind('ftp://www.domain.com'); + + $this->assertSame('ftp://www.domain.com', $form->getData()); + $this->assertSame('ftp://www.domain.com', $form->getViewData()); + } + + public function testSubmitAddsNoDefaultProtocolIfEmpty() + { + $form = $this->factory->create('url', null, array( + 'default_protocol' => 'http', + )); + + $form->bind(''); + + $this->assertNull($form->getData()); + $this->assertSame('', $form->getViewData()); + } + + public function testSubmitAddsNoDefaultProtocolIfSetToNull() + { + $form = $this->factory->create('url', null, array( + 'default_protocol' => null, + )); + + $form->bind('www.domain.com'); + + $this->assertSame('www.domain.com', $form->getData()); + $this->assertSame('www.domain.com', $form->getViewData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php new file mode 100755 index 0000000000..c9e93884bf --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/DefaultCsrfProviderTest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Csrf\CsrfProvider; + +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider; + +/** + * @runTestsInSeparateProcesses + */ +class DefaultCsrfProviderTest extends \PHPUnit_Framework_TestCase +{ + protected $provider; + + public static function setUpBeforeClass() + { + @session_start(); + } + + protected function setUp() + { + $this->provider = new DefaultCsrfProvider('SECRET'); + } + + protected function tearDown() + { + $this->provider = null; + } + + public function testGenerateCsrfToken() + { + $token = $this->provider->generateCsrfToken('foo'); + + $this->assertEquals(sha1('SECRET'.'foo'.session_id()), $token); + } + + public function testIsCsrfTokenValidSucceeds() + { + $token = sha1('SECRET'.'foo'.session_id()); + + $this->assertTrue($this->provider->isCsrfTokenValid('foo', $token)); + } + + public function testIsCsrfTokenValidFails() + { + $token = sha1('SECRET'.'bar'.session_id()); + + $this->assertFalse($this->provider->isCsrfTokenValid('foo', $token)); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php new file mode 100755 index 0000000000..1dcc6b4c63 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Csrf\CsrfProvider; + +use Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider; + +class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase +{ + protected $provider; + protected $session; + + protected function setUp() + { + if (!class_exists('Symfony\Component\HttpFoundation\Session\Session')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $this->session = $this->getMock( + 'Symfony\Component\HttpFoundation\Session\Session', + array(), + array(), + '', + false // don't call constructor + ); + $this->provider = new SessionCsrfProvider($this->session, 'SECRET'); + } + + protected function tearDown() + { + $this->provider = null; + $this->session = null; + } + + public function testGenerateCsrfToken() + { + $this->session->expects($this->once()) + ->method('getId') + ->will($this->returnValue('ABCDEF')); + + $token = $this->provider->generateCsrfToken('foo'); + + $this->assertEquals(sha1('SECRET'.'foo'.'ABCDEF'), $token); + } + + public function testIsCsrfTokenValidSucceeds() + { + $this->session->expects($this->once()) + ->method('getId') + ->will($this->returnValue('ABCDEF')); + + $token = sha1('SECRET'.'foo'.'ABCDEF'); + + $this->assertTrue($this->provider->isCsrfTokenValid('foo', $token)); + } + + public function testIsCsrfTokenValidFails() + { + $this->session->expects($this->once()) + ->method('getId') + ->will($this->returnValue('ABCDEF')); + + $token = sha1('SECRET'.'bar'.'ABCDEF'); + + $this->assertFalse($this->provider->isCsrfTokenValid('foo', $token)); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php new file mode 100755 index 0000000000..47dd529270 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php @@ -0,0 +1,258 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Csrf\Type; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Csrf\CsrfExtension; +use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase; + +class FormTypeCsrfExtensionTest_ChildType extends AbstractType +{ + public function buildForm(FormBuilderInterface $builder, array $options) + { + // The form needs a child in order to trigger CSRF protection by + // default + $builder->add('name', 'text'); + } + + public function getName() + { + return 'csrf_collection_test'; + } +} + +class FormTypeCsrfExtensionTest extends TypeTestCase +{ + protected $csrfProvider; + + protected function setUp() + { + $this->csrfProvider = $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface'); + + parent::setUp(); + } + + protected function tearDown() + { + $this->csrfProvider = null; + + parent::tearDown(); + } + + protected function getExtensions() + { + return array_merge(parent::getExtensions(), array( + new CsrfExtension($this->csrfProvider), + )); + } + + public function testCsrfProtectionByDefaultIfRootAndCompound() + { + $view = $this->factory + ->create('form', null, array( + 'csrf_field_name' => 'csrf', + 'compound' => true, + )) + ->createView(); + + $this->assertTrue(isset($view['csrf'])); + } + + public function testNoCsrfProtectionByDefaultIfCompoundButNotRoot() + { + $view = $this->factory + ->createNamedBuilder('root', 'form') + ->add($this->factory + ->createNamedBuilder('form', 'form', null, array( + 'csrf_field_name' => 'csrf', + 'compound' => true, + )) + ) + ->getForm() + ->get('form') + ->createView(); + + $this->assertFalse(isset($view['csrf'])); + } + + public function testNoCsrfProtectionByDefaultIfRootButNotCompound() + { + $view = $this->factory + ->create('form', null, array( + 'csrf_field_name' => 'csrf', + 'compound' => false, + )) + ->createView(); + + $this->assertFalse(isset($view['csrf'])); + } + + public function testCsrfProtectionCanBeDisabled() + { + $view = $this->factory + ->create('form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_protection' => false, + 'compound' => true, + )) + ->createView(); + + $this->assertFalse(isset($view['csrf'])); + } + + public function testGenerateCsrfToken() + { + $this->csrfProvider->expects($this->once()) + ->method('generateCsrfToken') + ->with('%INTENTION%') + ->will($this->returnValue('token')); + + $view = $this->factory + ->create('form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_provider' => $this->csrfProvider, + 'intention' => '%INTENTION%', + 'compound' => true, + )) + ->createView(); + + $this->assertEquals('token', $view['csrf']->vars['value']); + } + + public function provideBoolean() + { + return array( + array(true), + array(false), + ); + } + + /** + * @dataProvider provideBoolean + */ + public function testValidateTokenOnBindIfRootAndCompound($valid) + { + $this->csrfProvider->expects($this->once()) + ->method('isCsrfTokenValid') + ->with('%INTENTION%', 'token') + ->will($this->returnValue($valid)); + + $form = $this->factory + ->createBuilder('form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_provider' => $this->csrfProvider, + 'intention' => '%INTENTION%', + 'compound' => true, + )) + ->add('child', 'text') + ->getForm(); + + $form->bind(array( + 'child' => 'foobar', + 'csrf' => 'token', + )); + + // Remove token from data + $this->assertSame(array('child' => 'foobar'), $form->getData()); + + // Validate accordingly + $this->assertSame($valid, $form->isValid()); + } + + public function testFailIfRootAndCompoundAndTokenMissing() + { + $this->csrfProvider->expects($this->never()) + ->method('isCsrfTokenValid'); + + $form = $this->factory + ->createBuilder('form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_provider' => $this->csrfProvider, + 'intention' => '%INTENTION%', + 'compound' => true, + )) + ->add('child', 'text') + ->getForm(); + + $form->bind(array( + 'child' => 'foobar', + // token is missing + )); + + // Remove token from data + $this->assertSame(array('child' => 'foobar'), $form->getData()); + + // Validate accordingly + $this->assertFalse($form->isValid()); + } + + public function testDontValidateTokenIfCompoundButNoRoot() + { + $this->csrfProvider->expects($this->never()) + ->method('isCsrfTokenValid'); + + $form = $this->factory + ->createNamedBuilder('root', 'form') + ->add($this->factory + ->createNamedBuilder('form', 'form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_provider' => $this->csrfProvider, + 'intention' => '%INTENTION%', + 'compound' => true, + )) + ) + ->getForm() + ->get('form'); + + $form->bind(array( + 'child' => 'foobar', + 'csrf' => 'token', + )); + } + + public function testDontValidateTokenIfRootButNotCompound() + { + $this->csrfProvider->expects($this->never()) + ->method('isCsrfTokenValid'); + + $form = $this->factory + ->create('form', null, array( + 'csrf_field_name' => 'csrf', + 'csrf_provider' => $this->csrfProvider, + 'intention' => '%INTENTION%', + 'compound' => false, + )); + + $form->bind(array( + 'csrf' => 'token', + )); + } + + public function testNoCsrfProtectionOnPrototype() + { + $prototypeView = $this->factory + ->create('collection', null, array( + 'type' => new FormTypeCsrfExtensionTest_ChildType(), + 'options' => array( + 'csrf_field_name' => 'csrf', + ), + 'prototype' => true, + 'allow_add' => true, + )) + ->createView() + ->vars['prototype']; + + $this->assertFalse(isset($prototypeView['csrf'])); + $this->assertCount(1, $prototypeView); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php new file mode 100755 index 0000000000..bfb9afa0a7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php @@ -0,0 +1,285 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\HttpFoundation\EventListener; + +use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener; +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormConfigBuilder; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\File\UploadedFile; + +/** + * @author Bernhard Schussek + */ +class BindRequestListenerTest extends \PHPUnit_Framework_TestCase +{ + private $values; + + private $filesPlain; + + private $filesNested; + + /** + * @var UploadedFile + */ + private $uploadedFile; + + protected function setUp() + { + $path = tempnam(sys_get_temp_dir(), 'sf2'); + touch($path); + + $this->values = array( + 'name' => 'Bernhard', + 'image' => array('filename' => 'foobar.png'), + ); + + $this->filesPlain = array( + 'image' => array( + 'error' => UPLOAD_ERR_OK, + 'name' => 'upload.png', + 'size' => 123, + 'tmp_name' => $path, + 'type' => 'image/png' + ), + ); + + $this->filesNested = array( + 'error' => array('image' => UPLOAD_ERR_OK), + 'name' => array('image' => 'upload.png'), + 'size' => array('image' => 123), + 'tmp_name' => array('image' => $path), + 'type' => array('image' => 'image/png'), + ); + + $this->uploadedFile = new UploadedFile($path, 'upload.png', 'image/png', 123, UPLOAD_ERR_OK); + } + + protected function tearDown() + { + unlink($this->uploadedFile->getRealPath()); + } + + public function requestMethodProvider() + { + return array( + array('POST'), + array('PUT'), + array('DELETE'), + array('PATCH'), + ); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindRequest($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $values = array('author' => $this->values); + $files = array('author' => $this->filesNested); + $request = new Request(array(), $values, array(), array(), $files, array( + 'REQUEST_METHOD' => $method, + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertEquals(array( + 'name' => 'Bernhard', + 'image' => $this->uploadedFile, + ), $event->getData()); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindRequestWithEmptyName($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request(array(), $this->values, array(), array(), $this->filesPlain, array( + 'REQUEST_METHOD' => $method, + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('', null, $dispatcher); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertEquals(array( + 'name' => 'Bernhard', + 'image' => $this->uploadedFile, + ), $event->getData()); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindEmptyRequestToCompoundForm($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request(array(), array(), array(), array(), array(), array( + 'REQUEST_METHOD' => $method, + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $config->setCompound(true); + $config->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface')); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + // Default to empty array + $this->assertEquals(array(), $event->getData()); + } + + /** + * @dataProvider requestMethodProvider + */ + public function testBindEmptyRequestToSimpleForm($method) + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request(array(), array(), array(), array(), array(), array( + 'REQUEST_METHOD' => $method, + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $config->setCompound(false); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + // Default to null + $this->assertNull($event->getData()); + } + + public function testBindGetRequest() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $values = array('author' => $this->values); + $request = new Request($values, array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertEquals(array( + 'name' => 'Bernhard', + 'image' => array('filename' => 'foobar.png'), + ), $event->getData()); + } + + public function testBindGetRequestWithEmptyName() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request($this->values, array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('', null, $dispatcher); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertEquals(array( + 'name' => 'Bernhard', + 'image' => array('filename' => 'foobar.png'), + ), $event->getData()); + } + + public function testBindEmptyGetRequestToCompoundForm() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request(array(), array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $config->setCompound(true); + $config->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface')); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertEquals(array(), $event->getData()); + } + + public function testBindEmptyGetRequestToSimpleForm() + { + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + + $request = new Request(array(), array(), array(), array(), array(), array( + 'REQUEST_METHOD' => 'GET', + )); + + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $config = new FormConfigBuilder('author', null, $dispatcher); + $config->setCompound(false); + $form = new Form($config); + $event = new FormEvent($form, $request); + + $listener = new BindRequestListener(); + $listener->preBind($event); + + $this->assertNull($event->getData()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php new file mode 100755 index 0000000000..b79fd5d41b --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -0,0 +1,590 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\Constraints; + +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Validator\ConstraintViolation; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\Extension\Validator\Constraints\Form; +use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Validator\Constraint; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\GlobalExecutionContext; +use Symfony\Component\Validator\ExecutionContext; + +/** + * @author Bernhard Schussek + */ +class FormValidatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dispatcher; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $factory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $serverParams; + + /** + * @var FormValidator + */ + private $validator; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\Event')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->serverParams = $this->getMock( + 'Symfony\Component\Form\Extension\Validator\Util\ServerParams', + array('getNormalizedIniPostMaxSize', 'getContentLength') + ); + $this->validator = new FormValidator($this->serverParams); + } + + public function testValidate() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $options = array('validation_groups' => array('group1', 'group2')); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->getForm(); + + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testValidateConstraints() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $constraint1 = new NotNull(array('groups' => array('group1', 'group2'))); + $constraint2 = new NotBlank(array('groups' => 'group2')); + + $options = array( + 'validation_groups' => array('group1', 'group2'), + 'constraints' => array($constraint1, $constraint2), + ); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->getForm(); + + // First default constraints + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'data', true); + + // Then custom constraints + $graphWalker->expects($this->at(2)) + ->method('walkConstraint') + ->with($constraint1, $object, 'group1', 'data'); + $graphWalker->expects($this->at(3)) + ->method('walkConstraint') + ->with($constraint2, $object, 'group2', 'data'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testDontValidateIfParentWithoutCascadeValidation() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + + $parent = $this->getBuilder('parent', null, array('cascade_validation' => false)) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $options = array('validation_groups' => array('group1', 'group2')); + $form = $this->getBuilder('name', '\stdClass', $options)->getForm(); + $parent->add($form); + + $form->setData($object); + + $graphWalker->expects($this->never()) + ->method('walkReference'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testValidateConstraintsEvenIfNoCascadeValidation() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $constraint1 = new NotNull(array('groups' => array('group1', 'group2'))); + $constraint2 = new NotBlank(array('groups' => 'group2')); + + $parent = $this->getBuilder('parent', null, array('cascade_validation' => false)) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $options = array( + 'validation_groups' => array('group1', 'group2'), + 'constraints' => array($constraint1, $constraint2), + ); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->getForm(); + $parent->add($form); + + $graphWalker->expects($this->at(0)) + ->method('walkConstraint') + ->with($constraint1, $object, 'group1', 'data'); + $graphWalker->expects($this->at(1)) + ->method('walkConstraint') + ->with($constraint2, $object, 'group2', 'data'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testDontValidateIfNotSynchronized() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + + $form = $this->getBuilder('name', '\stdClass', array( + 'invalid_message' => 'invalid_message_key', + // Invalid message parameters must be supported, because the + // invalid message can be a translation key + // see https://github.com/symfony/symfony/issues/5144 + 'invalid_message_parameters' => array('{{ foo }}' => 'bar'), + )) + ->setData($object) + ->addViewTransformer(new CallbackTransformer( + function ($data) { return $data; }, + function () { throw new TransformationFailedException(); } + )) + ->getForm(); + + // Launch transformer + $form->bind('foo'); + + $graphWalker->expects($this->never()) + ->method('walkReference'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + + $expectedViolation = new ConstraintViolation( + 'invalid_message_key', + array('{{ value }}' => 'foo', '{{ foo }}' => 'bar'), + 'Root', + null, + 'foo', + null, + Form::ERR_INVALID + ); + + $this->assertCount(1, $context->getViolations()); + $this->assertEquals($expectedViolation, $context->getViolations()->get(0)); + } + + public function testDontValidateConstraintsIfNotSynchronized() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $constraint1 = $this->getMock('Symfony\Component\Validator\Constraint'); + $constraint2 = $this->getMock('Symfony\Component\Validator\Constraint'); + + $options = array( + 'validation_groups' => array('group1', 'group2'), + 'constraints' => array($constraint1, $constraint2), + ); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->addViewTransformer(new CallbackTransformer( + function ($data) { return $data; }, + function () { throw new TransformationFailedException(); } + )) + ->getForm(); + + // Launch transformer + $form->bind(array()); + + $graphWalker->expects($this->never()) + ->method('walkReference'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + // https://github.com/symfony/symfony/issues/4359 + public function testDontMarkInvalidIfAnyChildIsNotSynchronized() + { + $context = $this->getExecutionContext(); + $object = $this->getMock('\stdClass'); + + $failingTransformer = new CallbackTransformer( + function ($data) { return $data; }, + function () { throw new TransformationFailedException(); } + ); + + $form = $this->getBuilder('name', '\stdClass') + ->setData($object) + ->addViewTransformer($failingTransformer) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->add( + $this->getBuilder('child') + ->addViewTransformer($failingTransformer) + ) + ->getForm(); + + // Launch transformer + $form->bind(array('child' => 'foo')); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + + $this->assertCount(0, $context->getViolations()); + } + + public function testHandleCallbackValidationGroups() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $options = array('validation_groups' => array($this, 'getValidationGroups')); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->getForm(); + + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testHandleClosureValidationGroups() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $options = array('validation_groups' => function(FormInterface $form){ + return array('group1', 'group2'); + }); + $form = $this->getBuilder('name', '\stdClass', $options) + ->setData($object) + ->getForm(); + + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testUseInheritedValidationGroup() + { + $context = $this->getExecutionContext('foo.bar'); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + + $parentOptions = array( + 'validation_groups' => 'group', + 'cascade_validation' => true, + ); + $parent = $this->getBuilder('parent', null, $parentOptions) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getBuilder('name', '\stdClass')->getForm(); + $parent->add($form); + + $form->setData($object); + + $graphWalker->expects($this->once()) + ->method('walkReference') + ->with($object, 'group', 'foo.bar.data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testUseInheritedCallbackValidationGroup() + { + $context = $this->getExecutionContext('foo.bar'); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + + $parentOptions = array( + 'validation_groups' => array($this, 'getValidationGroups'), + 'cascade_validation' => true, + ); + $parent = $this->getBuilder('parent', null, $parentOptions) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getBuilder('name', '\stdClass')->getForm(); + $parent->add($form); + + $form->setData($object); + + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'foo.bar.data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'foo.bar.data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testUseInheritedClosureValidationGroup() + { + $context = $this->getExecutionContext('foo.bar'); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + + $parentOptions = array( + 'validation_groups' => function(FormInterface $form){ + return array('group1', 'group2'); + }, + 'cascade_validation' => true, + ); + $parent = $this->getBuilder('parent', null, $parentOptions) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getBuilder('name', '\stdClass')->getForm(); + $parent->add($form); + + $form->setData($object); + + $graphWalker->expects($this->at(0)) + ->method('walkReference') + ->with($object, 'group1', 'foo.bar.data', true); + $graphWalker->expects($this->at(1)) + ->method('walkReference') + ->with($object, 'group2', 'foo.bar.data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testAppendPropertyPath() + { + $context = $this->getExecutionContext('foo.bar'); + $graphWalker = $context->getGraphWalker(); + $object = $this->getMock('\stdClass'); + $form = $this->getBuilder('name', '\stdClass') + ->setData($object) + ->getForm(); + + $graphWalker->expects($this->once()) + ->method('walkReference') + ->with($object, 'Default', 'foo.bar.data', true); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testDontWalkScalars() + { + $context = $this->getExecutionContext(); + $graphWalker = $context->getGraphWalker(); + + $form = $this->getBuilder() + ->setData('scalar') + ->getForm(); + + $graphWalker->expects($this->never()) + ->method('walkReference'); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + } + + public function testViolationIfExtraData() + { + $context = $this->getExecutionContext(); + + $form = $this->getBuilder('parent', null, array('extra_fields_message' => 'Extra!')) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->add($this->getBuilder('child')) + ->getForm(); + + $form->bind(array('foo' => 'bar')); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + + $this->assertCount(1, $context->getViolations()); + $this->assertEquals('Extra!', $context->getViolations()->get(0)->getMessage()); + } + + /** + * @dataProvider getPostMaxSizeFixtures + */ + public function testPostMaxSizeViolation($contentLength, $iniMax, $nbViolation, $msg) + { + $this->serverParams->expects($this->once()) + ->method('getContentLength') + ->will($this->returnValue($contentLength)); + $this->serverParams->expects($this->any()) + ->method('getNormalizedIniPostMaxSize') + ->will($this->returnValue($iniMax)); + + $context = $this->getExecutionContext(); + $options = array('post_max_size_message' => 'Max {{ max }}!'); + $form = $this->getBuilder('name', null, $options)->getForm(); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + + $this->assertCount($nbViolation, $context->getViolations()); + if (null !== $msg) { + $this->assertEquals($msg, $context->getViolations()->get(0)->getMessage()); + } + } + + public function getPostMaxSizeFixtures() + { + return array( + array(pow(1024, 3) + 1, '1G', 1, 'Max 1G!'), + array(pow(1024, 3), '1G', 0, null), + array(pow(1024, 2) + 1, '1M', 1, 'Max 1M!'), + array(pow(1024, 2), '1M', 0, null), + array(1024 + 1, '1K', 1, 'Max 1K!'), + array(1024, '1K', 0, null), + array(null, '1K', 0, null), + array(1024, '', 0, null), + ); + } + + public function testNoViolationIfNotRoot() + { + $this->serverParams->expects($this->once()) + ->method('getContentLength') + ->will($this->returnValue(1025)); + $this->serverParams->expects($this->never()) + ->method('getNormalizedIniPostMaxSize'); + + $context = $this->getExecutionContext(); + $parent = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getForm(); + $parent->add($form); + + $this->validator->initialize($context); + $this->validator->validate($form, new Form()); + + $this->assertCount(0, $context->getViolations()); + } + + /** + * Access has to be public, as this method is called via callback array + * in {@link testValidateFormDataCanHandleCallbackValidationGroups()} + * and {@link testValidateFormDataUsesInheritedCallbackValidationGroup()} + */ + public function getValidationGroups(FormInterface $form) + { + return array('group1', 'group2'); + } + + private function getMockGraphWalker() + { + return $this->getMockBuilder('Symfony\Component\Validator\GraphWalker') + ->disableOriginalConstructor() + ->getMock(); + } + + private function getMockMetadataFactory() + { + return $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface'); + } + + private function getExecutionContext($propertyPath = null) + { + $graphWalker = $this->getMockGraphWalker(); + $metadataFactory = $this->getMockMetadataFactory(); + $globalContext = new GlobalExecutionContext('Root', $graphWalker, $metadataFactory); + + return new ExecutionContext($globalContext, null, $propertyPath, null, null, null); + } + + /** + * @param string $name + * @param string $dataClass + * @param array $options + * + * @return FormBuilder + */ + private function getBuilder($name = 'name', $dataClass = null, array $options = array()) + { + $options = array_replace(array( + 'constraints' => array(), + 'invalid_message_parameters' => array(), + ), $options); + + return new FormBuilder($name, $dataClass, $this->dispatcher, $this->factory, $options); + } + + private function getForm($name = 'name', $dataClass = null) + { + return $this->getBuilder($name, $dataClass)->getForm(); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php new file mode 100755 index 0000000000..69dd6fa9b2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php @@ -0,0 +1,149 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\EventListener; + +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Extension\Validator\Constraints\Form; +use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener; +use Symfony\Component\Validator\ConstraintViolation; + +class ValidationListenerTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dispatcher; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $factory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $validator; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $violationMapper; + + /** + * @var ValidationListener + */ + private $listener; + + private $message; + + private $params; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\Event')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface'); + $this->violationMapper = $this->getMock('Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapperInterface'); + $this->listener = new ValidationListener($this->validator, $this->violationMapper); + $this->message = 'Message'; + $this->params = array('foo' => 'bar'); + } + + private function getConstraintViolation($code = null) + { + return new ConstraintViolation($this->message, $this->params, null, 'prop.path', null, null, $code); + } + + private function getFormError() + { + return new FormError($this->message, $this->params); + } + + private function getBuilder($name = 'name', $propertyPath = null, $dataClass = null) + { + $builder = new FormBuilder($name, $dataClass, $this->dispatcher, $this->factory); + $builder->setPropertyPath(new PropertyPath($propertyPath ?: $name)); + $builder->setAttribute('error_mapping', array()); + $builder->setErrorBubbling(false); + $builder->setMapped(true); + + return $builder; + } + + private function getForm($name = 'name', $propertyPath = null, $dataClass = null) + { + return $this->getBuilder($name, $propertyPath, $dataClass)->getForm(); + } + + private function getMockForm() + { + return $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + } + + // More specific mapping tests can be found in ViolationMapperTest + public function testMapViolation() + { + $violation = $this->getConstraintViolation(); + $form = $this->getForm('street'); + + $this->validator->expects($this->once()) + ->method('validate') + ->will($this->returnValue(array($violation))); + + $this->violationMapper->expects($this->once()) + ->method('mapViolation') + ->with($violation, $form, false); + + $this->listener->validateForm(new FormEvent($form, null)); + } + + public function testMapViolationAllowsNonSyncIfInvalid() + { + $violation = $this->getConstraintViolation(Form::ERR_INVALID); + $form = $this->getForm('street'); + + $this->validator->expects($this->once()) + ->method('validate') + ->will($this->returnValue(array($violation))); + + $this->violationMapper->expects($this->once()) + ->method('mapViolation') + // pass true now + ->with($violation, $form, true); + + $this->listener->validateForm(new FormEvent($form, null)); + } + + public function testValidateIgnoresNonRoot() + { + $form = $this->getMockForm(); + $form->expects($this->once()) + ->method('isRoot') + ->will($this->returnValue(false)); + + $this->validator->expects($this->never()) + ->method('validate'); + + $this->violationMapper->expects($this->never()) + ->method('mapViolation'); + + $this->listener->validateForm(new FormEvent($form, null)); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php new file mode 100755 index 0000000000..13faefe956 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\Type; + +use Symfony\Component\Form\FormInterface; + +class FormTypeValidatorExtensionTest extends TypeTestCase +{ + public function testValidationGroupNullByDefault() + { + $form = $this->factory->create('form'); + + $this->assertNull($form->getConfig()->getOption('validation_groups')); + } + + public function testValidationGroupsTransformedToArray() + { + $form = $this->factory->create('form', null, array( + 'validation_groups' => 'group', + )); + + $this->assertEquals(array('group'), $form->getConfig()->getOption('validation_groups')); + } + + public function testValidationGroupsCanBeSetToArray() + { + $form = $this->factory->create('form', null, array( + 'validation_groups' => array('group1', 'group2'), + )); + + $this->assertEquals(array('group1', 'group2'), $form->getConfig()->getOption('validation_groups')); + } + + public function testValidationGroupsCanBeSetToCallback() + { + $form = $this->factory->create('form', null, array( + 'validation_groups' => array($this, 'testValidationGroupsCanBeSetToCallback'), + )); + + $this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups'))); + } + + public function testValidationGroupsCanBeSetToClosure() + { + $form = $this->factory->create('form', null, array( + 'validation_groups' => function(FormInterface $form){ return null; }, + )); + + $this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups'))); + } + + public function testBindValidatesData() + { + $builder = $this->factory->createBuilder('form', null, array( + 'validation_groups' => 'group', + )); + $builder->add('firstName', 'form'); + $form = $builder->getForm(); + + $this->validator->expects($this->once()) + ->method('validate') + ->with($this->equalTo($form)); + + // specific data is irrelevant + $form->bind(array()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php new file mode 100755 index 0000000000..9fbc17cb58 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\Type; + +use Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase as BaseTestCase; +use Symfony\Component\Form\Extension\Validator\ValidatorExtension; + +abstract class TypeTestCase extends BaseTestCase +{ + protected $validator; + + protected function setUp() + { + if (!class_exists('Symfony\Component\Validator\Constraint')) { + $this->markTestSkipped('The "Validator" component is not available'); + } + + $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface'); + $metadataFactory = $this->getMock('Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface'); + $this->validator->expects($this->once())->method('getMetadataFactory')->will($this->returnValue($metadataFactory)); + $metadata = $this->getMockBuilder('Symfony\Component\Validator\Mapping\ClassMetadata')->disableOriginalConstructor()->getMock(); + $metadataFactory->expects($this->once())->method('getClassMetadata')->will($this->returnValue($metadata)); + + parent::setUp(); + } + + protected function tearDown() + { + $this->validator = null; + + parent::tearDown(); + } + + protected function getExtensions() + { + return array_merge(parent::getExtensions(), array( + new ValidatorExtension($this->validator), + )); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php new file mode 100755 index 0000000000..e192f07108 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php @@ -0,0 +1,1497 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormConfigBuilder; +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Validator\ConstraintViolation; + +/** + * @author Bernhard Schussek + */ +class ViolationMapperTest extends \PHPUnit_Framework_TestCase +{ + const LEVEL_0 = 0; + + const LEVEL_1 = 1; + + const LEVEL_1B = 2; + + const LEVEL_2 = 3; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dispatcher; + + /** + * @var ViolationMapper + */ + private $mapper; + + /** + * @var string + */ + private $message; + + /** + * @var array + */ + private $params; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\Event')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->mapper = new ViolationMapper(); + $this->message = 'Message'; + $this->params = array('foo' => 'bar'); + } + + protected function getForm($name = 'name', $propertyPath = null, $dataClass = null, $errorMapping = array(), $virtual = false, $synchronized = true) + { + $config = new FormConfigBuilder($name, $dataClass, $this->dispatcher, array( + 'error_mapping' => $errorMapping, + )); + $config->setMapped(true); + $config->setVirtual($virtual); + $config->setPropertyPath($propertyPath); + $config->setCompound(true); + $config->setDataMapper($this->getDataMapper()); + + if (!$synchronized) { + $config->addViewTransformer(new CallbackTransformer( + function ($normData) { return $normData; }, + function () { throw new TransformationFailedException(); } + )); + } + + return new Form($config); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getDataMapper() + { + return $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + /** + * @param $propertyPath + * + * @return ConstraintViolation + */ + protected function getConstraintViolation($propertyPath) + { + return new ConstraintViolation($this->message, $this->params, null, $propertyPath, null); + } + + /** + * @return FormError + */ + protected function getFormError() + { + return new FormError($this->message, $this->params); + } + + public function testMapToVirtualFormIfDataDoesNotMatch() + { + $violation = $this->getConstraintViolation('children[address].data.foo'); + $parent = $this->getForm('parent'); + $child = $this->getForm('address', 'address', null, array(), true); + $grandChild = $this->getForm('street'); + + $parent->add($child); + $child->add($grandChild); + + $this->mapper->mapViolation($violation, $parent); + + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $child->getErrors(), $child->getName() . ' should have an error, but has none'); + $this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one'); + } + + public function testFollowDotRules() + { + $violation = $this->getConstraintViolation('data.foo'); + $parent = $this->getForm('parent', null, null, array( + 'foo' => 'address', + )); + $child = $this->getForm('address', null, null, array( + '.' => 'street', + )); + $grandChild = $this->getForm('street', null, null, array( + '.' => 'name', + )); + $grandGrandChild = $this->getForm('name'); + + $parent->add($child); + $child->add($grandChild); + $grandChild->add($grandGrandChild); + + $this->mapper->mapViolation($violation, $parent); + + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $grandGrandChild->getErrors(), $grandGrandChild->getName() . ' should have an error, but has none'); + } + + public function testAbortMappingIfNotSynchronized() + { + $violation = $this->getConstraintViolation('children[address].data.street'); + $parent = $this->getForm('parent'); + $child = $this->getForm('address', 'address', null, array(), false, false); + // even though "street" is synchronized, it should not have any errors + // due to its parent not being synchronized + $grandChild = $this->getForm('street' , 'street'); + + $parent->add($child); + $child->add($grandChild); + + // bind to invoke the transformer and mark the form unsynchronized + $parent->bind(array()); + + $this->mapper->mapViolation($violation, $parent); + + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one'); + } + + public function testAbortVirtualFormMappingIfNotSynchronized() + { + $violation = $this->getConstraintViolation('children[address].children[street].data.foo'); + $parent = $this->getForm('parent'); + $child = $this->getForm('address', 'address', null, array(), true, false); + // even though "street" is synchronized, it should not have any errors + // due to its parent not being synchronized + $grandChild = $this->getForm('street' , 'street', null, array(), true); + + $parent->add($child); + $child->add($grandChild); + + // bind to invoke the transformer and mark the form unsynchronized + $parent->bind(array()); + + $this->mapper->mapViolation($violation, $parent); + + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one'); + } + + public function testAbortDotRuleMappingIfNotSynchronized() + { + $violation = $this->getConstraintViolation('data.address'); + $parent = $this->getForm('parent'); + $child = $this->getForm('address', 'address', null, array( + '.' => 'street', + ), false, false); + // even though "street" is synchronized, it should not have any errors + // due to its parent not being synchronized + $grandChild = $this->getForm('street'); + + $parent->add($child); + $child->add($grandChild); + + // bind to invoke the transformer and mark the form unsynchronized + $parent->bind(array()); + + $this->mapper->mapViolation($violation, $parent); + + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $child->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChild->getName() . ' should not have an error, but has one'); + } + + public function provideDefaultTests() + { + // The mapping must be deterministic! If a child has the property path "[street]", + // "data[street]" should be mapped, but "data.street" should not! + return array( + // mapping target, child name, its property path, grand child name, its property path, violation path + array(self::LEVEL_0, 'address', 'address', 'street', 'street', ''), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data'), + + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.address.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'data[address].street'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'data.person.address.street'), + array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'data.person.address.street.prop'), + array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'data.person.address[street]'), + array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address].street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address.street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address].street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'data.person.address.street'), + array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'data.person.address.street.prop'), + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'data.person.address[street]'), + array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address].street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address.street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address].street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address.street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address[street].prop'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'data.person[address].street'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'data.person[address].street.prop'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'data.person[address][street]'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address.street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address].street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address.street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address[street].prop'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'data.person[address].street'), + array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'data.person[address].street.prop'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'data.person[address][street]'), + array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address.street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address].street'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address.street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address].street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address][street].prop'), + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'data[person].address.street'), + array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'data[person].address.street.prop'), + array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'data[person].address[street]'), + array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address].street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address.street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address].street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address][street].prop'), + array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'data[person].address.street'), + array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'data[person].address.street.prop'), + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'data[person].address[street]'), + array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'data[person].address[street].prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address].street'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address].street.prop'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address][street]'), + array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address]'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address.street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address].street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address.street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address[street].prop'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'data[person][address].street'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'data[person][address].street.prop'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'data[person][address][street]'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].data[street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address.street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address.street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address[street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address[street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address].street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address].street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address][street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address][street].prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address.street'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address.street.prop'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address[street]'), + array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address[street].prop'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'data[person][address].street'), + array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'data[person][address].street.prop'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'data[person][address][street]'), + array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'data[person][address][street].prop'), + + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].data.office.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office][street].prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'data.address.office.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'data.address.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office][street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office.street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office].street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].data.office.street'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office][street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office].street'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office].street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office][street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office][street].prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'data[address].office.street'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'data[address].office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address].office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address].office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office.street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].data.office[street]'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office][street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address.office.street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'data.address.office[street]'), + array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'data.address.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office][street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office.street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office].street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office.street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office[street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office][street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office].street'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office].street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office][street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office][street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address].office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address].office.street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'data[address].office[street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'data[address].office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office]'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].data[office].street'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office][street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office[street].prop'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'data.address[office].street'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'data.address[office].street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address[office][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address[office][street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office.street'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office].street'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office]'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].data[office].street'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].data[office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office][street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office].street'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office].street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office][street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office][street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office[street].prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'data[address][office].street'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'data[address][office].street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address][office][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office].street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].data[office][street]'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].data[office][street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office.street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office[street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address[office].street'), + array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address[office].street.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'data.address[office][street]'), + array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'data.address[office][street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office.street'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office].street'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office][street].prop'), + + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office].street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office][street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office][street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office.street'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office.street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office[street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office[street].prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office].street'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office].street.prop'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office][street]'), + array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office][street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office.street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office.street.prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office[street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office[street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address][office].street'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address][office].street.prop'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'data[address][office][street]'), + array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'data[address][office][street].prop'), + + // Edge cases which must not occur + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address][street].prop'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address][street]'), + array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address][street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address][street].prop'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address][street]'), + array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address][street].prop'), + + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].children[address].children[street]'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].children[address].data.street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].data.address.street'), + array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.address.street'), + + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].children[office].children[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].children[office].data.street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.street'), + array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.street'), + ); + } + + /** + * @dataProvider provideDefaultTests + */ + public function testDefaultErrorMapping($target, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath) + { + $violation = $this->getConstraintViolation($violationPath); + $parent = $this->getForm('parent'); + $child = $this->getForm($childName, $childPath); + $grandChild = $this->getForm($grandChildName, $grandChildPath); + + $parent->add($child); + $child->add($grandChild); + + $this->mapper->mapViolation($violation, $parent); + + if (self::LEVEL_0 === $target) { + $this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } elseif (self::LEVEL_1 === $target) { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } else { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none'); + } + } + + public function provideCustomDataErrorTests() + { + return array( + // mapping target, error mapping, child name, its property path, grand child name, its property path, violation path + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address]'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.street'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street]'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'), + + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.street'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].street'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street]'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street].prop'), + + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'), + + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.street'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street].prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street.prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street]'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street].prop'), + + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].street'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street].prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street.prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street]'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street].prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street'), + array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street.prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street]'), + array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street].prop'), + + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'), + + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'), + + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'), + + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'), + + array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'), + array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'), + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'), + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'), + + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'), + array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'), + array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'), + array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'), + array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'), + array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'), + array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'), + array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'), + array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'), + array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'), + array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'), + array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'), + array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'), + array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'), + array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'), + array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'), + array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'), + array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'), + array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'), + + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'), + array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'), + array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'), + array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'), + array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'), + + array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', 'street', 'data.foo'), + array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo]'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo'), + array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.prop'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo]'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].prop'), + + array(self::LEVEL_2, 'foo', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo'), + array(self::LEVEL_2, 'foo', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.prop'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo]'), + array(self::LEVEL_2, '[foo]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].prop'), + + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'), + + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.bar'), + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.bar.prop'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo[bar]'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo[bar].prop'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].bar'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].bar.prop'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo][bar]'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo][bar].prop'), + + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.bar'), + array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.bar.prop'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo[bar]'), + array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo[bar].prop'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].bar'), + array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].bar.prop'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo][bar]'), + array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo][bar].prop'), + + // Edge cases + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'), + + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'), + array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'), + array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'), + array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'), + ); + } + + /** + * @dataProvider provideCustomDataErrorTests + */ + public function testCustomDataErrorMapping($target, $mapFrom, $mapTo, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath) + { + $violation = $this->getConstraintViolation($violationPath); + $parent = $this->getForm('parent', null, null, array($mapFrom => $mapTo)); + $child = $this->getForm($childName, $childPath); + $grandChild = $this->getForm($grandChildName, $grandChildPath); + + $parent->add($child); + $child->add($grandChild); + + // Add a field mapped to the first element of $mapFrom + // to try to distract the algorithm + // Only add it if we expect the error to come up on a different + // level than LEVEL_0, because in this case the error would + // (correctly) be mapped to the distraction field + if ($target !== self::LEVEL_0) { + $mapFromPath = new PropertyPath($mapFrom); + $mapFromPrefix = $mapFromPath->isIndex(0) + ? '['.$mapFromPath->getElement(0).']' + : $mapFromPath->getElement(0); + $distraction = $this->getForm('distraction', $mapFromPrefix); + + $parent->add($distraction); + } + + $this->mapper->mapViolation($violation, $parent); + + if ($target !== self::LEVEL_0) { + $this->assertCount(0, $distraction->getErrors(), 'distraction should not have an error, but has one'); + } + + if (self::LEVEL_0 === $target) { + $this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } elseif (self::LEVEL_1 === $target) { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } else { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none'); + } + } + + public function provideCustomFormErrorTests() + { + // This case is different than the data errors, because here the + // left side of the mapping refers to the property path of the actual + // children. In other words, a child error only works if + // 1) the error actually maps to an existing child and + // 2) the property path of that child (relative to the form providing + // the mapping) matches the left side of the mapping + return array( + // mapping target, map from, map to, child name, its property path, grand child name, its property path, violation path + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street]'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street].prop'), + + // Property path of the erroneous field and mapping must match exactly + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'), + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'), + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street'), + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'), + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street]'), + array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'), + + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'), + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'), + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street'), + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'), + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street]'), + array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'), + + array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'), + array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'), + array(self::LEVEL_2, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street'), + array(self::LEVEL_2, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'), + array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street]'), + array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].children[street].data.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data.street'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data[street]'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street].prop'), + + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].children[street].data'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].children[street].data.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data.street'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data[street]'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].children[street].data.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data.street'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data[street]'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data[street].prop'), + + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street].data'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street].data.prop'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street.prop'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street].prop'), + + // Map to a nested child + array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo]'), + array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo]'), + array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo]'), + array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo]'), + + // Map from a nested child + array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'), + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'), + array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'), + array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'), + array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'), + ); + } + + /** + * @dataProvider provideCustomFormErrorTests + */ + public function testCustomFormErrorMapping($target, $mapFrom, $mapTo, $errorName, $errorPath, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath) + { + $violation = $this->getConstraintViolation($violationPath); + $parent = $this->getForm('parent', null, null, array($mapFrom => $mapTo)); + $child = $this->getForm($childName, $childPath); + $grandChild = $this->getForm($grandChildName, $grandChildPath); + $errorChild = $this->getForm($errorName, $errorPath); + + $parent->add($child); + $parent->add($errorChild); + $child->add($grandChild); + + $this->mapper->mapViolation($violation, $parent); + + if (self::LEVEL_0 === $target) { + $this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } elseif (self::LEVEL_1 === $target) { + $this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one'); + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } elseif (self::LEVEL_1B === $target) { + $this->assertEquals(array($this->getFormError()), $errorChild->getErrors(), $errorName . ' should have an error, but has none'); + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } else { + $this->assertCount(0, $errorChild->getErrors(), $errorName . ' should not have an error, but has one'); + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none'); + } + } + + public function provideVirtualFormErrorTests() + { + return array( + // mapping target, child name, its property path, grand child name, its property path, violation path + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street.prop'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street]'), + array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street].prop'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.street'), + array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address.street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address.street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address[street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address[street].prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street.prop'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street]'), + array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street].prop'), + ); + } + + /** + * @dataProvider provideVirtualFormErrorTests + */ + public function testVirtualFormErrorMapping($target, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath) + { + $violation = $this->getConstraintViolation($violationPath); + $parent = $this->getForm('parent'); + $child = $this->getForm($childName, $childPath, null, array(), true); + $grandChild = $this->getForm($grandChildName, $grandChildPath); + + $parent->add($child); + $child->add($grandChild); + + $this->mapper->mapViolation($violation, $parent); + + if (self::LEVEL_0 === $target) { + $this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName() . ' should have an error, but has none'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } elseif (self::LEVEL_1 === $target) { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName . ' should have an error, but has none'); + $this->assertCount(0, $grandChild->getErrors(), $grandChildName . ' should not have an error, but has one'); + } else { + $this->assertCount(0, $parent->getErrors(), $parent->getName() . ' should not have an error, but has one'); + $this->assertCount(0, $child->getErrors(), $childName . ' should not have an error, but has one'); + $this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName. ' should have an error, but has none'); + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php new file mode 100755 index 0000000000..02df8f43eb --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationPathTest.php @@ -0,0 +1,245 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Extension\Validator\ViolationMapper; + +use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationPath; + +/** + * @author Bernhard Schussek + */ +class ViolationPathTest extends \PHPUnit_Framework_TestCase +{ + public function providePaths() + { + return array( + array('children[address]', array( + array('address', true, true), + )), + array('children[address].children[street]', array( + array('address', true, true), + array('street', true, true), + )), + array('children[address][street]', array( + array('address', true, true), + ), 'children[address]'), + array('children[address].data', array( + array('address', true, true), + ), 'children[address]'), + array('children[address].data.street', array( + array('address', true, true), + array('street', false, false), + )), + array('children[address].data[street]', array( + array('address', true, true), + array('street', false, true), + )), + array('children[address].children[street].data.name', array( + array('address', true, true), + array('street', true, true), + array('name', false, false), + )), + array('children[address].children[street].data[name]', array( + array('address', true, true), + array('street', true, true), + array('name', false, true), + )), + array('data.address', array( + array('address', false, false), + )), + array('data[address]', array( + array('address', false, true), + )), + array('data.address.street', array( + array('address', false, false), + array('street', false, false), + )), + array('data[address].street', array( + array('address', false, true), + array('street', false, false), + )), + array('data.address[street]', array( + array('address', false, false), + array('street', false, true), + )), + array('data[address][street]', array( + array('address', false, true), + array('street', false, true), + )), + // A few invalid examples + array('data', array(), ''), + array('children', array(), ''), + array('children.address', array(), ''), + array('children.address[street]', array(), ''), + ); + } + + /** + * @dataProvider providePaths + */ + public function testCreatePath($string, $entries, $slicedPath = null) + { + if (null === $slicedPath) { + $slicedPath = $string; + } + + $path = new ViolationPath($string); + + $this->assertSame($slicedPath, $path->__toString()); + $this->assertSame(count($entries), count($path->getElements())); + $this->assertSame(count($entries), $path->getLength()); + + foreach ($entries as $index => $entry) { + $this->assertEquals($entry[0], $path->getElement($index)); + $this->assertSame($entry[1], $path->mapsForm($index)); + $this->assertSame($entry[2], $path->isIndex($index)); + $this->assertSame(!$entry[2], $path->isProperty($index)); + } + } + + public function provideParents() + { + return array( + array('children[address]', null), + array('children[address].children[street]', 'children[address]'), + array('children[address].data.street', 'children[address]'), + array('children[address].data[street]', 'children[address]'), + array('data.address', null), + array('data.address.street', 'data.address'), + array('data.address[street]', 'data.address'), + array('data[address].street', 'data[address]'), + array('data[address][street]', 'data[address]'), + ); + } + + /** + * @dataProvider provideParents + */ + public function testGetParent($violationPath, $parentPath) + { + $path = new ViolationPath($violationPath); + $parent = $parentPath === null ? null : new ViolationPath($parentPath); + + $this->assertEquals($parent, $path->getParent()); + } + + public function testGetElement() + { + $path = new ViolationPath('children[address].data[street].name'); + + $this->assertEquals('street', $path->getElement(1)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testGetElementDoesNotAcceptInvalidIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->getElement(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testGetElementDoesNotAcceptNegativeIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->getElement(-1); + } + + public function testIsProperty() + { + $path = new ViolationPath('children[address].data[street].name'); + + $this->assertFalse($path->isProperty(1)); + $this->assertTrue($path->isProperty(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsPropertyDoesNotAcceptInvalidIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->isProperty(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsPropertyDoesNotAcceptNegativeIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->isProperty(-1); + } + + public function testIsIndex() + { + $path = new ViolationPath('children[address].data[street].name'); + + $this->assertTrue($path->isIndex(1)); + $this->assertFalse($path->isIndex(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsIndexDoesNotAcceptInvalidIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->isIndex(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsIndexDoesNotAcceptNegativeIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->isIndex(-1); + } + + public function testMapsForm() + { + $path = new ViolationPath('children[address].data[street].name'); + + $this->assertTrue($path->mapsForm(0)); + $this->assertFalse($path->mapsForm(1)); + $this->assertFalse($path->mapsForm(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testMapsFormDoesNotAcceptInvalidIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->mapsForm(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testMapsFormDoesNotAcceptNegativeIndices() + { + $path = new ViolationPath('children[address].data[street].name'); + + $path->mapsForm(-1); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php new file mode 100755 index 0000000000..e53d19ffe9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php @@ -0,0 +1,27 @@ +getFormFactory(); + + $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($formFactory) { + $form = $event->getForm(); + $type = $form->getName() % 2 === 0 ? 'text' : 'textarea'; + $form->add($formFactory->createNamed('title', $type)); + }); + } + + public function getName() + { + return 'alternating_row'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Author.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Author.php new file mode 100755 index 0000000000..1120489469 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Author.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +class Author +{ + public $firstName; + private $lastName; + private $australian; + public $child; + private $readPermissions; + + private $privateProperty; + + public function setLastName($lastName) + { + $this->lastName = $lastName; + } + + public function getLastName() + { + return $this->lastName; + } + + private function getPrivateGetter() + { + return 'foobar'; + } + + public function setAustralian($australian) + { + $this->australian = $australian; + } + + public function isAustralian() + { + return $this->australian; + } + + public function setReadPermissions($bool) + { + $this->readPermissions = $bool; + } + + public function hasReadPermissions() + { + return $this->readPermissions; + } + + private function isPrivateIsser() + { + return true; + } + + public function getPrivateSetter() + { + } + + private function setPrivateSetter($data) + { + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AuthorType.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AuthorType.php new file mode 100755 index 0000000000..147f6e4867 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/AuthorType.php @@ -0,0 +1,30 @@ +add('firstName') + ->add('lastName') + ; + } + + public function getName() + { + return 'author'; + } + + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', + )); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php new file mode 100755 index 0000000000..950f677fd0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +/** + * This class is a hand written simplified version of PHP native `ArrayObject` + * class, to show that it behaves differently than the PHP native implementation. + */ +class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable +{ + private $array; + + public function __construct(array $array = null) + { + $this->array = $array ?: array(); + } + + public function offsetExists($offset) + { + return array_key_exists($offset, $this->array); + } + + public function offsetGet($offset) + { + return $this->array[$offset]; + } + + public function offsetSet($offset, $value) + { + if (null === $offset) { + $this->array[] = $value; + } else { + $this->array[$offset] = $value; + } + } + + public function offsetUnset($offset) + { + unset($this->array[$offset]); + } + + public function getIterator() + { + return new \ArrayIterator($this->array); + } + + public function count() + { + return count($this->array); + } + + public function serialize() + { + return serialize($this->array); + } + + public function unserialize($serialized) + { + $this->array = (array) unserialize((string) $serialized); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedDataTransformer.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedDataTransformer.php new file mode 100755 index 0000000000..37c2771385 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedDataTransformer.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\DataTransformerInterface; + +class FixedDataTransformer implements DataTransformerInterface +{ + private $mapping; + + public function __construct(array $mapping) + { + $this->mapping = $mapping; + } + + public function transform($value) + { + if (!array_key_exists($value, $this->mapping)) { + throw new \RuntimeException(sprintf('No mapping for value "%s"', $value)); + } + + return $this->mapping[$value]; + } + + public function reverseTransform($value) + { + $result = array_search($value, $this->mapping, true); + + if ($result === false) { + throw new \RuntimeException(sprintf('No reverse mapping for value "%s"', $value)); + } + + return $result; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedFilterListener.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedFilterListener.php new file mode 100755 index 0000000000..60f9ffdfb6 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FixedFilterListener.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +class FixedFilterListener implements EventSubscriberInterface +{ + private $mapping; + + public function __construct(array $mapping) + { + $this->mapping = array_merge(array( + 'preBind' => array(), + 'onBind' => array(), + 'preSetData' => array(), + ), $mapping); + } + + public function preBind(FormEvent $event) + { + $data = $event->getData(); + + if (isset($this->mapping['preBind'][$data])) { + $event->setData($this->mapping['preBind'][$data]); + } + } + + public function onBind(FormEvent $event) + { + $data = $event->getData(); + + if (isset($this->mapping['onBind'][$data])) { + $event->setData($this->mapping['onBind'][$data]); + } + } + + public function preSetData(FormEvent $event) + { + $data = $event->getData(); + + if (isset($this->mapping['preSetData'][$data])) { + $event->setData($this->mapping['preSetData'][$data]); + } + } + + public static function getSubscribedEvents() + { + return array( + FormEvents::PRE_BIND => 'preBind', + FormEvents::BIND => 'onBind', + FormEvents::PRE_SET_DATA => 'preSetData', + ); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubType.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubType.php new file mode 100755 index 0000000000..4f7ba6d4a7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubType.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class FooSubType extends AbstractType +{ + public function getName() + { + return 'foo_sub_type'; + } + + public function getParent() + { + return 'foo'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubTypeWithParentInstance.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubTypeWithParentInstance.php new file mode 100755 index 0000000000..468b5a32a7 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooSubTypeWithParentInstance.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class FooSubTypeWithParentInstance extends AbstractType +{ + public function getName() + { + return 'foo_sub_type_parent_instance'; + } + + public function getParent() + { + return new FooType(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooType.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooType.php new file mode 100755 index 0000000000..d26d3f7683 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooType.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +class FooType extends AbstractType +{ + public function getName() + { + return 'foo'; + } + + public function getParent() + { + return null; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBarExtension.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBarExtension.php new file mode 100755 index 0000000000..c5f92e1191 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBarExtension.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\FormBuilderInterface; + +class FooTypeBarExtension extends AbstractTypeExtension +{ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->setAttribute('bar', 'x'); + } + + public function getAllowedOptionValues() + { + return array( + 'a_or_b' => array('c'), + ); + } + + public function getExtendedType() + { + return 'foo'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBazExtension.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBazExtension.php new file mode 100755 index 0000000000..2e36475449 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/FooTypeBazExtension.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\FormBuilderInterface; + +class FooTypeBazExtension extends AbstractTypeExtension +{ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->setAttribute('baz', 'x'); + } + + public function getExtendedType() + { + return 'foo'; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Magician.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Magician.php new file mode 100755 index 0000000000..cd66f29d07 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/Magician.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +class Magician +{ + private $foobar; + + public function __set($property, $value) + { + $this->$property = $value; + } + + public function __get($property) + { + return isset($this->$property) ? $this->$property : null; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/TestExtension.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/TestExtension.php new file mode 100755 index 0000000000..f9de560f03 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/TestExtension.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Fixtures; + +use Symfony\Component\Form\FormTypeInterface; +use Symfony\Component\Form\FormTypeExtensionInterface; +use Symfony\Component\Form\FormTypeGuesserInterface; +use Symfony\Component\Form\FormExtensionInterface; + +class TestExtension implements FormExtensionInterface +{ + private $types = array(); + + private $extensions = array(); + + private $guesser; + + public function __construct(FormTypeGuesserInterface $guesser) + { + $this->guesser = $guesser; + } + + public function addType(FormTypeInterface $type) + { + $this->types[$type->getName()] = $type; + } + + public function getType($name) + { + return isset($this->types[$name]) ? $this->types[$name] : null; + } + + public function hasType($name) + { + return isset($this->types[$name]); + } + + public function addTypeExtension(FormTypeExtensionInterface $extension) + { + $type = $extension->getExtendedType(); + + if (!isset($this->extensions[$type])) { + $this->extensions[$type] = array(); + } + + $this->extensions[$type][] = $extension; + } + + public function getTypeExtensions($name) + { + return isset($this->extensions[$name]) ? $this->extensions[$name] : array(); + } + + public function hasTypeExtensions($name) + { + return isset($this->extensions[$name]); + } + + public function getTypeGuesser() + { + return $this->guesser; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/foo b/vendor/symfony/form/Symfony/Component/Form/Tests/Fixtures/foo new file mode 100755 index 0000000000..e69de29bb2 diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderInterface.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderInterface.php new file mode 100755 index 0000000000..76d1d62ea8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderInterface.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +interface FormBuilderInterface extends \Iterator, \Symfony\Component\Form\FormBuilderInterface +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderTest.php new file mode 100755 index 0000000000..42d4317459 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormBuilderTest.php @@ -0,0 +1,247 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormBuilder; + +class FormBuilderTest extends \PHPUnit_Framework_TestCase +{ + private $dispatcher; + + private $factory; + + private $builder; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->builder = new FormBuilder('name', null, $this->dispatcher, $this->factory); + } + + protected function tearDown() + { + $this->dispatcher = null; + $this->factory = null; + $this->builder = null; + } + + /** + * Changing the name is not allowed, otherwise the name and property path + * are not synchronized anymore + * + * @see FormType::buildForm + */ + public function testNoSetName() + { + $this->assertFalse(method_exists($this->builder, 'setName')); + } + + public function testAddNameNoString() + { + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + $this->builder->add(1234); + } + + public function testAddTypeNoString() + { + $this->setExpectedException('Symfony\Component\Form\Exception\UnexpectedTypeException'); + $this->builder->add('foo', 1234); + } + + public function testAddWithGuessFluent() + { + $this->builder = new FormBuilder('name', 'stdClass', $this->dispatcher, $this->factory); + $builder = $this->builder->add('foo'); + $this->assertSame($builder, $this->builder); + } + + public function testAddIsFluent() + { + $builder = $this->builder->add('foo', 'text', array('bar' => 'baz')); + $this->assertSame($builder, $this->builder); + } + + public function testAdd() + { + $this->assertFalse($this->builder->has('foo')); + $this->builder->add('foo', 'text'); + $this->assertTrue($this->builder->has('foo')); + } + + public function testAll() + { + $this->factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('foo', 'text') + ->will($this->returnValue(new FormBuilder('foo', null, $this->dispatcher, $this->factory))); + + $this->assertCount(0, $this->builder->all()); + $this->assertFalse($this->builder->has('foo')); + + $this->builder->add('foo', 'text'); + $children = $this->builder->all(); + + $this->assertTrue($this->builder->has('foo')); + $this->assertCount(1, $children); + $this->assertArrayHasKey('foo', $children); + } + + /* + * https://github.com/symfony/symfony/issues/4693 + */ + public function testMaintainOrderOfLazyAndExplicitChildren() + { + $this->builder->add('foo', 'text'); + $this->builder->add($this->getFormBuilder('bar')); + $this->builder->add('baz', 'text'); + + $children = $this->builder->all(); + + $this->assertSame(array('foo', 'bar', 'baz'), array_keys($children)); + } + + public function testAddFormType() + { + $this->assertFalse($this->builder->has('foo')); + $this->builder->add('foo', $this->getMock('Symfony\Component\Form\FormTypeInterface')); + $this->assertTrue($this->builder->has('foo')); + } + + public function testRemove() + { + $this->builder->add('foo', 'text'); + $this->builder->remove('foo'); + $this->assertFalse($this->builder->has('foo')); + } + + public function testRemoveUnknown() + { + $this->builder->remove('foo'); + $this->assertFalse($this->builder->has('foo')); + } + + // https://github.com/symfony/symfony/pull/4826 + public function testRemoveAndGetForm() + { + $this->builder->add('foo', 'text'); + $this->builder->remove('foo'); + $form = $this->builder->getForm(); + $this->assertInstanceOf('Symfony\Component\Form\Form', $form); + } + + public function testCreateNoTypeNo() + { + $this->factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('foo', 'text', null, array()) + ; + + $this->builder->create('foo'); + } + + public function testGetUnknown() + { + $this->setExpectedException('Symfony\Component\Form\Exception\FormException', 'The child with the name "foo" does not exist.'); + $this->builder->get('foo'); + } + + public function testGetExplicitType() + { + $expectedType = 'text'; + $expectedName = 'foo'; + $expectedOptions = array('bar' => 'baz'); + + $this->factory->expects($this->once()) + ->method('createNamedBuilder') + ->with($expectedName, $expectedType, null, $expectedOptions) + ->will($this->returnValue($this->getFormBuilder())); + + $this->builder->add($expectedName, $expectedType, $expectedOptions); + $builder = $this->builder->get($expectedName); + + $this->assertNotSame($builder, $this->builder); + } + + public function testGetGuessedType() + { + $expectedName = 'foo'; + $expectedOptions = array('bar' => 'baz'); + + $this->factory->expects($this->once()) + ->method('createBuilderForProperty') + ->with('stdClass', $expectedName, null, $expectedOptions) + ->will($this->returnValue($this->getFormBuilder())); + + $this->builder = new FormBuilder('name', 'stdClass', $this->dispatcher, $this->factory); + $this->builder->add($expectedName, null, $expectedOptions); + $builder = $this->builder->get($expectedName); + + $this->assertNotSame($builder, $this->builder); + } + + public function testGetParent() + { + $this->assertNull($this->builder->getParent()); + } + + public function testGetParentForAddedBuilder() + { + $builder = new FormBuilder('name', null, $this->dispatcher, $this->factory); + $this->builder->add($builder); + $this->assertSame($this->builder, $builder->getParent()); + } + + public function testGetParentForRemovedBuilder() + { + $builder = new FormBuilder('name', null, $this->dispatcher, $this->factory); + $this->builder->add($builder); + $this->builder->remove('name'); + $this->assertNull($builder->getParent()); + } + + public function testGetParentForCreatedBuilder() + { + $this->builder = new FormBuilder('name', 'stdClass', $this->dispatcher, $this->factory); + $this->factory + ->expects($this->once()) + ->method('createNamedBuilder') + ->with('bar', 'text', null, array(), $this->builder) + ; + + $this->factory + ->expects($this->once()) + ->method('createBuilderForProperty') + ->with('stdClass', 'foo', null, array(), $this->builder) + ; + + $this->builder->create('foo'); + $this->builder->create('bar', 'text'); + } + + private function getFormBuilder($name = 'name') + { + $mock = $this->getMockBuilder('Symfony\Component\Form\FormBuilder') + ->disableOriginalConstructor() + ->getMock(); + + $mock->expects($this->any()) + ->method('getName') + ->will($this->returnValue($name)); + + return $mock; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormConfigTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormConfigTest.php new file mode 100755 index 0000000000..e11561a47f --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormConfigTest.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +/** + * @author Bernhard Schussek + */ +use Symfony\Component\Form\FormConfigBuilder; + +class FormConfigTest extends \PHPUnit_Framework_TestCase +{ + public function getHtml4Ids() + { + return array( + array('a0', true), + array('a9', true), + array('z0', true), + array('A0', true), + array('A9', true), + array('Z0', true), + array('#', false), + array('a#', false), + array('a$', false), + array('a%', false), + array('a ', false), + array("a\t", false), + array("a\n", false), + array('a-', true), + array('a_', true), + array('a:', true), + // Periods are allowed by the HTML4 spec, but disallowed by us + // because they break the generated property paths + array('a.', false), + // Contrary to the HTML4 spec, we allow names starting with a + // number, otherwise naming fields by collection indices is not + // possible. + // For root forms, leading digits will be stripped from the + // "id" attribute to produce valid HTML4. + array('0', true), + array('9', true), + // Contrary to the HTML4 spec, we allow names starting with an + // underscore, since this is already a widely used practice in + // Symfony2. + // For root forms, leading underscores will be stripped from the + // "id" attribute to produce valid HTML4. + array('_', true), + ); + } + + /** + * @dataProvider getHtml4Ids + */ + public function testNameAcceptsOnlyNamesValidAsIdsInHtml4($name, $accepted) + { + $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + + try { + new FormConfigBuilder($name, null, $dispatcher); + if (!$accepted) { + $this->fail(sprintf('The value "%s" should not be accepted', $name)); + } + } catch (\InvalidArgumentException $e) { + // if the value was not accepted, but should be, rethrow exception + if ($accepted) { + throw $e; + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryBuilderTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryBuilderTest.php new file mode 100755 index 0000000000..a1292dbe72 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryBuilderTest.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormFactoryBuilder; +use Symfony\Component\Form\Tests\Fixtures\FooType; + +class FormFactoryBuilderTest extends \PHPUnit_Framework_TestCase +{ + private $registry; + private $guesser; + private $type; + + protected function setUp() + { + $factory = new \ReflectionClass('Symfony\Component\Form\FormFactory'); + $this->registry = $factory->getProperty('registry'); + $this->registry->setAccessible(true); + + $this->guesser = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); + $this->type = new FooType; + } + + public function testAddType() + { + $factoryBuilder = new FormFactoryBuilder; + $factoryBuilder->addType($this->type); + + $factory = $factoryBuilder->getFormFactory(); + $registry = $this->registry->getValue($factory); + $extensions = $registry->getExtensions(); + + $this->assertCount(1, $extensions); + $this->assertTrue($extensions[0]->hasType($this->type->getName())); + $this->assertNull($extensions[0]->getTypeGuesser()); + } + + public function testAddTypeGuesser() + { + $factoryBuilder = new FormFactoryBuilder; + $factoryBuilder->addTypeGuesser($this->guesser); + + $factory = $factoryBuilder->getFormFactory(); + $registry = $this->registry->getValue($factory); + $extensions = $registry->getExtensions(); + + $this->assertCount(1, $extensions); + $this->assertNotNull($extensions[0]->getTypeGuesser()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryTest.php new file mode 100755 index 0000000000..105e6b6663 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormFactoryTest.php @@ -0,0 +1,637 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\FormTypeGuesserChain; +use Symfony\Component\Form\FormFactory; +use Symfony\Component\Form\Guess\Guess; +use Symfony\Component\Form\Guess\ValueGuess; +use Symfony\Component\Form\Guess\TypeGuess; +use Symfony\Component\Form\Tests\Fixtures\Author; +use Symfony\Component\Form\Tests\Fixtures\FooType; +use Symfony\Component\Form\Tests\Fixtures\FooSubType; +use Symfony\Component\Form\Tests\Fixtures\FooSubTypeWithParentInstance; + +/** + * @author Bernhard Schussek + */ +class FormFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $guesser1; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $guesser2; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $registry; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $resolvedTypeFactory; + + /** + * @var FormFactory + */ + private $factory; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactoryInterface'); + $this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); + $this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); + $this->registry = $this->getMock('Symfony\Component\Form\FormRegistryInterface'); + $this->factory = new FormFactory($this->registry, $this->resolvedTypeFactory); + + $this->registry->expects($this->any()) + ->method('getTypeGuesser') + ->will($this->returnValue(new FormTypeGuesserChain(array( + $this->guesser1, + $this->guesser2, + )))); + } + + public function testAddType() + { + $type = new FooType(); + $resolvedType = $this->getMockResolvedType(); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type) + ->will($this->returnValue($resolvedType)); + + $this->registry->expects($this->once()) + ->method('addType') + ->with($resolvedType); + + $this->factory->addType($type); + } + + public function testHasType() + { + $this->registry->expects($this->once()) + ->method('hasType') + ->with('name') + ->will($this->returnValue('RESULT')); + + $this->assertSame('RESULT', $this->factory->hasType('name')); + } + + public function testGetType() + { + $type = new FooType(); + $resolvedType = $this->getMockResolvedType(); + + $resolvedType->expects($this->once()) + ->method('getInnerType') + ->will($this->returnValue($type)); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('name') + ->will($this->returnValue($resolvedType)); + + $this->assertEquals($type, $this->factory->getType('name')); + } + + public function testCreateNamedBuilderWithTypeName() + { + $options = array('a' => '1', 'b' => '2'); + $resolvedType = $this->getMockResolvedType(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('type') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', 'type', null, $options)); + } + + public function testCreateNamedBuilderWithTypeInstance() + { + $options = array('a' => '1', 'b' => '2'); + $type = new FooType(); + $resolvedType = $this->getMockResolvedType(); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', $type, null, $options)); + } + + public function testCreateNamedBuilderWithTypeInstanceWithParentType() + { + $options = array('a' => '1', 'b' => '2'); + $type = new FooSubType(); + $resolvedType = $this->getMockResolvedType(); + $parentResolvedType = $this->getMockResolvedType(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('foo') + ->will($this->returnValue($parentResolvedType)); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type, array(), $parentResolvedType) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', $type, null, $options)); + } + + public function testCreateNamedBuilderWithTypeInstanceWithParentTypeInstance() + { + $options = array('a' => '1', 'b' => '2'); + $type = new FooSubTypeWithParentInstance(); + $resolvedType = $this->getMockResolvedType(); + $parentResolvedType = $this->getMockResolvedType(); + + $this->resolvedTypeFactory->expects($this->at(0)) + ->method('createResolvedType') + ->with($type->getParent()) + ->will($this->returnValue($parentResolvedType)); + + $this->resolvedTypeFactory->expects($this->at(1)) + ->method('createResolvedType') + ->with($type, array(), $parentResolvedType) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', $type, null, $options)); + } + + public function testCreateNamedBuilderWithResolvedTypeInstance() + { + $options = array('a' => '1', 'b' => '2'); + $resolvedType = $this->getMockResolvedType(); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', $resolvedType, null, $options)); + } + + public function testCreateNamedBuilderWithParentBuilder() + { + $options = array('a' => '1', 'b' => '2'); + $parentBuilder = $this->getMockFormBuilder(); + $resolvedType = $this->getMockResolvedType(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('type') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options, $parentBuilder) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', 'type', null, $options, $parentBuilder)); + } + + public function testCreateNamedBuilderFillsDataOption() + { + $givenOptions = array('a' => '1', 'b' => '2'); + $expectedOptions = array_merge($givenOptions, array('data' => 'DATA')); + $resolvedType = $this->getMockResolvedType(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('type') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $expectedOptions) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', 'type', 'DATA', $givenOptions)); + } + + public function testCreateNamedBuilderDoesNotOverrideExistingDataOption() + { + $options = array('a' => '1', 'b' => '2', 'data' => 'CUSTOM'); + $resolvedType = $this->getMockResolvedType(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('type') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue('BUILDER')); + + $this->assertSame('BUILDER', $this->factory->createNamedBuilder('name', 'type', 'DATA', $options)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + * @expectedExceptionMessage Expected argument of type "string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface", "stdClass" given + */ + public function testCreateNamedBuilderThrowsUnderstandableException() + { + $this->factory->createNamedBuilder('name', new \stdClass()); + } + + public function testCreateUsesTypeNameIfTypeGivenAsString() + { + $options = array('a' => '1', 'b' => '2'); + $resolvedType = $this->getMockResolvedType(); + $builder = $this->getMockFormBuilder(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('TYPE') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'TYPE', $options) + ->will($this->returnValue($builder)); + + $builder->expects($this->once()) + ->method('getForm') + ->will($this->returnValue('FORM')); + + $this->assertSame('FORM', $this->factory->create('TYPE', null, $options)); + } + + public function testCreateUsesTypeNameIfTypeGivenAsObject() + { + $options = array('a' => '1', 'b' => '2'); + $resolvedType = $this->getMockResolvedType(); + $builder = $this->getMockFormBuilder(); + + $resolvedType->expects($this->once()) + ->method('getName') + ->will($this->returnValue('TYPE')); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'TYPE', $options) + ->will($this->returnValue($builder)); + + $builder->expects($this->once()) + ->method('getForm') + ->will($this->returnValue('FORM')); + + $this->assertSame('FORM', $this->factory->create($resolvedType, null, $options)); + } + + public function testCreateNamed() + { + $options = array('a' => '1', 'b' => '2'); + $resolvedType = $this->getMockResolvedType(); + $builder = $this->getMockFormBuilder(); + + $this->registry->expects($this->once()) + ->method('getType') + ->with('type') + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->once()) + ->method('createBuilder') + ->with($this->factory, 'name', $options) + ->will($this->returnValue($builder)); + + $builder->expects($this->once()) + ->method('getForm') + ->will($this->returnValue('FORM')); + + $this->assertSame('FORM', $this->factory->createNamed('name', 'type', null, $options)); + } + + public function testCreateBuilderForPropertyWithoutTypeGuesser() + { + $registry = $this->getMock('Symfony\Component\Form\FormRegistryInterface'); + $factory = $this->getMockBuilder('Symfony\Component\Form\FormFactory') + ->setMethods(array('createNamedBuilder')) + ->setConstructorArgs(array($registry, $this->resolvedTypeFactory)) + ->getMock(); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array()) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty('Application\Author', 'firstName'); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderForPropertyCreatesFormWithHighestConfidence() + { + $this->guesser1->expects($this->once()) + ->method('guessType') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new TypeGuess( + 'text', + array('max_length' => 10), + Guess::MEDIUM_CONFIDENCE + ))); + + $this->guesser2->expects($this->once()) + ->method('guessType') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new TypeGuess( + 'password', + array('max_length' => 7), + Guess::HIGH_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'password', null, array('max_length' => 7)) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty('Application\Author', 'firstName'); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderCreatesTextFormIfNoGuess() + { + $this->guesser1->expects($this->once()) + ->method('guessType') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(null)); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text') + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty('Application\Author', 'firstName'); + + $this->assertEquals('builderInstance', $builder); + } + + public function testOptionsCanBeOverridden() + { + $this->guesser1->expects($this->once()) + ->method('guessType') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new TypeGuess( + 'text', + array('max_length' => 10), + Guess::MEDIUM_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('max_length' => 11)) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName', + null, + array('max_length' => 11) + ); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderUsesMaxLengthIfFound() + { + $this->guesser1->expects($this->once()) + ->method('guessMaxLength') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + 15, + Guess::MEDIUM_CONFIDENCE + ))); + + $this->guesser2->expects($this->once()) + ->method('guessMaxLength') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + 20, + Guess::HIGH_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('max_length' => 20)) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName' + ); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderUsesMinLengthIfFound() + { + $this->guesser1->expects($this->once()) + ->method('guessMinLength') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + 2, + Guess::MEDIUM_CONFIDENCE + ))); + + $this->guesser2->expects($this->once()) + ->method('guessMinLength') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + 5, + Guess::HIGH_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('pattern' => '.{5,}')) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName' + ); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderPrefersPatternOverMinLength() + { + // min length is deprecated + $this->guesser1->expects($this->once()) + ->method('guessMinLength') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + 2, + Guess::HIGH_CONFIDENCE + ))); + + // pattern is preferred even though confidence is lower + $this->guesser2->expects($this->once()) + ->method('guessPattern') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + '.{5,10}', + Guess::LOW_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('pattern' => '.{5,10}')) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName' + ); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderUsesRequiredSettingWithHighestConfidence() + { + $this->guesser1->expects($this->once()) + ->method('guessRequired') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + true, + Guess::MEDIUM_CONFIDENCE + ))); + + $this->guesser2->expects($this->once()) + ->method('guessRequired') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + false, + Guess::HIGH_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('required' => false)) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName' + ); + + $this->assertEquals('builderInstance', $builder); + } + + public function testCreateBuilderUsesPatternIfFound() + { + $this->guesser1->expects($this->once()) + ->method('guessPattern') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + '[a-z]', + Guess::MEDIUM_CONFIDENCE + ))); + + $this->guesser2->expects($this->once()) + ->method('guessPattern') + ->with('Application\Author', 'firstName') + ->will($this->returnValue(new ValueGuess( + '[a-zA-Z]', + Guess::HIGH_CONFIDENCE + ))); + + $factory = $this->getMockFactory(array('createNamedBuilder')); + + $factory->expects($this->once()) + ->method('createNamedBuilder') + ->with('firstName', 'text', null, array('pattern' => '[a-zA-Z]')) + ->will($this->returnValue('builderInstance')); + + $builder = $factory->createBuilderForProperty( + 'Application\Author', + 'firstName' + ); + + $this->assertEquals('builderInstance', $builder); + } + + private function getMockFactory(array $methods = array()) + { + return $this->getMockBuilder('Symfony\Component\Form\FormFactory') + ->setMethods($methods) + ->setConstructorArgs(array($this->registry, $this->resolvedTypeFactory)) + ->getMock(); + } + + private function getMockResolvedType() + { + return $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + } + + private function getMockType() + { + return $this->getMock('Symfony\Component\Form\FormTypeInterface'); + } + + private function getMockFormBuilder() + { + return $this->getMock('Symfony\Component\Form\Tests\FormBuilderInterface'); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormIntegrationTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormIntegrationTestCase.php new file mode 100755 index 0000000000..536ff4c824 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormIntegrationTestCase.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\Forms; + +/** + * @author Bernhard Schussek + */ +abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Symfony\Component\Form\FormFactoryInterface + */ + protected $factory; + + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->factory = Forms::createFormFactoryBuilder() + ->addExtensions($this->getExtensions()) + ->getFormFactory(); + } + + protected function getExtensions() + { + return array(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormInterface.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormInterface.php new file mode 100755 index 0000000000..5c27c6ead4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormInterface.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +interface FormInterface extends \Iterator, \Symfony\Component\Form\FormInterface +{ +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormPerformanceTestCase.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormPerformanceTestCase.php new file mode 100755 index 0000000000..04a855b3ba --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormPerformanceTestCase.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +/** + * Base class for performance tests. + * + * Copied from Doctrine 2's OrmPerformanceTestCase. + * + * @author robo + * @author Bernhard Schussek + */ +abstract class FormPerformanceTestCase extends FormIntegrationTestCase +{ + /** + * @var integer + */ + protected $maxRunningTime = 0; + + /** + */ + protected function runTest() + { + $s = microtime(true); + parent::runTest(); + $time = microtime(true) - $s; + + if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { + $this->fail( + sprintf( + 'expected running time: <= %s but was: %s', + + $this->maxRunningTime, + $time + ) + ); + } + } + + /** + * @param integer $maxRunningTime + * @throws \InvalidArgumentException + */ + public function setMaxRunningTime($maxRunningTime) + { + if (is_integer($maxRunningTime) && $maxRunningTime >= 0) { + $this->maxRunningTime = $maxRunningTime; + } else { + throw new \InvalidArgumentException; + } + } + + /** + * @return integer + * @since Method available since Release 2.3.0 + */ + public function getMaxRunningTime() + { + return $this->maxRunningTime; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/FormRegistryTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/FormRegistryTest.php new file mode 100755 index 0000000000..746d68f3aa --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/FormRegistryTest.php @@ -0,0 +1,269 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form; + +use Symfony\Component\Form\Tests\Fixtures\TestExtension; +use Symfony\Component\Form\Tests\Fixtures\FooSubTypeWithParentInstance; +use Symfony\Component\Form\Tests\Fixtures\FooSubType; +use Symfony\Component\Form\Tests\Fixtures\FooTypeBazExtension; +use Symfony\Component\Form\Tests\Fixtures\FooTypeBarExtension; +use Symfony\Component\Form\Tests\Fixtures\FooType; + +/** + * @author Bernhard Schussek + */ +class FormRegistryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var FormRegistry + */ + private $registry; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $resolvedTypeFactory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $guesser1; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $guesser2; + + /** + * @var TestExtension + */ + private $extension1; + + /** + * @var TestExtension + */ + private $extension2; + + protected function setUp() + { + $this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactory'); + $this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); + $this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); + $this->extension1 = new TestExtension($this->guesser1); + $this->extension2 = new TestExtension($this->guesser2); + $this->registry = new FormRegistry(array( + $this->extension1, + $this->extension2, + ), $this->resolvedTypeFactory); + } + + public function testGetTypeReturnsAddedType() + { + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $this->registry->addType($resolvedType); + + $this->assertSame($resolvedType, $this->registry->getType('foo')); + } + + public function testGetTypeFromExtension() + { + $type = new FooType(); + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $this->extension2->addType($type); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $resolvedType = $this->registry->getType('foo'); + + $this->assertSame($resolvedType, $this->registry->getType('foo')); + } + + public function testGetTypeWithTypeExtensions() + { + $type = new FooType(); + $ext1 = new FooTypeBarExtension(); + $ext2 = new FooTypeBazExtension(); + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $this->extension2->addType($type); + $this->extension1->addTypeExtension($ext1); + $this->extension2->addTypeExtension($ext2); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type, array($ext1, $ext2)) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $this->assertSame($resolvedType, $this->registry->getType('foo')); + } + + public function testGetTypeConnectsParent() + { + $parentType = new FooType(); + $type = new FooSubType(); + $parentResolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $this->extension1->addType($parentType); + $this->extension2->addType($type); + + $this->resolvedTypeFactory->expects($this->at(0)) + ->method('createResolvedType') + ->with($parentType) + ->will($this->returnValue($parentResolvedType)); + + $this->resolvedTypeFactory->expects($this->at(1)) + ->method('createResolvedType') + ->with($type, array(), $parentResolvedType) + ->will($this->returnValue($resolvedType)); + + $parentResolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo_sub_type')); + + $this->assertSame($resolvedType, $this->registry->getType('foo_sub_type')); + } + + public function testGetTypeConnectsParentIfGetParentReturnsInstance() + { + $type = new FooSubTypeWithParentInstance(); + $parentResolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $this->extension1->addType($type); + + $this->resolvedTypeFactory->expects($this->at(0)) + ->method('createResolvedType') + ->with($this->isInstanceOf('Symfony\Component\Form\Tests\Fixtures\FooType')) + ->will($this->returnValue($parentResolvedType)); + + $this->resolvedTypeFactory->expects($this->at(1)) + ->method('createResolvedType') + ->with($type, array(), $parentResolvedType) + ->will($this->returnValue($resolvedType)); + + $parentResolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo_sub_type_parent_instance')); + + $this->assertSame($resolvedType, $this->registry->getType('foo_sub_type_parent_instance')); + } + + /** + * @expectedException Symfony\Component\Form\Exception\FormException + */ + public function testGetTypeThrowsExceptionIfParentNotFound() + { + $type = new FooSubType(); + + $this->extension1->addType($type); + + $this->registry->getType($type); + } + + /** + * @expectedException Symfony\Component\Form\Exception\FormException + */ + public function testGetTypeThrowsExceptionIfTypeNotFound() + { + $this->registry->getType('bar'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testGetTypeThrowsExceptionIfNoString() + { + $this->registry->getType(array()); + } + + public function testHasTypeAfterAdding() + { + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $this->assertFalse($this->registry->hasType('foo')); + + $this->registry->addType($resolvedType); + + $this->assertTrue($this->registry->hasType('foo')); + } + + public function testHasTypeAfterLoadingFromExtension() + { + $type = new FooType(); + $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + + $this->resolvedTypeFactory->expects($this->once()) + ->method('createResolvedType') + ->with($type) + ->will($this->returnValue($resolvedType)); + + $resolvedType->expects($this->any()) + ->method('getName') + ->will($this->returnValue('foo')); + + $this->assertFalse($this->registry->hasType('foo')); + + $this->extension2->addType($type); + + $this->assertTrue($this->registry->hasType('foo')); + } + + public function testGetTypeGuesser() + { + $expectedGuesser = new FormTypeGuesserChain(array($this->guesser1, $this->guesser2)); + + $this->assertEquals($expectedGuesser, $this->registry->getTypeGuesser()); + + $registry = new FormRegistry( + array($this->getMock('Symfony\Component\Form\FormExtensionInterface')), + $this->resolvedTypeFactory); + + $this->assertNull($registry->getTypeGuesser()); + } + + public function testGetExtensions() + { + $expectedExtensions = array($this->extension1, $this->extension2); + + $this->assertEquals($expectedExtensions, $this->registry->getExtensions()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php new file mode 100755 index 0000000000..235eb6ed2d --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Guess/GuessTest.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Guess; + +use Symfony\Component\Form\Guess\Guess; + +class TestGuess extends Guess {} + +class GuessTest extends \PHPUnit_Framework_TestCase +{ + public function testGetBestGuessReturnsGuessWithHighestConfidence() + { + $guess1 = new TestGuess(Guess::MEDIUM_CONFIDENCE); + $guess2 = new TestGuess(Guess::LOW_CONFIDENCE); + $guess3 = new TestGuess(Guess::HIGH_CONFIDENCE); + + $this->assertSame($guess3, Guess::getBestGuess(array($guess1, $guess2, $guess3))); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testGuessExpectsValidConfidence() + { + new TestGuess(5); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php new file mode 100755 index 0000000000..9a676ad371 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php @@ -0,0 +1,282 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\ResolvedFormType; +use Symfony\Component\Form\FormView; +use Symfony\Component\Form\FormBuilder; +use Symfony\Component\Form\Form; +use Symfony\Component\OptionsResolver\OptionsResolverInterface; + +/** + * @author Bernhard Schussek + */ +class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dispatcher; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $factory; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + private $dataMapper; + + protected function setUp() + { + if (!class_exists('Symfony\Component\OptionsResolver\OptionsResolver')) { + $this->markTestSkipped('The "OptionsResolver" component is not available'); + } + + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); + $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + $this->dataMapper = $this->getMock('Symfony\Component\Form\DataMapperInterface'); + } + + public function testCreateBuilder() + { + if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) { + $this->markTestSkipped('This test requires PHPUnit 3.7.'); + } + + $parentType = $this->getMockFormType(); + $type = $this->getMockFormType(); + $extension1 = $this->getMockFormTypeExtension(); + $extension2 = $this->getMockFormTypeExtension(); + + $parentResolvedType = new ResolvedFormType($parentType); + $resolvedType = new ResolvedFormType($type, array($extension1, $extension2), $parentResolvedType); + + $test = $this; + $i = 0; + + $assertIndex = function ($index) use (&$i, $test) { + return function () use (&$i, $test, $index) { + /* @var \PHPUnit_Framework_TestCase $test */ + $test->assertEquals($index, $i, 'Executed at index ' . $index); + + ++$i; + }; + }; + + $assertIndexAndAddOption = function ($index, $option, $default) use ($assertIndex) { + $assertIndex = $assertIndex($index); + + return function (OptionsResolverInterface $resolver) use ($assertIndex, $index, $option, $default) { + $assertIndex(); + + $resolver->setDefaults(array($option => $default)); + }; + }; + + // First the default options are generated for the super type + $parentType->expects($this->once()) + ->method('setDefaultOptions') + ->will($this->returnCallback($assertIndexAndAddOption(0, 'a', 'a_default'))); + + // The form type itself + $type->expects($this->once()) + ->method('setDefaultOptions') + ->will($this->returnCallback($assertIndexAndAddOption(1, 'b', 'b_default'))); + + // And its extensions + $extension1->expects($this->once()) + ->method('setDefaultOptions') + ->will($this->returnCallback($assertIndexAndAddOption(2, 'c', 'c_default'))); + + $extension2->expects($this->once()) + ->method('setDefaultOptions') + ->will($this->returnCallback($assertIndexAndAddOption(3, 'd', 'd_default'))); + + $givenOptions = array('a' => 'a_custom', 'c' => 'c_custom'); + $resolvedOptions = array('a' => 'a_custom', 'b' => 'b_default', 'c' => 'c_custom', 'd' => 'd_default'); + + // Then the form is built for the super type + $parentType->expects($this->once()) + ->method('buildForm') + ->with($this->anything(), $resolvedOptions) + ->will($this->returnCallback($assertIndex(4))); + + // Then the type itself + $type->expects($this->once()) + ->method('buildForm') + ->with($this->anything(), $resolvedOptions) + ->will($this->returnCallback($assertIndex(5))); + + // Then its extensions + $extension1->expects($this->once()) + ->method('buildForm') + ->with($this->anything(), $resolvedOptions) + ->will($this->returnCallback($assertIndex(6))); + + $extension2->expects($this->once()) + ->method('buildForm') + ->with($this->anything(), $resolvedOptions) + ->will($this->returnCallback($assertIndex(7))); + + $factory = $this->getMockFormFactory(); + $parentBuilder = $this->getBuilder('parent'); + $builder = $resolvedType->createBuilder($factory, 'name', $givenOptions, $parentBuilder); + + $this->assertSame($parentBuilder, $builder->getParent()); + $this->assertSame($resolvedType, $builder->getType()); + } + + public function testCreateView() + { + $parentType = $this->getMockFormType(); + $type = $this->getMockFormType(); + $field1Type = $this->getMockFormType(); + $field2Type = $this->getMockFormType(); + $extension1 = $this->getMockFormTypeExtension(); + $extension2 = $this->getMockFormTypeExtension(); + + $parentResolvedType = new ResolvedFormType($parentType); + $resolvedType = new ResolvedFormType($type, array($extension1, $extension2), $parentResolvedType); + $field1ResolvedType = new ResolvedFormType($field1Type); + $field2ResolvedType = new ResolvedFormType($field2Type); + + $options = array('a' => '1', 'b' => '2'); + $form = $this->getBuilder('name', $options) + ->setCompound(true) + ->setDataMapper($this->dataMapper) + ->setType($resolvedType) + ->add($this->getBuilder('foo')->setType($field1ResolvedType)) + ->add($this->getBuilder('bar')->setType($field2ResolvedType)) + ->getForm(); + + $test = $this; + $i = 0; + + $assertIndexAndNbOfChildViews = function ($index, $nbOfChildViews) use (&$i, $test) { + return function (FormView $view) use (&$i, $test, $index, $nbOfChildViews) { + /* @var \PHPUnit_Framework_TestCase $test */ + $test->assertEquals($index, $i, 'Executed at index ' . $index); + $test->assertCount($nbOfChildViews, $view); + + ++$i; + }; + }; + + // First the super type + $parentType->expects($this->once()) + ->method('buildView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(0, 0))); + + // Then the type itself + $type->expects($this->once()) + ->method('buildView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(1, 0))); + + // Then its extensions + $extension1->expects($this->once()) + ->method('buildView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(2, 0))); + + $extension2->expects($this->once()) + ->method('buildView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(3, 0))); + + // Now the first child form + $field1Type->expects($this->once()) + ->method('buildView') + ->will($this->returnCallback($assertIndexAndNbOfChildViews(4, 0))); + $field1Type->expects($this->once()) + ->method('finishView') + ->will($this->returnCallback($assertIndexAndNbOfChildViews(5, 0))); + + // And the second child form + $field2Type->expects($this->once()) + ->method('buildView') + ->will($this->returnCallback($assertIndexAndNbOfChildViews(6, 0))); + $field2Type->expects($this->once()) + ->method('finishView') + ->will($this->returnCallback($assertIndexAndNbOfChildViews(7, 0))); + + // Again first the parent + $parentType->expects($this->once()) + ->method('finishView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(8, 2))); + + // Then the type itself + $type->expects($this->once()) + ->method('finishView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(9, 2))); + + // Then its extensions + $extension1->expects($this->once()) + ->method('finishView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(10, 2))); + + $extension2->expects($this->once()) + ->method('finishView') + ->with($this->anything(), $form, $options) + ->will($this->returnCallback($assertIndexAndNbOfChildViews(11, 2))); + + $parentView = new FormView(); + $view = $resolvedType->createView($form, $parentView); + + $this->assertSame($parentView, $view->parent); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getMockFormType() + { + return $this->getMock('Symfony\Component\Form\FormTypeInterface'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getMockFormTypeExtension() + { + return $this->getMock('Symfony\Component\Form\FormTypeExtensionInterface'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getMockFormFactory() + { + return $this->getMock('Symfony\Component\Form\FormFactoryInterface'); + } + + /** + * @param string $name + * @param array $options + * + * @return FormBuilder + */ + protected function getBuilder($name = 'name', array $options = array()) + { + return new FormBuilder($name, null, $this->dispatcher, $this->factory, $options); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/SimpleFormTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/SimpleFormTest.php new file mode 100755 index 0000000000..20dee8f8f4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -0,0 +1,870 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests; + +use Symfony\Component\Form\Form; +use Symfony\Component\Form\FormEvent; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\FormConfigBuilder; +use Symfony\Component\Form\FormError; +use Symfony\Component\Form\Exception\TransformationFailedException; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer; +use Symfony\Component\Form\Tests\Fixtures\FixedFilterListener; + +class SimpleFormTest_Countable implements \Countable +{ + private $count; + + public function __construct($count) + { + $this->count = $count; + } + + public function count() + { + return $this->count; + } +} + +class SimpleFormTest_Traversable implements \IteratorAggregate +{ + private $iterator; + + public function __construct($count) + { + $this->iterator = new \ArrayIterator($count > 0 ? array_fill(0, $count, 'Foo') : array()); + } + + public function getIterator() + { + return $this->iterator; + } +} + +class SimpleFormTest extends AbstractFormTest +{ + public function testDataIsInitializedToConfiguredValue() + { + $model = new FixedDataTransformer(array( + 'default' => 'foo', + )); + $view = new FixedDataTransformer(array( + 'foo' => 'bar', + )); + + $config = new FormConfigBuilder('name', null, $this->dispatcher); + $config->addViewTransformer($view); + $config->addModelTransformer($model); + $config->setData('default'); + $form = new Form($config); + + $this->assertSame('default', $form->getData()); + $this->assertSame('foo', $form->getNormData()); + $this->assertSame('bar', $form->getViewData()); + } + + // https://github.com/symfony/symfony/commit/d4f4038f6daf7cf88ca7c7ab089473cce5ebf7d8#commitcomment-1632879 + public function testDataIsInitializedFromBind() + { + $mock = $this->getMockBuilder('\stdClass') + ->setMethods(array('preSetData', 'preBind')) + ->getMock(); + $mock->expects($this->at(0)) + ->method('preSetData'); + $mock->expects($this->at(1)) + ->method('preBind'); + + $config = new FormConfigBuilder('name', null, $this->dispatcher); + $config->addEventListener(FormEvents::PRE_SET_DATA, array($mock, 'preSetData')); + $config->addEventListener(FormEvents::PRE_BIND, array($mock, 'preBind')); + $form = new Form($config); + + // no call to setData() or similar where the object would be + // initialized otherwise + + $form->bind('foobar'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\AlreadyBoundException + */ + public function testBindThrowsExceptionIfAlreadyBound() + { + $this->form->bind(array()); + $this->form->bind(array()); + } + + public function testBindIsIgnoredIfDisabled() + { + $form = $this->getBuilder() + ->setDisabled(true) + ->setData('initial') + ->getForm(); + + $form->bind('new'); + + $this->assertEquals('initial', $form->getData()); + $this->assertTrue($form->isBound()); + } + + public function testNeverRequiredIfParentNotRequired() + { + $parent = $this->getBuilder()->setRequired(false)->getForm(); + $child = $this->getBuilder()->setRequired(true)->getForm(); + + $child->setParent($parent); + + $this->assertFalse($child->isRequired()); + } + + public function testRequired() + { + $parent = $this->getBuilder()->setRequired(true)->getForm(); + $child = $this->getBuilder()->setRequired(true)->getForm(); + + $child->setParent($parent); + + $this->assertTrue($child->isRequired()); + } + + public function testNotRequired() + { + $parent = $this->getBuilder()->setRequired(true)->getForm(); + $child = $this->getBuilder()->setRequired(false)->getForm(); + + $child->setParent($parent); + + $this->assertFalse($child->isRequired()); + } + + public function testAlwaysDisabledIfParentDisabled() + { + $parent = $this->getBuilder()->setDisabled(true)->getForm(); + $child = $this->getBuilder()->setDisabled(false)->getForm(); + + $child->setParent($parent); + + $this->assertTrue($child->isDisabled()); + } + + public function testDisabled() + { + $parent = $this->getBuilder()->setDisabled(false)->getForm(); + $child = $this->getBuilder()->setDisabled(true)->getForm(); + + $child->setParent($parent); + + $this->assertTrue($child->isDisabled()); + } + + public function testNotDisabled() + { + $parent = $this->getBuilder()->setDisabled(false)->getForm(); + $child = $this->getBuilder()->setDisabled(false)->getForm(); + + $child->setParent($parent); + + $this->assertFalse($child->isDisabled()); + } + + public function testGetRootReturnsRootOfParent() + { + $parent = $this->getMockForm(); + $parent->expects($this->once()) + ->method('getRoot') + ->will($this->returnValue('ROOT')); + + $this->form->setParent($parent); + + $this->assertEquals('ROOT', $this->form->getRoot()); + } + + public function testGetRootReturnsSelfIfNoParent() + { + $this->assertSame($this->form, $this->form->getRoot()); + } + + public function testEmptyIfEmptyArray() + { + $this->form->setData(array()); + + $this->assertTrue($this->form->isEmpty()); + } + + public function testEmptyIfEmptyCountable() + { + $this->form = new Form(new FormConfigBuilder('name', __NAMESPACE__ . '\SimpleFormTest_Countable', $this->dispatcher)); + + $this->form->setData(new SimpleFormTest_Countable(0)); + + $this->assertTrue($this->form->isEmpty()); + } + + public function testNotEmptyIfFilledCountable() + { + $this->form = new Form(new FormConfigBuilder('name', __NAMESPACE__ . '\SimpleFormTest_Countable', $this->dispatcher)); + + $this->form->setData(new SimpleFormTest_Countable(1)); + + $this->assertFalse($this->form->isEmpty()); + } + + public function testEmptyIfEmptyTraversable() + { + $this->form = new Form(new FormConfigBuilder('name', __NAMESPACE__ . '\SimpleFormTest_Traversable', $this->dispatcher)); + + $this->form->setData(new SimpleFormTest_Traversable(0)); + + $this->assertTrue($this->form->isEmpty()); + } + + public function testNotEmptyIfFilledTraversable() + { + $this->form = new Form(new FormConfigBuilder('name', __NAMESPACE__ . '\SimpleFormTest_Traversable', $this->dispatcher)); + + $this->form->setData(new SimpleFormTest_Traversable(1)); + + $this->assertFalse($this->form->isEmpty()); + } + + public function testEmptyIfNull() + { + $this->form->setData(null); + + $this->assertTrue($this->form->isEmpty()); + } + + public function testEmptyIfEmptyString() + { + $this->form->setData(''); + + $this->assertTrue($this->form->isEmpty()); + } + + public function testNotEmptyIfText() + { + $this->form->setData('foobar'); + + $this->assertFalse($this->form->isEmpty()); + } + + public function testValidIfBound() + { + $form = $this->getBuilder()->getForm(); + $form->bind('foobar'); + + $this->assertTrue($form->isValid()); + } + + public function testValidIfBoundAndDisabled() + { + $form = $this->getBuilder()->setDisabled(true)->getForm(); + $form->bind('foobar'); + + $this->assertTrue($form->isValid()); + } + + /** + * @expectedException \LogicException + */ + public function testNotValidIfNotBound() + { + $this->form->isValid(); + } + + public function testNotValidIfErrors() + { + $form = $this->getBuilder()->getForm(); + $form->bind('foobar'); + $form->addError(new FormError('Error!')); + + $this->assertFalse($form->isValid()); + } + + public function testHasErrors() + { + $this->form->addError(new FormError('Error!')); + + $this->assertCount(1, $this->form->getErrors()); + } + + public function testHasNoErrors() + { + $this->assertCount(0, $this->form->getErrors()); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\AlreadyBoundException + */ + public function testSetParentThrowsExceptionIfAlreadyBound() + { + $this->form->bind(array()); + $this->form->setParent($this->getBuilder('parent')->getForm()); + } + + public function testBound() + { + $form = $this->getBuilder()->getForm(); + $form->bind('foobar'); + + $this->assertTrue($form->isBound()); + } + + public function testNotBound() + { + $this->assertFalse($this->form->isBound()); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\AlreadyBoundException + */ + public function testSetDataThrowsExceptionIfAlreadyBound() + { + $this->form->bind(array()); + $this->form->setData(null); + } + + public function testSetDataClonesObjectIfNotByReference() + { + $data = new \stdClass(); + $form = $this->getBuilder('name', null, '\stdClass')->setByReference(false)->getForm(); + $form->setData($data); + + $this->assertNotSame($data, $form->getData()); + $this->assertEquals($data, $form->getData()); + } + + public function testSetDataDoesNotCloneObjectIfByReference() + { + $data = new \stdClass(); + $form = $this->getBuilder('name', null, '\stdClass')->setByReference(true)->getForm(); + $form->setData($data); + + $this->assertSame($data, $form->getData()); + } + + public function testSetDataExecutesTransformationChain() + { + // use real event dispatcher now + $form = $this->getBuilder('name', new EventDispatcher()) + ->addEventSubscriber(new FixedFilterListener(array( + 'preSetData' => array( + 'app' => 'filtered', + ), + ))) + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 'filtered' => 'norm', + ))) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'norm' => 'client', + ))) + ->getForm(); + + $form->setData('app'); + + $this->assertEquals('filtered', $form->getData()); + $this->assertEquals('norm', $form->getNormData()); + $this->assertEquals('client', $form->getViewData()); + } + + public function testSetDataExecutesViewTransformersInOrder() + { + $form = $this->getBuilder() + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'first' => 'second', + ))) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'second' => 'third', + ))) + ->getForm(); + + $form->setData('first'); + + $this->assertEquals('third', $form->getViewData()); + } + + public function testSetDataExecutesModelTransformersInReverseOrder() + { + $form = $this->getBuilder() + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 'second' => 'third', + ))) + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 'first' => 'second', + ))) + ->getForm(); + + $form->setData('first'); + + $this->assertEquals('third', $form->getNormData()); + } + + /* + * When there is no data transformer, the data must have the same format + * in all three representations + */ + public function testSetDataConvertsScalarToStringIfNoTransformer() + { + $form = $this->getBuilder()->getForm(); + + $form->setData(1); + + $this->assertSame('1', $form->getData()); + $this->assertSame('1', $form->getNormData()); + $this->assertSame('1', $form->getViewData()); + } + + /* + * Data in client format should, if possible, always be a string to + * facilitate differentiation between '0' and '' + */ + public function testSetDataConvertsScalarToStringIfOnlyModelTransformer() + { + $form = $this->getBuilder() + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 1 => 23, + ))) + ->getForm(); + + $form->setData(1); + + $this->assertSame(1, $form->getData()); + $this->assertSame(23, $form->getNormData()); + $this->assertSame('23', $form->getViewData()); + } + + /* + * NULL remains NULL in app and norm format to remove the need to treat + * empty values and NULL explicitly in the application + */ + public function testSetDataConvertsNullToStringIfNoTransformer() + { + $form = $this->getBuilder()->getForm(); + + $form->setData(null); + + $this->assertNull($form->getData()); + $this->assertNull($form->getNormData()); + $this->assertSame('', $form->getViewData()); + } + + public function testSetDataIsIgnoredIfDataIsLocked() + { + $form = $this->getBuilder() + ->setData('default') + ->setDataLocked(true) + ->getForm(); + + $form->setData('foobar'); + + $this->assertSame('default', $form->getData()); + } + + public function testBindConvertsEmptyToNullIfNoTransformer() + { + $form = $this->getBuilder()->getForm(); + + $form->bind(''); + + $this->assertNull($form->getData()); + $this->assertNull($form->getNormData()); + $this->assertSame('', $form->getViewData()); + } + + public function testBindExecutesTransformationChain() + { + // use real event dispatcher now + $form = $this->getBuilder('name', new EventDispatcher()) + ->addEventSubscriber(new FixedFilterListener(array( + 'preBind' => array( + 'client' => 'filteredclient', + ), + 'onBind' => array( + 'norm' => 'filterednorm', + ), + ))) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + // direction is reversed! + 'norm' => 'filteredclient', + 'filterednorm' => 'cleanedclient' + ))) + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + // direction is reversed! + 'app' => 'filterednorm', + ))) + ->getForm(); + + $form->bind('client'); + + $this->assertEquals('app', $form->getData()); + $this->assertEquals('filterednorm', $form->getNormData()); + $this->assertEquals('cleanedclient', $form->getViewData()); + } + + public function testBindExecutesViewTransformersInReverseOrder() + { + $form = $this->getBuilder() + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'third' => 'second', + ))) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'second' => 'first', + ))) + ->getForm(); + + $form->bind('first'); + + $this->assertEquals('third', $form->getNormData()); + } + + public function testBindExecutesModelTransformersInOrder() + { + $form = $this->getBuilder() + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 'second' => 'first', + ))) + ->addModelTransformer(new FixedDataTransformer(array( + '' => '', + 'third' => 'second', + ))) + ->getForm(); + + $form->bind('first'); + + $this->assertEquals('third', $form->getData()); + } + + public function testSynchronizedByDefault() + { + $this->assertTrue($this->form->isSynchronized()); + } + + public function testSynchronizedAfterBinding() + { + $this->form->bind('foobar'); + + $this->assertTrue($this->form->isSynchronized()); + } + + public function testNotSynchronizedIfViewReverseTransformationFailed() + { + $transformer = $this->getDataTransformer(); + $transformer->expects($this->once()) + ->method('reverseTransform') + ->will($this->throwException(new TransformationFailedException())); + + $form = $this->getBuilder() + ->addViewTransformer($transformer) + ->getForm(); + + $form->bind('foobar'); + + $this->assertFalse($form->isSynchronized()); + } + + public function testNotSynchronizedIfModelReverseTransformationFailed() + { + $transformer = $this->getDataTransformer(); + $transformer->expects($this->once()) + ->method('reverseTransform') + ->will($this->throwException(new TransformationFailedException())); + + $form = $this->getBuilder() + ->addModelTransformer($transformer) + ->getForm(); + + $form->bind('foobar'); + + $this->assertFalse($form->isSynchronized()); + } + + public function testEmptyDataCreatedBeforeTransforming() + { + $form = $this->getBuilder() + ->setEmptyData('foo') + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) + ->getForm(); + + $form->bind(''); + + $this->assertEquals('bar', $form->getData()); + } + + public function testEmptyDataFromClosure() + { + $test = $this; + $form = $this->getBuilder() + ->setEmptyData(function ($form) use ($test) { + // the form instance is passed to the closure to allow use + // of form data when creating the empty value + $test->assertInstanceOf('Symfony\Component\Form\FormInterface', $form); + + return 'foo'; + }) + ->addViewTransformer(new FixedDataTransformer(array( + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) + ->getForm(); + + $form->bind(''); + + $this->assertEquals('bar', $form->getData()); + } + + public function testBindValidatesAfterTransformation() + { + $test = $this; + $validator = $this->getFormValidator(); + $form = $this->getBuilder() + ->addValidator($validator) + ->getForm(); + + $validator->expects($this->once()) + ->method('validate') + ->with($form) + ->will($this->returnCallback(function ($form) use ($test) { + $test->assertEquals('foobar', $form->getData()); + })); + + $form->bind('foobar'); + } + + public function testBindResetsErrors() + { + $this->form->addError(new FormError('Error!')); + $this->form->bind('foobar'); + + $this->assertSame(array(), $this->form->getErrors()); + } + + public function testCreateView() + { + $type = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + $view = $this->getMock('Symfony\Component\Form\FormView'); + $form = $this->getBuilder()->setType($type)->getForm(); + + $type->expects($this->once()) + ->method('createView') + ->with($form) + ->will($this->returnValue($view)); + + $this->assertSame($view, $form->createView()); + } + + public function testCreateViewWithParent() + { + $type = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + $view = $this->getMock('Symfony\Component\Form\FormView'); + $parentForm = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); + $parentView = $this->getMock('Symfony\Component\Form\FormView'); + $form = $this->getBuilder()->setType($type)->getForm(); + $form->setParent($parentForm); + + $parentForm->expects($this->once()) + ->method('createView') + ->will($this->returnValue($parentView)); + + $type->expects($this->once()) + ->method('createView') + ->with($form, $parentView) + ->will($this->returnValue($view)); + + $this->assertSame($view, $form->createView()); + } + + public function testCreateViewWithExplicitParent() + { + $type = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); + $view = $this->getMock('Symfony\Component\Form\FormView'); + $parentView = $this->getMock('Symfony\Component\Form\FormView'); + $form = $this->getBuilder()->setType($type)->getForm(); + + $type->expects($this->once()) + ->method('createView') + ->with($form, $parentView) + ->will($this->returnValue($view)); + + $this->assertSame($view, $form->createView($parentView)); + } + + public function testGetErrorsAsString() + { + $this->form->addError(new FormError('Error!')); + + $this->assertEquals("ERROR: Error!\n", $this->form->getErrorsAsString()); + } + + public function testFormCanHaveEmptyName() + { + $form = $this->getBuilder('')->getForm(); + + $this->assertEquals('', $form->getName()); + } + + public function testSetNullParentWorksWithEmptyName() + { + $form = $this->getBuilder('')->getForm(); + $form->setParent(null); + + $this->assertNull($form->getParent()); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\FormException + * @expectedExceptionMessage A form with an empty name cannot have a parent form. + */ + public function testFormCannotHaveEmptyNameNotInRootLevel() + { + $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->add($this->getBuilder('')) + ->getForm(); + } + + public function testGetPropertyPathReturnsConfiguredPath() + { + $form = $this->getBuilder()->setPropertyPath('address.street')->getForm(); + + $this->assertEquals(new PropertyPath('address.street'), $form->getPropertyPath()); + } + + // see https://github.com/symfony/symfony/issues/3903 + public function testGetPropertyPathDefaultsToNameIfParentHasDataClass() + { + $parent = $this->getBuilder(null, null, 'stdClass') + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getBuilder('name')->getForm(); + $parent->add($form); + + $this->assertEquals(new PropertyPath('name'), $form->getPropertyPath()); + } + + // see https://github.com/symfony/symfony/issues/3903 + public function testGetPropertyPathDefaultsToIndexedNameIfParentDataClassIsNull() + { + $parent = $this->getBuilder() + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->getForm(); + $form = $this->getBuilder('name')->getForm(); + $parent->add($form); + + $this->assertEquals(new PropertyPath('[name]'), $form->getPropertyPath()); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\FormException + */ + public function testViewDataMustNotBeObjectIfDataClassIsNull() + { + $config = new FormConfigBuilder('name', null, $this->dispatcher); + $config->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => new \stdClass(), + ))); + $form = new Form($config); + + $form->setData('foo'); + } + + public function testViewDataMayBeArrayAccessIfDataClassIsNull() + { + $arrayAccess = $this->getMock('\ArrayAccess'); + $config = new FormConfigBuilder('name', null, $this->dispatcher); + $config->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => $arrayAccess, + ))); + $form = new Form($config); + + $form->setData('foo'); + + $this->assertSame($arrayAccess, $form->getViewData()); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\FormException + */ + public function testViewDataMustBeObjectIfDataClassIsSet() + { + $config = new FormConfigBuilder('name', 'stdClass', $this->dispatcher); + $config->addViewTransformer(new FixedDataTransformer(array( + '' => '', + 'foo' => array('bar' => 'baz'), + ))); + $form = new Form($config); + + $form->setData('foo'); + } + + /** + * @expectedException \Symfony\Component\Form\Exception\FormException + */ + public function testSetDataCannotInvokeItself() + { + // Cycle detection to prevent endless loops + $config = new FormConfigBuilder('name', 'stdClass', $this->dispatcher); + $config->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { + $event->getForm()->setData('bar'); + }); + $form = new Form($config); + + $form->setData('foo'); + } + + public function testBindingWrongDataIsIgnored() + { + $test = $this; + + $child = $this->getBuilder('child', $this->dispatcher); + $child->addEventListener(FormEvents::PRE_BIND, function (FormEvent $event) use ($test) { + // child form doesn't receive the wrong data that is bound on parent + $test->assertNull($event->getData()); + }); + + $parent = $this->getBuilder('parent', new EventDispatcher()) + ->setCompound(true) + ->setDataMapper($this->getDataMapper()) + ->add($child) + ->getForm(); + + $parent->bind('not-an-array'); + } + + protected function createForm() + { + return $this->getBuilder()->getForm(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/FormUtilTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/FormUtilTest.php new file mode 100755 index 0000000000..c70c0d6fcc --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/FormUtilTest.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +use Symfony\Component\Form\Util\FormUtil; + +class FormUtilTest extends \PHPUnit_Framework_TestCase +{ + public function singularifyProvider() + { + // see http://english-zone.com/spelling/plurals.html + // see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English + return array( + array('tags', 'tag'), + array('alumni', 'alumnus'), + array('funguses', array('fungus', 'funguse', 'fungusis')), + array('fungi', 'fungus'), + array('axes', array('ax', 'axe', 'axis')), + array('appendices', array('appendex', 'appendix', 'appendice')), + array('indices', array('index', 'indix', 'indice')), + array('prices', array('prex', 'prix', 'price')), + array('indexes', 'index'), + array('children', 'child'), + array('men', 'man'), + array('women', 'woman'), + array('oxen', 'ox'), + array('bacteria', array('bacterion', 'bacterium')), + array('criteria', array('criterion', 'criterium')), + array('feet', 'foot'), + array('nebulae', 'nebula'), + array('babies', 'baby'), + array('hooves', 'hoof'), + array('chateaux', 'chateau'), + array('echoes', array('echo', 'echoe')), + array('analyses', array('analys', 'analyse', 'analysis')), + array('theses', array('thes', 'these', 'thesis')), + array('foci', 'focus'), + array('focuses', array('focus', 'focuse', 'focusis')), + array('oases', array('oas', 'oase', 'oasis')), + array('matrices', array('matrex', 'matrix', 'matrice')), + array('matrixes', 'matrix'), + array('bureaus', 'bureau'), + array('bureaux', 'bureau'), + array('beaux', 'beau'), + array('data', array('daton', 'datum')), + array('phenomena', array('phenomenon', 'phenomenum')), + array('strata', array('straton', 'stratum')), + array('geese', 'goose'), + array('teeth', 'tooth'), + array('antennae', 'antenna'), + array('antennas', 'antenna'), + array('houses', array('hous', 'house', 'housis')), + array('arches', array('arch', 'arche')), + array('atlases', array('atlas', 'atlase', 'atlasis')), + array('batches', array('batch', 'batche')), + array('bushes', array('bush', 'bushe')), + array('buses', array('bus', 'buse', 'busis')), + array('calves', 'calf'), + array('circuses', array('circus', 'circuse', 'circusis')), + array('crises', array('cris', 'crise', 'crisis')), + array('dwarves', 'dwarf'), + array('elves', 'elf'), + array('emphases', array('emphas', 'emphase', 'emphasis')), + array('faxes', 'fax'), + array('halves', 'half'), + array('heroes', array('hero', 'heroe')), + array('hoaxes', 'hoax'), + array('irises', array('iris', 'irise', 'irisis')), + array('kisses', array('kiss', 'kisse', 'kissis')), + array('knives', 'knife'), + array('lives', 'life'), + array('lice', 'louse'), + array('mice', 'mouse'), + array('neuroses', array('neuros', 'neurose', 'neurosis')), + array('plateaux', 'plateau'), + array('poppies', 'poppy'), + array('quizzes', 'quiz'), + array('scarves', 'scarf'), + array('spies', 'spy'), + array('stories', 'story'), + array('syllabi', 'syllabus'), + array('thieves', 'thief'), + array('waltzes', array('waltz', 'waltze')), + array('wharves', 'wharf'), + array('wives', 'wife'), + array('ions', 'ion'), + array('bases', array('bas', 'base', 'basis')), + array('cars', 'car'), + array('cassettes', array('cassett', 'cassette')), + array('lamps', 'lamp'), + array('hats', 'hat'), + array('cups', 'cup'), + array('boxes', 'box'), + array('sandwiches', array('sandwich', 'sandwiche')), + array('suitcases', array('suitcas', 'suitcase', 'suitcasis')), + array('roses', array('ros', 'rose', 'rosis')), + array('garages', array('garag', 'garage')), + array('shoes', array('sho', 'shoe')), + array('days', 'day'), + array('boys', 'boy'), + array('roofs', 'roof'), + array('cliffs', 'cliff'), + array('sheriffs', 'sheriff'), + array('discos', 'disco'), + array('pianos', 'piano'), + array('photos', 'photo'), + array('trees', array('tre', 'tree')), + array('bees', array('be', 'bee')), + array('cheeses', array('chees', 'cheese', 'cheesis')), + array('radii', 'radius'), + + // test casing: if the first letter was uppercase, it should remain so + array('Men', 'Man'), + array('GrandChildren', 'GrandChild'), + array('SubTrees', array('SubTre', 'SubTree')), + ); + } + + /** + * @dataProvider singularifyProvider + */ + public function testSingularify($plural, $singular) + { + $this->assertEquals($singular, FormUtil::singularify($plural)); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayObjectTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayObjectTest.php new file mode 100755 index 0000000000..96ddc6d6f0 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayObjectTest.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +class PropertyPathArrayObjectTest extends PropertyPathCollectionTest +{ + protected function getCollection(array $array) + { + return new \ArrayObject($array); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayTest.php new file mode 100755 index 0000000000..ce726c80f8 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathArrayTest.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +class PropertyPathArrayTest extends PropertyPathCollectionTest +{ + protected function getCollection(array $array) + { + return $array; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathBuilderTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathBuilderTest.php new file mode 100755 index 0000000000..6649bdcdc9 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathBuilderTest.php @@ -0,0 +1,251 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Util\PropertyPathBuilder; + +/** + * @author Bernhard Schussek + */ +class PropertyPathBuilderTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var string + */ + const PREFIX = 'old1[old2].old3[old4][old5].old6'; + + /** + * @var PropertyPathBuilder + */ + private $builder; + + protected function setUp() + { + $this->builder = new PropertyPathBuilder(new PropertyPath(self::PREFIX)); + } + + public function testCreateEmpty() + { + $builder = new PropertyPathBuilder(); + + $this->assertNull($builder->getPropertyPath()); + } + + public function testCreateCopyPath() + { + $this->assertEquals(new PropertyPath(self::PREFIX), $this->builder->getPropertyPath()); + } + + public function testAppendIndex() + { + $this->builder->appendIndex('new1'); + + $path = new PropertyPath(self::PREFIX . '[new1]'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testAppendProperty() + { + $this->builder->appendProperty('new1'); + + $path = new PropertyPath(self::PREFIX . '.new1'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testAppend() + { + $this->builder->append(new PropertyPath('new1[new2]')); + + $path = new PropertyPath(self::PREFIX . '.new1[new2]'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testAppendWithOffset() + { + $this->builder->append(new PropertyPath('new1[new2].new3'), 1); + + $path = new PropertyPath(self::PREFIX . '[new2].new3'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testAppendWithOffsetAndLength() + { + $this->builder->append(new PropertyPath('new1[new2].new3'), 1, 1); + + $path = new PropertyPath(self::PREFIX . '[new2]'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testReplaceByIndex() + { + $this->builder->replaceByIndex(1, 'new1'); + + $path = new PropertyPath('old1[new1].old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testReplaceByIndexWithoutName() + { + $this->builder->replaceByIndex(0); + + $path = new PropertyPath('[old1][old2].old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceByIndexDoesNotAllowInvalidOffsets() + { + $this->builder->replaceByIndex(6, 'new1'); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceByIndexDoesNotAllowNegativeOffsets() + { + $this->builder->replaceByIndex(-1, 'new1'); + } + + public function testReplaceByProperty() + { + $this->builder->replaceByProperty(1, 'new1'); + + $path = new PropertyPath('old1.new1.old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testReplaceByPropertyWithoutName() + { + $this->builder->replaceByProperty(1); + + $path = new PropertyPath('old1.old2.old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceByPropertyDoesNotAllowInvalidOffsets() + { + $this->builder->replaceByProperty(6, 'new1'); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceByPropertyDoesNotAllowNegativeOffsets() + { + $this->builder->replaceByProperty(-1, 'new1'); + } + + public function testReplace() + { + $this->builder->replace(1, 1, new PropertyPath('new1[new2].new3')); + + $path = new PropertyPath('old1.new1[new2].new3.old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceDoesNotAllowInvalidOffsets() + { + $this->builder->replace(6, 1, new PropertyPath('new1[new2].new3')); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testReplaceDoesNotAllowNegativeOffsets() + { + $this->builder->replace(-1, 1, new PropertyPath('new1[new2].new3')); + } + + public function testReplaceWithLengthGreaterOne() + { + $this->builder->replace(0, 2, new PropertyPath('new1[new2].new3')); + + $path = new PropertyPath('new1[new2].new3.old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testReplaceSubstring() + { + $this->builder->replace(1, 1, new PropertyPath('new1[new2].new3.new4[new5]'), 1, 3); + + $path = new PropertyPath('old1[new2].new3.new4.old3[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + public function testReplaceSubstringWithLengthGreaterOne() + { + $this->builder->replace(1, 2, new PropertyPath('new1[new2].new3.new4[new5]'), 1, 3); + + $path = new PropertyPath('old1[new2].new3.new4[old4][old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + // https://github.com/symfony/symfony/issues/5605 + public function testReplaceWithLongerPath() + { + // error occurs when path contains at least two more elements + // than the builder + $path = new PropertyPath('new1.new2.new3'); + + $builder = new PropertyPathBuilder(new PropertyPath('old1')); + $builder->replace(0, 1, $path); + + $this->assertEquals($path, $builder->getPropertyPath()); + } + + public function testRemove() + { + $this->builder->remove(3); + + $path = new PropertyPath('old1[old2].old3[old5].old6'); + + $this->assertEquals($path, $this->builder->getPropertyPath()); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testRemoveDoesNotAllowInvalidOffsets() + { + $this->builder->remove(6); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testRemoveDoesNotAllowNegativeOffsets() + { + $this->builder->remove(-1); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCollectionTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCollectionTest.php new file mode 100755 index 0000000000..e183ab72da --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCollectionTest.php @@ -0,0 +1,341 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Util\FormUtil; + +class PropertyPathCollectionTest_Car +{ + private $axes; + + public function __construct($axes = null) + { + $this->axes = $axes; + } + + // In the test, use a name that FormUtil can't uniquely singularify + public function addAxis($axis) + { + $this->axes[] = $axis; + } + + public function removeAxis($axis) + { + foreach ($this->axes as $key => $value) { + if ($value === $axis) { + unset($this->axes[$key]); + + return; + } + } + } + + public function getAxes() + { + return $this->axes; + } +} + +class PropertyPathCollectionTest_CarCustomSingular +{ + public function addFoo($axis) {} + + public function removeFoo($axis) {} + + public function getAxes() {} +} + +class PropertyPathCollectionTest_Engine +{ +} + +class PropertyPathCollectionTest_CarOnlyAdder +{ + public function addAxis($axis) {} + + public function getAxes() {} +} + +class PropertyPathCollectionTest_CarOnlyRemover +{ + public function removeAxis($axis) {} + + public function getAxes() {} +} + +class PropertyPathCollectionTest_CarNoAdderAndRemover +{ + public function getAxes() {} +} + +class PropertyPathCollectionTest_CarNoAdderAndRemoverWithProperty +{ + protected $axes = array(); + + public function getAxes() {} +} + +class PropertyPathCollectionTest_CompositeCar +{ + public function getStructure() {} + + public function setStructure($structure) {} +} + +class PropertyPathCollectionTest_CarStructure +{ + public function addAxis($axis) {} + + public function removeAxis($axis) {} + + public function getAxes() {} +} + +abstract class PropertyPathCollectionTest extends \PHPUnit_Framework_TestCase +{ + abstract protected function getCollection(array $array); + + public function testGetValueReadsArrayAccess() + { + $object = $this->getCollection(array('firstName' => 'Bernhard')); + + $path = new PropertyPath('[firstName]'); + + $this->assertEquals('Bernhard', $path->getValue($object)); + } + + public function testGetValueReadsNestedArrayAccess() + { + $object = $this->getCollection(array('person' => array('firstName' => 'Bernhard'))); + + $path = new PropertyPath('[person][firstName]'); + + $this->assertEquals('Bernhard', $path->getValue($object)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testGetValueThrowsExceptionIfArrayAccessExpected() + { + $path = new PropertyPath('[firstName]'); + + $path->getValue(new \stdClass()); + } + + public function testSetValueUpdatesArrayAccess() + { + $object = $this->getCollection(array()); + + $path = new PropertyPath('[firstName]'); + $path->setValue($object, 'Bernhard'); + + $this->assertEquals('Bernhard', $object['firstName']); + } + + public function testSetValueUpdatesNestedArrayAccess() + { + $object = $this->getCollection(array()); + + $path = new PropertyPath('[person][firstName]'); + $path->setValue($object, 'Bernhard'); + + $this->assertEquals('Bernhard', $object['person']['firstName']); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testSetValueThrowsExceptionIfArrayAccessExpected() + { + $path = new PropertyPath('[firstName]'); + + $path->setValue(new \stdClass(), 'Bernhard'); + } + + public function testSetValueCallsAdderAndRemoverForCollections() + { + $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth', 4 => 'fifth')); + $axesMerged = $this->getCollection(array(1 => 'first', 2 => 'second', 3 => 'third')); + $axesAfter = $this->getCollection(array(1 => 'second', 5 => 'first', 6 => 'third')); + $axesMergedCopy = is_object($axesMerged) ? clone $axesMerged : $axesMerged; + + // Don't use a mock in order to test whether the collections are + // modified while iterating them + $car = new PropertyPathCollectionTest_Car($axesBefore); + + $path = new PropertyPath('axes'); + + $path->setValue($car, $axesMerged); + + $this->assertEquals($axesAfter, $car->getAxes()); + + // The passed collection was not modified + $this->assertEquals($axesMergedCopy, $axesMerged); + } + + public function testSetValueCallsAdderAndRemoverForNestedCollections() + { + $car = $this->getMock(__CLASS__ . '_CompositeCar'); + $structure = $this->getMock(__CLASS__ . '_CarStructure'); + $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); + $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $path = new PropertyPath('structure.axes'); + + $car->expects($this->any()) + ->method('getStructure') + ->will($this->returnValue($structure)); + + $structure->expects($this->at(0)) + ->method('getAxes') + ->will($this->returnValue($axesBefore)); + $structure->expects($this->at(1)) + ->method('removeAxis') + ->with('fourth'); + $structure->expects($this->at(2)) + ->method('addAxis') + ->with('first'); + $structure->expects($this->at(3)) + ->method('addAxis') + ->with('third'); + + $path->setValue($car, $axesAfter); + } + + public function testSetValueCallsCustomAdderAndRemover() + { + $this->markTestSkipped('This feature is temporarily disabled as of 2.1'); + + $car = $this->getMock(__CLASS__ . '_CarCustomSingular'); + $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); + $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $path = new PropertyPath('axes|foo'); + + $car->expects($this->at(0)) + ->method('getAxes') + ->will($this->returnValue($axesBefore)); + $car->expects($this->at(1)) + ->method('removeFoo') + ->with('fourth'); + $car->expects($this->at(2)) + ->method('addFoo') + ->with('first'); + $car->expects($this->at(3)) + ->method('addFoo') + ->with('third'); + + $path->setValue($car, $axesAfter); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testMapFormToDataFailsIfOnlyAdderFound() + { + $car = $this->getMock(__CLASS__ . '_CarOnlyAdder'); + $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); + $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $path = new PropertyPath('axes'); + + $car->expects($this->any()) + ->method('getAxes') + ->will($this->returnValue($axesBefore)); + + $path->setValue($car, $axesAfter); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testMapFormToDataFailsIfOnlyRemoverFound() + { + $car = $this->getMock(__CLASS__ . '_CarOnlyRemover'); + $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); + $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + + $path = new PropertyPath('axes'); + + $car->expects($this->any()) + ->method('getAxes') + ->will($this->returnValue($axesBefore)); + + $path->setValue($car, $axesAfter); + } + + /** + * @dataProvider noAdderRemoverData + */ + public function testNoAdderAndRemoverThrowsSensibleError($car, $path, $message) + { + $axes = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); + + try { + $path->setValue($car, $axes); + $this->fail('An expected exception was not thrown!'); + } catch (\Symfony\Component\Form\Exception\FormException $e) { + $this->assertEquals($message, $e->getMessage()); + } + } + + public function noAdderRemoverData() + { + $data = array(); + + $car = $this->getMock(__CLASS__ . '_CarNoAdderAndRemover'); + $propertyPath = new PropertyPath('axes'); + $expectedMessage = sprintf( + 'Neither element "axes" nor method "setAxes()" exists in class ' + .'"%s", nor could adders and removers be found based on the ' + .'guessed singulars: %s' +// . '(provide a singular by suffixing the ' +// .'property path with "|{singular}" to override the guesser)' + , + get_class($car), + implode(', ', (array) $singulars = FormUtil::singularify('Axes')) + ); + $data[] = array($car, $propertyPath, $expectedMessage); + + /* + Temporarily disabled in 2.1 + + $propertyPath = new PropertyPath('axes|boo'); + $expectedMessage = sprintf( + 'Neither element "axes" nor method "setAxes()" exists in class ' + .'"%s", nor could adders and removers be found based on the ' + .'passed singular: %s', + get_class($car), + 'boo' + ); + $data[] = array($car, $propertyPath, $expectedMessage); + */ + + $car = $this->getMock(__CLASS__ . '_CarNoAdderAndRemoverWithProperty'); + $propertyPath = new PropertyPath('axes'); + $expectedMessage = sprintf( + 'Property "axes" is not public in class "%s", nor could adders and ' + .'removers be found based on the guessed singulars: %s' +// .' (provide a singular by suffixing the property path with ' +// .'"|{singular}" to override the guesser)' + . '. Maybe you should ' + .'create the method "setAxes()"?', + get_class($car), + implode(', ', (array) $singulars = FormUtil::singularify('Axes')) + ); + $data[] = array($car, $propertyPath, $expectedMessage); + + return $data; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCustomArrayObjectTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCustomArrayObjectTest.php new file mode 100755 index 0000000000..a8c6476372 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathCustomArrayObjectTest.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +use Symfony\Component\Form\Tests\Fixtures\CustomArrayObject; + +class PropertyPathCustomArrayObjectTest extends PropertyPathCollectionTest +{ + protected function getCollection(array $array) + { + return new CustomArrayObject($array); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathTest.php b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathTest.php new file mode 100755 index 0000000000..7642def026 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/Util/PropertyPathTest.php @@ -0,0 +1,557 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Tests\Util; + +use Symfony\Component\Form\Util\PropertyPath; +use Symfony\Component\Form\Tests\Fixtures\Author; +use Symfony\Component\Form\Tests\Fixtures\Magician; + +class PropertyPathTest extends \PHPUnit_Framework_TestCase +{ + public function testGetValueReadsArray() + { + $array = array('firstName' => 'Bernhard'); + + $path = new PropertyPath('[firstName]'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testGetValueThrowsExceptionIfIndexNotationExpected() + { + $array = array('firstName' => 'Bernhard'); + + $path = new PropertyPath('firstName'); + + $path->getValue($array); + } + + public function testGetValueReadsZeroIndex() + { + $array = array('Bernhard'); + + $path = new PropertyPath('[0]'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + public function testGetValueReadsIndexWithSpecialChars() + { + $array = array('%!@$§.' => 'Bernhard'); + + $path = new PropertyPath('[%!@$§.]'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + public function testGetValueReadsNestedIndexWithSpecialChars() + { + $array = array('root' => array('%!@$§.' => 'Bernhard')); + + $path = new PropertyPath('[root][%!@$§.]'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + public function testGetValueReadsArrayWithCustomPropertyPath() + { + $array = array('child' => array('index' => array('firstName' => 'Bernhard'))); + + $path = new PropertyPath('[child][index][firstName]'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + public function testGetValueReadsArrayWithMissingIndexForCustomPropertyPath() + { + $array = array('child' => array('index' => array())); + + $path = new PropertyPath('[child][index][firstName]'); + + $this->assertNull($path->getValue($array)); + } + + public function testGetValueReadsProperty() + { + $object = new Author(); + $object->firstName = 'Bernhard'; + + $path = new PropertyPath('firstName'); + + $this->assertEquals('Bernhard', $path->getValue($object)); + } + + public function testGetValueIgnoresSingular() + { + $this->markTestSkipped('This feature is temporarily disabled as of 2.1'); + + $object = (object) array('children' => 'Many'); + + $path = new PropertyPath('children|child'); + + $this->assertEquals('Many', $path->getValue($object)); + } + + public function testGetValueReadsPropertyWithSpecialCharsExceptDot() + { + $array = (object) array('%!@$§' => 'Bernhard'); + + $path = new PropertyPath('%!@$§'); + + $this->assertEquals('Bernhard', $path->getValue($array)); + } + + public function testGetValueReadsPropertyWithCustomPropertyPath() + { + $object = new Author(); + $object->child = array(); + $object->child['index'] = new Author(); + $object->child['index']->firstName = 'Bernhard'; + + $path = new PropertyPath('child[index].firstName'); + + $this->assertEquals('Bernhard', $path->getValue($object)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\PropertyAccessDeniedException + */ + public function testGetValueThrowsExceptionIfPropertyIsNotPublic() + { + $path = new PropertyPath('privateProperty'); + + $path->getValue(new Author()); + } + + public function testGetValueReadsGetters() + { + $path = new PropertyPath('lastName'); + + $object = new Author(); + $object->setLastName('Schussek'); + + $this->assertEquals('Schussek', $path->getValue($object)); + } + + public function testGetValueCamelizesGetterNames() + { + $path = new PropertyPath('last_name'); + + $object = new Author(); + $object->setLastName('Schussek'); + + $this->assertEquals('Schussek', $path->getValue($object)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\PropertyAccessDeniedException + */ + public function testGetValueThrowsExceptionIfGetterIsNotPublic() + { + $path = new PropertyPath('privateGetter'); + + $path->getValue(new Author()); + } + + public function testGetValueReadsIssers() + { + $path = new PropertyPath('australian'); + + $object = new Author(); + $object->setAustralian(false); + + $this->assertFalse($path->getValue($object)); + } + + public function testGetValueReadHassers() + { + $path = new PropertyPath('read_permissions'); + + $object = new Author(); + $object->setReadPermissions(true); + + $this->assertTrue($path->getValue($object)); + } + + public function testGetValueReadsMagicGet() + { + $path = new PropertyPath('magicProperty'); + + $object = new Magician(); + $object->__set('magicProperty', 'foobar'); + + $this->assertSame('foobar', $path->getValue($object)); + } + + /* + * https://github.com/symfony/symfony/pull/4450 + */ + public function testGetValueReadsMagicGetThatReturnsConstant() + { + $path = new PropertyPath('magicProperty'); + + $object = new Magician(); + + $this->assertNull($path->getValue($object)); + } + + /** + * @expectedException Symfony\Component\Form\Exception\PropertyAccessDeniedException + */ + public function testGetValueThrowsExceptionIfIsserIsNotPublic() + { + $path = new PropertyPath('privateIsser'); + + $path->getValue(new Author()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testGetValueThrowsExceptionIfPropertyDoesNotExist() + { + $path = new PropertyPath('foobar'); + + $path->getValue(new Author()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testGetValueThrowsExceptionIfNotObjectOrArray() + { + $path = new PropertyPath('foobar'); + + $path->getValue('baz'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testGetValueThrowsExceptionIfNull() + { + $path = new PropertyPath('foobar'); + + $path->getValue(null); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testGetValueThrowsExceptionIfEmpty() + { + $path = new PropertyPath('foobar'); + + $path->getValue(''); + } + + public function testSetValueUpdatesArrays() + { + $array = array(); + + $path = new PropertyPath('[firstName]'); + $path->setValue($array, 'Bernhard'); + + $this->assertEquals(array('firstName' => 'Bernhard'), $array); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyException + */ + public function testSetValueThrowsExceptionIfIndexNotationExpected() + { + $array = array(); + + $path = new PropertyPath('firstName'); + $path->setValue($array, 'Bernhard'); + } + + public function testSetValueUpdatesArraysWithCustomPropertyPath() + { + $array = array(); + + $path = new PropertyPath('[child][index][firstName]'); + $path->setValue($array, 'Bernhard'); + + $this->assertEquals(array('child' => array('index' => array('firstName' => 'Bernhard'))), $array); + } + + public function testSetValueUpdatesProperties() + { + $object = new Author(); + + $path = new PropertyPath('firstName'); + $path->setValue($object, 'Bernhard'); + + $this->assertEquals('Bernhard', $object->firstName); + } + + public function testSetValueUpdatesPropertiesWithCustomPropertyPath() + { + $object = new Author(); + $object->child = array(); + $object->child['index'] = new Author(); + + $path = new PropertyPath('child[index].firstName'); + $path->setValue($object, 'Bernhard'); + + $this->assertEquals('Bernhard', $object->child['index']->firstName); + } + + public function testSetValueUpdateMagicSet() + { + $object = new Magician(); + + $path = new PropertyPath('magicProperty'); + $path->setValue($object, 'foobar'); + + $this->assertEquals('foobar', $object->__get('magicProperty')); + } + + public function testSetValueUpdatesSetters() + { + $object = new Author(); + + $path = new PropertyPath('lastName'); + $path->setValue($object, 'Schussek'); + + $this->assertEquals('Schussek', $object->getLastName()); + } + + public function testSetValueCamelizesSetterNames() + { + $object = new Author(); + + $path = new PropertyPath('last_name'); + $path->setValue($object, 'Schussek'); + + $this->assertEquals('Schussek', $object->getLastName()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\PropertyAccessDeniedException + */ + public function testSetValueThrowsExceptionIfGetterIsNotPublic() + { + $path = new PropertyPath('privateSetter'); + + $path->setValue(new Author(), 'foobar'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testSetValueThrowsExceptionIfNotObjectOrArray() + { + $path = new PropertyPath('foobar'); + $value = 'baz'; + + $path->setValue($value, 'bam'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testSetValueThrowsExceptionIfNull() + { + $path = new PropertyPath('foobar'); + $value = null; + + $path->setValue($value, 'bam'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testSetValueThrowsExceptionIfEmpty() + { + $path = new PropertyPath('foobar'); + $value = ''; + + $path->setValue($value, 'bam'); + } + + public function testToString() + { + $path = new PropertyPath('reference.traversable[index].property'); + + $this->assertEquals('reference.traversable[index].property', $path->__toString()); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyPathException + */ + public function testInvalidPropertyPath_noDotBeforeProperty() + { + new PropertyPath('[index]property'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyPathException + */ + public function testInvalidPropertyPath_dotAtTheBeginning() + { + new PropertyPath('.property'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyPathException + */ + public function testInvalidPropertyPath_unexpectedCharacters() + { + new PropertyPath('property.$form'); + } + + /** + * @expectedException Symfony\Component\Form\Exception\InvalidPropertyPathException + */ + public function testInvalidPropertyPath_empty() + { + new PropertyPath(''); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testInvalidPropertyPath_null() + { + new PropertyPath(null); + } + + /** + * @expectedException Symfony\Component\Form\Exception\UnexpectedTypeException + */ + public function testInvalidPropertyPath_false() + { + new PropertyPath(false); + } + + public function testValidPropertyPath_zero() + { + new PropertyPath('0'); + } + + public function testGetParent_dot() + { + $propertyPath = new PropertyPath('grandpa.parent.child'); + + $this->assertEquals(new PropertyPath('grandpa.parent'), $propertyPath->getParent()); + } + + public function testGetParent_index() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $this->assertEquals(new PropertyPath('grandpa.parent'), $propertyPath->getParent()); + } + + public function testGetParent_noParent() + { + $propertyPath = new PropertyPath('path'); + + $this->assertNull($propertyPath->getParent()); + } + + public function testCopyConstructor() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + $copy = new PropertyPath($propertyPath); + + $this->assertEquals($propertyPath, $copy); + } + + public function testGetElement() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $this->assertEquals('child', $propertyPath->getElement(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testGetElementDoesNotAcceptInvalidIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->getElement(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testGetElementDoesNotAcceptNegativeIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->getElement(-1); + } + + public function testIsProperty() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $this->assertTrue($propertyPath->isProperty(1)); + $this->assertFalse($propertyPath->isProperty(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsPropertyDoesNotAcceptInvalidIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->isProperty(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsPropertyDoesNotAcceptNegativeIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->isProperty(-1); + } + + public function testIsIndex() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $this->assertFalse($propertyPath->isIndex(1)); + $this->assertTrue($propertyPath->isIndex(2)); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsIndexDoesNotAcceptInvalidIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->isIndex(3); + } + + /** + * @expectedException \OutOfBoundsException + */ + public function testIsIndexDoesNotAcceptNegativeIndices() + { + $propertyPath = new PropertyPath('grandpa.parent[child]'); + + $propertyPath->isIndex(-1); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Tests/bootstrap.php b/vendor/symfony/form/Symfony/Component/Form/Tests/bootstrap.php new file mode 100755 index 0000000000..902cefce5c --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Tests/bootstrap.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Form')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Form')).'.php')) { + require_once $file; + } + } +}); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/FormUtil.php b/vendor/symfony/form/Symfony/Component/Form/Util/FormUtil.php new file mode 100755 index 0000000000..4e6230eb91 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/FormUtil.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * @author Bernhard Schussek + */ +abstract class FormUtil +{ + const PLURAL_SUFFIX = 0; + + const PLURAL_SUFFIX_LENGTH = 1; + + const PLURAL_SUFFIX_AFTER_VOCAL = 2; + + const PLURAL_SUFFIX_AFTER_CONS = 3; + + const SINGULAR_SUFFIX = 4; + + /** + * Map english plural to singular suffixes + * + * @var array + * + * @see http://english-zone.com/spelling/plurals.html + * @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English + */ + private static $pluralMap = array( + // First entry: plural suffix, reversed + // Second entry: length of plural suffix + // Third entry: Whether the suffix may succeed a vocal + // Fourth entry: Whether the suffix may succeed a consonant + // Fifth entry: singular suffix, normal + + // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + array('a', 1, true, true, array('on', 'um')), + + // nebulae (nebula) + array('ea', 2, true, true, 'a'), + + // mice (mouse), lice (louse) + array('eci', 3, false, true, 'ouse'), + + // geese (goose) + array('esee', 4, false, true, 'oose'), + + // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) + array('i', 1, true, true, 'us'), + + // men (man), women (woman) + array('nem', 3, true, true, 'man'), + + // children (child) + array('nerdlihc', 8, true, true, 'child'), + + // oxen (ox) + array('nexo', 4, false, false, 'ox'), + + // indices (index), appendices (appendix), prices (price) + array('seci', 4, false, true, array('ex', 'ix', 'ice')), + + // babies (baby) + array('sei', 3, false, true, 'y'), + + // analyses (analysis), ellipses (ellipsis), funguses (fungus), + // neuroses (neurosis), theses (thesis), emphases (emphasis), + // oases (oasis), crises (crisis), houses (house), bases (base), + // atlases (atlas), kisses (kiss) + array('ses', 3, true, true, array('s', 'se', 'sis')), + + // lives (life), wives (wife) + array('sevi', 4, false, true, 'ife'), + + // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) + array('sev', 3, true, true, 'f'), + + // axes (axis), axes (ax), axes (axe) + array('sexa', 4, false, false, array('ax', 'axe', 'axis')), + + // indexes (index), matrixes (matrix) + array('sex', 3, true, false, 'x'), + + // quizzes (quiz) + array('sezz', 4, true, false, 'z'), + + // bureaus (bureau) + array('suae', 4, false, true, 'eau'), + + // roses (rose), garages (garage), cassettes (cassette), + // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), + // shoes (shoe) + array('se', 2, true, true, array('', 'e')), + + // tags (tag) + array('s', 1, true, true, ''), + + // chateaux (chateau) + array('xuae', 4, false, true, 'eau'), + ); + + /** + * Returns the singular form of a word + * + * If the method can't determine the form with certainty, an array of the + * possible singulars is returned. + * + * @param string $plural A word in plural form + * @return string|array The singular form or an array of possible singular + * forms + */ + public static function singularify($plural) + { + $pluralRev = strrev($plural); + $lowerPluralRev = strtolower($pluralRev); + $pluralLength = strlen($lowerPluralRev); + + // The outer loop $i iterates over the entries of the plural table + // The inner loop $j iterates over the characters of the plural suffix + // in the plural table to compare them with the characters of the actual + // given plural suffix + for ($i = 0, $numPlurals = count(self::$pluralMap); $i < $numPlurals; ++$i) { + $suffix = self::$pluralMap[$i][self::PLURAL_SUFFIX]; + $suffixLength = self::$pluralMap[$i][self::PLURAL_SUFFIX_LENGTH]; + $j = 0; + + // Compare characters in the plural table and of the suffix of the + // given plural one by one + while ($suffix[$j] === $lowerPluralRev[$j]) { + // Let $j point to the next character + ++$j; + + // Successfully compared the last character + // Add an entry with the singular suffix to the singular array + if ($j === $suffixLength) { + // Is there any character preceding the suffix in the plural string? + if ($j < $pluralLength) { + $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]); + + if (!self::$pluralMap[$i][self::PLURAL_SUFFIX_AFTER_VOCAL] && $nextIsVocal) { + break; + } + + if (!self::$pluralMap[$i][self::PLURAL_SUFFIX_AFTER_CONS] && !$nextIsVocal) { + break; + } + } + + $newBase = substr($plural, 0, $pluralLength - $suffixLength); + $newSuffix = self::$pluralMap[$i][self::SINGULAR_SUFFIX]; + + // Check whether the first character in the plural suffix + // is uppercased. If yes, uppercase the first character in + // the singular suffix too + $firstUpper = ctype_upper($pluralRev[$j - 1]); + + if (is_array($newSuffix)) { + $singulars = array(); + + foreach ($newSuffix as $newSuffixEntry) { + $singulars[] = $newBase . ($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); + } + + return $singulars; + } + + return $newBase . ($firstUpper ? ucFirst($newSuffix) : $newSuffix); + } + + // Suffix is longer than word + if ($j === $pluralLength) { + break; + } + } + } + + // Convert teeth to tooth, feet to foot + if (false !== ($pos = strpos($plural, 'ee'))) { + return substr_replace($plural, 'oo', $pos, 2); + } + + // Assume that plural and singular is identical + return $plural; + } + + /** + * Returns whether the given data is empty. + * + * This logic is reused multiple times throughout the processing of + * a form and needs to be consistent. PHP's keyword `empty` cannot + * be used as it also considers 0 and "0" to be empty. + * + * @param mixed $data + * + * @return Boolean + */ + public static function isEmpty($data) + { + // Should not do a check for array() === $data!!! + // This method is used in occurrences where arrays are + // not considered to be empty, ever. + return null === $data || '' === $data; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPath.php b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPath.php new file mode 100755 index 0000000000..a5cf13befe --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPath.php @@ -0,0 +1,629 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +use Traversable; +use ReflectionClass; +use Symfony\Component\Form\Exception\InvalidPropertyPathException; +use Symfony\Component\Form\Exception\InvalidPropertyException; +use Symfony\Component\Form\Exception\PropertyAccessDeniedException; +use Symfony\Component\Form\Exception\UnexpectedTypeException; + +/** + * Allows easy traversing of a property path + * + * @author Bernhard Schussek + */ +class PropertyPath implements \IteratorAggregate, PropertyPathInterface +{ + /** + * Character used for separating between plural and singular of an element. + * @var string + */ + const SINGULAR_SEPARATOR = '|'; + + const VALUE = 0; + const IS_REF = 1; + + /** + * The elements of the property path + * @var array + */ + private $elements = array(); + + /** + * The singular forms of the elements in the property path. + * @var array + */ + private $singulars = array(); + + /** + * The number of elements in the property path + * @var integer + */ + private $length; + + /** + * Contains a Boolean for each property in $elements denoting whether this + * element is an index. It is a property otherwise. + * @var array + */ + private $isIndex = array(); + + /** + * String representation of the path + * @var string + */ + private $pathAsString; + + /** + * Constructs a property path from a string. + * + * @param PropertyPath|string $propertyPath The property path as string or instance. + * + * @throws UnexpectedTypeException If the given path is not a string. + * @throws InvalidPropertyPathException If the syntax of the property path is not valid. + */ + public function __construct($propertyPath) + { + // Can be used as copy constructor + if ($propertyPath instanceof PropertyPath) { + /* @var PropertyPath $propertyPath */ + $this->elements = $propertyPath->elements; + $this->singulars = $propertyPath->singulars; + $this->length = $propertyPath->length; + $this->isIndex = $propertyPath->isIndex; + $this->pathAsString = $propertyPath->pathAsString; + + return; + } + if (!is_string($propertyPath)) { + throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\Form\Util\PropertyPath'); + } + + if ('' === $propertyPath) { + throw new InvalidPropertyPathException('The property path should not be empty.'); + } + + $this->pathAsString = $propertyPath; + $position = 0; + $remaining = $propertyPath; + + // first element is evaluated differently - no leading dot for properties + $pattern = '/^(([^\.\[]+)|\[([^\]]+)\])(.*)/'; + + while (preg_match($pattern, $remaining, $matches)) { + if ('' !== $matches[2]) { + $element = $matches[2]; + $this->isIndex[] = false; + } else { + $element = $matches[3]; + $this->isIndex[] = true; + } + // Disabled this behaviour as the syntax is not yet final + //$pos = strpos($element, self::SINGULAR_SEPARATOR); + $pos = false; + $singular = null; + + if (false !== $pos) { + $singular = substr($element, $pos + 1); + $element = substr($element, 0, $pos); + } + + $this->elements[] = $element; + $this->singulars[] = $singular; + + $position += strlen($matches[1]); + $remaining = $matches[4]; + $pattern = '/^(\.(\w+)|\[([^\]]+)\])(.*)/'; + } + + if ('' !== $remaining) { + throw new InvalidPropertyPathException(sprintf( + 'Could not parse property path "%s". Unexpected token "%s" at position %d', + $propertyPath, + $remaining{0}, + $position + )); + } + + $this->length = count($this->elements); + } + + /** + * {@inheritdoc} + */ + public function __toString() + { + return $this->pathAsString; + } + + /** + * {@inheritdoc} + */ + public function getLength() + { + return $this->length; + } + + /** + * {@inheritdoc} + */ + public function getParent() + { + if ($this->length <= 1) { + return null; + } + + $parent = clone $this; + + --$parent->length; + $parent->pathAsString = substr($parent->pathAsString, 0, max(strrpos($parent->pathAsString, '.'), strrpos($parent->pathAsString, '['))); + array_pop($parent->elements); + array_pop($parent->singulars); + array_pop($parent->isIndex); + + return $parent; + } + + /** + * Returns a new iterator for this path + * + * @return PropertyPathIteratorInterface + */ + public function getIterator() + { + return new PropertyPathIterator($this); + } + + /** + * {@inheritdoc} + */ + public function getElements() + { + return $this->elements; + } + + /** + * {@inheritdoc} + */ + public function getElement($index) + { + if (!isset($this->elements[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the property path'); + } + + return $this->elements[$index]; + } + + /** + * {@inheritdoc} + */ + public function isProperty($index) + { + if (!isset($this->isIndex[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the property path'); + } + + return !$this->isIndex[$index]; + } + + /** + * {@inheritdoc} + */ + public function isIndex($index) + { + if (!isset($this->isIndex[$index])) { + throw new \OutOfBoundsException('The index ' . $index . ' is not within the property path'); + } + + return $this->isIndex[$index]; + } + + /** + * Returns the value at the end of the property path of the object + * + * Example: + * + * $path = new PropertyPath('child.name'); + * + * echo $path->getValue($object); + * // equals echo $object->getChild()->getName(); + * + * + * This method first tries to find a public getter for each property in the + * path. The name of the getter must be the camel-cased property name + * prefixed with "get", "is", or "has". + * + * If the getter does not exist, this method tries to find a public + * property. The value of the property is then returned. + * + * If none of them are found, an exception is thrown. + * + * @param object|array $objectOrArray The object or array to traverse + * + * @return mixed The value at the end of the property path + * + * @throws InvalidPropertyException If the property/getter does not exist + * @throws PropertyAccessDeniedException If the property/getter exists but is not public + */ + public function getValue($objectOrArray) + { + $propertyValues =& $this->readPropertiesUntil($objectOrArray, $this->length - 1); + + return $propertyValues[count($propertyValues) - 1][self::VALUE]; + } + + /** + * Sets the value at the end of the property path of the object + * + * Example: + * + * $path = new PropertyPath('child.name'); + * + * echo $path->setValue($object, 'Fabien'); + * // equals echo $object->getChild()->setName('Fabien'); + * + * + * This method first tries to find a public setter for each property in the + * path. The name of the setter must be the camel-cased property name + * prefixed with "set". + * + * If the setter does not exist, this method tries to find a public + * property. The value of the property is then changed. + * + * If neither is found, an exception is thrown. + * + * @param object|array $objectOrArray The object or array to modify. + * @param mixed $value The value to set at the end of the property path. + * + * @throws InvalidPropertyException If a property does not exist. + * @throws PropertyAccessDeniedException If a property cannot be accessed due to + * access restrictions (private or protected). + * @throws UnexpectedTypeException If a value within the path is neither object + * nor array. + */ + public function setValue(&$objectOrArray, $value) + { + $propertyValues =& $this->readPropertiesUntil($objectOrArray, $this->length - 2); + $overwrite = true; + + // Add the root object to the list + array_unshift($propertyValues, array( + self::VALUE => &$objectOrArray, + self::IS_REF => true, + )); + + for ($i = count($propertyValues) - 1; $i >= 0; --$i) { + $objectOrArray =& $propertyValues[$i][self::VALUE]; + + if ($overwrite) { + if (!is_object($objectOrArray) && !is_array($objectOrArray)) { + throw new UnexpectedTypeException($objectOrArray, 'object or array'); + } + + $property = $this->elements[$i]; + $singular = $this->singulars[$i]; + $isIndex = $this->isIndex[$i]; + + $this->writeProperty($objectOrArray, $property, $singular, $isIndex, $value); + } + + $value =& $objectOrArray; + $overwrite = !$propertyValues[$i][self::IS_REF]; + } + } + + /** + * Reads the path from an object up to a given path index. + * + * @param object|array $objectOrArray The object or array to read from. + * @param integer $lastIndex The integer up to which should be read. + * + * @return array The values read in the path. + * + * @throws UnexpectedTypeException If a value within the path is neither object nor array. + */ + private function &readPropertiesUntil(&$objectOrArray, $lastIndex) + { + $propertyValues = array(); + + for ($i = 0; $i <= $lastIndex; ++$i) { + if (!is_object($objectOrArray) && !is_array($objectOrArray)) { + throw new UnexpectedTypeException($objectOrArray, 'object or array'); + } + + $property = $this->elements[$i]; + $isIndex = $this->isIndex[$i]; + $isArrayAccess = is_array($objectOrArray) || $objectOrArray instanceof \ArrayAccess; + + // Create missing nested arrays on demand + if ($isIndex && $isArrayAccess && !isset($objectOrArray[$property])) { + $objectOrArray[$property] = $i + 1 < $this->length ? array() : null; + } + + $propertyValue =& $this->readProperty($objectOrArray, $property, $isIndex); + $objectOrArray =& $propertyValue[self::VALUE]; + + $propertyValues[] =& $propertyValue; + } + + return $propertyValues; + } + + /** + * Reads the a property from an object or array. + * + * @param object|array $objectOrArray The object or array to read from. + * @param string $property The property to read. + * @param Boolean $isIndex Whether to interpret the property as index. + * + * @return mixed The value of the read property + * + * @throws InvalidPropertyException If the property does not exist. + * @throws PropertyAccessDeniedException If the property cannot be accessed due to + * access restrictions (private or protected). + */ + private function &readProperty(&$objectOrArray, $property, $isIndex) + { + // Use an array instead of an object since performance is + // very crucial here + $result = array( + self::VALUE => null, + self::IS_REF => false + ); + + if ($isIndex) { + if (!$objectOrArray instanceof \ArrayAccess && !is_array($objectOrArray)) { + throw new InvalidPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($objectOrArray))); + } + + if (isset($objectOrArray[$property])) { + if (is_array($objectOrArray)) { + $result[self::VALUE] =& $objectOrArray[$property]; + $result[self::IS_REF] = true; + } else { + $result[self::VALUE] = $objectOrArray[$property]; + } + } + } elseif (is_object($objectOrArray)) { + $camelProp = $this->camelize($property); + $reflClass = new ReflectionClass($objectOrArray); + $getter = 'get'.$camelProp; + $isser = 'is'.$camelProp; + $hasser = 'has'.$camelProp; + + if ($reflClass->hasMethod($getter)) { + if (!$reflClass->getMethod($getter)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $getter, $reflClass->name)); + } + + $result[self::VALUE] = $objectOrArray->$getter(); + } elseif ($reflClass->hasMethod($isser)) { + if (!$reflClass->getMethod($isser)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $isser, $reflClass->name)); + } + + $result[self::VALUE] = $objectOrArray->$isser(); + } elseif ($reflClass->hasMethod($hasser)) { + if (!$reflClass->getMethod($hasser)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $hasser, $reflClass->name)); + } + + $result[self::VALUE] = $objectOrArray->$hasser(); + } elseif ($reflClass->hasMethod('__get')) { + // needed to support magic method __get + $result[self::VALUE] = $objectOrArray->$property; + } elseif ($reflClass->hasProperty($property)) { + if (!$reflClass->getProperty($property)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s". Maybe you should create the method "%s()" or "%s()" or "%s()"?', $property, $reflClass->name, $getter, $isser, $hasser)); + } + + $result[self::VALUE] =& $objectOrArray->$property; + $result[self::IS_REF] = true; + } elseif (property_exists($objectOrArray, $property)) { + // needed to support \stdClass instances + $result[self::VALUE] =& $objectOrArray->$property; + $result[self::IS_REF] = true; + } else { + throw new InvalidPropertyException(sprintf('Neither property "%s" nor method "%s()" nor method "%s()" exists in class "%s"', $property, $getter, $isser, $reflClass->name)); + } + } else { + throw new InvalidPropertyException(sprintf('Cannot read property "%s" from an array. Maybe you should write the property path as "[%s]" instead?', $property, $property)); + } + + // Objects are always passed around by reference + if (is_object($result[self::VALUE])) { + $result[self::IS_REF] = true; + } + + return $result; + } + + /** + * Sets the value of the property at the given index in the path + * + * @param object|array $objectOrArray The object or array to write to. + * @param string $property The property to write. + * @param string|null $singular The singular form of the property name or null. + * @param Boolean $isIndex Whether to interpret the property as index. + * @param mixed $value The value to write. + * + * @throws InvalidPropertyException If the property does not exist. + * @throws PropertyAccessDeniedException If the property cannot be accessed due to + * access restrictions (private or protected). + */ + private function writeProperty(&$objectOrArray, $property, $singular, $isIndex, $value) + { + $adderRemoverError = null; + + if ($isIndex) { + if (!$objectOrArray instanceof \ArrayAccess && !is_array($objectOrArray)) { + throw new InvalidPropertyException(sprintf('Index "%s" cannot be modified in object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($objectOrArray))); + } + + $objectOrArray[$property] = $value; + } elseif (is_object($objectOrArray)) { + $reflClass = new ReflectionClass($objectOrArray); + + // The plural form is the last element of the property path + $plural = $this->camelize($this->elements[$this->length - 1]); + + // Any of the two methods is required, but not yet known + $singulars = null !== $singular ? array($singular) : (array) FormUtil::singularify($plural); + + if (is_array($value) || $value instanceof Traversable) { + $methods = $this->findAdderAndRemover($reflClass, $singulars); + if (null !== $methods) { + // At this point the add and remove methods have been found + // Use iterator_to_array() instead of clone in order to prevent side effects + // see https://github.com/symfony/symfony/issues/4670 + $itemsToAdd = is_object($value) ? iterator_to_array($value) : $value; + $itemToRemove = array(); + $propertyValue = $this->readProperty($objectOrArray, $property, $isIndex); + $previousValue = $propertyValue[self::VALUE]; + + if (is_array($previousValue) || $previousValue instanceof Traversable) { + foreach ($previousValue as $previousItem) { + foreach ($value as $key => $item) { + if ($item === $previousItem) { + // Item found, don't add + unset($itemsToAdd[$key]); + + // Next $previousItem + continue 2; + } + } + + // Item not found, add to remove list + $itemToRemove[] = $previousItem; + } + } + + foreach ($itemToRemove as $item) { + call_user_func(array($objectOrArray, $methods[1]), $item); + } + + foreach ($itemsToAdd as $item) { + call_user_func(array($objectOrArray, $methods[0]), $item); + } + + return; + } else { + $adderRemoverError = ', nor could adders and removers be found based on the '; + if (null === $singular) { + // $adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars).' (provide a singular by suffixing the property path with "|{singular}" to override the guesser)'; + $adderRemoverError .= 'guessed singulars: '.implode(', ', $singulars); + } else { + $adderRemoverError .= 'passed singular: '.$singular; + } + } + } + + $setter = 'set'.$this->camelize($property); + if ($reflClass->hasMethod($setter)) { + if (!$reflClass->getMethod($setter)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Method "%s()" is not public in class "%s"', $setter, $reflClass->name)); + } + + $objectOrArray->$setter($value); + } elseif ($reflClass->hasMethod('__set')) { + // needed to support magic method __set + $objectOrArray->$property = $value; + } elseif ($reflClass->hasProperty($property)) { + if (!$reflClass->getProperty($property)->isPublic()) { + throw new PropertyAccessDeniedException(sprintf('Property "%s" is not public in class "%s"%s. Maybe you should create the method "%s()"?', $property, $reflClass->name, $adderRemoverError, $setter)); + } + + $objectOrArray->$property = $value; + } elseif (property_exists($objectOrArray, $property)) { + // needed to support \stdClass instances + $objectOrArray->$property = $value; + } else { + throw new InvalidPropertyException(sprintf('Neither element "%s" nor method "%s()" exists in class "%s"%s', $property, $setter, $reflClass->name, $adderRemoverError)); + } + } else { + throw new InvalidPropertyException(sprintf('Cannot write property "%s" in an array. Maybe you should write the property path as "[%s]" instead?', $property, $property)); + } + } + + /** + * Camelizes a given string. + * + * @param string $string Some string. + * + * @return string The camelized version of the string. + */ + private function camelize($string) + { + return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $string); + } + + /** + * Searches for add and remove methods. + * + * @param \ReflectionClass $reflClass The reflection class for the given object + * @param array $singulars The singular form of the property name or null. + * + * @return array|null An array containing the adder and remover when found, null otherwise. + * + * @throws InvalidPropertyException If the property does not exist. + */ + private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars) + { + foreach ($singulars as $singular) { + $addMethod = 'add' . $singular; + $removeMethod = 'remove' . $singular; + + $addMethodFound = $this->isAccessible($reflClass, $addMethod, 1); + $removeMethodFound = $this->isAccessible($reflClass, $removeMethod, 1); + + if ($addMethodFound && $removeMethodFound) { + return array($addMethod, $removeMethod); + } + + if ($addMethodFound xor $removeMethodFound) { + throw new InvalidPropertyException(sprintf( + 'Found the public method "%s", but did not find a public "%s" on class %s', + $addMethodFound ? $addMethod : $removeMethod, + $addMethodFound ? $removeMethod : $addMethod, + $reflClass->name + )); + } + } + + return null; + } + + /** + * Returns whether a method is public and has a specific number of required parameters. + * + * @param \ReflectionClass $class The class of the method. + * @param string $methodName The method name. + * @param integer $parameters The number of parameters. + * + * @return Boolean Whether the method is public and has $parameters + * required parameters. + */ + private function isAccessible(ReflectionClass $class, $methodName, $parameters) + { + if ($class->hasMethod($methodName)) { + $method = $class->getMethod($methodName); + + if ($method->isPublic() && $method->getNumberOfRequiredParameters() === $parameters) { + return true; + } + } + + return false; + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathBuilder.php b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathBuilder.php new file mode 100755 index 0000000000..f17c8b2258 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathBuilder.php @@ -0,0 +1,294 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * @author Bernhard Schussek + */ +class PropertyPathBuilder +{ + /** + * @var array + */ + private $elements = array(); + + /** + * @var array + */ + private $isIndex = array(); + + /** + * Creates a new property path builder. + * + * @param null|PropertyPathInterface $path The path to initially store + * in the builder. Optional. + */ + public function __construct(PropertyPathInterface $path = null) + { + if (null !== $path) { + $this->append($path); + } + } + + /** + * Appends a (sub-) path to the current path. + * + * @param PropertyPathInterface $path The path to append. + * @param integer $offset The offset where the appended piece + * starts in $path. + * @param integer $length The length of the appended piece. + * If 0, the full path is appended. + */ + public function append(PropertyPathInterface $path, $offset = 0, $length = 0) + { + if (0 === $length) { + $end = $path->getLength(); + } else { + $end = $offset + $length; + } + + for (; $offset < $end; ++$offset) { + $this->elements[] = $path->getElement($offset); + $this->isIndex[] = $path->isIndex($offset); + } + } + + /** + * Appends an index element to the current path. + * + * @param string $name The name of the appended index. + */ + public function appendIndex($name) + { + $this->elements[] = $name; + $this->isIndex[] = true; + } + + /** + * Appends a property element to the current path. + * + * @param string $name The name of the appended property. + */ + public function appendProperty($name) + { + $this->elements[] = $name; + $this->isIndex[] = false; + } + + /** + * Removes elements from the current path. + * + * @param integer $offset The offset at which to remove. + * @param integer $length The length of the removed piece. + * + * @throws \OutOfBoundsException if offset is invalid + */ + public function remove($offset, $length = 1) + { + if (!isset($this->elements[$offset])) { + throw new \OutOfBoundsException('The offset ' . $offset . ' is not within the property path'); + } + + $this->resize($offset, $length, 0); + } + + /** + * Replaces a sub-path by a different (sub-) path. + * + * @param integer $offset The offset at which to replace. + * @param integer $length The length of the piece to replace. + * @param PropertyPathInterface $path The path to insert. + * @param integer $pathOffset The offset where the inserted piece + * starts in $path. + * @param integer $pathLength The length of the inserted piece. + * If 0, the full path is inserted. + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function replace($offset, $length, PropertyPathInterface $path, $pathOffset = 0, $pathLength = 0) + { + if (!isset($this->elements[$offset])) { + throw new \OutOfBoundsException('The offset ' . $offset . ' is not within the property path'); + } + + if (0 === $pathLength) { + $pathLength = $path->getLength() - $pathOffset; + } + + $this->resize($offset, $length, $pathLength); + + for ($i = 0; $i < $pathLength; ++$i) { + $this->elements[$offset + $i] = $path->getElement($pathOffset + $i); + $this->isIndex[$offset + $i] = $path->isIndex($pathOffset + $i); + } + } + + /** + * Replaces a property element by an index element. + * + * @param integer $offset The offset at which to replace. + * @param string $name The new name of the element. Optional. + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function replaceByIndex($offset, $name = null) + { + if (!isset($this->elements[$offset])) { + throw new \OutOfBoundsException('The offset ' . $offset . ' is not within the property path'); + } + + if (null !== $name) { + $this->elements[$offset] = $name; + } + + $this->isIndex[$offset] = true; + } + + /** + * Replaces an index element by a property element. + * + * @param integer $offset The offset at which to replace. + * @param string $name The new name of the element. Optional. + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function replaceByProperty($offset, $name = null) + { + if (!isset($this->elements[$offset])) { + throw new \OutOfBoundsException('The offset ' . $offset . ' is not within the property path'); + } + + if (null !== $name) { + $this->elements[$offset] = $name; + } + + $this->isIndex[$offset] = false; + } + + /** + * Returns the length of the current path. + * + * @return integer The path length. + */ + public function getLength() + { + return count($this->elements); + } + + /** + * Returns the current property path. + * + * @return PropertyPathInterface The constructed property path. + */ + public function getPropertyPath() + { + $pathAsString = $this->__toString(); + + return '' !== $pathAsString ? new PropertyPath($pathAsString) : null; + } + + /** + * Returns the current property path as string. + * + * @return string The property path as string. + */ + public function __toString() + { + $string = ''; + + foreach ($this->elements as $offset => $element) { + if ($this->isIndex[$offset]) { + $element = '[' . $element . ']'; + } elseif ('' !== $string) { + $string .= '.'; + } + + $string .= $element; + } + + return $string; + } + + /** + * Resizes the path so that a chunk of length $cutLength is + * removed at $offset and another chunk of length $insertionLength + * can be inserted. + * + * @param integer $offset The offset where the removed chunk starts. + * @param integer $cutLength The length of the removed chunk. + * @param integer $insertionLength The length of the inserted chunk. + */ + private function resize($offset, $cutLength, $insertionLength) + { + // Nothing else to do in this case + if ($insertionLength === $cutLength) { + return; + } + + $length = count($this->elements); + + if ($cutLength > $insertionLength) { + // More elements should be removed than inserted + $diff = $cutLength - $insertionLength; + $newLength = $length - $diff; + + // Shift elements to the left (left-to-right until the new end) + // Max allowed offset to be shifted is such that + // $offset + $diff < $length (otherwise invalid index access) + // i.e. $offset < $length - $diff = $newLength + for ($i = $offset; $i < $newLength; ++$i) { + $this->elements[$i] = $this->elements[$i + $diff]; + $this->isIndex[$i] = $this->isIndex[$i + $diff]; + } + + // All remaining elements should be removed + for (; $i < $length; ++$i) { + unset($this->elements[$i]); + unset($this->isIndex[$i]); + } + } else { + $diff = $insertionLength - $cutLength; + + $newLength = $length + $diff; + $indexAfterInsertion = $offset + $insertionLength; + + // $diff <= $insertionLength + // $indexAfterInsertion >= $insertionLength + // => $diff <= $indexAfterInsertion + + // In each of the following loops, $i >= $diff must hold, + // otherwise ($i - $diff) becomes negative. + + // Shift old elements to the right to make up space for the + // inserted elements. This needs to be done left-to-right in + // order to preserve an ascending array index order + // Since $i = max($length, $indexAfterInsertion) and $indexAfterInsertion >= $diff, + // $i >= $diff is guaranteed. + for ($i = max($length, $indexAfterInsertion); $i < $newLength; ++$i) { + $this->elements[$i] = $this->elements[$i - $diff]; + $this->isIndex[$i] = $this->isIndex[$i - $diff]; + } + + // Shift remaining elements to the right. Do this right-to-left + // so we don't overwrite elements before copying them + // The last written index is the immediate index after the inserted + // string, because the indices before that will be overwritten + // anyway. + // Since $i >= $indexAfterInsertion and $indexAfterInsertion >= $diff, + // $i >= $diff is guaranteed. + for ($i = $length - 1; $i >= $indexAfterInsertion; --$i) { + $this->elements[$i] = $this->elements[$i - $diff]; + $this->isIndex[$i] = $this->isIndex[$i - $diff]; + } + } + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathInterface.php b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathInterface.php new file mode 100755 index 0000000000..bceca29d90 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathInterface.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * @author Bernhard Schussek + */ +interface PropertyPathInterface extends \Traversable +{ + /** + * Returns the string representation of the property path + * + * @return string The path as string. + */ + public function __toString(); + + /** + * Returns the length of the property path, i.e. the number of elements. + * + * @return integer The path length. + */ + public function getLength(); + + /** + * Returns the parent property path. + * + * The parent property path is the one that contains the same items as + * this one except for the last one. + * + * If this property path only contains one item, null is returned. + * + * @return PropertyPath The parent path or null. + */ + public function getParent(); + + /** + * Returns the elements of the property path as array + * + * @return array An array of property/index names + */ + public function getElements(); + + /** + * Returns the element at the given index in the property path + * + * @param integer $index The index key + * + * @return string A property or index name + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function getElement($index); + + /** + * Returns whether the element at the given index is a property + * + * @param integer $index The index in the property path + * + * @return Boolean Whether the element at this index is a property + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function isProperty($index); + + /** + * Returns whether the element at the given index is an array index + * + * @param integer $index The index in the property path + * + * @return Boolean Whether the element at this index is an array index + * + * @throws \OutOfBoundsException If the offset is invalid. + */ + public function isIndex($index); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIterator.php b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIterator.php new file mode 100755 index 0000000000..c165d0854e --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIterator.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * Traverses a property path and provides additional methods to find out + * information about the current element + * + * @author Bernhard Schussek + */ +class PropertyPathIterator extends \ArrayIterator implements PropertyPathIteratorInterface +{ + /** + * The traversed property path + * @var PropertyPathInterface + */ + protected $path; + + /** + * Constructor. + * + * @param PropertyPathInterface $path The property path to traverse + */ + public function __construct(PropertyPathInterface $path) + { + parent::__construct($path->getElements()); + + $this->path = $path; + } + + /** + * {@inheritdoc} + */ + public function isIndex() + { + return $this->path->isIndex($this->key()); + } + + /** + * {@inheritdoc} + */ + public function isProperty() + { + return $this->path->isProperty($this->key()); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php new file mode 100755 index 0000000000..35fb11ad73 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * @author Bernhard Schussek + */ +interface PropertyPathIteratorInterface extends \Iterator, \SeekableIterator +{ + /** + * Returns whether the current element in the property path is an array + * index. + * + * @return Boolean + */ + public function isIndex(); + + /** + * Returns whether the current element in the property path is a property + * name. + * + * @return Boolean + */ + public function isProperty(); +} diff --git a/vendor/symfony/form/Symfony/Component/Form/Util/VirtualFormAwareIterator.php b/vendor/symfony/form/Symfony/Component/Form/Util/VirtualFormAwareIterator.php new file mode 100755 index 0000000000..b73654c1e2 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/Util/VirtualFormAwareIterator.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Util; + +/** + * Iterator that traverses fields of a field group + * + * If the iterator encounters a virtual field group, it enters the field + * group and traverses its children as well. + * + * @author Bernhard Schussek + */ +class VirtualFormAwareIterator extends \ArrayIterator implements \RecursiveIterator +{ + public function getChildren() + { + return new self($this->current()->getChildren()); + } + + public function hasChildren() + { + return $this->current()->getConfig()->getVirtual(); + } +} diff --git a/vendor/symfony/form/Symfony/Component/Form/composer.json b/vendor/symfony/form/Symfony/Component/Form/composer.json new file mode 100755 index 0000000000..83f69cda74 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/form", + "type": "library", + "description": "Symfony Form Component", + "keywords": [], + "homepage": "http://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": "2.1.*", + "symfony/locale": "2.1.*", + "symfony/options-resolver": "2.1.*" + }, + "require-dev": { + "symfony/validator": "2.1.*", + "symfony/http-foundation": "2.1.*" + }, + "suggest": { + "symfony/validator": "2.1.*", + "symfony/http-foundation": "2.1.*" + }, + "autoload": { + "psr-0": { "Symfony\\Component\\Form": "" } + }, + "target-dir": "Symfony/Component/Form", + "minimum-stability": "dev" +} diff --git a/vendor/symfony/form/Symfony/Component/Form/phpunit.xml.dist b/vendor/symfony/form/Symfony/Component/Form/phpunit.xml.dist new file mode 100755 index 0000000000..0fd49c27e4 --- /dev/null +++ b/vendor/symfony/form/Symfony/Component/Form/phpunit.xml.dist @@ -0,0 +1,29 @@ + + + + + + ./Tests/ + + + + + + ./ + + ./Tests + ./vendor + + + + diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ApacheRequest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md old mode 100644 new mode 100755 index 13ed8dd7c9..4a00207e67 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md @@ -1,14 +1,6 @@ CHANGELOG ========= -2.2.0 ------ - - * added a IpUtils class to check if an IP belongs to a CIDR - * added Request::getRealMethod() to get the "real" HTTP method (getMethod() returns the "intended" HTTP method) - * disabled _method request parameter support by default (call Request::enableHttpMethodParameterOverride() to enable it) - * Request::splitHttpAcceptHeader() method is deprecated and will be removed in 2.3 - 2.1.0 ----- diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Cookie.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/AccessDeniedException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/FileNotFoundException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UnexpectedTypeException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/Exception/UploadException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesser.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/ExtensionGuesserInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesserInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php old mode 100644 new mode 100755 index 63c5386a11..d201e2dc03 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -118,19 +118,6 @@ class UploadedFile extends File return $this->originalName; } - /** - * Returns the original file extension - * - * It is extracted from the original file name that was uploaded. - * Then is should not be considered as a safe value. - * - * @return string The extension - */ - public function getClientOriginalExtension() - { - return pathinfo($this->originalName, PATHINFO_EXTENSION); - } - /** * Returns the file mime type. * diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/FileBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ParameterBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md old mode 100644 new mode 100755 index ed49b4e15e..bb6f02c443 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md @@ -31,7 +31,7 @@ the HTTP specification. Loading ------- -If you are not using Composer but are using PHP 5.3.x, you must add the following to your autoloader: +If you are using PHP 5.3.x you must add the following to your autoloader: // SessionHandlerInterface if (!interface_exists('SessionHandlerInterface')) { @@ -43,6 +43,4 @@ Resources You can run the unit tests with the following command: - $ cd path/to/Symfony/Component/HttpFoundation/ - $ composer.phar install --dev - $ phpunit + phpunit diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php old mode 100644 new mode 100755 index 95bd4218f6..18e5480cc2 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php @@ -53,8 +53,6 @@ class Request self::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', ); - protected static $httpMethodParameterOverride = false; - /** * @var \Symfony\Component\HttpFoundation\ParameterBag * @@ -562,19 +560,6 @@ class Request return implode('&', $parts); } - /** - * Enables support for the _method request parameter to determine the intended HTTP method. - * - * Be warned that enabling this feature might lead to CSRF issues in your code. - * Check that you are using CSRF tokens when required. - * - * The HTTP method can only be overriden when the real HTTP method is POST. - */ - public static function enableHttpMethodParameterOverride() - { - self::$httpMethodParameterOverride = true; - } - /** * Gets a "parameter" value. * @@ -1032,51 +1017,26 @@ class Request } /** - * Gets the request "intended" method. - * - * If the X-HTTP-Method-Override header is set, and if the method is a POST, - * then it is used to determine the "real" intended HTTP method. - * - * The _method request parameter can also be used to determine the HTTP method, - * but only if enableHttpMethodParameterOverride() has been called. + * Gets the request method. * * The method is always an uppercased string. * * @return string The request method * * @api - * - * @see getRealMethod */ public function getMethod() { if (null === $this->method) { $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); - if ('POST' === $this->method) { - if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { - $this->method = strtoupper($method); - } elseif (self::$httpMethodParameterOverride) { - $this->method = strtoupper($this->request->get('_method', $this->query->get('_method', 'POST'))); - } + $this->method = strtoupper($this->headers->get('X-HTTP-METHOD-OVERRIDE', $this->request->get('_method', $this->query->get('_method', 'POST')))); } } return $this->method; } - /** - * Gets the "real" request method. - * - * @return string The request method - * - * @see getMethod - */ - public function getRealMethod() - { - return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); - } - /** * Gets the mime type associated with the format. * @@ -1333,9 +1293,9 @@ class Request return $this->languages; } - $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); + $languages = $this->splitHttpAcceptHeader($this->headers->get('Accept-Language')); $this->languages = array(); - foreach (array_keys($languages) as $lang) { + foreach ($languages as $lang => $q) { if (strstr($lang, '-')) { $codes = explode('-', $lang); if ($codes[0] == 'i') { @@ -1375,7 +1335,7 @@ class Request return $this->charsets; } - return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all()); + return $this->charsets = array_keys($this->splitHttpAcceptHeader($this->headers->get('Accept-Charset'))); } /** @@ -1391,7 +1351,7 @@ class Request return $this->acceptableContentTypes; } - return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all()); + return $this->acceptableContentTypes = array_keys($this->splitHttpAcceptHeader($this->headers->get('Accept'))); } /** @@ -1415,21 +1375,40 @@ class Request * @param string $header Header to split * * @return array Array indexed by the values of the Accept-* header in preferred order - * - * @deprecated Deprecated since version 2.2, to be removed in 2.3. */ public function splitHttpAcceptHeader($header) { - $headers = array(); - foreach (AcceptHeader::fromString($header)->all() as $item) { - $key = $item->getValue(); - foreach ($item->getAttributes() as $name => $value) { - $key .= sprintf(';%s=%s', $name, $value); + if (!$header) { + return array(); + } + + $values = array(); + $groups = array(); + foreach (array_filter(explode(',', $header)) as $value) { + // Cut off any q-value that might come after a semi-colon + if (preg_match('/;\s*(q=.*$)/', $value, $match)) { + $q = substr(trim($match[1]), 2); + $value = trim(substr($value, 0, -strlen($match[0]))); + } else { + $q = 1; + } + + $groups[$q][] = $value; + } + + krsort($groups); + + foreach ($groups as $q => $items) { + $q = (float) $q; + + if (0 < $q) { + foreach ($items as $value) { + $values[trim($value)] = $q; + } } - $headers[$key] = $item->getQuality(); } - return $headers; + return $values; } /* diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php old mode 100644 new mode 100755 index 49b92f0e2c..7ebae28bba --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcher.php @@ -143,10 +143,95 @@ class RequestMatcher implements RequestMatcherInterface return false; } - if (null !== $this->ip && !IpUtils::checkIp($request->getClientIp(), $this->ip)) { + if (null !== $this->ip && !$this->checkIp($request->getClientIp(), $this->ip)) { return false; } return true; } + + /** + * Validates an IP address. + * + * @param string $requestIp + * @param string $ip + * + * @return boolean True valid, false if not. + */ + protected function checkIp($requestIp, $ip) + { + // IPv6 address + if (false !== strpos($requestIp, ':')) { + return $this->checkIp6($requestIp, $ip); + } else { + return $this->checkIp4($requestIp, $ip); + } + } + + /** + * Validates an IPv4 address. + * + * @param string $requestIp + * @param string $ip + * + * @return boolean True valid, false if not. + */ + protected function checkIp4($requestIp, $ip) + { + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + + if ($netmask < 1 || $netmask > 32) { + return false; + } + } else { + $address = $ip; + $netmask = 32; + } + + return 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); + } + + /** + * Validates an IPv6 address. + * + * @author David Soria Parra + * @see https://github.com/dsp/v6tools + * + * @param string $requestIp + * @param string $ip + * + * @return boolean True valid, false if not. + */ + protected function checkIp6($requestIp, $ip) + { + if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) { + throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); + } + + if (false !== strpos($ip, '/')) { + list($address, $netmask) = explode('/', $ip, 2); + + if ($netmask < 1 || $netmask > 128) { + return false; + } + } else { + $address = $ip; + $netmask = 128; + } + + $bytesAddr = unpack("n*", inet_pton($address)); + $bytesTest = unpack("n*", inet_pton($requestIp)); + + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; $i++) { + $left = $netmask - 16 * ($i-1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xffff >> $left) & 0xffff; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return false; + } + } + + return true; + } } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RequestMatcherInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php old mode 100644 new mode 100755 index f24c491057..7428b9a9c3 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php @@ -231,7 +231,7 @@ class Response $headers->remove('Content-Length'); } - if ($request->isMethod('HEAD')) { + if ('HEAD' === $request->getMethod()) { // cf. RFC2616 14.13 $length = $headers->get('Content-Length'); $this->setContent(null); @@ -270,7 +270,7 @@ class Response header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)); // headers - foreach ($this->headers->allPreserveCase() as $name => $values) { + foreach ($this->headers->all() as $name => $values) { foreach ($values as $value) { header($name.': '.$value, false); } @@ -1108,7 +1108,7 @@ class Response } /** - * Is the response forbidden? + * Is the reponse forbidden? * * @return Boolean * diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php old mode 100644 new mode 100755 index 531e003fb7..c27d811608 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php @@ -36,11 +36,6 @@ class ResponseHeaderBag extends HeaderBag */ protected $cookies = array(); - /** - * @var array - */ - protected $headerNames = array(); - /** * Constructor. * @@ -53,7 +48,7 @@ class ResponseHeaderBag extends HeaderBag parent::__construct($headers); if (!isset($this->headers['cache-control'])) { - $this->set('Cache-Control', ''); + $this->set('cache-control', ''); } } @@ -70,16 +65,6 @@ class ResponseHeaderBag extends HeaderBag return parent::__toString().$cookies; } - /** - * Returns the headers, with original capitalizations. - * - * @return array An array of headers - */ - public function allPreserveCase() - { - return array_combine($this->headerNames, $this->headers); - } - /** * {@inheritdoc} * @@ -87,12 +72,10 @@ class ResponseHeaderBag extends HeaderBag */ public function replace(array $headers = array()) { - $this->headerNames = array(); - parent::replace($headers); if (!isset($this->headers['cache-control'])) { - $this->set('Cache-Control', ''); + $this->set('cache-control', ''); } } @@ -105,14 +88,10 @@ class ResponseHeaderBag extends HeaderBag { parent::set($key, $values, $replace); - $uniqueKey = strtr(strtolower($key), '_', '-'); - $this->headerNames[$uniqueKey] = $key; - // ensure the cache-control header has sensible defaults - if (in_array($uniqueKey, array('cache-control', 'etag', 'last-modified', 'expires'))) { + if (in_array(strtr(strtolower($key), '_', '-'), array('cache-control', 'etag', 'last-modified', 'expires'))) { $computed = $this->computeCacheControlValue(); $this->headers['cache-control'] = array($computed); - $this->headerNames['cache-control'] = 'Cache-Control'; $this->computedCacheControl = $this->parseCacheControl($computed); } } @@ -126,10 +105,7 @@ class ResponseHeaderBag extends HeaderBag { parent::remove($key); - $uniqueKey = strtr(strtolower($key), '_', '-'); - unset($this->headerNames[$uniqueKey]); - - if ('cache-control' === $uniqueKey) { + if ('cache-control' === strtr(strtolower($key), '_', '-')) { $this->computedCacheControl = array(); } } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ServerBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBagInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Session.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionBagInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/SessionInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcacheSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php old mode 100644 new mode 100755 index 4a262aade3..93a5729643 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -36,20 +36,18 @@ class MongoDbSessionHandler implements \SessionHandlerInterface /** * Constructor. * - * List of available options: - * * database: The name of the database [required] - * * collection: The name of the collection [required] - * * id_field: The field name for storing the session id [default: _id] - * * data_field: The field name for storing the session data [default: data] - * * time_field: The field name for storing the timestamp [default: time] - * - * @param \Mongo $mongo A "Mongo" instance - * @param array $options An associative array of field options + * @param \Mongo|\MongoClient $mongo A MongoClient or Mongo instance + * @param array $options An associative array of field options * + * @throws \InvalidArgumentException When MongoClient or Mongo instance not provided * @throws \InvalidArgumentException When "database" or "collection" not provided */ - public function __construct(\Mongo $mongo, array $options) + public function __construct($mongo, array $options) { + if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { + throw new \InvalidArgumentException('MongoClient or Mongo instance required'); + } + if (!isset($options['database']) || !isset($options['collection'])) { throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler'); } @@ -57,9 +55,9 @@ class MongoDbSessionHandler implements \SessionHandlerInterface $this->mongo = $mongo; $this->options = array_merge(array( - 'id_field' => '_id', - 'data_field' => 'data', - 'time_field' => 'time', + 'id_field' => 'sess_id', + 'data_field' => 'sess_data', + 'time_field' => 'sess_time', ), $options); } @@ -84,9 +82,10 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function destroy($sessionId) { - $this->getCollection()->remove(array( - $this->options['id_field'] => $sessionId - )); + $this->getCollection()->remove( + array($this->options['id_field'] => $sessionId), + array('justOne' => true) + ); return true; } @@ -96,21 +95,11 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function gc($lifetime) { - /* Note: MongoDB 2.2+ supports TTL collections, which may be used in - * place of this method by indexing the "time_field" field with an - * "expireAfterSeconds" option. Regardless of whether TTL collections - * are used, consider indexing this field to make the remove query more - * efficient. - * - * See: http://docs.mongodb.org/manual/tutorial/expire-data/ - */ - $time = new \MongoDate(time() - $lifetime); + $time = new \MongoTimestamp(time() - $lifetime); $this->getCollection()->remove(array( $this->options['time_field'] => array('$lt' => $time), )); - - return true; } /** @@ -118,13 +107,16 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function write($sessionId, $data) { + $data = array( + $this->options['id_field'] => $sessionId, + $this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY), + $this->options['time_field'] => new \MongoTimestamp() + ); + $this->getCollection()->update( array($this->options['id_field'] => $sessionId), - array('$set' => array( - $this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY), - $this->options['time_field'] => new \MongoDate(), - )), - array('upsert' => true, 'multiple' => false) + array('$set' => $data), + array('upsert' => true) ); return true; @@ -150,7 +142,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface private function getCollection() { if (null === $this->collection) { - $this->collection = $this->mongo->selectDB($this->options['database'])->selectCollection($this->options['collection']); + $this->collection = $this->mongo->selectCollection($this->options['database'], $this->options['collection']); } return $this->collection; diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/NullSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php old mode 100644 new mode 100755 index b18d071d95..a1fcf539f8 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -159,6 +159,9 @@ class MockArraySessionStorage implements SessionStorageInterface */ public function save() { + if (!$this->started || $this->closed) { + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + } // nothing to do since we don't persist the session data $this->closed = false; } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php old mode 100644 new mode 100755 index 80aa44b06b..280630914a --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -97,6 +97,10 @@ class MockFileSessionStorage extends MockArraySessionStorage */ public function save() { + if (!$this->started) { + throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + } + file_put_contents($this->getFilePath(), serialize($this->data)); // this is needed for Silex, where the session object is re-used across requests diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php old mode 100644 new mode 100755 index f23ca3a7fd..2dc8564881 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -27,17 +27,17 @@ class NativeSessionStorage implements SessionStorageInterface /** * Array of SessionBagInterface * - * @var SessionBagInterface[] + * @var array */ protected $bags; /** - * @var Boolean + * @var boolean */ protected $started = false; /** - * @var Boolean + * @var boolean */ protected $closed = false; diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/AbstractProxy.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/NativeProxy.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/Proxy/SessionHandlerProxy.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php old mode 100644 new mode 100755 index 26a741829b..711eaa29a3 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session/Storage/SessionStorageInterface.php @@ -110,6 +110,9 @@ interface SessionStorageInterface * used for a storage object design for unit or functional testing where * a real PHP session would interfere with testing, in which case it * it should actually persist the session data if required. + * + * @throws \RuntimeException If the session is saved without being started, or if the session + * is already closed. */ public function save(); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php old mode 100644 new mode 100755 index 721cc3cd9e..6a9948d62a --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/CookieTest.php @@ -79,23 +79,6 @@ class CookieTest extends \PHPUnit_Framework_TestCase $this->assertEquals(3600, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date'); } - public function testConstructorWithDateTime() - { - $expire = new \DateTime(); - $cookie = new Cookie('foo', 'bar', $expire); - - $this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date'); - } - - public function testGetExpiresTimeWithStringValue() - { - $value = "+1 day"; - $cookie = new Cookie('foo', 'bar', $value); - $expire = strtotime($value); - - $this->assertEquals($expire, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date'); - } - public function testGetDomain() { $cookie = new Cookie('foo', 'bar', 3600, '/', '.myfoodomain.com'); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/FileTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/FileTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/.unknownextension old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/directory/.empty old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/Fixtures/test.gif old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/MimeType/MimeTypeTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php old mode 100644 new mode 100755 index 94a075ac46..b42a3fc89c --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/File/UploadedFileTest.php @@ -89,19 +89,6 @@ class UploadedFileTest extends \PHPUnit_Framework_TestCase $this->assertEquals('original.gif', $file->getClientOriginalName()); } - public function testGetClientOriginalExtension() - { - $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', - 'original.gif', - 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null - ); - - $this->assertEquals('gif', $file->getClientOriginalExtension()); - } - /** * @expectedException Symfony\Component\HttpFoundation\File\Exception\FileException */ diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/FileBagTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php old mode 100644 new mode 100755 index b1bfefbf87..67e6040d12 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php @@ -24,49 +24,6 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase $this->assertTrue($bag->has('foo')); } - public function testToStringNull() - { - $bag = new HeaderBag(); - $this->assertEquals('', $bag->__toString()); - } - - public function testToStringNotNull() - { - $bag = new HeaderBag(array('foo' => 'bar')); - $this->assertEquals("Foo: bar\r\n", $bag->__toString()); - } - - public function testKeys() - { - $bag = new HeaderBag(array('foo' => 'bar')); - $keys = $bag->keys(); - $this->assertEquals("foo", $keys[0]); - } - - public function testGetDate() - { - $bag = new HeaderBag(array('foo' => 'Tue, 4 Sep 2012 20:00:00 +0200')); - $headerDate = $bag->getDate('foo'); - $this->assertInstanceOf('DateTime', $headerDate); - } - - /** - * @expectedException \RuntimeException - */ - public function testGetDateException() - { - $bag = new HeaderBag(array('foo' => 'Tue')); - $headerDate = $bag->getDate('foo'); - } - - public function testGetCacheControlHeader() - { - $bag = new HeaderBag(); - $bag->addCacheControlDirective('public', '#a'); - $this->assertTrue($bag->hasCacheControlDirective('public')); - $this->assertEquals('#a', $bag->getCacheControlDirective('public')); - } - /** * @covers Symfony\Component\HttpFoundation\HeaderBag::all */ diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php old mode 100644 new mode 100755 index 6cd42bf91d..c3c0b16bfd --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php @@ -32,28 +32,6 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array('foo' => 'bar'), $bag->all(), '->all() gets all the input'); } - public function testKeys() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $this->assertEquals(array('foo'), $bag->keys()); - } - - public function testAdd() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $bag->add(array('bar' => 'bas')); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all()); - } - - public function testRemove() - { - $bag = new ParameterBag(array('foo' => 'bar')); - $bag->add(array('bar' => 'bas')); - $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all()); - $bag->remove('bar'); - $this->assertEquals(array('foo' => 'bar'), $bag->all()); - } - /** * @covers Symfony\Component\HttpFoundation\ParameterBag::replace */ diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php old mode 100644 new mode 100755 index 0e1a0f5caf..ab8bd489f4 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php @@ -16,6 +16,78 @@ use Symfony\Component\HttpFoundation\Request; class RequestMatcherTest extends \PHPUnit_Framework_TestCase { + /** + * @dataProvider testIpv4Provider + */ + public function testIpv4($matches, $remoteAddr, $cidr) + { + $request = Request::create('', 'get', array(), array(), array(), array('REMOTE_ADDR' => $remoteAddr)); + + $matcher = new RequestMatcher(); + $matcher->matchIp($cidr); + + $this->assertEquals($matches, $matcher->matches($request)); + } + + public function testIpv4Provider() + { + return array( + array(true, '192.168.1.1', '192.168.1.1'), + array(true, '192.168.1.1', '192.168.1.1/1'), + array(true, '192.168.1.1', '192.168.1.0/24'), + array(false, '192.168.1.1', '1.2.3.4/1'), + array(false, '192.168.1.1', '192.168.1/33'), + ); + } + + /** + * @dataProvider testIpv6Provider + */ + public function testIpv6($matches, $remoteAddr, $cidr) + { + if (!defined('AF_INET6')) { + $this->markTestSkipped('Only works when PHP is compiled without the option "disable-ipv6".'); + } + + $request = Request::create('', 'get', array(), array(), array(), array('REMOTE_ADDR' => $remoteAddr)); + + $matcher = new RequestMatcher(); + $matcher->matchIp($cidr); + + $this->assertEquals($matches, $matcher->matches($request)); + } + + public function testIpv6Provider() + { + return array( + array(true, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), + array(false, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), + array(false, '2a01:198:603:0:396e:4789:8e99:890f', '::1'), + array(true, '0:0:0:0:0:0:0:1', '::1'), + array(false, '0:0:603:0:396e:4789:8e99:0001', '::1'), + ); + } + + public function testAnIpv6WithOptionDisabledIpv6() + { + if (defined('AF_INET6')) { + $this->markTestSkipped('Only works when PHP is compiled with the option "disable-ipv6".'); + } + + $request = Request::create('', 'get', array(), array(), array(), array('REMOTE_ADDR' => '2a01:198:603:0:396e:4789:8e99:890f')); + + $matcher = new RequestMatcher(); + $matcher->matchIp('2a01:198:603:0::/65'); + + try { + $matcher->matches($request); + + $this->fail('An expected RuntimeException has not been raised.'); + } catch (\Exception $e) { + $this->assertInstanceOf('\RuntimeException', $e); + } + } + /** * @dataProvider testMethodFixtures */ diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php old mode 100644 new mode 100755 index 0276786430..535ebfc9a3 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -45,55 +45,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase $this->assertEquals('bar', $request->headers->get('FOO'), '->initialize() takes an array of HTTP headers as its fourth argument'); } - public function testGetLocale() - { - $request = new Request(); - $request->setLocale('pl'); - $locale = $request->getLocale(); - $this->assertEquals('pl', $locale); - } - - public function testGetUser() - { - $request = Request::create('http://user_test:password_test@test.com/'); - $user = $request->getUser(); - - $this->assertEquals('user_test', $user); - } - - public function testGetPassword() - { - $request = Request::create('http://user_test:password_test@test.com/'); - $password = $request->getPassword(); - - $this->assertEquals('password_test', $password); - } - - public function testIsNoCache() - { - $request = new Request(); - $isNoCache = $request->isNoCache(); - - $this->assertFalse($isNoCache); - } - - public function testGetContentType() - { - $request = new Request(); - $contentType = $request->getContentType(); - - $this->assertNull($contentType); - } - - public function testSetDefaultLocale() - { - $request = new Request(); - $request->setDefaultLocale('pl'); - $locale = $request->getLocale(); - - $this->assertEquals('pl', $locale); - } - /** * @covers Symfony\Component\HttpFoundation\Request::create */ @@ -663,28 +614,13 @@ class RequestTest extends \PHPUnit_Framework_TestCase $request->setMethod('POST'); $request->request->set('_method', 'purge'); - $this->assertEquals('POST', $request->getMethod(), '->getMethod() does not return the method from _method if defined and POST but support not enabled'); - - $request = new Request(); - $request->setMethod('POST'); - $request->request->set('_method', 'purge'); - Request::enableHttpMethodParameterOverride(); $this->assertEquals('PURGE', $request->getMethod(), '->getMethod() returns the method from _method if defined and POST'); - $this->disableHttpMethodParameterOverride(); - $request = new Request(); $request->setMethod('POST'); + $request->request->remove('_method'); $request->query->set('_method', 'purge'); - $this->assertEquals('POST', $request->getMethod(), '->getMethod() does not return the method from _method if defined and POST but support not enabled'); - - $request = new Request(); - $request->setMethod('POST'); - $request->query->set('_method', 'purge'); - Request::enableHttpMethodParameterOverride(); $this->assertEquals('PURGE', $request->getMethod(), '->getMethod() returns the method from _method if defined and POST'); - $this->disableHttpMethodParameterOverride(); - $request = new Request(); $request->setMethod('POST'); $request->headers->set('X-HTTP-METHOD-OVERRIDE', 'delete'); $this->assertEquals('DELETE', $request->getMethod(), '->getMethod() returns the method from X-HTTP-Method-Override even though _method is set if defined and POST'); @@ -777,10 +713,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase array('PUT'), array('DELETE'), array('PATCH'), - array('put'), - array('delete'), - array('patch'), - ); } @@ -789,8 +721,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase */ public function testCreateFromGlobals($method) { - $normalizedMethod = strtoupper($method); - $_GET['foo1'] = 'bar1'; $_POST['foo2'] = 'bar2'; $_COOKIE['foo3'] = 'bar3'; @@ -809,23 +739,19 @@ class RequestTest extends \PHPUnit_Framework_TestCase $_SERVER['REQUEST_METHOD'] = $method; $_SERVER['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; $request = RequestContentProxy::createFromGlobals(); - $this->assertEquals($normalizedMethod, $request->getMethod()); + $this->assertEquals($method, $request->getMethod()); $this->assertEquals('mycontent', $request->request->get('content')); unset($_SERVER['REQUEST_METHOD'], $_SERVER['CONTENT_TYPE']); - Request::createFromGlobals(); - Request::enableHttpMethodParameterOverride(); $_POST['_method'] = $method; $_POST['foo6'] = 'bar6'; - $_SERVER['REQUEST_METHOD'] = 'PoSt'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $request = Request::createFromGlobals(); - $this->assertEquals($normalizedMethod, $request->getMethod()); - $this->assertEquals('POST', $request->getRealMethod()); + $this->assertEquals($method, $request->getMethod()); $this->assertEquals('bar6', $request->request->get('foo6')); unset($_POST['_method'], $_POST['foo6'], $_SERVER['REQUEST_METHOD']); - $this->disableHttpMethodParameterOverride(); } public function testOverrideGlobals() @@ -1067,19 +993,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase $this->assertTrue($request->hasSession()); } - public function testGetSession() - { - $request = new Request(); - - $request->setSession(new Session(new MockArraySessionStorage())); - $this->assertTrue($request->hasSession()); - - $session = $request->getSession(); - $this->assertObjectHasAttribute('storage', $session); - $this->assertObjectHasAttribute('flashName', $session); - $this->assertObjectHasAttribute('attributeName', $session); - } - public function testHasPreviousSession() { $request = new Request(); @@ -1117,10 +1030,10 @@ class RequestTest extends \PHPUnit_Framework_TestCase array('text/html;q=0.8', array('text/html' => 0.8)), array('text/html;foo=bar;q=0.8 ', array('text/html;foo=bar' => 0.8)), array('text/html;charset=utf-8; q=0.8', array('text/html;charset=utf-8' => 0.8)), - array('text/html,application/xml;q=0.9,*/*;charset=utf-8; q=0.8', array('text/html' => 1.0, 'application/xml' => 0.9, '*/*;charset=utf-8' => 0.8)), - array('text/html,application/xhtml+xml;q=0.9,*/*;q=0.8; foo=bar', array('text/html' => 1.0, 'application/xhtml+xml' => 0.9, '*/*;foo=bar' => 0.8)), - array('text/html,application/xhtml+xml;charset=utf-8;q=0.9; foo=bar,*/*', array('text/html' => 1.0, '*/*' => 1.0, 'application/xhtml+xml;charset=utf-8;foo=bar' => 0.9)), - array('text/html,application/xhtml+xml', array('text/html' => 1.0, 'application/xhtml+xml' => 1.0)), + array('text/html,application/xml;q=0.9,*/*;charset=utf-8; q=0.8', array('text/html' => 1, 'application/xml' => 0.9, '*/*;charset=utf-8' => 0.8)), + array('text/html,application/xhtml+xml;q=0.9,*/*;q=0.8; foo=bar', array('text/html' => 1, 'application/xhtml+xml' => 0.9, '*/*' => 0.8)), + array('text/html,application/xhtml+xml;charset=utf-8;q=0.9; foo=bar,*/*', array('text/html' => 1, '*/*' => 1, 'application/xhtml+xml;charset=utf-8' => 0.9)), + array('text/html,application/xhtml+xml', array('application/xhtml+xml' => 1, 'text/html' => 1)), ); } @@ -1247,14 +1160,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase $property->setValue(false); } - private function disableHttpMethodParameterOverride() - { - $class = new \ReflectionClass('Symfony\\Component\\HttpFoundation\\Request'); - $property = $class->getProperty('httpMethodParameterOverride'); - $property->setAccessible(true); - $property->setValue(false); - } - public function testTrustedProxies() { $request = Request::create('http://example.com/'); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php old mode 100644 new mode 100755 index fd163d197d..fc3d908cb1 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php @@ -16,51 +16,6 @@ use Symfony\Component\HttpFoundation\Cookie; class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase { - /** - * @covers Symfony\Component\HttpFoundation\ResponseHeaderBag::allPreserveCase - * @dataProvider provideAllPreserveCase - */ - public function testAllPreserveCase($headers, $expected) - { - $bag = new ResponseHeaderBag($headers); - - $this->assertEquals($expected, $bag->allPreserveCase(), '->allPreserveCase() gets all input keys in original case'); - } - - public function provideAllPreserveCase() - { - return array( - array( - array('fOo' => 'BAR'), - array('fOo' => array('BAR'), 'Cache-Control' => array('no-cache')) - ), - array( - array('ETag' => 'xyzzy'), - array('ETag' => array('xyzzy'), 'Cache-Control' => array('private, must-revalidate')) - ), - array( - array('Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ=='), - array('Content-MD5' => array('Q2hlY2sgSW50ZWdyaXR5IQ=='), 'Cache-Control' => array('no-cache')) - ), - array( - array('P3P' => 'CP="CAO PSA OUR"'), - array('P3P' => array('CP="CAO PSA OUR"'), 'Cache-Control' => array('no-cache')) - ), - array( - array('WWW-Authenticate' => 'Basic realm="WallyWorld"'), - array('WWW-Authenticate' => array('Basic realm="WallyWorld"'), 'Cache-Control' => array('no-cache')) - ), - array( - array('X-UA-Compatible' => 'IE=edge,chrome=1'), - array('X-UA-Compatible' => array('IE=edge,chrome=1'), 'Cache-Control' => array('no-cache')) - ), - array( - array('X-XSS-Protection' => '1; mode=block'), - array('X-XSS-Protection' => array('1; mode=block'), 'Cache-Control' => array('no-cache')) - ), - ); - } - public function testCacheControlHeader() { $bag = new ResponseHeaderBag(array()); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php old mode 100644 new mode 100755 index 622d65bc3f..432499e945 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\HttpFoundation\Tests\Session\Attribute; +namespace Symfony\Component\HttpFoundation\Tests; use Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag; diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/AutoExpireFlashBagTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php old mode 100644 new mode 100755 index 2568b3c7f3..68c416ca0f --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php @@ -54,29 +54,6 @@ class SessionTest extends \PHPUnit_Framework_TestCase $this->assertNotEquals('', $this->session->getId()); } - public function testIsStarted() - { - $this->assertFalse($this->session->isStarted()); - $this->session->start(); - $this->assertTrue($this->session->isStarted()); - } - - public function testSetId() - { - $this->assertEquals('', $this->session->getId()); - $this->session->setId('0123456789abcdef'); - $this->session->start(); - $this->assertEquals('0123456789abcdef', $this->session->getId()); - } - - public function testSetName() - { - $this->assertEquals('MOCKSESSID', $this->session->getName()); - $this->session->setName('session.test.com'); - $this->session->start(); - $this->assertEquals('session.test.com', $this->session->getName()); - } - public function testGet() { // tests defaults @@ -174,6 +151,7 @@ class SessionTest extends \PHPUnit_Framework_TestCase public function testSave() { + $this->session->start(); $this->session->save(); } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php old mode 100644 new mode 100755 index 474fc3b029..04d3a3f171 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -27,18 +27,20 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('\Mongo')) { - $this->markTestSkipped('MongoDbSessionHandler requires the mongo extension.'); + if (!extension_loaded('mongo')) { + $this->markTestSkipped('MongoDbSessionHandler requires the PHP "mongo" extension.'); } - $this->mongo = $this->getMockBuilder('Mongo') + $mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? 'Mongo' : 'MongoClient'; + + $this->mongo = $this->getMockBuilder($mongoClass) ->disableOriginalConstructor() ->getMock(); $this->options = array( - 'id_field' => '_id', - 'data_field' => 'data', - 'time_field' => 'time', + 'id_field' => 'sess_id', + 'data_field' => 'sess_data', + 'time_field' => 'sess_time', 'database' => 'sf2-test', 'collection' => 'session-test' ); @@ -46,6 +48,22 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $this->storage = new MongoDbSessionHandler($this->mongo, $this->options); } + /** + * @expectedException InvalidArgumentException + */ + public function testConstructorShouldThrowExceptionForInvalidMongo() + { + new MongoDbSessionHandler(new \stdClass(), $this->options); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testConstructorShouldThrowExceptionForMissingOptions() + { + new MongoDbSessionHandler($this->mongo, array()); + } + public function testOpenMethodAlwaysReturnTrue() { $this->assertTrue($this->storage->open('test', 'test'), 'The "open" method should always return true'); @@ -58,22 +76,13 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase public function testWrite() { - $database = $this->getMockBuilder('MongoDB') - ->disableOriginalConstructor() - ->getMock(); - $collection = $this->getMockBuilder('MongoCollection') ->disableOriginalConstructor() ->getMock(); $this->mongo->expects($this->once()) - ->method('selectDB') - ->with($this->options['database']) - ->will($this->returnValue($database)); - - $database->expects($this->once()) ->method('selectCollection') - ->with($this->options['collection']) + ->with($this->options['database'], $this->options['collection']) ->will($this->returnValue($collection)); $that = $this; @@ -81,44 +90,35 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $collection->expects($this->once()) ->method('update') - ->will($this->returnCallback(function($criteria, $updateData, $options) use ($that, &$data) { - $that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria); - $that->assertEquals(array('upsert' => true, 'multiple' => false), $options); + ->will($this->returnCallback(function($citeria, $updateData, $options) use ($that, &$data) { + $that->assertEquals(array($that->options['id_field'] => 'foo'), $citeria); + $that->assertEquals(array('upsert' => true), $options); $data = $updateData['$set']; })); $this->assertTrue($this->storage->write('foo', 'bar')); + $this->assertEquals('foo', $data[$this->options['id_field']]); $this->assertEquals('bar', $data[$this->options['data_field']]->bin); - $that->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); } public function testReplaceSessionData() { - $database = $this->getMockBuilder('MongoDB') - ->disableOriginalConstructor() - ->getMock(); - $collection = $this->getMockBuilder('MongoCollection') ->disableOriginalConstructor() ->getMock(); $this->mongo->expects($this->once()) - ->method('selectDB') - ->with($this->options['database']) - ->will($this->returnValue($database)); - - $database->expects($this->once()) ->method('selectCollection') - ->with($this->options['collection']) + ->with($this->options['database'], $this->options['collection']) ->will($this->returnValue($collection)); $data = array(); $collection->expects($this->exactly(2)) ->method('update') - ->will($this->returnCallback(function($criteria, $updateData, $options) use (&$data) { + ->will($this->returnCallback(function($citeria, $updateData, $options) use (&$data) { $data = $updateData; })); @@ -130,60 +130,45 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase public function testDestroy() { - $database = $this->getMockBuilder('MongoDB') - ->disableOriginalConstructor() - ->getMock(); - $collection = $this->getMockBuilder('MongoCollection') ->disableOriginalConstructor() ->getMock(); $this->mongo->expects($this->once()) - ->method('selectDB') - ->with($this->options['database']) - ->will($this->returnValue($database)); - - $database->expects($this->once()) ->method('selectCollection') - ->with($this->options['collection']) + ->with($this->options['database'], $this->options['collection']) ->will($this->returnValue($collection)); $collection->expects($this->once()) ->method('remove') - ->with(array($this->options['id_field'] => 'foo')); + ->with( + array($this->options['id_field'] => 'foo'), + array('justOne' => true) + ); - $this->assertTrue($this->storage->destroy('foo')); + $this->storage->destroy('foo'); } public function testGc() { - $database = $this->getMockBuilder('MongoDB') - ->disableOriginalConstructor() - ->getMock(); - $collection = $this->getMockBuilder('MongoCollection') ->disableOriginalConstructor() ->getMock(); $this->mongo->expects($this->once()) - ->method('selectDB') - ->with($this->options['database']) - ->will($this->returnValue($database)); - - $database->expects($this->once()) ->method('selectCollection') - ->with($this->options['collection']) + ->with($this->options['database'], $this->options['collection']) ->will($this->returnValue($collection)); $that = $this; $collection->expects($this->once()) ->method('remove') - ->will($this->returnCallback(function($criteria) use ($that) { - $that->assertInstanceOf('MongoDate', $criteria[$that->options['time_field']]['$lt']); - $that->assertGreaterThanOrEqual(time() - -1, $criteria[$that->options['time_field']]['$lt']->sec); + ->will($this->returnCallback(function($citeria) use ($that) { + $that->assertInstanceOf('MongoTimestamp', $citeria[$that->options['time_field']]['$lt']); + $that->assertGreaterThanOrEqual(time() - -1, $citeria[$that->options['time_field']]['$lt']->sec); })); - $this->assertTrue($this->storage->gc(-1)); + $this->storage->gc(-1); } } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php old mode 100644 new mode 100755 index ef70281ce0..39f268b4b5 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php @@ -82,14 +82,6 @@ class MetadataBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals('_sf2_meta', $this->bag->getStorageKey()); } - public function testGetLifetime() - { - $bag = new MetadataBag(); - $array = array(MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 1000); - $bag->initialize($array); - $this->assertEquals(1000, $bag->getLifetime()); - } - public function testGetCreated() { $this->assertEquals(1234567, $this->bag->getCreated()); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php old mode 100644 new mode 100755 index c9b2a7480c..2a6f6bb7e8 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockArraySessionStorageTest.php @@ -95,4 +95,12 @@ class MockArraySessionStorageTest extends \PHPUnit_Framework_TestCase $this->storage->start(); $this->assertNotEquals('', $this->storage->getId()); } + + /** + * @expectedException RuntimeException + */ + public function testUnstartedSave() + { + $this->storage->save(); + } } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php old mode 100644 new mode 100755 index f18089d92a..d42c62a25c --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -106,6 +106,15 @@ class MockFileSessionStorageTest extends \PHPUnit_Framework_TestCase $this->assertEquals('bar', $storage2->getBag('attributes')->get('foo'), 'values persist between instances'); } + /** + * @expectedException RuntimeException + */ + public function testSaveWithoutStart() + { + $storage1 = $this->getStorage(); + $storage1->save(); + } + private function getStorage() { $storage = new MockFileSessionStorage($this->sessionDir); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/NativeProxyTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/bootstrap.php b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/bootstrap.php new file mode 100755 index 0000000000..f7fc8c9809 --- /dev/null +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/bootstrap.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (ltrim('SessionHandlerInterface', '/') === $class) { + require_once __DIR__.'/../Resources/stubs/SessionHandlerInterface.php'; + } + + if (0 !== strpos(ltrim($class, '/'), 'Symfony\Component\HttpFoundation')) { + return; + } + + require_once __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpFoundation')).'.php'; +}); diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json old mode 100644 new mode 100755 index 09b8725308..e9f54948b6 --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/composer.json @@ -19,14 +19,11 @@ "php": ">=5.3.3" }, "autoload": { - "psr-0": { "Symfony\\Component\\HttpFoundation\\": "" }, - "classmap": [ "Symfony/Component/HttpFoundation/Resources/stubs" ] + "psr-0": { + "Symfony\\Component\\HttpFoundation": "", + "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs" + } }, "target-dir": "Symfony/Component/HttpFoundation", - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - } + "minimum-stability": "dev" } diff --git a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist old mode 100644 new mode 100755 index df11f72c0f..2a760f290c --- a/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist +++ b/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist @@ -9,7 +9,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="vendor/autoload.php" + bootstrap="Tests/bootstrap.php" > diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php old mode 100644 new mode 100755 index 494feabe58..3348456c54 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/Bundle.php @@ -172,7 +172,7 @@ abstract class Bundle extends ContainerAware implements BundleInterface */ public function registerCommands(Application $application) { - if (!$dir = realpath($this->getPath().'/Command')) { + if (!is_dir($dir = $this->getPath().'/Command')) { return; } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Bundle/BundleInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md old mode 100644 new mode 100755 index 75b5d9321a..c27de87eca --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md @@ -1,18 +1,6 @@ CHANGELOG ========= -2.2.0 ------ - - * [BC BREAK] renamed TimeDataCollector::getTotalTime() to - TimeDataCollector::getDuration() - * updated the MemoryDataCollector to include the memory used in the - kernel.terminate event listeners - * moved the Stopwatch classes to a new component - * added TraceableControllerResolver - * added TraceableEventDispatcher (removed ContainerAwareTraceableEventDispatcher) - * added support for WinCache opcode cache in ConfigDataCollector - 2.1.0 ----- diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/CacheClearerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheClearer/ChainCacheClearer.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmer.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CacheWarmer/WarmableInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Config/FileLocator.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolver.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Controller/ControllerResolverInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php old mode 100644 new mode 100755 index 97797a48f2..81ede39ced --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -42,18 +42,17 @@ class ConfigDataCollector extends DataCollector public function collect(Request $request, Response $response, \Exception $exception = null) { $this->data = array( - 'token' => $response->headers->get('X-Debug-Token'), - 'symfony_version' => Kernel::VERSION, - 'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a', - 'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a', - 'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a', - 'php_version' => PHP_VERSION, - 'xdebug_enabled' => extension_loaded('xdebug'), - 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'), - 'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'), - 'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'), - 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'), - 'bundles' => array(), + 'token' => $response->headers->get('X-Debug-Token'), + 'symfony_version' => Kernel::VERSION, + 'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a', + 'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a', + 'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a', + 'php_version' => PHP_VERSION, + 'xdebug_enabled' => extension_loaded('xdebug'), + 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'), + 'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'), + 'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'), + 'bundles' => array(), ); if (isset($this->kernel)) { @@ -163,16 +162,6 @@ class ConfigDataCollector extends DataCollector return $this->data['xcache_enabled']; } - /** - * Returns true if WinCache is enabled. - * - * @return Boolean true if WinCache is enabled, false otherwise - */ - public function hasWinCache() - { - return $this->data['wincache_enabled']; - } - /** * Returns true if any accelerator is enabled. * @@ -180,7 +169,7 @@ class ConfigDataCollector extends DataCollector */ public function hasAccelerator() { - return $this->hasApc() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache(); + return $this->hasApc() || $this->hasEAccelerator() || $this->hasXCache(); } public function getBundles() diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollector.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php old mode 100644 new mode 100755 index cd7f787017..406f1df02f --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/EventDataCollector.php @@ -14,6 +14,7 @@ namespace Symfony\Component\HttpKernel\DataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * EventDataCollector. @@ -22,29 +23,26 @@ use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; */ class EventDataCollector extends DataCollector { + private $dispatcher; + + public function setEventDispatcher(EventDispatcherInterface $dispatcher) + { + if ($dispatcher instanceof TraceableEventDispatcherInterface) { + $this->dispatcher = $dispatcher; + } + } + /** * {@inheritdoc} */ public function collect(Request $request, Response $response, \Exception $exception = null) { $this->data = array( - 'called_listeners' => array(), - 'not_called_listeners' => array(), + 'called_listeners' => null !== $this->dispatcher ? $this->dispatcher->getCalledListeners() : array(), + 'not_called_listeners' => null !== $this->dispatcher ? $this->dispatcher->getNotCalledListeners() : array(), ); } - /** - * Sets the called listeners. - * - * @param array $listeners An array of called listeners - * - * @see TraceableEventDispatcherInterface - */ - public function setCalledListeners(array $listeners) - { - $this->data['called_listeners'] = $listeners; - } - /** * Gets the called listeners. * @@ -57,18 +55,6 @@ class EventDataCollector extends DataCollector return $this->data['called_listeners']; } - /** - * Sets the not called listeners. - * - * @param array $listeners An array of not called listeners - * - * @see TraceableEventDispatcherInterface - */ - public function setNotCalledListeners(array $listeners) - { - $this->data['not_called_listeners'] = $listeners; - } - /** * Gets the not called listeners. * diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php old mode 100644 new mode 100755 index f08720e807..97f7165303 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpKernel\DataCollector; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Debug\ErrorHandler; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; @@ -39,9 +38,8 @@ class LoggerDataCollector extends DataCollector { if (null !== $this->logger) { $this->data = array( - 'error_count' => $this->logger->countErrors(), - 'logs' => $this->sanitizeLogs($this->logger->getLogs()), - 'deprecation_count' => $this->computeDeprecationCount() + 'error_count' => $this->logger->countErrors(), + 'logs' => $this->sanitizeLogs($this->logger->getLogs()), ); } } @@ -68,11 +66,6 @@ class LoggerDataCollector extends DataCollector return isset($this->data['logs']) ? $this->data['logs'] : array(); } - public function countDeprecations() - { - return isset($this->data['deprecation_count']) ? $this->data['deprecation_count'] : 0; - } - /** * {@inheritdoc} */ @@ -110,16 +103,4 @@ class LoggerDataCollector extends DataCollector return $context; } - - private function computeDeprecationCount() - { - $count = 0; - foreach ($this->logger->getLogs() as $log) { - if (isset($log['context']['type']) && ErrorHandler::TYPE_DEPRECATION === $log['context']['type']) { - $count++; - } - } - - return $count; - } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php old mode 100644 new mode 100755 index 649c88d764..c41ca314da --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/MemoryDataCollector.php @@ -21,17 +21,14 @@ use Symfony\Component\HttpFoundation\Response; */ class MemoryDataCollector extends DataCollector { - public function __construct() - { - $this->data = array('memory' => 0); - } - /** * {@inheritdoc} */ public function collect(Request $request, Response $response, \Exception $exception = null) { - $this->updateMemoryUsage(); + $this->data = array( + 'memory' => memory_get_peak_usage(true), + ); } /** @@ -44,14 +41,6 @@ class MemoryDataCollector extends DataCollector return $this->data['memory']; } - /** - * Updates the memory usage data. - */ - public function updateMemoryUsage() - { - $this->data['memory'] = memory_get_peak_usage(true); - } - /** * {@inheritdoc} */ diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php old mode 100644 new mode 100755 index 6294845c72..930ea14110 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -92,31 +92,18 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter 'flashes' => $flashes, 'path_info' => $request->getPathInfo(), 'controller' => 'n/a', - 'locale' => $request->getLocale(), ); if (isset($this->controllers[$request])) { $controller = $this->controllers[$request]; if (is_array($controller)) { - try { - $r = new \ReflectionMethod($controller[0], $controller[1]); - $this->data['controller'] = array( - 'class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], - 'method' => $controller[1], - 'file' => $r->getFilename(), - 'line' => $r->getStartLine(), - ); - } catch (\ReflectionException $re) { - if (is_callable($controller)) { - // using __call or __callStatic - $this->data['controller'] = array( - 'class' => is_object($controller[0]) ? get_class($controller[0]) : $controller[0], - 'method' => $controller[1], - 'file' => 'n/a', - 'line' => 'n/a', - ); - } - } + $r = new \ReflectionMethod($controller[0], $controller[1]); + $this->data['controller'] = array( + 'class' => get_class($controller[0]), + 'method' => $controller[1], + 'file' => $r->getFilename(), + 'line' => $r->getStartLine(), + ); } elseif ($controller instanceof \Closure) { $this->data['controller'] = 'Closure'; } else { @@ -201,11 +188,6 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter return $this->data['format']; } - public function getLocale() - { - return $this->data['locale']; - } - /** * Gets the route name. * diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php old mode 100644 new mode 100755 index 5fd2378499..0d5ac81971 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php @@ -70,11 +70,11 @@ class TimeDataCollector extends DataCollector * * @return float The elapsed time */ - public function getDuration() + public function getTotalTime() { $lastEvent = $this->data['events']['__section__']; - return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime(); + return $lastEvent->getOrigin() + $lastEvent->getTotalTime() - $this->getStartTime(); } /** diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php new file mode 100755 index 0000000000..bba6ea7b55 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php @@ -0,0 +1,318 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +use Symfony\Component\HttpKernel\Debug\Stopwatch; +use Symfony\Component\HttpKernel\Log\LoggerInterface; +use Symfony\Component\HttpKernel\Profiler\Profile; +use Symfony\Component\HttpKernel\Profiler\Profiler; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\EventDispatcher\Event; +use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; +use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; + +/** + * Extends the ContainerAwareEventDispatcher to add some debugging tools. + * + * @author Fabien Potencier + */ +class ContainerAwareTraceableEventDispatcher extends ContainerAwareEventDispatcher implements TraceableEventDispatcherInterface +{ + private $logger; + private $called; + private $stopwatch; + private $priorities; + private $profiler; + + /** + * Constructor. + * + * @param ContainerInterface $container A ContainerInterface instance + * @param Stopwatch $stopwatch A Stopwatch instance + * @param LoggerInterface $logger A LoggerInterface instance + */ + public function __construct(ContainerInterface $container, Stopwatch $stopwatch, LoggerInterface $logger = null) + { + parent::__construct($container); + + $this->stopwatch = $stopwatch; + $this->logger = $logger; + $this->called = array(); + } + + /** + * {@inheritdoc} + */ + public function dispatch($eventName, Event $event = null) + { + switch ($eventName) { + case 'kernel.request': + $this->stopwatch->openSection(); + break; + case 'kernel.view': + case 'kernel.response': + // stop only if a controller has been executed + try { + $this->stopwatch->stop('controller'); + } catch (\LogicException $e) { + } + break; + case 'kernel.terminate': + $token = $event->getResponse()->headers->get('X-Debug-Token'); + $this->stopwatch->openSection($token); + break; + } + + $e1 = $this->stopwatch->start($eventName, 'section'); + + parent::dispatch($eventName, $event); + + $e1->stop(); + + switch ($eventName) { + case 'kernel.controller': + $this->stopwatch->start('controller', 'section'); + break; + case 'kernel.response': + $token = $event->getResponse()->headers->get('X-Debug-Token'); + $this->stopwatch->stopSection($token); + if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { + // The profiles can only be updated once they have been created + // that is after the 'kernel.response' event of the main request + $this->updateProfiles($token, true); + } + break; + case 'kernel.terminate': + $this->stopwatch->stopSection($token); + // The children profiles have been updated by the previous 'kernel.response' + // event. Only the root profile need to be updated with the 'kernel.terminate' + // timing informations. + $this->updateProfiles($token, false); + break; + } + + return $event; + } + + /** + * {@inheritDoc} + * + * @throws \RuntimeException if the listener method is not callable + */ + public function addListener($eventName, $listener, $priority = 0) + { + if (!is_callable($listener)) { + throw new \RuntimeException(sprintf('The given callback (%s) for event "%s" is not callable.', $this->getListenerAsString($listener), $eventName)); + } + + $this->priorities[$eventName.'_'.$this->getListenerAsString($listener)] = $priority; + + parent::addListener($eventName, $listener, $priority); + } + + /** + * {@inheritDoc} + */ + protected function doDispatch($listeners, $eventName, Event $event) + { + foreach ($listeners as $listener) { + $info = $this->getListenerInfo($listener, $eventName); + + if (null !== $this->logger) { + $this->logger->debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty'])); + } + + $this->called[$eventName.'.'.$info['pretty']] = $info; + + $e2 = $this->stopwatch->start(isset($info['class']) ? substr($info['class'], strrpos($info['class'], '\\') + 1) : $info['type'], 'event_listener'); + + call_user_func($listener, $event); + + $e2->stop(); + + if ($event->isPropagationStopped()) { + if (null !== $this->logger) { + $this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName)); + + $skippedListeners = $this->getListeners($eventName); + $skipped = false; + + foreach ($skippedListeners as $skippedListener) { + if ($skipped) { + $info = $this->getListenerInfo($skippedListener, $eventName); + $this->logger->debug(sprintf('Listener "%s" was not called for event "%s".', $info['pretty'], $eventName)); + } + + if ($skippedListener === $listener) { + $skipped = true; + } + } + } + + break; + } + } + } + + /** + * {@inheritDoc} + */ + protected function lazyLoad($eventName) + { + $e = $this->stopwatch->start($eventName.'.loading', 'event_listener_loading'); + + parent::lazyLoad($eventName); + + $e->stop(); + } + + /** + * {@inheritDoc} + */ + public function getCalledListeners() + { + return $this->called; + } + + /** + * {@inheritDoc} + */ + public function getNotCalledListeners() + { + $notCalled = array(); + + foreach ($this->getListeners() as $name => $listeners) { + foreach ($listeners as $listener) { + $info = $this->getListenerInfo($listener, $name); + if (!isset($this->called[$name.'.'.$info['pretty']])) { + $notCalled[$name.'.'.$info['pretty']] = $info; + } + } + } + + return $notCalled; + } + + /** + * Returns information about the listener + * + * @param object $listener The listener + * @param string $eventName The event name + * + * @return array Informations about the listener + */ + private function getListenerInfo($listener, $eventName) + { + $info = array( + 'event' => $eventName, + 'priority' => $this->priorities[$eventName.'_'.$this->getListenerAsString($listener)], + ); + if ($listener instanceof \Closure) { + $info += array( + 'type' => 'Closure', + 'pretty' => 'closure' + ); + } elseif (is_string($listener)) { + try { + $r = new \ReflectionFunction($listener); + $file = $r->getFileName(); + $line = $r->getStartLine(); + } catch (\ReflectionException $e) { + $file = null; + $line = null; + } + $info += array( + 'type' => 'Function', + 'function' => $listener, + 'file' => $file, + 'line' => $line, + 'pretty' => $listener, + ); + } elseif (is_array($listener) || (is_object($listener) && is_callable($listener))) { + if (!is_array($listener)) { + $listener = array($listener, '__invoke'); + } + $class = is_object($listener[0]) ? get_class($listener[0]) : $listener[0]; + try { + $r = new \ReflectionMethod($class, $listener[1]); + $file = $r->getFileName(); + $line = $r->getStartLine(); + } catch (\ReflectionException $e) { + $file = null; + $line = null; + } + $info += array( + 'type' => 'Method', + 'class' => $class, + 'method' => $listener[1], + 'file' => $file, + 'line' => $line, + 'pretty' => $class.'::'.$listener[1], + ); + } + + return $info; + } + + /** + * Updates the stopwatch data in the profile hierarchy. + * + * @param string $token Profile token + * @param Boolean $updateChildren Whether to update the children altogether + */ + private function updateProfiles($token, $updateChildren) + { + if (!$this->getContainer()->has('profiler')) { + return; + } + + $this->profiler = $this->getContainer()->get('profiler'); + + if (!$profile = $this->profiler->loadProfile($token)) { + return; + } + + $this->saveStopwatchInfoInProfile($profile, $updateChildren); + } + + /** + * Update the profiles with the timing info and saves them. + * + * @param Profile $profile The root profile + * @param Boolean $updateChildren Whether to update the children altogether + */ + private function saveStopwatchInfoInProfile(Profile $profile, $updateChildren) + { + $profile->getCollector('time')->setEvents($this->stopwatch->getSectionEvents($profile->getToken())); + $this->profiler->saveProfile($profile); + + if ($updateChildren) { + foreach ($profile->getChildren() as $child) { + $this->saveStopwatchInfoInProfile($child, true); + } + } + } + + private function getListenerAsString($listener) + { + if (is_string($listener)) { + return '[string] '.$listener; + } elseif (is_array($listener)) { + return '[array] '.(is_object($listener[0]) ? get_class($listener[0]) : $listener[0]).'::'.$listener[1]; + } elseif (is_object($listener)) { + return '[object] '.get_class($listener); + } + + return '[?] '.var_export($listener, true); + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php old mode 100644 new mode 100755 index 50eadfe0a5..605c08626c --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ErrorHandler.php @@ -11,9 +11,6 @@ namespace Symfony\Component\HttpKernel\Debug; -use Symfony\Component\HttpKernel\Exception\FatalErrorException; -use Symfony\Component\HttpKernel\Log\LoggerInterface; - /** * ErrorHandler. * @@ -21,8 +18,6 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface; */ class ErrorHandler { - const TYPE_DEPRECATION = -100; - private $levels = array( E_WARNING => 'Warning', E_NOTICE => 'Notice', @@ -33,19 +28,10 @@ class ErrorHandler E_RECOVERABLE_ERROR => 'Catchable Fatal Error', E_DEPRECATED => 'Deprecated', E_USER_DEPRECATED => 'User Deprecated', - E_ERROR => 'Error', - E_CORE_ERROR => 'Core Error', - E_COMPILE_ERROR => 'Compile Error', - E_PARSE => 'Parse', ); private $level; - private $reservedMemory; - - /** @var LoggerInterface */ - private static $logger; - /** * Register the error handler. * @@ -59,8 +45,6 @@ class ErrorHandler $handler->setLevel($level); set_error_handler(array($handler, 'handle')); - register_shutdown_function(array($handler, 'handleFatal')); - $handler->reservedMemory = str_repeat('x', 10240); return $handler; } @@ -70,11 +54,6 @@ class ErrorHandler $this->level = null === $level ? error_reporting() : $level; } - public static function setLogger(LoggerInterface $logger) - { - self::$logger = $logger; - } - /** * @throws \ErrorException When error_reporting returns error */ @@ -84,51 +63,10 @@ class ErrorHandler return false; } - if ($level & (E_USER_DEPRECATED | E_DEPRECATED)) { - if (null !== self::$logger) { - $deprecation = array( - 'type' => self::TYPE_DEPRECATION, - 'file' => $file, - 'line' => $line, - 'stack' => version_compare(PHP_VERSION, '5.4', '<') - ? array_slice(debug_backtrace(false), 0, 10) - : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10) - ); - - self::$logger->warn($message, $deprecation); - } - - return true; - } - if (error_reporting() & $level && $this->level & $level) { throw new \ErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line), 0, $level, $file, $line); } return false; } - - public function handleFatal() - { - if (null === $error = error_get_last()) { - return; - } - - unset($this->reservedMemory); - $type = $error['type']; - if (0 === $this->level || !in_array($type, array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE))) { - return; - } - - // get current exception handler - $exceptionHandler = set_exception_handler(function() {}); - restore_exception_handler(); - - if (is_array($exceptionHandler) && $exceptionHandler[0] instanceof ExceptionHandler) { - $level = isset($this->levels[$type]) ? $this->levels[$type] : $type; - $message = sprintf('%s: %s in %s line %d', $level, $error['message'], $error['file'], $error['line']); - $exception = new FatalErrorException($message, 0, $type, $error['file'], $error['line']); - $exceptionHandler[0]->handle($exception); - } - } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php old mode 100644 new mode 100755 index cfa624387e..19a684caf7 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php @@ -75,112 +75,112 @@ class ExceptionHandler */ public function createResponse($exception) { - if (!$exception instanceof FlattenException) { - $exception = FlattenException::create($exception); - } + $content = ''; + $title = ''; + try { + if (!$exception instanceof FlattenException) { + $exception = FlattenException::create($exception); + } - return new Response($this->decorate($this->getContent($exception), $this->getStylesheet($exception)), $exception->getStatusCode(), $exception->getHeaders()); - } + switch ($exception->getStatusCode()) { + case 404: + $title = 'Sorry, the page you are looking for could not be found.'; + break; + default: + $title = 'Whoops, looks like something went wrong.'; + } - /** - * Gets the HTML content associated with the given exception. - * - * @param FlattenException $exception A FlattenException instance - * - * @return string The content as a string - */ - public function getContent(FlattenException $exception) - { - switch ($exception->getStatusCode()) { - case 404: - $title = 'Sorry, the page you are looking for could not be found.'; - break; - default: + if ($this->debug) { + $content = $this->getContent($exception); + } + } catch (\Exception $e) { + // something nasty happened and we cannot throw an exception here anymore + if ($this->debug) { + $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage()); + } else { $title = 'Whoops, looks like something went wrong.'; + } } + return new Response($this->decorate($content, $title), $exception->getStatusCode(), $exception->getHeaders()); + } + + private function getContent($exception) + { + $message = nl2br($exception->getMessage()); + $class = $this->abbrClass($exception->getClass()); + $count = count($exception->getAllPrevious()); $content = ''; - if ($this->debug) { - try { - $count = count($exception->getAllPrevious()); - $total = $count + 1; - foreach ($exception->toArray() as $position => $e) { - $ind = $count - $position + 1; - $class = $this->abbrClass($e['class']); - $message = nl2br($e['message']); - $content .= sprintf(<< -

%d/%d %s: %s

- -
-
    + foreach ($exception->toArray() as $position => $e) { + $ind = $count - $position + 1; + $total = $count + 1; + $class = $this->abbrClass($e['class']); + $message = nl2br($e['message']); + $content .= sprintf(<< +

    %d/%d %s: %s

    +
+
+
    EOF - , $ind, $total, $class, $message); - foreach ($e['trace'] as $trace) { - $content .= '
  1. '; - if ($trace['function']) { - $content .= sprintf('at %s%s%s(%s)', $this->abbrClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); - } - if (isset($trace['file']) && isset($trace['line'])) { - if ($linkFormat = ini_get('xdebug.file_link_format')) { - $link = str_replace(array('%f', '%l'), array($trace['file'], $trace['line']), $linkFormat); - $content .= sprintf(' in %s line %s', $link, $trace['file'], $trace['line']); - } else { - $content .= sprintf(' in %s line %s', $trace['file'], $trace['line']); - } - } - $content .= "
  2. \n"; - } - - $content .= "
\n
\n"; + , $ind, $total, $class, $message); + foreach ($e['trace'] as $i => $trace) { + $content .= '
  • '; + if ($trace['function']) { + $content .= sprintf('at %s%s%s(%s)', $this->abbrClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args'])); } - } catch (\Exception $e) { - // something nasty happened and we cannot throw an exception anymore - if ($this->debug) { - $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($exception), $exception->getMessage()); - } else { - $title = 'Whoops, looks like something went wrong.'; + if (isset($trace['file']) && isset($trace['line'])) { + if ($linkFormat = ini_get('xdebug.file_link_format')) { + $link = str_replace(array('%f', '%l'), array($trace['file'], $trace['line']), $linkFormat); + $content .= sprintf(' in %s line %s', $link, $trace['file'], $trace['line']); + } else { + $content .= sprintf(' in %s line %s', $trace['file'], $trace['line']); + } } + $content .= "
  • \n"; } + + $content .= " \n\n"; } - return << -

    $title

    - $content - -EOF; + return $content; } - /** - * Gets the stylesheet associated with the given exception. - * - * @param FlattenException $exception A FlattenException instance - * - * @return string The stylesheet as a string - */ - public function getStylesheet(FlattenException $exception) + private function decorate($content, $title) { return << + + + + + {$title} + - $content +
    +

    $title

    +$content +
    EOF; @@ -253,7 +237,7 @@ EOF; * * @return string */ - private function formatArgs(array $args) + public function formatArgs(array $args) { $result = array(); foreach ($args as $key => $item) { diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/Stopwatch.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/Stopwatch.php new file mode 100755 index 0000000000..7f2673d386 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/Stopwatch.php @@ -0,0 +1,251 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +/** + * Stopwatch provides a way to profile code. + * + * @author Fabien Potencier + */ +class Stopwatch +{ + private $sections; + private $activeSections; + + public function __construct() + { + $this->sections = $this->activeSections = array('__root__' => new Section('__root__')); + } + + /** + * Creates a new section or re-opens an existing section. + * + * @param string|null $id The id of the session to re-open, null to create a new one + * + * @throws \LogicException When the section to re-open is not reachable + */ + public function openSection($id = null) + { + $current = end($this->activeSections); + + if (null !== $id && null === $current->get($id)) { + throw new \LogicException(sprintf('The section "%s" has been started at an other level and can not be opened.', $id)); + } + + $this->start('__section__.child', 'section'); + $this->activeSections[] = $current->open($id); + $this->start('__section__'); + } + + /** + * Stops the last started section. + * + * The id parameter is used to retrieve the events from this section. + * + * @see getSectionEvents + * + * @param string $id The identifier of the section + */ + public function stopSection($id) + { + $this->stop('__section__'); + + if (1 == count($this->activeSections)) { + throw new \LogicException('There is no started section to stop.'); + } + + $this->sections[$id] = array_pop($this->activeSections)->setId($id); + $this->stop('__section__.child'); + } + + /** + * Starts an event. + * + * @param string $name The event name + * @param string $category The event category + * + * @return StopwatchEvent A StopwatchEvent instance + */ + public function start($name, $category = null) + { + return end($this->activeSections)->startEvent($name, $category); + } + + /** + * Stops an event. + * + * @param string $name The event name + * + * @return StopwatchEvent A StopwatchEvent instance + */ + public function stop($name) + { + return end($this->activeSections)->stopEvent($name); + } + + /** + * Stops then restarts an event. + * + * @param string $name The event name + * + * @return StopwatchEvent A StopwatchEvent instance + */ + public function lap($name) + { + return end($this->activeSections)->stopEvent($name)->start(); + } + + /** + * Gets all events for a given section. + * + * @param string $id A section identifier + * + * @return StopwatchEvent[] An array of StopwatchEvent instances + */ + public function getSectionEvents($id) + { + return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : array(); + } +} + +class Section +{ + private $events = array(); + private $origin; + private $id; + private $children = array(); + + /** + * Constructor. + * + * @param float|null $origin Set the origin of the events in this section, use null to set their origin to their start time + */ + public function __construct($origin = null) + { + $this->origin = is_numeric($origin) ? $origin : null; + } + + /** + * Returns the child section. + * + * @param string $id The child section identifier + * + * @return Section|null The child section or null when none found + */ + public function get($id) + { + foreach ($this->children as $child) { + if ($id === $child->getId()) { + return $child; + } + } + + return null; + } + + /** + * 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. + * + * @return Section A child section + */ + public function open($id) + { + if (null === $session = $this->get($id)) { + $session = $this->children[] = new self(microtime(true) * 1000); + } + + return $session; + } + + /** + * @return string The identifier of the section + */ + public function getId() + { + return $this->id; + } + + /** + * Sets the session identifier. + * + * @param string $id The session identifier + * + * @return Section The current section + */ + public function setId($id) + { + $this->id = $id; + + return $this; + } + + /** + * Starts an event. + * + * @param string $name The event name + * @param string $category The event category + * + * @return StopwatchEvent The event + */ + public function startEvent($name, $category) + { + if (!isset($this->events[$name])) { + $this->events[$name] = new StopwatchEvent($this->origin ?: microtime(true) * 1000, $category); + } + + return $this->events[$name]->start(); + } + + /** + * Stops an event. + * + * @param string $name The event name + * + * @return StopwatchEvent The event + * + * @throws \LogicException When the event has not been started + */ + public function stopEvent($name) + { + if (!isset($this->events[$name])) { + throw new \LogicException(sprintf('Event "%s" is not started.', $name)); + } + + return $this->events[$name]->stop(); + } + + /** + * Stops then restarts an event. + * + * @param string $name The event name + * + * @return StopwatchEvent The event + * + * @throws \LogicException When the event has not been started + */ + public function lap($name) + { + return $this->stop($name)->start(); + } + + /** + * Returns the events from this section. + * + * @return StopwatchEvent[] An array of StopwatchEvent instances + */ + public function getEvents() + { + return $this->events; + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php new file mode 100755 index 0000000000..200c465bac --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php @@ -0,0 +1,182 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Debug; + +/** + * Represents an Event managed by Stopwatch. + * + * @author Fabien Potencier + */ +class StopwatchEvent +{ + private $periods; + private $origin; + private $category; + private $started; + + /** + * Constructor. + * + * @param float $origin The origin time in milliseconds + * @param string $category The event category + * + * @throws \InvalidArgumentException When the raw time is not valid + */ + public function __construct($origin, $category = null) + { + $this->origin = $this->formatTime($origin); + $this->category = is_string($category) ? $category : 'default'; + $this->started = array(); + $this->periods = array(); + } + + /** + * Gets the category. + * + * @return string The category + */ + public function getCategory() + { + return $this->category; + } + + /** + * Gets the origin. + * + * @return integer The origin in milliseconds + */ + public function getOrigin() + { + return $this->origin; + } + + /** + * Starts a new event period. + * + * @return StopwatchEvent The event + */ + public function start() + { + $this->started[] = $this->getNow(); + + return $this; + } + + /** + * Stops the last started event period. + * + * @return StopwatchEvent The event + */ + public function stop() + { + if (!count($this->started)) { + throw new \LogicException('stop() called but start() has not been called before.'); + } + + $this->periods[] = array(array_pop($this->started), $this->getNow()); + + return $this; + } + + /** + * Stops the current period and then starts a new one. + * + * @return StopwatchEvent The event + */ + public function lap() + { + return $this->stop()->start(); + } + + /** + * Stops all non already stopped periods. + */ + public function ensureStopped() + { + while (count($this->started)) { + $this->stop(); + } + } + + /** + * Gets all event periods. + * + * @return array An array of periods + */ + public function getPeriods() + { + return $this->periods; + } + + /** + * Gets the relative time of the start of the first period. + * + * @return integer The time (in milliseconds) + */ + public function getStartTime() + { + return isset($this->periods[0]) ? $this->periods[0][0] : 0; + } + + /** + * Gets the relative time of the end of the last period. + * + * @return integer The time (in milliseconds) + */ + public function getEndTime() + { + return ($count = count($this->periods)) ? $this->periods[$count - 1][1] : 0; + } + + /** + * Gets the total time of all periods. + * + * @return integer The time (in milliseconds) + */ + public function getTotalTime() + { + $total = 0; + foreach ($this->periods as $period) { + $total += $period[1] - $period[0]; + } + + return $this->formatTime($total); + } + + /** + * Return the current time relative to origin. + * + * @return float Time in ms + */ + protected function getNow() + { + return $this->formatTime(microtime(true) * 1000 - $this->origin); + } + + /** + * Formats a time. + * + * @param numerical $time A raw time + * + * @return float The formatted time + * + * @throws \InvalidArgumentException When the raw time is not valid + */ + private function formatTime($time) + { + if (!is_numeric($time)) { + throw new \InvalidArgumentException('The time must be a numerical value'); + } + + return round($time, 1); + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/AddClassesToCachePass.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php old mode 100644 new mode 100755 index 2ca0f13284..5c8d5e69ad --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/Extension.php @@ -11,14 +11,19 @@ namespace Symfony\Component\HttpKernel\DependencyInjection; -use Symfony\Component\DependencyInjection\Extension\Extension as BaseExtension; +use Symfony\Component\Config\Definition\Processor; +use Symfony\Component\Config\Definition\ConfigurationInterface; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Container; /** - * Allow adding classes to the class cache. + * Provides useful features shared by many extensions. * * @author Fabien Potencier */ -abstract class Extension extends BaseExtension +abstract class Extension implements ExtensionInterface, ConfigurationExtensionInterface { private $classes = array(); @@ -41,4 +46,80 @@ abstract class Extension extends BaseExtension { $this->classes = array_merge($this->classes, $classes); } + + /** + * Returns the base path for the XSD files. + * + * @return string The XSD base path + */ + public function getXsdValidationBasePath() + { + return false; + } + + /** + * Returns the namespace to be used for this extension (XML namespace). + * + * @return string The XML namespace + */ + public function getNamespace() + { + return 'http://example.org/schema/dic/'.$this->getAlias(); + } + + /** + * Returns the recommended alias to use in XML. + * + * This alias is also the mandatory prefix to use when using YAML. + * + * This convention is to remove the "Extension" postfix from the class + * name and then lowercase and underscore the result. So: + * + * AcmeHelloExtension + * + * becomes + * + * acme_hello + * + * This can be overridden in a sub-class to specify the alias manually. + * + * @return string The alias + */ + public function getAlias() + { + $className = get_class($this); + if (substr($className, -9) != 'Extension') { + throw new \BadMethodCallException('This extension does not follow the naming convention; you must overwrite the getAlias() method.'); + } + $classBaseName = substr(strrchr($className, '\\'), 1, -9); + + return Container::underscore($classBaseName); + } + + final protected function processConfiguration(ConfigurationInterface $configuration, array $configs) + { + $processor = new Processor(); + + return $processor->processConfiguration($configuration, $configs); + } + + /** + * {@inheritDoc} + */ + public function getConfiguration(array $config, ContainerBuilder $container) + { + $reflected = new \ReflectionClass($this); + $namespace = $reflected->getNamespaceName(); + + $class = $namespace . '\\Configuration'; + if (class_exists($class)) { + if (!method_exists($class, '__construct')) { + $configuration = new $class(); + + return $configuration; + } + } + + return null; + } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php old mode 100644 new mode 100755 index a71f504d99..bcabcf32d5 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForControllerResultEvent.php @@ -29,7 +29,6 @@ class GetResponseForControllerResultEvent extends GetResponseEvent { /** * The return value of the controller - * * @var mixed */ private $controllerResult; @@ -42,7 +41,7 @@ class GetResponseForControllerResultEvent extends GetResponseEvent } /** - * Returns the return value of the controller. + * Returns the return value of the controller * * @return mixed The controller return value * @@ -52,16 +51,4 @@ class GetResponseForControllerResultEvent extends GetResponseEvent { return $this->controllerResult; } - - /** - * Assigns the return value of the controller. - * - * @param array The controller return value - * - * @api - */ - public function setControllerResult(array $controllerResult) - { - $this->controllerResult = $controllerResult; - } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/GetResponseForExceptionEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/KernelEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Event/PostResponseEvent.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/EsiListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/LocaleListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ResponseListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/RouterListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/StreamedResponseListener.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/AccessDeniedHttpException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php old mode 100644 new mode 100755 index 367b549440..c42cb09baf --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/FlattenException.php @@ -47,7 +47,7 @@ class FlattenException $e->setStatusCode($statusCode); $e->setHeaders($headers); - $e->setTraceFromException($exception); + $e->setTrace($exception->getTrace(), $exception->getFile(), $exception->getLine()); $e->setClass(get_class($exception)); $e->setFile($exception->getFile()); $e->setLine($exception->getLine()); @@ -168,40 +168,6 @@ class FlattenException return $this->trace; } - public function setTraceFromException(\Exception $exception) - { - $trace = $exception->getTrace(); - - if ($exception instanceof FatalErrorException) { - if (function_exists('xdebug_get_function_stack')) { - $trace = array_slice(array_reverse(xdebug_get_function_stack()), 4); - - foreach ($trace as $i => $frame) { - // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695 - if (!isset($frame['type'])) { - $trace[$i]['type'] = '??'; - } - - if ('dynamic' === $trace[$i]['type']) { - $trace[$i]['type'] = '->'; - } elseif ('static' === $trace[$i]['type']) { - $trace[$i]['type'] = '::'; - } - - // XDebug also has a different name for the parameters array - if (isset($frame['params']) && !isset($frame['args'])) { - $trace[$i]['args'] = $frame['params']; - unset($trace[$i]['params']); - } - } - } else { - $trace = array_slice(array_reverse($trace), 1); - } - } - - $this->setTrace($trace, $exception->getFile(), $exception->getLine()); - } - public function setTrace($trace, $file, $line) { $this->trace = array(); @@ -229,7 +195,7 @@ class FlattenException 'short_class' => $class, 'class' => isset($entry['class']) ? $entry['class'] : '', 'type' => isset($entry['type']) ? $entry['type'] : '', - 'function' => $entry['function'], + 'function' => isset($entry['function']) ? $entry['function'] : null, 'file' => isset($entry['file']) ? $entry['file'] : null, 'line' => isset($entry['line']) ? $entry['line'] : null, 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(), @@ -255,9 +221,6 @@ class FlattenException $result[$key] = array('boolean', $value); } elseif (is_resource($value)) { $result[$key] = array('resource', get_resource_type($value)); - } elseif ($value instanceof \__PHP_Incomplete_Class) { - // Special case of object, is_object will return false - $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value)); } else { $result[$key] = array('string', (string) $value); } @@ -265,11 +228,4 @@ class FlattenException return $result; } - - private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value) - { - $array = new \ArrayObject($value); - - return $array['__PHP_Incomplete_Class_Name']; - } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/HttpExceptionInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/MethodNotAllowedHttpException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Exception/NotFoundHttpException.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php old mode 100644 new mode 100755 index 0ab9ea0a25..e1a0e6a271 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -34,9 +34,9 @@ class Esi * Constructor. * * @param array $contentTypes An array of content-type that should be parsed for ESI information. - * (default: text/html, text/xml, application/xhtml+xml, and application/xml) + * (default: text/html, text/xml, and application/xml) */ - public function __construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml')) + public function __construct(array $contentTypes = array('text/html', 'text/xml', 'application/xml')) { $this->contentTypes = $contentTypes; } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategyInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php old mode 100644 new mode 100755 index 649f4ffe69..ec66dcd5fc --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -515,7 +515,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface // wait for the lock to be released $wait = 0; - while ($this->store->isLocked($request) && $wait < 5000000) { + while (is_file($lock) && $wait < 5000000) { usleep(50000); $wait += 50000; } @@ -580,7 +580,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface */ private function restoreResponseBody(Request $request, Response $response) { - if ($request->isMethod('HEAD') || 304 === $response->getStatusCode()) { + if ('HEAD' === $request->getMethod() || 304 === $response->getStatusCode()) { $response->setContent(null); $response->headers->remove('X-Body-Eval'); $response->headers->remove('X-Body-File'); diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php old mode 100644 new mode 100755 index 2d1df30a7c..1b624230d4 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -71,13 +71,7 @@ class Store implements StoreInterface */ public function lock(Request $request) { - $path = $this->getPath($this->getCacheKey($request).'.lck'); - if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) { - return false; - } - - $lock = @fopen($path, 'x'); - if (false !== $lock) { + if (false !== $lock = @fopen($path = $this->getPath($this->getCacheKey($request).'.lck'), 'x')) { fclose($lock); $this->locks[] = $path; @@ -85,7 +79,7 @@ class Store implements StoreInterface return true; } - return !file_exists($path) ?: $path; + return $path; } /** @@ -102,11 +96,6 @@ class Store implements StoreInterface return is_file($file) ? @unlink($file) : false; } - public function isLocked(Request $request) - { - return is_file($this->getPath($this->getCacheKey($request).'.lck')); - } - /** * Locates a cached Response for the Request provided. * diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php old mode 100644 new mode 100755 index 29a54d8725..9284170462 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/StoreInterface.php @@ -71,15 +71,6 @@ interface StoreInterface */ public function unlock(Request $request); - /** - * Returns whether or not a lock exists. - * - * @param Request $request A Request instance - * - * @return Boolean true if lock exists, false otherwise - */ - public function isLocked(Request $request); - /** * Purges data for the given URL. * diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernelInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php old mode 100644 new mode 100755 index 73473cf3f8..8eaf8699e6 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Kernel.php @@ -46,11 +46,7 @@ use Symfony\Component\ClassLoader\DebugClassLoader; */ abstract class Kernel implements KernelInterface, TerminableInterface { - /** - * @var BundleInterface[] - */ protected $bundles; - protected $bundleMap; protected $container; protected $rootDir; @@ -62,11 +58,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $classes; protected $errorReportingLevel; - const VERSION = '2.2.0-DEV'; - const VERSION_ID = '20100'; + const VERSION = '2.1.5-DEV'; + const VERSION_ID = '20105'; const MAJOR_VERSION = '2'; - const MINOR_VERSION = '2'; - const RELEASE_VERSION = '0'; + const MINOR_VERSION = '1'; + const RELEASE_VERSION = '5'; const EXTRA_VERSION = 'DEV'; /** @@ -95,18 +91,17 @@ abstract class Kernel implements KernelInterface, TerminableInterface public function init() { - ini_set('display_errors', 0); - if ($this->debug) { + ini_set('display_errors', 1); error_reporting(-1); DebugClassLoader::enable(); ErrorHandler::register($this->errorReportingLevel); if ('cli' !== php_sapi_name()) { ExceptionHandler::register(); - } else { - ini_set('display_errors', 1); } + } else { + ini_set('display_errors', 0); } } @@ -162,7 +157,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Shutdowns the kernel. + * + * This method is mainly useful when doing functional testing. * * @api */ @@ -207,7 +204,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the registered bundle instances. + * + * @return array An array of registered bundle instances * * @api */ @@ -217,7 +216,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Checks if a given class name belongs to an active bundle. + * + * @param string $class A class name + * + * @return Boolean true if the class belongs to an active bundle, false otherwise * * @api */ @@ -233,7 +236,14 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Returns a bundle and optionally its descendants by its name. + * + * @param string $name Bundle name + * @param Boolean $first Whether to return the first bundle only or together with its descendants + * + * @return BundleInterface|Array A BundleInterface instance or an array of BundleInterface instances if $first is false + * + * @throws \InvalidArgumentException when the bundle is not enabled * * @api */ @@ -336,7 +346,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the name of the kernel + * + * @return string The kernel name * * @api */ @@ -350,7 +362,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the environment. + * + * @return string The current environment * * @api */ @@ -360,7 +374,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Checks if debug mode is enabled. + * + * @return Boolean true if debug mode is enabled, false otherwise * * @api */ @@ -370,7 +386,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the application root dir. + * + * @return string The application root dir * * @api */ @@ -385,7 +403,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the current container. + * + * @return ContainerInterface A ContainerInterface instance * * @api */ @@ -416,7 +436,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the request start time (not available if debug is disabled). + * + * @return integer The request start timestamp * * @api */ @@ -426,7 +448,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the cache directory. + * + * @return string The cache directory * * @api */ @@ -436,7 +460,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the log directory. + * + * @return string The log directory * * @api */ @@ -446,7 +472,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * {@inheritdoc} + * Gets the charset of the application. + * + * @return string The charset * * @api */ @@ -730,26 +758,17 @@ abstract class Kernel implements KernelInterface, TerminableInterface return $source; } - $rawChunk = ''; $output = ''; - $tokens = token_get_all($source); - for (reset($tokens); false !== $token = current($tokens); next($tokens)) { + foreach (token_get_all($source) as $token) { if (is_string($token)) { - $rawChunk .= $token; - } elseif (T_START_HEREDOC === $token[0]) { - $output .= preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $rawChunk) . $token[1]; - do { - $token = next($tokens); - $output .= $token[1]; - } while ($token[0] !== T_END_HEREDOC); - $rawChunk = ''; + $output .= $token; } elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) { - $rawChunk .= $token[1]; + $output .= $token[1]; } } // replace multiple new lines with a single newline - $output .= preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $rawChunk); + $output = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $output); return $output; } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelEvents.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php old mode 100644 new mode 100755 index dd37b60e03..4010a3020e --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/KernelInterface.php @@ -30,7 +30,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable /** * Returns an array of bundles to registers. * - * @return BundleInterface[] An array of bundle instances. + * @return array An array of bundle instances. * * @api */ @@ -64,7 +64,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable /** * Gets the registered bundle instances. * - * @return BundleInterface[] An array of registered bundle instances + * @return array An array of registered bundle instances * * @api */ @@ -87,7 +87,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable * @param string $name Bundle name * @param Boolean $first Whether to return the first bundle only or together with its descendants * - * @return BundleInterface|BundleInterface[] A BundleInterface instance or an array of BundleInterface instances if $first is false + * @return BundleInterface|Array A BundleInterface instance or an array of BundleInterface instances if $first is false * * @throws \InvalidArgumentException when the bundle is not enabled * diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/LICENSE old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/DebugLoggerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/LoggerInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Log/NullLogger.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php old mode 100644 new mode 100755 index 7e4553c3e4..94b81c2ddb --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php @@ -32,7 +32,14 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface } /** - * {@inheritdoc} + * Finds profiler tokens for the given criteria. + * + * @param string $ip The IP + * @param string $url The URL + * @param string $limit The maximum number of tokens to return + * @param string $method The request method + * + * @return array An array of tokens */ public function find($ip, $url, $limit, $method) { @@ -47,7 +54,7 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface } /** - * {@inheritdoc} + * Purges all data from the database. */ public function purge() { @@ -55,7 +62,13 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface } /** - * {@inheritdoc} + * Reads data associated with the given token. + * + * The method returns false if the token does not exists in the storage. + * + * @param string $token A token + * + * @return Profile The profile associated with token */ public function read($token) { @@ -69,7 +82,11 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface } /** - * {@inheritdoc} + * Saves a Profile. + * + * @param Profile $profile A Profile instance + * + * @return Boolean Write operation successful */ public function write(Profile $profile) { @@ -85,7 +102,9 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface 'time' => $profile->getTime() ); - return $this->getMongo()->update(array('_id' => $profile->getToken()), array_filter($record, function ($v) { return !empty($v); }), array('upsert' => true)); + $result = $this->getMongo()->update(array('_id' => $profile->getToken()), array_filter($record, function ($v) { return !empty($v); }), array('upsert' => true)); + + return (boolean) (isset($result['ok']) ? $result['ok'] : $result); } /** @@ -97,12 +116,15 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface { if ($this->mongo === null) { if (preg_match('#^(mongodb://.*)/(.*)/(.*)$#', $this->dsn, $matches)) { - $mongo = new \Mongo($matches[1] . (!empty($matches[2]) ? '/' . $matches[2] : '')); + $server = $matches[1] . (!empty($matches[2]) ? '/' . $matches[2] : ''); $database = $matches[2]; $collection = $matches[3]; + + $mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? '\Mongo' : '\MongoClient'; + $mongo = new $mongoClass($server); $this->mongo = $mongo->selectCollection($database, $collection); } else { - throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use MongoDB with an invalid dsn "%s". The expected format is "mongodb://user:pass@location/database/collection"', $this->dsn)); + throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use MongoDB with an invalid dsn "%s". The expected format is "mongodb://[user:pass@]host/database/collection"', $this->dsn)); } } @@ -111,7 +133,6 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface /** * @param array $data - * * @return Profile */ protected function createProfileFromData(array $data) @@ -132,8 +153,7 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface /** * @param string $token - * - * @return Profile[] An array of Profile instances + * @return array */ protected function readChildren($token) { @@ -156,7 +176,6 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface * @param string $ip * @param string $url * @param string $method - * * @return array */ private function buildQuery($ip, $url, $method) @@ -180,7 +199,6 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface /** * @param array $data - * * @return array */ private function getData(array $data) @@ -198,7 +216,6 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface /** * @param array $data - * * @return Profile */ private function getProfile(array $data) diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/MysqlProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php old mode 100644 new mode 100755 index 36dcab8ecc..b7bc617690 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -216,7 +216,7 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface * @param string $token The parent token * @param string $parent The parent instance * - * @return Profile[] An array of Profile instance + * @return array An array of Profile instance */ protected function readChildren($token, $parent) { diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php old mode 100644 new mode 100755 index e24c725144..bed24f1d10 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -21,26 +21,13 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; class Profile { private $token; - - /** - * @var DataCollectorInterface[] - */ - private $collectors = array(); - + private $collectors; private $ip; private $method; private $url; private $time; - - /** - * @var Profile - */ private $parent; - - /** - * @var Profile[] - */ - private $children = array(); + private $children; /** * Constructor. @@ -50,6 +37,8 @@ class Profile public function __construct($token) { $this->token = $token; + $this->collectors = array(); + $this->children = array(); } /** @@ -112,11 +101,6 @@ class Profile return $this->ip; } - /** - * Sets the IP. - * - * @param string $ip - */ public function setIp($ip) { $this->ip = $ip; @@ -170,18 +154,13 @@ class Profile /** * Finds children profilers. * - * @return Profile[] An array of Profile + * @return array An array of Profile */ public function getChildren() { return $this->children; } - /** - * Sets children profiler. - * - * @param Profile[] $children An array of Profile - */ public function setChildren(array $children) { $this->children = array(); @@ -201,15 +180,6 @@ class Profile $child->setParent($this); } - /** - * Gets a Collector by name. - * - * @param string $name A collector name - * - * @return DataCollectorInterface A DataCollectorInterface instance - * - * @throws \InvalidArgumentException if the collector does not exist - */ public function getCollector($name) { if (!isset($this->collectors[$name])) { @@ -219,21 +189,11 @@ class Profile return $this->collectors[$name]; } - /** - * Gets the Collectors associated with this profile. - * - * @return DataCollectorInterface[] - */ public function getCollectors() { return $this->collectors; } - /** - * Sets the Collectors associated with this profile. - * - * @param DataCollectorInterface[] $collectors - */ public function setCollectors(array $collectors) { $this->collectors = array(); @@ -242,23 +202,11 @@ class Profile } } - /** - * Adds a Collector. - * - * @param DataCollectorInterface $collector A DataCollectorInterface instance - */ public function addCollector(DataCollectorInterface $collector) { $this->collectors[$collector->getName()] = $collector; } - /** - * Returns true if a Collector for the given name exists. - * - * @param string $name A collector name - * - * @return Boolean - */ public function hasCollector($name) { return isset($this->collectors[$name]); diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php old mode 100644 new mode 100755 index aa336a8b04..e3ec45fe41 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -24,25 +24,10 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface; */ class Profiler { - /** - * @var ProfilerStorageInterface - */ private $storage; - - /** - * @var DataCollectorInterface[] - */ - private $collectors = array(); - - /** - * @var LoggerInterface - */ + private $collectors; private $logger; - - /** - * @var Boolean - */ - private $enabled = true; + private $enabled; /** * Constructor. @@ -54,6 +39,8 @@ class Profiler { $this->storage = $storage; $this->logger = $logger; + $this->collectors = array(); + $this->enabled = true; } /** @@ -64,14 +51,6 @@ class Profiler $this->enabled = false; } - /** - * Enables the profiler. - */ - public function enable() - { - $this->enabled = true; - } - /** * Loads the Profile for the given Response. * @@ -217,7 +196,7 @@ class Profiler /** * Sets the Collectors associated with this profiler. * - * @param DataCollectorInterface[] $collectors An array of collectors + * @param array $collectors An array of collectors */ public function set(array $collectors = array()) { diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Profiler/SqliteProfilerStorage.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md old mode 100644 new mode 100755 index e0f3c987c4..c44d530858 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md @@ -84,6 +84,9 @@ Resources You can run the unit tests with the following command: - $ cd path/to/Symfony/Component/HttpKernel/ - $ composer.phar install --dev - $ phpunit + phpunit + +If you also want to run the unit tests that depend on other Symfony +Components, install dev dependencies before running PHPUnit: + + php composer.phar install --dev diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/TerminableInterface.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheClearer/ChainCacheClearerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/CacheWarmer/CacheWarmerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/ClientTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php old mode 100644 new mode 100755 index 5a0166d39e..f517c12b2f --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -53,9 +53,7 @@ class ConfigDataCollectorTest extends \PHPUnit_Framework_TestCase || (extension_loaded('apc') && ini_get('apc.enabled')) || - (extension_loaded('xcache') && ini_get('xcache.cacher')) - || - (extension_loaded('wincache') && ini_get('wincache.ocenabled')))) { + (extension_loaded('xcache') && ini_get('xcache.cacher')))) { $this->assertTrue($c->hasAccelerator()); } else { $this->assertFalse($c->hasAccelerator()); diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php new file mode 100755 index 0000000000..67702c7e96 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\DataCollector; + +use Symfony\Component\HttpKernel\DataCollector\EventDataCollector; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\HttpKernel\Tests\Fixtures\TestEventDispatcher; + +class EventDataCollectorTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { + $this->markTestSkipped('The "EventDispatcher" component is not available'); + } + + if (!class_exists('Symfony\Component\HttpFoundation\Request')) { + $this->markTestSkipped('The "HttpFoundation" component is not available'); + } + } + + public function testCollect() + { + $c = new EventDataCollector(); + $c->setEventDispatcher(new TestEventDispatcher()); + + $c->collect(new Request(), new Response()); + + $this->assertSame('events',$c->getName()); + $this->assertSame(array('foo'),$c->getCalledListeners()); + $this->assertSame(array('bar'),$c->getNotCalledListeners()); + } + +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php old mode 100644 new mode 100755 index ea82d9d315..a4b853c3ed --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php @@ -12,7 +12,6 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector; -use Symfony\Component\HttpKernel\Debug\ErrorHandler; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -28,19 +27,18 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase /** * @dataProvider getCollectTestData */ - public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount) + public function testCollect($nb, $logs, $expected) { $logger = $this->getMock('Symfony\Component\HttpKernel\Log\DebugLoggerInterface'); $logger->expects($this->once())->method('countErrors')->will($this->returnValue($nb)); - $logger->expects($this->exactly(2))->method('getLogs')->will($this->returnValue($logs)); + $logger->expects($this->once())->method('getLogs')->will($this->returnValue($logs)); $c = new LoggerDataCollector($logger); $c->collect(new Request(), new Response()); $this->assertSame('logger', $c->getName()); $this->assertSame($nb, $c->countErrors()); - $this->assertSame($expectedLogs ? $expectedLogs : $logs, $c->getLogs()); - $this->assertSame($expectedDeprecationCount, $c->countDeprecations()); + $this->assertSame($expected ? $expected : $logs, $c->getLogs()); } public function getCollectTestData() @@ -50,28 +48,16 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase 1, array(array('message' => 'foo', 'context' => array())), null, - 0 ), array( 1, array(array('message' => 'foo', 'context' => array('foo' => fopen(__FILE__, 'r')))), array(array('message' => 'foo', 'context' => array('foo' => 'Resource(stream)'))), - 0 ), array( 1, array(array('message' => 'foo', 'context' => array('foo' => new \stdClass()))), array(array('message' => 'foo', 'context' => array('foo' => 'Object(stdClass)'))), - 0 - ), - array( - 1, - array( - array('message' => 'foo', 'context' => array('type' => ErrorHandler::TYPE_DEPRECATION)), - array('message' => 'foo2', 'context' => array('type' => ErrorHandler::TYPE_DEPRECATION)) - ), - null, - 2 ), ); } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php old mode 100644 new mode 100755 index 10322b132d..538d077d2c --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -11,14 +11,10 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; -use Symfony\Component\HttpKernel\HttpKernel; -use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Cookie; -use Symfony\Component\EventDispatcher\EventDispatcher; class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase { @@ -47,102 +43,12 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Symfony\Component\HttpFoundation\ParameterBag',$c->getRequestQuery()); $this->assertEquals('html',$c->getFormat()); $this->assertEquals(array(),$c->getSessionAttributes()); - $this->assertEquals('en',$c->getLocale()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\HeaderBag',$c->getResponseHeaders()); $this->assertEquals(200,$c->getStatusCode()); $this->assertEquals('application/json',$c->getContentType()); } - /** - * Test various types of controller callables. - * - * @dataProvider provider - */ - public function testControllerInspection(Request $request, Response $response) - { - // make sure we always match the line number - $r1 = new \ReflectionMethod($this, 'testControllerInspection'); - $r2 = new \ReflectionMethod($this, 'staticControllerMethod'); - // test name, callable, expected - $controllerTests = array( - array( - '"Regular" callable', - array($this, 'testControllerInspection'), - array( - 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', - 'method' => 'testControllerInspection', - 'file' => __FILE__, - 'line' => $r1->getStartLine() - ), - ), - - array( - 'Closure', - function() { return 'foo'; }, - 'Closure', - ), - - array( - 'Static callback as string', - 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod', - 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest::staticControllerMethod', - ), - - array( - 'Static callable with instance', - array($this, 'staticControllerMethod'), - array( - 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', - 'method' => 'staticControllerMethod', - 'file' => __FILE__, - 'line' => $r2->getStartLine() - ), - ), - - array( - 'Static callable with class name', - array('Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'staticControllerMethod'), - array( - 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', - 'method' => 'staticControllerMethod', - 'file' => __FILE__, - 'line' => $r2->getStartLine() - ), - ), - - array( - 'Callable with instance depending on __call()', - array($this, 'magicMethod'), - array( - 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', - 'method' => 'magicMethod', - 'file' => 'n/a', - 'line' => 'n/a' - ), - ), - - array( - 'Callable with class name depending on __callStatic()', - array('Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'magicMethod'), - array( - 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', - 'method' => 'magicMethod', - 'file' => 'n/a', - 'line' => 'n/a' - ), - ), - ); - - $c = new RequestDataCollector(); - - foreach ($controllerTests as $controllerTest) { - $this->injectController($c, $controllerTest[1], $request); - $c->collect($request, $response); - $this->assertEquals($controllerTest[2], $c->getController(), sprintf('Testing: %s', $controllerTest[0])); - } - } - public function provider() { if (!class_exists('Symfony\Component\HttpFoundation\Request')) { @@ -164,39 +70,4 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase ); } - /** - * Inject the given controller callable into the data collector. - */ - protected function injectController($collector, $controller, $request) - { - $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); - $httpKernel = new HttpKernel(new EventDispatcher(), $resolver); - $event = new FilterControllerEvent($httpKernel, $controller, $request, HttpKernelInterface::MASTER_REQUEST); - $collector->onKernelController($event); - } - - /** - * Dummy method used as controller callable - */ - public static function staticControllerMethod() - { - throw new \LogicException('Unexpected method call'); - } - - /** - * Magic method to allow non existing methods to be called and delegated. - */ - public function __call($method, $args) - { - throw new \LogicException('Unexpected method call'); - } - - /** - * Magic method to allow non existing methods to be called and delegated. - */ - public static function __callStatic($method, $args) - { - throw new \LogicException('Unexpected method call'); - } - } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php new file mode 100755 index 0000000000..40c54e56a5 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ContainerAwareTraceableEventDispatcherTest.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\Debug; + +use Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher; +use Symfony\Component\HttpKernel\Debug\Stopwatch; + +class ContainerAwareTraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase +{ + protected function setUp() + { + if (!class_exists('Symfony\Component\DependencyInjection\Container')) { + $this->markTestSkipped('The "DependencyInjection" component is not available'); + } + + if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { + $this->markTestSkipped('The "HttpKernel" component is not available'); + } + } + + /** + * @expectedException \RuntimeException + */ + public function testThrowsAnExceptionWhenAListenerMethodIsNotCallable() + { + $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $dispatcher = new ContainerAwareTraceableEventDispatcher($container, new Stopwatch()); + $dispatcher->addListener('onFooEvent', new \stdClass()); + } + + public function testClosureDoesNotTriggerErrorNotice() + { + $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $dispatcher = new ContainerAwareTraceableEventDispatcher($container, new StopWatch()); + $triggered = false; + + $dispatcher->addListener('onFooEvent', function() use (&$triggered) { + $triggered = true; + }); + + try { + $dispatcher->dispatch('onFooEvent'); + } catch (\PHPUnit_Framework_Error_Notice $e) { + $this->fail($e->getMessage()); + } + + $this->assertTrue($triggered, 'Closure should have been executed upon dispatch'); + } + + public function testStaticCallable() + { + $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $dispatcher = new ContainerAwareTraceableEventDispatcher($container, new StopWatch()); + + $dispatcher->addListener('onFooEvent', array(__NAMESPACE__.'\StaticClassFixture', 'staticListener')); + + $dispatcher->dispatch('onFooEvent'); + + $this->assertTrue(StaticClassFixture::$called); + } +} + +class StaticClassFixture +{ + public static $called = false; + + public static function staticListener($event) + { + self::$called = true; + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php old mode 100644 new mode 100755 index fdd02eaaf5..0eb2d79d4c --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ErrorHandlerTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\HttpKernel\Tests\Debug; use Symfony\Component\HttpKernel\Debug\ErrorHandler; +use Symfony\Component\HttpKernel\Debug\ErrorException; /** * ErrorHandlerTest @@ -47,51 +48,14 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase $handler = ErrorHandler::register(3); try { - $handler->handle(111, 'foo', 'foo.php', 12, 'foo'); + $handler->handle(1, 'foo', 'foo.php', 12, 'foo'); } catch (\ErrorException $e) { - $this->assertSame('111: foo in foo.php line 12', $e->getMessage()); - $this->assertSame(111, $e->getSeverity()); + $this->assertSame('1: foo in foo.php line 12', $e->getMessage()); + $this->assertSame(1, $e->getSeverity()); $this->assertSame('foo.php', $e->getFile()); $this->assertSame(12, $e->getLine()); } restore_error_handler(); - - $handler = ErrorHandler::register(E_USER_DEPRECATED); - $this->assertTrue($handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, 'foo')); - - restore_error_handler(); - - $handler = ErrorHandler::register(E_DEPRECATED); - $this->assertTrue($handler->handle(E_DEPRECATED, 'foo', 'foo.php', 12, 'foo')); - - restore_error_handler(); - - $logger = $this->getMock('Symfony\Component\HttpKernel\Log\LoggerInterface'); - - $that = $this; - $warnArgCheck = function($message, $context) use ($that) { - $that->assertEquals('foo', $message); - $that->assertArrayHasKey('file', $context); - $that->assertEquals($context['file'], 'foo.php'); - $that->assertArrayHasKey('line', $context); - $that->assertEquals($context['line'], 12); - $that->assertArrayHasKey('type', $context); - $that->assertEquals($context['type'], ErrorHandler::TYPE_DEPRECATION); - $that->assertArrayHasKey('stack', $context); - $that->assertInternalType('array', $context['stack']); - }; - - $logger - ->expects($this->once()) - ->method('warn') - ->will($this->returnCallback($warnArgCheck)) - ; - - $handler = ErrorHandler::register(E_USER_DEPRECATED); - $handler->setLogger($logger); - $handler->handle(E_USER_DEPRECATED, 'foo', 'foo.php', 12, 'foo'); - - restore_error_handler(); } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php old mode 100644 new mode 100755 index 4ccbe7dea4..c13e559362 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php @@ -45,11 +45,11 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase $response = $handler->createResponse(new \RuntimeException('Foo')); $this->assertEquals('500', $response->getStatusCode()); - $this->assertContains('Whoops, looks like something went wrong.', $response->getContent()); + $this->assertContains('Whoops, looks like something went wrong.', $response->getContent()); $response = $handler->createResponse(new NotFoundHttpException('Foo')); $this->assertEquals('404', $response->getStatusCode()); - $this->assertContains('Sorry, the page you are looking for could not be found.', $response->getContent()); + $this->assertContains('Sorry, the page you are looking for could not be found.', $response->getContent()); } public function testHeaders() diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php new file mode 100755 index 0000000000..a739bc8a73 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchEventTest.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\Debug; + +use Symfony\Component\HttpKernel\Debug\StopwatchEvent; + +/** + * StopwatchEventTest + * + * @author Fabien Potencier + */ +class StopwatchEventTest extends \PHPUnit_Framework_TestCase +{ + public function testGetOrigin() + { + $event = new StopwatchEvent(12); + $this->assertEquals(12, $event->getOrigin()); + } + + public function testGetCategory() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $this->assertEquals('default', $event->getCategory()); + + $event = new StopwatchEvent(microtime(true) * 1000, 'cat'); + $this->assertEquals('cat', $event->getCategory()); + } + + public function testGetPeriods() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $this->assertEquals(array(), $event->getPeriods()); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + $event->stop(); + $this->assertCount(1, $event->getPeriods()); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + $event->stop(); + $event->start(); + $event->stop(); + $this->assertCount(2, $event->getPeriods()); + } + + public function testLap() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + $event->lap(); + $event->stop(); + $this->assertCount(2, $event->getPeriods()); + } + + public function testTotalTime() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(20000); + $event->stop(); + $total = $event->getTotalTime(); + $this->assertTrue($total >= 11 && $total <= 29, $total.' should be 20 (between 11 and 29)'); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(10000); + $event->stop(); + $event->start(); + usleep(10000); + $event->stop(); + $total = $event->getTotalTime(); + $this->assertTrue($total >= 11 && $total <= 29, $total.' should be 20 (between 11 and 29)'); + } + + /** + * @expectedException \LogicException + */ + public function testStopWithoutStart() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $event->stop(); + } + + public function testEnsureStopped() + { + // this also test overlap between two periods + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(10000); + $event->start(); + usleep(10000); + $event->ensureStopped(); + $total = $event->getTotalTime(); + $this->assertTrue($total >= 21 && $total <= 39, $total.' should be 30 (between 21 and 39)'); + } + + public function testStartTime() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $this->assertTrue($event->getStartTime() < 0.5); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + $event->stop(); + $this->assertTrue($event->getStartTime() < 1); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(10000); + $event->stop(); + $start = $event->getStartTime(); + $this->assertTrue($start >= 0 && $start <= 20); + } + + public function testEndTime() + { + $event = new StopwatchEvent(microtime(true) * 1000); + $this->assertEquals(0, $event->getEndTime()); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + $this->assertEquals(0, $event->getEndTime()); + + $event = new StopwatchEvent(microtime(true) * 1000); + $event->start(); + usleep(10000); + $event->stop(); + $event->start(); + usleep(10000); + $event->stop(); + $end = $event->getEndTime(); + $this->assertTrue($end >= 11 && $end <= 29, $end.' should be 20 (between 11 and 29)'); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testInvalidOriginThrowsAnException() + { + new StopwatchEvent("abc"); + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php new file mode 100755 index 0000000000..210acb5959 --- /dev/null +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/StopwatchTest.php @@ -0,0 +1,120 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpKernel\Tests\Debug; + +use Symfony\Component\HttpKernel\Debug\Stopwatch; + +/** + * StopwatchTest + * + * @author Fabien Potencier + */ +class StopwatchTest extends \PHPUnit_Framework_TestCase +{ + public function testStart() + { + $stopwatch = new Stopwatch(); + $event = $stopwatch->start('foo', 'cat'); + + $this->assertInstanceof('Symfony\Component\HttpKernel\Debug\StopwatchEvent', $event); + $this->assertEquals('cat', $event->getCategory()); + } + + public function testStop() + { + $stopwatch = new Stopwatch(); + $stopwatch->start('foo', 'cat'); + usleep(20000); + $event = $stopwatch->stop('foo'); + + $this->assertInstanceof('Symfony\Component\HttpKernel\Debug\StopwatchEvent', $event); + $total = $event->getTotalTime(); + $this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)'); + } + + public function testLap() + { + $stopwatch = new Stopwatch(); + $stopwatch->start('foo', 'cat'); + usleep(10000); + $event = $stopwatch->lap('foo'); + usleep(10000); + $stopwatch->stop('foo'); + + $this->assertInstanceof('Symfony\Component\HttpKernel\Debug\StopwatchEvent', $event); + $total = $event->getTotalTime(); + $this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)'); + } + + /** + * @expectedException \LogicException + */ + public function testStopWithoutStart() + { + $stopwatch = new Stopwatch(); + $stopwatch->stop('foo'); + } + + public function testSection() + { + $stopwatch = new Stopwatch(); + + $stopwatch->openSection(); + $stopwatch->start('foo', 'cat'); + $stopwatch->stop('foo'); + $stopwatch->start('bar', 'cat'); + $stopwatch->stop('bar'); + $stopwatch->stopSection('1'); + + $stopwatch->openSection(); + $stopwatch->start('foobar', 'cat'); + $stopwatch->stop('foobar'); + $stopwatch->stopSection('2'); + + $stopwatch->openSection(); + $stopwatch->start('foobar', 'cat'); + $stopwatch->stop('foobar'); + $stopwatch->stopSection('0'); + + // the section is an event by itself + $this->assertCount(3, $stopwatch->getSectionEvents('1')); + $this->assertCount(2, $stopwatch->getSectionEvents('2')); + $this->assertCount(2, $stopwatch->getSectionEvents('0')); + } + + public function testReopenASection() + { + $stopwatch = new Stopwatch(); + + $stopwatch->openSection(); + $stopwatch->start('foo', 'cat'); + $stopwatch->stopSection('section'); + + $stopwatch->openSection('section'); + $stopwatch->start('bar', 'cat'); + $stopwatch->stopSection('section'); + + $events = $stopwatch->getSectionEvents('section'); + + $this->assertCount(3, $events); + $this->assertCount(2, $events['__section__']->getPeriods()); + } + + /** + * @expectedException \LogicException + */ + public function testReopenANewSectionShouldThrowAnException() + { + $stopwatch = new Stopwatch(); + $stopwatch->openSection('section'); + } +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php old mode 100644 new mode 100755 index d51ab6aa07..65975aa96f --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Exception/FlattenExceptionTest.php @@ -14,18 +14,6 @@ namespace Symfony\Component\HttpKernel\Tests\Exception; use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; -use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; -use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; -use Symfony\Component\HttpKernel\Exception\ConflictHttpException; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\HttpKernel\Exception\GoneHttpException; -use Symfony\Component\HttpKernel\Exception\LengthRequiredHttpException; -use Symfony\Component\HttpKernel\Exception\PreconditionFailedHttpException; -use Symfony\Component\HttpKernel\Exception\PreconditionRequiredHttpException; -use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; -use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; -use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; class FlattenExceptionTest extends \PHPUnit_Framework_TestCase { @@ -39,66 +27,12 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase $flattened = FlattenException::create(new NotFoundHttpException()); $this->assertEquals('404', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"')); - $this->assertEquals('401', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new BadRequestHttpException()); - $this->assertEquals('400', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new NotAcceptableHttpException()); - $this->assertEquals('406', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new ConflictHttpException()); - $this->assertEquals('409', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST'))); - $this->assertEquals('405', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new AccessDeniedHttpException()); - $this->assertEquals('403', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new GoneHttpException()); - $this->assertEquals('410', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new LengthRequiredHttpException()); - $this->assertEquals('411', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new PreconditionFailedHttpException()); - $this->assertEquals('412', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new PreconditionRequiredHttpException()); - $this->assertEquals('428', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException()); - $this->assertEquals('503', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException()); - $this->assertEquals('429', $flattened->getStatusCode()); - - $flattened = FlattenException::create(new UnsupportedMediaTypeHttpException()); - $this->assertEquals('415', $flattened->getStatusCode()); } public function testHeadersForHttpException() { $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST'))); $this->assertEquals(array('Allow' => 'POST'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"')); - $this->assertEquals(array('WWW-Authenticate' => 'Basic realm="My Realm"'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException('Fri, 31 Dec 1999 23:59:59 GMT')); - $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new ServiceUnavailableHttpException(120)); - $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException('Fri, 31 Dec 1999 23:59:59 GMT')); - $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders()); - - $flattened = FlattenException::create(new TooManyRequestsHttpException(120)); - $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders()); } /** @@ -156,18 +90,18 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase public function testToArray(\Exception $exception, $statusCode) { $flattened = FlattenException::create($exception); - $flattened->setTrace(array(), 'foo.php', 123); + $flattened->setTrace(array(),'foo.php',123); $this->assertEquals(array( array( 'message'=> 'test', 'class'=>'Exception', 'trace'=>array(array( - 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123, + 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php','line' => 123, 'args' => array() )), ) - ), $flattened->toArray()); + ),$flattened->toArray()); } public function flattenDataProvider() @@ -191,45 +125,4 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase { return new \Exception(); } - - public function testSetTraceIncompleteClass() - { - $flattened = FlattenException::create(new \Exception('test', 123)); - $flattened->setTrace( - array( - array( - 'file' => __FILE__, - 'line' => 123, - 'function' => 'test', - 'args' => array( - unserialize('O:14:"BogusTestClass":0:{}') - ), - ), - ), - 'foo.php', 123 - ); - - $this->assertEquals(array( - array( - 'message'=> 'test', - 'class'=>'Exception', - 'trace'=>array( - array( - 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', - 'file' => 'foo.php', 'line' => 123, - 'args' => array(), - ), - array( - 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => 'test', - 'file' => __FILE__, 'line' => 123, - 'args' => array( - array( - 'incomplete-object', 'BogusTestClass' - ), - ), - ) - ), - ) - ), $flattened->toArray()); - } } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/BaseBundle/Resources/hide.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/Resources/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/bar.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle1Bundle/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Bundle2Bundle/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ChildBundle/Resources/hide.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionAbsentBundle/ExtensionAbsentBundle.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/DependencyInjection/ExtensionLoadedExtension.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionLoadedBundle/ExtensionLoadedBundle.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/DependencyInjection/ExtensionPresentExtension.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/ExtensionPresentBundle.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/FooBarBundle.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/BaseBundle/hide.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/Bundle1Bundle/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/ChildBundle/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/Resources/FooBundle/foo.txt old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php old mode 100644 new mode 100755 index e7d60cff3d..48ff956b4d --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestClient.php @@ -19,12 +19,7 @@ class TestClient extends Client { $script = parent::getScript($request); - $autoload = file_exists(__DIR__.'/../../vendor/autoload.php') - ? __DIR__.'/../../vendor/autoload.php' - : __DIR__.'/../../../../../../vendor/autoload.php' - ; - - $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '$autoload';\n", $script); + $script = preg_replace('/(\->register\(\);)/', "$0\nrequire_once '".__DIR__."/../bootstrap.php';", $script); return $script; } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Fixtures/TestEventDispatcher.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php old mode 100644 new mode 100755 index 12d301f387..fa879ce931 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php @@ -207,18 +207,6 @@ class StoreTest extends \PHPUnit_Framework_TestCase $this->assertCount(2, $this->getStoreMetadata($key)); } - public function testLocking() - { - $req = Request::create('/test', 'get', array(), array(), array(), array('HTTP_FOO' => 'Foo', 'HTTP_BAR' => 'Bar')); - $this->assertTrue($this->store->lock($req)); - - $path = $this->store->lock($req); - $this->assertTrue($this->store->isLocked($req)); - - $this->store->unlock($req); - $this->assertFalse($this->store->isLocked($req)); - } - protected function storeSimpleEntry($path = null, $headers = array()) { if (null === $path) { diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestHttpKernel.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php old mode 100644 new mode 100755 diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php old mode 100644 new mode 100755 index d4295f5ab8..46361f6f5a --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -223,28 +223,9 @@ class KernelTest extends \PHPUnit_Framework_TestCase return; } - $source = <<<'EOF' + $source = << + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\HttpKernel')) { + if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\HttpKernel')).'.php')) { + require_once $file; + } + } +}); + +if (file_exists($loader = __DIR__.'/../vendor/autoload.php')) { + require_once $loader; +} diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json old mode 100644 new mode 100755 index a6cf81f10e..f61d92493f --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/composer.json @@ -17,36 +17,30 @@ ], "require": { "php": ">=5.3.3", - "symfony/event-dispatcher": "2.2.*", - "symfony/http-foundation": "2.2.*" + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*" }, "require-dev": { - "symfony/browser-kit": "2.2.*", - "symfony/class-loader": "2.2.*", - "symfony/config": "2.2.*", - "symfony/console": "2.2.*", - "symfony/dependency-injection": "2.2.*", - "symfony/finder": "2.2.*", - "symfony/process": "2.2.*", - "symfony/routing": "2.2.*", - "symfony/stopwatch": "2.2.*" + "symfony/browser-kit": "2.1.*", + "symfony/class-loader": "2.1.*", + "symfony/config": "2.1.*", + "symfony/console": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/finder": "2.1.*", + "symfony/process": "2.1.*", + "symfony/routing": "2.1.*" }, "suggest": { - "symfony/browser-kit": "2.2.*", - "symfony/class-loader": "2.2.*", - "symfony/config": "2.2.*", - "symfony/console": "2.2.*", - "symfony/dependency-injection": "2.2.*", - "symfony/finder": "2.2.*" + "symfony/browser-kit": "2.1.*", + "symfony/class-loader": "2.1.*", + "symfony/config": "2.1.*", + "symfony/console": "2.1.*", + "symfony/dependency-injection": "2.1.*", + "symfony/finder": "2.1.*" }, "autoload": { - "psr-0": { "Symfony\\Component\\HttpKernel\\": "" } + "psr-0": { "Symfony\\Component\\HttpKernel": "" } }, "target-dir": "Symfony/Component/HttpKernel", - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - } + "minimum-stability": "dev" } diff --git a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist old mode 100644 new mode 100755 index f8490c3f9e..dd824acdf7 --- a/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist +++ b/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist @@ -9,7 +9,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="false" - bootstrap="vendor/autoload.php" + bootstrap="Tests/bootstrap.php" > diff --git a/vendor/symfony/locale/Symfony/Component/Locale/CHANGELOG.md b/vendor/symfony/locale/Symfony/Component/Locale/CHANGELOG.md new file mode 100755 index 0000000000..da55a26728 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/CHANGELOG.md @@ -0,0 +1,9 @@ +CHANGELOG +========= + +2.1.0 +----- + + * added Locale::getIntlIcuVersion(), Locale::getIntlIcuDataVersion(), Locale::getIcuDataVersion() and Locale::getIcuDataDirectory() + * renamed update-data.php to build-data.php, the script usage changed, now it is easier to update the ICU data + * updated the ICU data to the release 49.1.2 diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php new file mode 100755 index 0000000000..eadc39601e --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Locale\Exception; + +use Symfony\Component\Locale\Exception\NotImplementedException; + +/** + * @author Eriksen Costa + */ +class MethodArgumentNotImplementedException extends NotImplementedException +{ + /** + * Constructor + * + * @param string $methodName The method name that raised the exception + * @param string $argName The argument name that is not implemented + */ + public function __construct($methodName, $argName) + { + $message = sprintf('The %s() method\'s argument $%s behavior is not implemented.', $methodName, $argName); + parent::__construct($message); + } +} diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php new file mode 100755 index 0000000000..421ca53381 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Locale\Exception; + +use Symfony\Component\Locale\Exception\NotImplementedException; + +/** + * @author Eriksen Costa + */ +class MethodArgumentValueNotImplementedException extends NotImplementedException +{ + /** + * Constructor + * + * @param string $methodName The method name that raised the exception + * @param string $argName The argument name + * @param string $argValue The argument value that is not implemented + * @param string $additionalMessage An optional additional message to append to the exception message + */ + public function __construct($methodName, $argName, $argValue, $additionalMessage = '') + { + $message = sprintf( + 'The %s() method\'s argument $%s value %s behavior is not implemented.%s', + $methodName, + $argName, + var_export($argValue, true), + $additionalMessage !== '' ? ' '.$additionalMessage.'. ' : '' + ); + + parent::__construct($message); + } +} diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodNotImplementedException.php b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodNotImplementedException.php new file mode 100755 index 0000000000..4c3ec97611 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Exception/MethodNotImplementedException.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Locale\Exception; + +/** + * @author Eriksen Costa + */ +class MethodNotImplementedException extends NotImplementedException +{ + /** + * Constructor + * + * @param string $methodName The name of the method + */ + public function __construct($methodName) + { + parent::__construct(sprintf('The %s() is not implemented.', $methodName)); + } +} diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Exception/NotImplementedException.php b/vendor/symfony/locale/Symfony/Component/Locale/Exception/NotImplementedException.php new file mode 100755 index 0000000000..350a458bbe --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Exception/NotImplementedException.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Locale\Exception; + +/** + * Base exception class for not implemented behaviors of the intl extension in the Locale component. + * + * @author Eriksen Costa + */ +class NotImplementedException extends \RuntimeException +{ + const INTL_INSTALL_MESSAGE = 'Please install the \'intl\' extension for full localization capabilities.'; + + /** + * Constructor + * + * @param string $message The exception message. A note to install the intl extension is appended to this string + */ + public function __construct($message) + { + parent::__construct($message.' '.self::INTL_INSTALL_MESSAGE); + } +} diff --git a/vendor/symfony/locale/Symfony/Component/Locale/LICENSE b/vendor/symfony/locale/Symfony/Component/Locale/LICENSE new file mode 100755 index 0000000000..cdffe7aebc --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2012 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Locale.php b/vendor/symfony/locale/Symfony/Component/Locale/Locale.php new file mode 100755 index 0000000000..6982a81a9f --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Locale.php @@ -0,0 +1,294 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Locale; + +class Locale extends \Locale +{ + /** + * The ICU data version that ships with Symfony + */ + const ICU_DATA_VERSION = '49'; + + /** + * Caches the countries in different locales + * @var array + */ + protected static $countries = array(); + + /** + * Caches the languages in different locales + * @var array + */ + protected static $languages = array(); + + /** + * Caches the different locales + * @var array + */ + protected static $locales = array(); + + /** + * Returns the country names for a locale + * + * @param string $locale The locale to use for the country names + * + * @return array The country names with their codes as keys + * + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getDisplayCountries($locale) + { + if (!isset(self::$countries[$locale])) { + $bundle = \ResourceBundle::create($locale, self::getIcuDataDirectory().'/region'); + + if (null === $bundle) { + throw new \RuntimeException(sprintf('The country resource bundle could not be loaded for locale "%s"', $locale)); + } + + $collator = new \Collator($locale); + $countries = array(); + $bundleCountries = $bundle->get('Countries') ?: array(); + + foreach ($bundleCountries as $code => $name) { + // Global countries (f.i. "America") have numeric codes + // Countries have alphabetic codes + // "ZZ" is the code for unknown country + if (ctype_alpha($code) && 'ZZ' !== $code) { + $countries[$code] = $name; + } + } + + $fallbackLocale = self::getFallbackLocale($locale); + if (null !== $fallbackLocale) { + $countries = array_merge(self::getDisplayCountries($fallbackLocale), $countries); + } + + $collator->asort($countries); + + self::$countries[$locale] = $countries; + } + + return self::$countries[$locale]; + } + + /** + * Returns all available country codes + * + * @return array The country codes + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getCountries() + { + return array_keys(self::getDisplayCountries(self::getDefault())); + } + + /** + * Returns the language names for a locale + * + * @param string $locale The locale to use for the language names + * + * @return array The language names with their codes as keys + * + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getDisplayLanguages($locale) + { + if (!isset(self::$languages[$locale])) { + $bundle = \ResourceBundle::create($locale, self::getIcuDataDirectory().'/lang'); + + if (null === $bundle) { + throw new \RuntimeException(sprintf('The language resource bundle could not be loaded for locale "%s"', $locale)); + } + + $collator = new \Collator($locale); + $languages = array(); + $bundleLanguages = $bundle->get('Languages') ?: array(); + + foreach ($bundleLanguages as $code => $name) { + // "mul" is the code for multiple languages + if ('mul' !== $code) { + $languages[$code] = $name; + } + } + + $fallbackLocale = self::getFallbackLocale($locale); + if (null !== $fallbackLocale) { + $languages = array_merge(self::getDisplayLanguages($fallbackLocale), $languages); + } + + $collator->asort($languages); + + self::$languages[$locale] = $languages; + } + + return self::$languages[$locale]; + } + + /** + * Returns all available language codes + * + * @return array The language codes + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getLanguages() + { + return array_keys(self::getDisplayLanguages(self::getDefault())); + } + + /** + * Returns the locale names for a locale + * + * @param string $locale The locale to use for the locale names + * @return array The locale names with their codes as keys + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getDisplayLocales($locale) + { + if (!isset(self::$locales[$locale])) { + $bundle = \ResourceBundle::create($locale, self::getIcuDataDirectory().'/names'); + + if (null === $bundle) { + throw new \RuntimeException(sprintf('The locale resource bundle could not be loaded for locale "%s"', $locale)); + } + + $collator = new \Collator($locale); + $locales = array(); + $bundleLocales = $bundle->get('Locales') ?: array(); + + foreach ($bundleLocales as $code => $name) { + $locales[$code] = $name; + } + + $fallbackLocale = self::getFallbackLocale($locale); + if (null !== $fallbackLocale) { + $locales = array_merge(self::getDisplayLocales($fallbackLocale), $locales); + } + + $collator->asort($locales); + + self::$locales[$locale] = $locales; + } + + return self::$locales[$locale]; + } + + /** + * Returns all available locale codes + * + * @return array The locale codes + * @throws RuntimeException When the resource bundles cannot be loaded + */ + public static function getLocales() + { + return array_keys(self::getDisplayLocales(self::getDefault())); + } + + /** + * Returns the ICU version as defined by the intl extension + * + * @return string|null The ICU version + */ + public static function getIntlIcuVersion() + { + if (defined('INTL_ICU_VERSION')) { + return INTL_ICU_VERSION; + } + + try { + $reflector = new \ReflectionExtension('intl'); + } catch (\ReflectionException $e) { + return; + } + + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + preg_match('/^ICU version (?:=>)?(.*)$/m', $output, $matches); + + return trim($matches[1]); + } + + /** + * Returns the ICU Data version as defined by the intl extension + * + * @return string|null The ICU Data version + */ + public static function getIntlIcuDataVersion() + { + if (defined('INTL_ICU_DATA_VERSION')) { + return INTL_ICU_DATA_VERSION; + } + + try { + $reflector = new \ReflectionExtension('intl'); + } catch (\ReflectionException $e) { + return; + } + + ob_start(); + $reflector->info(); + $output = strip_tags(ob_get_clean()); + preg_match('/^ICU Data version (?:=>)?(.*)$/m', $output, $matches); + + return trim($matches[1]); + } + + /** + * Returns the ICU data version that ships with Symfony. If the environment variable USE_INTL_ICU_DATA_VERSION is + * defined, it will try use the ICU data version as defined by the intl extension, if available. + * + * @return string The ICU data version that ships with Symfony + */ + public static function getIcuDataVersion() + { + static $dataVersion; + + if (null === $dataVersion) { + $dataVersion = self::ICU_DATA_VERSION; + + if (getenv('USE_INTL_ICU_DATA_VERSION') && self::getIntlIcuVersion()) { + $dataVersion = self::getIntlIcuVersion(); + + preg_match('/^(?P[0-9]\.[0-9]|[0-9]{2,})/', $dataVersion, $matches); + + $dataVersion = $matches['version']; + } + } + + return $dataVersion; + } + + /** + * Returns the directory path of the ICU data that ships with Symfony + * + * @return string The path to the ICU data directory + */ + public static function getIcuDataDirectory() + { + return __DIR__.'/Resources/data/'.self::getIcuDataVersion(); + } + + /** + * Returns the fallback locale for a given locale, if any + * + * @param $locale The locale to find the fallback for + * @return string|null The fallback locale, or null if no parent exists + */ + protected static function getFallbackLocale($locale) + { + if (false === $pos = strrpos($locale, '_')) { + return null; + } + + return substr($locale, 0, $pos); + } +} diff --git a/vendor/symfony/locale/Symfony/Component/Locale/README.md b/vendor/symfony/locale/Symfony/Component/Locale/README.md new file mode 100755 index 0000000000..7db3d6bf01 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/README.md @@ -0,0 +1,36 @@ +Locale Component +================ + +Locale provides fallback code to handle cases when the ``intl`` extension is +missing. + +Loading the fallback classes for example using the ClassLoader component only +requires adding the following lines to your autoloader: + + // intl + if (!function_exists('intl_get_error_code')) { + require __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'; + + $loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); + } + +Resources +--------- + +You can run the unit tests with the following command: + + phpunit + +If your PHP have the ``intl`` extension enabled but the intl extension ICU data +version mismatch the one shipped with the component, you can build the data for +it and use the ``USE_INTL_ICU_DATA_VERSION`` environment variable. + + php Resources/data/build-data.php + export USE_INTL_ICU_DATA_VERSION=true + phpunit + +This way the tests will use the ICU data files with the same version of your +``intl`` extension. + +Read the file ``Resources/data/UPDATE.txt`` for more info about building or +updating the ICU data files. \ No newline at end of file diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/af.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/af.res new file mode 100755 index 0000000000..04224eb20c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/af.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/agq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/agq.res new file mode 100755 index 0000000000..44aa3168f6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/agq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ak.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ak.res new file mode 100755 index 0000000000..ad0f8a02be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ak.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/am.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/am.res new file mode 100755 index 0000000000..8c1bbe3fa0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/am.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ar.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ar.res new file mode 100755 index 0000000000..8a5c9ea43f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ar.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/as.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/as.res new file mode 100755 index 0000000000..996edba81f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/as.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/asa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/asa.res new file mode 100755 index 0000000000..624bafd498 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/asa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az.res new file mode 100755 index 0000000000..96afd1ec27 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_AZ.res new file mode 100755 index 0000000000..ff23f22775 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Cyrl.res new file mode 100755 index 0000000000..f339a4d281 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn_AZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/az_Latn_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bas.res new file mode 100755 index 0000000000..557c6e4bfa Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/be.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/be.res new file mode 100755 index 0000000000..5f8f379582 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/be.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bem.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bem.res new file mode 100755 index 0000000000..0bc8e9f854 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bem.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bez.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bez.res new file mode 100755 index 0000000000..e5bc78b0f2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bez.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bg.res new file mode 100755 index 0000000000..65251873a6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bm.res new file mode 100755 index 0000000000..3e05759d76 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn.res new file mode 100755 index 0000000000..f01b02626e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn_IN.res new file mode 100755 index 0000000000..140749aaae Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bn_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bo.res new file mode 100755 index 0000000000..f44ec333a3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/br.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/br.res new file mode 100755 index 0000000000..c6c6242d21 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/br.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/brx.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/brx.res new file mode 100755 index 0000000000..95c769e121 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/brx.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bs.res new file mode 100755 index 0000000000..9f1ec2bdc2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/bs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ca.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ca.res new file mode 100755 index 0000000000..349b600926 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ca.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cgg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cgg.res new file mode 100755 index 0000000000..e67247191f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cgg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/chr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/chr.res new file mode 100755 index 0000000000..a54ebf8dcd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/chr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cs.res new file mode 100755 index 0000000000..6420d10216 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cy.res new file mode 100755 index 0000000000..36a24cccbc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/cy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/da.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/da.res new file mode 100755 index 0000000000..821ac9f1b3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/da.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dav.res new file mode 100755 index 0000000000..8617106b89 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de.res new file mode 100755 index 0000000000..e406aa7c4d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de_CH.res new file mode 100755 index 0000000000..7595884237 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/de_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dje.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dje.res new file mode 100755 index 0000000000..4bb050598e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dje.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dua.res new file mode 100755 index 0000000000..fc6789082d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dyo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dyo.res new file mode 100755 index 0000000000..e9525f57b8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/dyo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ebu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ebu.res new file mode 100755 index 0000000000..c4eee95659 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ebu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ee.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ee.res new file mode 100755 index 0000000000..4d3beaeadd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ee.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/el.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/el.res new file mode 100755 index 0000000000..e36037113f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/el.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en.res new file mode 100755 index 0000000000..a4f2989bd1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_RH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_RH.res new file mode 100755 index 0000000000..df1b86000a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_RH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_ZW.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/en_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eo.res new file mode 100755 index 0000000000..2d602258b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es.res new file mode 100755 index 0000000000..fee9922ce8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_419.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_419.res new file mode 100755 index 0000000000..dc765ecda4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_419.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_CL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_CL.res new file mode 100755 index 0000000000..f03d498419 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/es_CL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/et.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/et.res new file mode 100755 index 0000000000..fb0f15190a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/et.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eu.res new file mode 100755 index 0000000000..73a21b5c24 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/eu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ewo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ewo.res new file mode 100755 index 0000000000..f4a261e685 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ewo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa.res new file mode 100755 index 0000000000..732b848c6c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa_AF.res new file mode 100755 index 0000000000..ab264b3329 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fa_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ff.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ff.res new file mode 100755 index 0000000000..b48b50b9f0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ff.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fi.res new file mode 100755 index 0000000000..f8ab51bd64 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil.res new file mode 100755 index 0000000000..719f89cb06 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil_PH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fil_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fo.res new file mode 100755 index 0000000000..54667d00b5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr.res new file mode 100755 index 0000000000..f5533fef31 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr_CA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr_CA.res new file mode 100755 index 0000000000..d892f83817 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/fr_CA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ga.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ga.res new file mode 100755 index 0000000000..e639e935e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ga.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gl.res new file mode 100755 index 0000000000..56eccb653e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gsw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gsw.res new file mode 100755 index 0000000000..734cede0f2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gsw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gu.res new file mode 100755 index 0000000000..2f1b525bb5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/guz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/guz.res new file mode 100755 index 0000000000..34b0c9dd5d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/guz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gv.res new file mode 100755 index 0000000000..68cc5c2ae7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/gv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha.res new file mode 100755 index 0000000000..5b35f130fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_GH.res new file mode 100755 index 0000000000..1edc5961c2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_GH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NE.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NG.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_Latn_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NE.res new file mode 100755 index 0000000000..46a98886d0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NG.res new file mode 100755 index 0000000000..954922a1a3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ha_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/haw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/haw.res new file mode 100755 index 0000000000..cdf6076af4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/haw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he.res new file mode 100755 index 0000000000..e76c0a4c55 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he_IL.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/he_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hi.res new file mode 100755 index 0000000000..14ad32d9a2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hr.res new file mode 100755 index 0000000000..e51b7f79e5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hu.res new file mode 100755 index 0000000000..b825707052 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hy.res new file mode 100755 index 0000000000..341f547e4b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/hy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id.res new file mode 100755 index 0000000000..571dfc3d01 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id_ID.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/id_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ig.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ig.res new file mode 100755 index 0000000000..9766525b9e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ig.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ii.res new file mode 100755 index 0000000000..e21b7ff02d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in.res new file mode 100755 index 0000000000..6a5ac33942 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in_ID.res new file mode 100755 index 0000000000..dcdcac2986 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/in_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/is.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/is.res new file mode 100755 index 0000000000..20f07a2f6e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/is.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/it.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/it.res new file mode 100755 index 0000000000..fe4abd3bf2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/it.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw.res new file mode 100755 index 0000000000..e64e1b39bd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw_IL.res new file mode 100755 index 0000000000..e586d07777 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/iw_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja.res new file mode 100755 index 0000000000..780cd09abc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP_TRADITIONAL.res new file mode 100755 index 0000000000..4b6ec414e1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ja_JP_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/jmc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/jmc.res new file mode 100755 index 0000000000..ad70950cce Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/jmc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ka.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ka.res new file mode 100755 index 0000000000..80b69beba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ka.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kab.res new file mode 100755 index 0000000000..c2d6be4619 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kam.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kam.res new file mode 100755 index 0000000000..d48ae9ef2d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kam.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kde.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kde.res new file mode 100755 index 0000000000..857d8eb173 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kde.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kea.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kea.res new file mode 100755 index 0000000000..55a84afc90 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kea.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/khq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/khq.res new file mode 100755 index 0000000000..bbf07c5fb0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/khq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ki.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ki.res new file mode 100755 index 0000000000..8eb60db6a8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ki.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk.res new file mode 100755 index 0000000000..bdf3ca5ce8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl_KZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_Cyrl_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_KZ.res new file mode 100755 index 0000000000..6cfb7f01dd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kk_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kl.res new file mode 100755 index 0000000000..69066044d2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kln.res new file mode 100755 index 0000000000..04b0924c5d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/km.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/km.res new file mode 100755 index 0000000000..997dd675da Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/km.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kn.res new file mode 100755 index 0000000000..64ac931529 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ko.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ko.res new file mode 100755 index 0000000000..9d8f9ad8de Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ko.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kok.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kok.res new file mode 100755 index 0000000000..b1b1b1f9f2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kok.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksb.res new file mode 100755 index 0000000000..e04bc3146f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksf.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksf.res new file mode 100755 index 0000000000..e5ea57ce39 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ksf.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kw.res new file mode 100755 index 0000000000..2c27563517 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/kw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lag.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lag.res new file mode 100755 index 0000000000..bf73b8f3ce Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lag.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lg.res new file mode 100755 index 0000000000..aa442aea11 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ln.res new file mode 100755 index 0000000000..378348dcb9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lt.res new file mode 100755 index 0000000000..c6a3ddf68f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lu.res new file mode 100755 index 0000000000..542c04e667 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luo.res new file mode 100755 index 0000000000..d4ad807856 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luy.res new file mode 100755 index 0000000000..ba865ddf27 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/luy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lv.res new file mode 100755 index 0000000000..db2ba9c363 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/lv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mas.res new file mode 100755 index 0000000000..3210228cb2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mer.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mer.res new file mode 100755 index 0000000000..1fafa3c01b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mer.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mfe.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mfe.res new file mode 100755 index 0000000000..6c1cad3ed6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mfe.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mg.res new file mode 100755 index 0000000000..ed9397cfb9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mgh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mgh.res new file mode 100755 index 0000000000..46a922d8f4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mgh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mk.res new file mode 100755 index 0000000000..19b9114f01 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ml.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ml.res new file mode 100755 index 0000000000..a31b845650 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ml.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mo.res new file mode 100755 index 0000000000..3f8911a731 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mr.res new file mode 100755 index 0000000000..b4b88fd72d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ms.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ms.res new file mode 100755 index 0000000000..f764e92c1e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ms.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mt.res new file mode 100755 index 0000000000..249b223852 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mua.res new file mode 100755 index 0000000000..02934d4383 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/mua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/my.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/my.res new file mode 100755 index 0000000000..733a421585 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/my.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/naq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/naq.res new file mode 100755 index 0000000000..2fcf825828 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/naq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb.res new file mode 100755 index 0000000000..f1e7dd45cd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb_NO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nb_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nd.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nd.res new file mode 100755 index 0000000000..a7f817ea21 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nd.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ne.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ne.res new file mode 100755 index 0000000000..560965a632 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ne.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl.res new file mode 100755 index 0000000000..4cc32220a8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl_BE.res new file mode 100755 index 0000000000..0a5118ef52 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nl_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nmg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nmg.res new file mode 100755 index 0000000000..138631b56c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nmg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn.res new file mode 100755 index 0000000000..da0a149fa4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn_NO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nn_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no.res new file mode 100755 index 0000000000..f11a728c15 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO.res new file mode 100755 index 0000000000..4c61d61206 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO_NY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO_NY.res new file mode 100755 index 0000000000..4599f32a3c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/no_NO_NY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nus.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nus.res new file mode 100755 index 0000000000..8b2dabf25f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nus.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nyn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nyn.res new file mode 100755 index 0000000000..1d412f1b72 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/nyn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/om.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/om.res new file mode 100755 index 0000000000..91bfe0ea7b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/om.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/or.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/or.res new file mode 100755 index 0000000000..33da2f45a4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/or.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa.res new file mode 100755 index 0000000000..f3d2952405 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab.res new file mode 100755 index 0000000000..ab99c1d379 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab_PK.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Arab_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru_IN.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_Guru_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_IN.res new file mode 100755 index 0000000000..5a7533dae2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_PK.res new file mode 100755 index 0000000000..a713857528 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pa_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pl.res new file mode 100755 index 0000000000..dc9193ee29 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ps.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ps.res new file mode 100755 index 0000000000..45c92c2019 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ps.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt.res new file mode 100755 index 0000000000..7bc432d74a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt_PT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt_PT.res new file mode 100755 index 0000000000..bd8421e9ba Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/pt_PT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rm.res new file mode 100755 index 0000000000..ed79e09a2a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rn.res new file mode 100755 index 0000000000..46c4384fea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro.res new file mode 100755 index 0000000000..7a85b8408e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro_MD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro_MD.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ro_MD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rof.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rof.res new file mode 100755 index 0000000000..2285883019 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rof.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/root.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/root.res new file mode 100755 index 0000000000..e2a5795db1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/root.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru.res new file mode 100755 index 0000000000..de63f5f657 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru_UA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru_UA.res new file mode 100755 index 0000000000..13da750899 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ru_UA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rw.res new file mode 100755 index 0000000000..b8dd52ffc7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rwk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rwk.res new file mode 100755 index 0000000000..150d08d471 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/rwk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/saq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/saq.res new file mode 100755 index 0000000000..0d4f2c3e10 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/saq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sbp.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sbp.res new file mode 100755 index 0000000000..8aa44a554a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sbp.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/seh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/seh.res new file mode 100755 index 0000000000..1a09cc9ff0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/seh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ses.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ses.res new file mode 100755 index 0000000000..50c472fd20 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ses.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sg.res new file mode 100755 index 0000000000..642c2608db Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh.res new file mode 100755 index 0000000000..0cdf3e0d66 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_BA.res new file mode 100755 index 0000000000..ba85740b9a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sh_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi.res new file mode 100755 index 0000000000..315d88e8a7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn_MA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_MA.res new file mode 100755 index 0000000000..36bc365aec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Tfng.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Tfng.res new file mode 100755 index 0000000000..c24242adca Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/shi_Tfng.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/si.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/si.res new file mode 100755 index 0000000000..21e4365c2a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/si.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sk.res new file mode 100755 index 0000000000..a18e31f65f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sl.res new file mode 100755 index 0000000000..edace1fab5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sn.res new file mode 100755 index 0000000000..caed2ee8ab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/so.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/so.res new file mode 100755 index 0000000000..f9565542c3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/so.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sq.res new file mode 100755 index 0000000000..c317c84886 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr.res new file mode 100755 index 0000000000..d358f39c38 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_BA.res new file mode 100755 index 0000000000..dfc6b9cf5e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_BA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_RS.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Cyrl_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn.res new file mode 100755 index 0000000000..0fdc8b3a4f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_BA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_ME.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_RS.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_Latn_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_ME.res new file mode 100755 index 0000000000..aac52f2add Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_RS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sr_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv.res new file mode 100755 index 0000000000..6ec06629f3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv_FI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv_FI.res new file mode 100755 index 0000000000..b0ea8668a5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sv_FI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sw.res new file mode 100755 index 0000000000..6d8a626b07 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/sw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/swc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/swc.res new file mode 100755 index 0000000000..c5c706313a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/swc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ta.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ta.res new file mode 100755 index 0000000000..aa89194849 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ta.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/te.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/te.res new file mode 100755 index 0000000000..381fc219d0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/te.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/teo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/teo.res new file mode 100755 index 0000000000..60909508b0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/teo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th.res new file mode 100755 index 0000000000..d93f80f5cd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH_TRADITIONAL.res new file mode 100755 index 0000000000..4341e54401 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/th_TH_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ti.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ti.res new file mode 100755 index 0000000000..943ac97c76 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ti.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl.res new file mode 100755 index 0000000000..a70580492b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl_PH.res new file mode 100755 index 0000000000..6c39389184 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tl_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/to.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/to.res new file mode 100755 index 0000000000..72ffcfcc10 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/to.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tr.res new file mode 100755 index 0000000000..57539e1e61 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/twq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/twq.res new file mode 100755 index 0000000000..b2aefe0d19 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/twq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm.res new file mode 100755 index 0000000000..4a5bad3304 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn_MA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_MA.res new file mode 100755 index 0000000000..fa1287bc54 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/tzm_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uk.res new file mode 100755 index 0000000000..94f8d5503f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ur.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ur.res new file mode 100755 index 0000000000..a3ff02922a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/ur.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz.res new file mode 100755 index 0000000000..6bab55bf8a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_AF.res new file mode 100755 index 0000000000..4243259061 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab.res new file mode 100755 index 0000000000..91d54e6628 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab_AF.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Arab_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl_UZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Cyrl_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Latn.res new file mode 100755 index 0000000000..605bd997f5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_UZ.res new file mode 100755 index 0000000000..ca4f1c3171 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/uz_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai.res new file mode 100755 index 0000000000..35b5ef74ab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_LR.res new file mode 100755 index 0000000000..8d03de293b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Latn.res new file mode 100755 index 0000000000..ea01dd862f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii.res new file mode 100755 index 0000000000..20a61f02b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii_LR.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vai_Vaii_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vi.res new file mode 100755 index 0000000000..461e30f1ea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vun.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vun.res new file mode 100755 index 0000000000..3955ea92a8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/vun.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/xog.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/xog.res new file mode 100755 index 0000000000..0947307975 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/xog.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yav.res new file mode 100755 index 0000000000..831c155aae Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yo.res new file mode 100755 index 0000000000..4f4a51add6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/yo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh.res new file mode 100755 index 0000000000..8987aef93a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_CN.res new file mode 100755 index 0000000000..b92fec8c89 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_HK.res new file mode 100755 index 0000000000..740476e738 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_CN.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_HK.res new file mode 100755 index 0000000000..ee3febe49d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_MO.res new file mode 100755 index 0000000000..51034a092b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_SG.res new file mode 100755 index 0000000000..fd35da61bb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hans_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant.res new file mode 100755 index 0000000000..51c69dce9a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_HK.res new file mode 100755 index 0000000000..dc7505c176 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_MO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_TW.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_Hant_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_MO.res new file mode 100755 index 0000000000..99708079ec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_SG.res new file mode 100755 index 0000000000..6dc927e229 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_TW.res new file mode 100755 index 0000000000..27020e6762 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zh_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zu.res new file mode 100755 index 0000000000..79f9df9066 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/lang/zu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af.res new file mode 100755 index 0000000000..53b2c5338b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_NA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_NA.res new file mode 100755 index 0000000000..e269b7ab19 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_NA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_ZA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_ZA.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/af_ZA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq.res new file mode 100755 index 0000000000..c04740e7b8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/agq_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak.res new file mode 100755 index 0000000000..3281043397 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak_GH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ak_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am.res new file mode 100755 index 0000000000..5a7d583239 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am_ET.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am_ET.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/am_ET.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar.res new file mode 100755 index 0000000000..e4655d9888 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_001.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_001.res new file mode 100755 index 0000000000..faedb8c087 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_001.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_AE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_AE.res new file mode 100755 index 0000000000..a7662e66a2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_AE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_BH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_BH.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_BH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_DZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_DZ.res new file mode 100755 index 0000000000..356aafaf06 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_DZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_EG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_EG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_EG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_IQ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_IQ.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_IQ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_JO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_JO.res new file mode 100755 index 0000000000..3154ef67b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_JO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_KW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_KW.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_KW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LB.res new file mode 100755 index 0000000000..3154ef67b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LY.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_LY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_MA.res new file mode 100755 index 0000000000..8232d9dc07 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_OM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_OM.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_OM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_QA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_QA.res new file mode 100755 index 0000000000..67519b10d8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_QA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SA.res new file mode 100755 index 0000000000..67519b10d8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SD.res new file mode 100755 index 0000000000..2e734c739c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SY.res new file mode 100755 index 0000000000..0c3e5ea51b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_SY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_TN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_TN.res new file mode 100755 index 0000000000..2a8799ee81 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_TN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_YE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_YE.res new file mode 100755 index 0000000000..67519b10d8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ar_YE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as.res new file mode 100755 index 0000000000..4534751f7c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/as_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa.res new file mode 100755 index 0000000000..403a401e32 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/asa_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az.res new file mode 100755 index 0000000000..81d6301338 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_AZ.res new file mode 100755 index 0000000000..ff23f22775 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl.res new file mode 100755 index 0000000000..23b338297d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl_AZ.res new file mode 100755 index 0000000000..20a61f02b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Cyrl_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn.res new file mode 100755 index 0000000000..7dfa8a55f6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn_AZ.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/az_Latn_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas.res new file mode 100755 index 0000000000..e079a54876 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bas_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be.res new file mode 100755 index 0000000000..fa62377052 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be_BY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be_BY.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/be_BY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem.res new file mode 100755 index 0000000000..7de5ab1075 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem_ZM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem_ZM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bem_ZM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez.res new file mode 100755 index 0000000000..17dbc72191 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bez_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg.res new file mode 100755 index 0000000000..b98c603609 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg_BG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg_BG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bg_BG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm.res new file mode 100755 index 0000000000..bed4fcbb5d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm_ML.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm_ML.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bm_ML.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn.res new file mode 100755 index 0000000000..dea2f05a11 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_BD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_BD.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_BD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_IN.res new file mode 100755 index 0000000000..57ce142fad Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bn_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo.res new file mode 100755 index 0000000000..fd2e48a169 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_CN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bo_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br.res new file mode 100755 index 0000000000..dc58b06bd7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br_FR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br_FR.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/br_FR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx.res new file mode 100755 index 0000000000..98314d51e8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx_IN.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/brx_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs.res new file mode 100755 index 0000000000..a2f6a22666 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs_BA.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/bs_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca.res new file mode 100755 index 0000000000..2fa4c5d59c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca_ES.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca_ES.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ca_ES.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg.res new file mode 100755 index 0000000000..e3686c5109 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg_UG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg_UG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cgg_UG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr.res new file mode 100755 index 0000000000..e78791ba38 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr_US.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr_US.res new file mode 100755 index 0000000000..7de44792e2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/chr_US.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs.res new file mode 100755 index 0000000000..b9dc5ac3ea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs_CZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs_CZ.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cs_CZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy.res new file mode 100755 index 0000000000..3559c7ebfb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy_GB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy_GB.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/cy_GB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da.res new file mode 100755 index 0000000000..1a3465bf04 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da_DK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da_DK.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/da_DK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav.res new file mode 100755 index 0000000000..cb03f2a1bd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dav_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de.res new file mode 100755 index 0000000000..79a157ec8f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_AT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_AT.res new file mode 100755 index 0000000000..ecd886354b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_AT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_BE.res new file mode 100755 index 0000000000..00755b1804 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_CH.res new file mode 100755 index 0000000000..257a730811 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_DE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_DE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_DE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LI.res new file mode 100755 index 0000000000..8e96adbed7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LU.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/de_LU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje.res new file mode 100755 index 0000000000..e2195400b7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje_NE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dje_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua.res new file mode 100755 index 0000000000..2eadd5a199 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dua_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo.res new file mode 100755 index 0000000000..8ce0c8ae1f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo_SN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo_SN.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/dyo_SN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu.res new file mode 100755 index 0000000000..a613913060 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ebu_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee.res new file mode 100755 index 0000000000..029bbb9da4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_GH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_TG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_TG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ee_TG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el.res new file mode 100755 index 0000000000..9e118195a2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_CY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_CY.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_CY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_GR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_GR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/el_GR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en.res new file mode 100755 index 0000000000..ae264e51a6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AS.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AU.res new file mode 100755 index 0000000000..c5a81802a2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_AU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BB.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BE.res new file mode 100755 index 0000000000..dac6c94304 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BW.res new file mode 100755 index 0000000000..0656c3f2ed Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BZ.res new file mode 100755 index 0000000000..57a216e567 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_BZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_CA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_CA.res new file mode 100755 index 0000000000..f515d62ae7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_CA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GB.res new file mode 100755 index 0000000000..f5d3b8d8f4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GU.res new file mode 100755 index 0000000000..e23787bbaf Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GY.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_GY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_HK.res new file mode 100755 index 0000000000..56cd9d03a1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IE.res new file mode 100755 index 0000000000..e49f64d582 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IN.res new file mode 100755 index 0000000000..6c95fdad40 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_JM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_JM.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_JM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MP.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MT.res new file mode 100755 index 0000000000..28c5bad72b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MU.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_MU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NA.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NZ.res new file mode 100755 index 0000000000..ef175a4adc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_NZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PH.res new file mode 100755 index 0000000000..d6995aaef7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PK.res new file mode 100755 index 0000000000..0c334e181f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_RH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_RH.res new file mode 100755 index 0000000000..df1b86000a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_RH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_SG.res new file mode 100755 index 0000000000..313a8f45e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_TT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_TT.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_TT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_UM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_UM.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_UM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US.res new file mode 100755 index 0000000000..1e3cc2f1e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US_POSIX.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US_POSIX.res new file mode 100755 index 0000000000..c5abc3ef40 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_US_POSIX.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_VI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_VI.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_VI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZA.res new file mode 100755 index 0000000000..da0952d68c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZW.res new file mode 100755 index 0000000000..dbb47a8eff Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/en_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eo.res new file mode 100755 index 0000000000..ab2e01753b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es.res new file mode 100755 index 0000000000..79d26493f0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_419.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_419.res new file mode 100755 index 0000000000..c70c91e21a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_419.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_AR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_AR.res new file mode 100755 index 0000000000..8838926b3c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_AR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_BO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_BO.res new file mode 100755 index 0000000000..033c90feeb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_BO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CL.res new file mode 100755 index 0000000000..aa21a4b50f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CO.res new file mode 100755 index 0000000000..5262b66c79 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CR.res new file mode 100755 index 0000000000..44bbe638d1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_CR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_DO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_DO.res new file mode 100755 index 0000000000..5235efc8e2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_DO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_EC.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_EC.res new file mode 100755 index 0000000000..d7263e13b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_EC.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_ES.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_ES.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_ES.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GQ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GQ.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GQ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GT.res new file mode 100755 index 0000000000..cc2de503c2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_GT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_HN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_HN.res new file mode 100755 index 0000000000..4224a1a0ea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_HN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_MX.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_MX.res new file mode 100755 index 0000000000..b95e9cbca9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_MX.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_NI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_NI.res new file mode 100755 index 0000000000..b95e9cbca9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_NI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PA.res new file mode 100755 index 0000000000..c99f182465 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PE.res new file mode 100755 index 0000000000..32362d82b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PR.res new file mode 100755 index 0000000000..c99f182465 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PY.res new file mode 100755 index 0000000000..dc9b3d6a5d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_PY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_SV.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_SV.res new file mode 100755 index 0000000000..b95e9cbca9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_SV.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_US.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_US.res new file mode 100755 index 0000000000..b8ed83af09 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_US.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_UY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_UY.res new file mode 100755 index 0000000000..170185d16c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_UY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_VE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_VE.res new file mode 100755 index 0000000000..2d817dbd21 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/es_VE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et.res new file mode 100755 index 0000000000..aa55e5aed3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et_EE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et_EE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/et_EE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu.res new file mode 100755 index 0000000000..27d395820f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu_ES.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu_ES.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/eu_ES.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo.res new file mode 100755 index 0000000000..43e64df5f2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ewo_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa.res new file mode 100755 index 0000000000..8893dbd595 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_AF.res new file mode 100755 index 0000000000..e12f1d8825 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_IR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_IR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fa_IR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff.res new file mode 100755 index 0000000000..a7c200153d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff_SN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff_SN.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ff_SN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi.res new file mode 100755 index 0000000000..781a8360b1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi_FI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi_FI.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fi_FI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil.res new file mode 100755 index 0000000000..09952eeb4a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil_PH.res new file mode 100755 index 0000000000..e4cac110a7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fil_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo.res new file mode 100755 index 0000000000..c19cc2f1b7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo_FO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo_FO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fo_FO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr.res new file mode 100755 index 0000000000..f549e77a79 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BE.res new file mode 100755 index 0000000000..b4afeb7ce1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BF.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BI.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BJ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BJ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BJ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BL.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_BL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CA.res new file mode 100755 index 0000000000..61a953c922 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CF.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CH.res new file mode 100755 index 0000000000..dd296a037a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CI.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_DJ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_DJ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_DJ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_FR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_FR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_FR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GA.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GF.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GN.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GP.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GQ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GQ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_GQ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_KM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_KM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_KM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_LU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_LU.res new file mode 100755 index 0000000000..b22b203456 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_LU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MC.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MC.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MC.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MF.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_ML.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_ML.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_ML.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MQ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MQ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_MQ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_NE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RW.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_RW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_SN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_SN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_SN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_TG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_YT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_YT.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/fr_YT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga.res new file mode 100755 index 0000000000..cc7fe781b2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga_IE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga_IE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ga_IE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl.res new file mode 100755 index 0000000000..01a544fb3b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl_ES.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl_ES.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gl_ES.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw.res new file mode 100755 index 0000000000..87e2a5bef0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw_CH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gsw_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu.res new file mode 100755 index 0000000000..6efc89611e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gu_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz.res new file mode 100755 index 0000000000..d75280742d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/guz_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv.res new file mode 100755 index 0000000000..b639b949ed Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv_GB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv_GB.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/gv_GB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha.res new file mode 100755 index 0000000000..3a86e755f8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_GH.res new file mode 100755 index 0000000000..1edc5961c2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn.res new file mode 100755 index 0000000000..7dfa8a55f6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_GH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_Latn_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NE.res new file mode 100755 index 0000000000..46a98886d0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NG.res new file mode 100755 index 0000000000..954922a1a3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ha_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw.res new file mode 100755 index 0000000000..d75e2d1757 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw_US.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw_US.res new file mode 100755 index 0000000000..1e3cc2f1e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/haw_US.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he.res new file mode 100755 index 0000000000..e08a6a3214 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he_IL.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/he_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi.res new file mode 100755 index 0000000000..0c25ee767c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hi_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr.res new file mode 100755 index 0000000000..2b1aad8dd0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr_HR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr_HR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hr_HR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu.res new file mode 100755 index 0000000000..4a6dd53945 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu_HU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu_HU.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hu_HU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy.res new file mode 100755 index 0000000000..8fa38b249a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy_AM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy_AM.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/hy_AM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id.res new file mode 100755 index 0000000000..e5ccefc898 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id_ID.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/id_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig.res new file mode 100755 index 0000000000..5f921af750 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig_NG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ig_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii.res new file mode 100755 index 0000000000..3026f418c1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii_CN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ii_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in.res new file mode 100755 index 0000000000..6a5ac33942 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in_ID.res new file mode 100755 index 0000000000..dcdcac2986 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/in_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is.res new file mode 100755 index 0000000000..e7cb73a7e6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is_IS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is_IS.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/is_IS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it.res new file mode 100755 index 0000000000..01af535275 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_CH.res new file mode 100755 index 0000000000..b8557c2b64 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_IT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_IT.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/it_IT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw.res new file mode 100755 index 0000000000..e64e1b39bd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw_IL.res new file mode 100755 index 0000000000..e586d07777 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/iw_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja.res new file mode 100755 index 0000000000..5e934c4a0e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP_TRADITIONAL.res new file mode 100755 index 0000000000..4b6ec414e1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ja_JP_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc.res new file mode 100755 index 0000000000..a82b794be6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/jmc_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka.res new file mode 100755 index 0000000000..ceb5fd051b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka_GE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka_GE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ka_GE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab.res new file mode 100755 index 0000000000..0cb22b26aa Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab_DZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab_DZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kab_DZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam.res new file mode 100755 index 0000000000..22875f11d3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam_KE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kam_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde.res new file mode 100755 index 0000000000..6c0a7e1f95 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kde_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea.res new file mode 100755 index 0000000000..30b0831702 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea_CV.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea_CV.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kea_CV.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq.res new file mode 100755 index 0000000000..920cef2479 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq_ML.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq_ML.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/khq_ML.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki.res new file mode 100755 index 0000000000..83df84208e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ki_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk.res new file mode 100755 index 0000000000..1ab9f63d7d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl.res new file mode 100755 index 0000000000..7ea5f09ab1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl_KZ.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_Cyrl_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_KZ.res new file mode 100755 index 0000000000..6cfb7f01dd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kk_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl.res new file mode 100755 index 0000000000..360d5becd2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl_GL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl_GL.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kl_GL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln.res new file mode 100755 index 0000000000..189154e7c9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kln_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km.res new file mode 100755 index 0000000000..a1756063c0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km_KH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km_KH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/km_KH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn.res new file mode 100755 index 0000000000..0b73216ea6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kn_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko.res new file mode 100755 index 0000000000..63210093a5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko_KR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko_KR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ko_KR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok.res new file mode 100755 index 0000000000..c0f5aee86c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kok_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb.res new file mode 100755 index 0000000000..95dff90ee4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksb_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf.res new file mode 100755 index 0000000000..2d7c8e3c69 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ksf_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw.res new file mode 100755 index 0000000000..7928166d5f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw_GB.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw_GB.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/kw_GB.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag.res new file mode 100755 index 0000000000..42be0b88d0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lag_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg.res new file mode 100755 index 0000000000..62c07ee812 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg_UG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg_UG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lg_UG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln.res new file mode 100755 index 0000000000..b0c543c0ea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CD.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ln_CG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt.res new file mode 100755 index 0000000000..2d4c3ea35f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt_LT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt_LT.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lt_LT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu.res new file mode 100755 index 0000000000..e5dd3f3ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu_CD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu_CD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lu_CD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo.res new file mode 100755 index 0000000000..808fc803d1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luo_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy.res new file mode 100755 index 0000000000..bebf877bc4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/luy_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv.res new file mode 100755 index 0000000000..7771000677 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv_LV.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv_LV.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/lv_LV.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas.res new file mode 100755 index 0000000000..1b4969c7d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mas_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer.res new file mode 100755 index 0000000000..3c7d66608a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mer_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe.res new file mode 100755 index 0000000000..106ca837c6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe_MU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe_MU.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mfe_MU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg.res new file mode 100755 index 0000000000..82618faabd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg_MG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg_MG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mg_MG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh.res new file mode 100755 index 0000000000..f9636bb77d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh_MZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh_MZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mgh_MZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk.res new file mode 100755 index 0000000000..4cf9ea19ee Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk_MK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk_MK.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mk_MK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml.res new file mode 100755 index 0000000000..3bfcbba262 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ml_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mo.res new file mode 100755 index 0000000000..3f8911a731 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr.res new file mode 100755 index 0000000000..59dd5623e8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mr_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms.res new file mode 100755 index 0000000000..c52394640a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_BN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_BN.res new file mode 100755 index 0000000000..7792b11717 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_BN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_MY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_MY.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ms_MY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt.res new file mode 100755 index 0000000000..d0853a0a88 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt_MT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt_MT.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mt_MT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua.res new file mode 100755 index 0000000000..59070d55b0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/mua_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my.res new file mode 100755 index 0000000000..7d7f3ab8ab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my_MM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my_MM.res new file mode 100755 index 0000000000..9a494ec60c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/my_MM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq.res new file mode 100755 index 0000000000..cf34275f49 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq_NA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq_NA.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/naq_NA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb.res new file mode 100755 index 0000000000..3708df7d90 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb_NO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nb_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd.res new file mode 100755 index 0000000000..f0db1ee43d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd_ZW.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nd_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne.res new file mode 100755 index 0000000000..ee13202653 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_IN.res new file mode 100755 index 0000000000..43513e1c86 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_NP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_NP.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ne_NP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl.res new file mode 100755 index 0000000000..cc55f3a3bf Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_AW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_AW.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_AW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_BE.res new file mode 100755 index 0000000000..9432332de3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_CW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_CW.res new file mode 100755 index 0000000000..e881e0fc2e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_CW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_NL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_NL.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_NL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_SX.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_SX.res new file mode 100755 index 0000000000..e881e0fc2e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nl_SX.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg.res new file mode 100755 index 0000000000..9b4a55af4a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nmg_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn.res new file mode 100755 index 0000000000..320b33902d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn_NO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nn_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no.res new file mode 100755 index 0000000000..f11a728c15 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO.res new file mode 100755 index 0000000000..4c61d61206 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO_NY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO_NY.res new file mode 100755 index 0000000000..4599f32a3c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/no_NO_NY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus.res new file mode 100755 index 0000000000..59ff821a7a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus_SD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus_SD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nus_SD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn.res new file mode 100755 index 0000000000..6b41072805 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn_UG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn_UG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/nyn_UG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om.res new file mode 100755 index 0000000000..fa23514656 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_ET.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_ET.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_ET.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_KE.res new file mode 100755 index 0000000000..3d827ada45 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/om_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or.res new file mode 100755 index 0000000000..105b92e97a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/or_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa.res new file mode 100755 index 0000000000..fae1477eca Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab.res new file mode 100755 index 0000000000..c8007241af Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab_PK.res new file mode 100755 index 0000000000..20a61f02b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Arab_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru.res new file mode 100755 index 0000000000..ae18e1b677 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_Guru_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_IN.res new file mode 100755 index 0000000000..5a7533dae2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_PK.res new file mode 100755 index 0000000000..a713857528 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pa_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl.res new file mode 100755 index 0000000000..4f691e54e9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl_PL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl_PL.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pl_PL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps.res new file mode 100755 index 0000000000..628cb19b94 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps_AF.res new file mode 100755 index 0000000000..20a61f02b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ps_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt.res new file mode 100755 index 0000000000..c6f9f71b81 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_AO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_AO.res new file mode 100755 index 0000000000..3608ecc115 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_AO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_BR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_BR.res new file mode 100755 index 0000000000..ad13c237d9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_BR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_GW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_GW.res new file mode 100755 index 0000000000..3608ecc115 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_GW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_MZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_MZ.res new file mode 100755 index 0000000000..3608ecc115 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_MZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_PT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_PT.res new file mode 100755 index 0000000000..a39a4d701b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_PT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_ST.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_ST.res new file mode 100755 index 0000000000..3608ecc115 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/pt_ST.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm.res new file mode 100755 index 0000000000..204fd7a4b0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm_CH.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rm_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn.res new file mode 100755 index 0000000000..3a1f184fb3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn_BI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn_BI.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rn_BI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro.res new file mode 100755 index 0000000000..0aa182779f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_MD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_MD.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_MD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_RO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_RO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ro_RO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof.res new file mode 100755 index 0000000000..df70d3a2da Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rof_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/root.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/root.res new file mode 100755 index 0000000000..fc7be5a86a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/root.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru.res new file mode 100755 index 0000000000..c5d3a89a4f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_MD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_MD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_MD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_RU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_RU.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_RU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_UA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_UA.res new file mode 100755 index 0000000000..d792894901 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ru_UA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw.res new file mode 100755 index 0000000000..59479d06a5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw_RW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw_RW.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rw_RW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk.res new file mode 100755 index 0000000000..dc5d0113dc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/rwk_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq.res new file mode 100755 index 0000000000..a5b3353b5d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/saq_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp.res new file mode 100755 index 0000000000..84a8be78e7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sbp_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh.res new file mode 100755 index 0000000000..99dd7e2e55 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh_MZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh_MZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/seh_MZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses.res new file mode 100755 index 0000000000..f241c572d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses_ML.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses_ML.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ses_ML.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg.res new file mode 100755 index 0000000000..d4be14a06f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg_CF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg_CF.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sg_CF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh.res new file mode 100755 index 0000000000..0cdf3e0d66 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_BA.res new file mode 100755 index 0000000000..ba85740b9a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sh_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi.res new file mode 100755 index 0000000000..4912405b0b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn_MA.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_MA.res new file mode 100755 index 0000000000..36bc365aec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng.res new file mode 100755 index 0000000000..9851345f4a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng_MA.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/shi_Tfng_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si.res new file mode 100755 index 0000000000..79ff255ace Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si_LK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si_LK.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/si_LK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk.res new file mode 100755 index 0000000000..cb8a28176a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk_SK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk_SK.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sk_SK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl.res new file mode 100755 index 0000000000..d1966cec00 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl_SI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl_SI.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sl_SI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn.res new file mode 100755 index 0000000000..b98a2c5d97 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn_ZW.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sn_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so.res new file mode 100755 index 0000000000..cbe1e123c2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_DJ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_DJ.res new file mode 100755 index 0000000000..3d827ada45 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_DJ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_ET.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_ET.res new file mode 100755 index 0000000000..3d827ada45 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_ET.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_KE.res new file mode 100755 index 0000000000..3d827ada45 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_SO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_SO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/so_SO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq.res new file mode 100755 index 0000000000..27dc14e8f0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq_AL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq_AL.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sq_AL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr.res new file mode 100755 index 0000000000..d0c70d66a2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_BA.res new file mode 100755 index 0000000000..dfc6b9cf5e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl.res new file mode 100755 index 0000000000..7ea5f09ab1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_BA.res new file mode 100755 index 0000000000..7bf3de95c8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_ME.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_RS.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Cyrl_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn.res new file mode 100755 index 0000000000..76fe549a38 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_BA.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_ME.res new file mode 100755 index 0000000000..3d0812173a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_RS.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_Latn_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_ME.res new file mode 100755 index 0000000000..aac52f2add Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_RS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sr_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv.res new file mode 100755 index 0000000000..297bd42b6e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_FI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_FI.res new file mode 100755 index 0000000000..b8bcf07f70 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_FI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_SE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_SE.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sv_SE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw.res new file mode 100755 index 0000000000..e9c3b768eb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_KE.res new file mode 100755 index 0000000000..4886e6d9d6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_TZ.res new file mode 100755 index 0000000000..f8c6726a4a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/sw_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc.res new file mode 100755 index 0000000000..b5514bbc6f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc_CD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc_CD.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/swc_CD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta.res new file mode 100755 index 0000000000..b4d5b7d87d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_LK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_LK.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ta_LK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te.res new file mode 100755 index 0000000000..e52b53f1a3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te_IN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/te_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo.res new file mode 100755 index 0000000000..43a5b02a91 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_KE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_KE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_KE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_UG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_UG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/teo_UG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th.res new file mode 100755 index 0000000000..d096b043fe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH_TRADITIONAL.res new file mode 100755 index 0000000000..4341e54401 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/th_TH_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti.res new file mode 100755 index 0000000000..a25eb39f2a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ER.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ER.res new file mode 100755 index 0000000000..85886ee2a1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ER.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ET.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ET.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ti_ET.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl.res new file mode 100755 index 0000000000..a70580492b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl_PH.res new file mode 100755 index 0000000000..6c39389184 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tl_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to.res new file mode 100755 index 0000000000..21acf4fe86 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to_TO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to_TO.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/to_TO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr.res new file mode 100755 index 0000000000..15a9f33d52 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr_TR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr_TR.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tr_TR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq.res new file mode 100755 index 0000000000..e0b6f06df6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq_NE.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/twq_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm.res new file mode 100755 index 0000000000..9e7a009fff Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn.res new file mode 100755 index 0000000000..c029bc0ba7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn_MA.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_MA.res new file mode 100755 index 0000000000..fa1287bc54 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/tzm_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk.res new file mode 100755 index 0000000000..ce5f0358d1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk_UA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk_UA.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uk_UA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur.res new file mode 100755 index 0000000000..1b73a92850 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_IN.res new file mode 100755 index 0000000000..883f2b5e66 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_PK.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/ur_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz.res new file mode 100755 index 0000000000..cc332d7166 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_AF.res new file mode 100755 index 0000000000..4243259061 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab.res new file mode 100755 index 0000000000..69a9ce24de Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab_AF.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Arab_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl.res new file mode 100755 index 0000000000..7ea5f09ab1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl_UZ.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Cyrl_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn.res new file mode 100755 index 0000000000..e62f0f8a63 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn_UZ.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_Latn_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_UZ.res new file mode 100755 index 0000000000..ca4f1c3171 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/uz_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai.res new file mode 100755 index 0000000000..e06e12b79e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_LR.res new file mode 100755 index 0000000000..8d03de293b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn.res new file mode 100755 index 0000000000..588c2e70e6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn_LR.res new file mode 100755 index 0000000000..0eed211f4e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Latn_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii.res new file mode 100755 index 0000000000..97f7e0ef91 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii_LR.res new file mode 100755 index 0000000000..0eed211f4e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vai_Vaii_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi.res new file mode 100755 index 0000000000..2327715074 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi_VN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi_VN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vi_VN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun.res new file mode 100755 index 0000000000..54986786ca Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun_TZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun_TZ.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/vun_TZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog.res new file mode 100755 index 0000000000..ccc0c788e7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog_UG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog_UG.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/xog_UG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav.res new file mode 100755 index 0000000000..20e4cead93 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav_CM.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav_CM.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yav_CM.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo.res new file mode 100755 index 0000000000..79a748e75d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo_NG.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/yo_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh.res new file mode 100755 index 0000000000..ffdd788fef Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_CN.res new file mode 100755 index 0000000000..b92fec8c89 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_HK.res new file mode 100755 index 0000000000..740476e738 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans.res new file mode 100755 index 0000000000..3c360377e0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_CN.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_HK.res new file mode 100755 index 0000000000..8430785993 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_MO.res new file mode 100755 index 0000000000..fe22082d4d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_SG.res new file mode 100755 index 0000000000..8d3efde682 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hans_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant.res new file mode 100755 index 0000000000..497e641804 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_HK.res new file mode 100755 index 0000000000..59c4f02e9f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_MO.res new file mode 100755 index 0000000000..a84ab5a963 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_TW.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_Hant_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_MO.res new file mode 100755 index 0000000000..99708079ec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_SG.res new file mode 100755 index 0000000000..6dc927e229 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_TW.res new file mode 100755 index 0000000000..27020e6762 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zh_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu.res new file mode 100755 index 0000000000..21ccfbc3a9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu_ZA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu_ZA.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/locales/zu_ZA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ar.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ar.res new file mode 100755 index 0000000000..a1da61b318 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ar.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bg.res new file mode 100755 index 0000000000..e0b268c4ac Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/br.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/br.res new file mode 100755 index 0000000000..4044b5ce1c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/br.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/brx.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/brx.res new file mode 100755 index 0000000000..2c708ac277 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/brx.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bs.res new file mode 100755 index 0000000000..2c4ff8e903 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/bs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ca.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ca.res new file mode 100755 index 0000000000..914eed5016 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ca.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/cs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/cs.res new file mode 100755 index 0000000000..1fe4536e54 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/cs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/da.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/da.res new file mode 100755 index 0000000000..aa9cd27508 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/da.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de.res new file mode 100755 index 0000000000..c7795d82be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de_CH.res new file mode 100755 index 0000000000..d865870627 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/de_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/el.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/el.res new file mode 100755 index 0000000000..834c0afb69 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/el.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en.res new file mode 100755 index 0000000000..ad05ae0cab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_RH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_RH.res new file mode 100755 index 0000000000..ad05ae0cab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_RH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_ZW.res new file mode 100755 index 0000000000..ad05ae0cab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/en_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es.res new file mode 100755 index 0000000000..f7c9cdb028 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_419.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_419.res new file mode 100755 index 0000000000..f7c9cdb028 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_419.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_CL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_CL.res new file mode 100755 index 0000000000..2bfaa8d98c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/es_CL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/et.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/et.res new file mode 100755 index 0000000000..5d2876757a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/et.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/eu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/eu.res new file mode 100755 index 0000000000..3f185789bb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/eu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa.res new file mode 100755 index 0000000000..f4ac92f138 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa_AF.res new file mode 100755 index 0000000000..7ee858c242 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fa_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fi.res new file mode 100755 index 0000000000..b499167bf7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil.res new file mode 100755 index 0000000000..e3b1cd89fb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil_PH.res new file mode 100755 index 0000000000..e3b1cd89fb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fil_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr.res new file mode 100755 index 0000000000..9c04f22a78 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr_CA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr_CA.res new file mode 100755 index 0000000000..9c04f22a78 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/fr_CA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gsw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gsw.res new file mode 100755 index 0000000000..3d453e3fe1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gsw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gu.res new file mode 100755 index 0000000000..7ec17ce161 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/gu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he.res new file mode 100755 index 0000000000..997a4c29be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he_IL.res new file mode 100755 index 0000000000..997a4c29be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/he_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hi.res new file mode 100755 index 0000000000..c249d65500 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hr.res new file mode 100755 index 0000000000..0fa33834f1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hu.res new file mode 100755 index 0000000000..441fa5baea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/hu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id.res new file mode 100755 index 0000000000..3946f8575e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id_ID.res new file mode 100755 index 0000000000..3946f8575e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/id_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in.res new file mode 100755 index 0000000000..3946f8575e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in_ID.res new file mode 100755 index 0000000000..3946f8575e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/in_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/it.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/it.res new file mode 100755 index 0000000000..1ea9fa6dfd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/it.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw.res new file mode 100755 index 0000000000..997a4c29be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw_IL.res new file mode 100755 index 0000000000..997a4c29be Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/iw_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja.res new file mode 100755 index 0000000000..fa0980c19a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP.res new file mode 100755 index 0000000000..fa0980c19a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP_TRADITIONAL.res new file mode 100755 index 0000000000..fa0980c19a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ja_JP_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ko.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ko.res new file mode 100755 index 0000000000..6b2c0d79a8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ko.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lt.res new file mode 100755 index 0000000000..b37769dbf2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lv.res new file mode 100755 index 0000000000..8323456f59 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/lv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mk.res new file mode 100755 index 0000000000..d7d0fb72f9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ml.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ml.res new file mode 100755 index 0000000000..ac0cbf5d57 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ml.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mo.res new file mode 100755 index 0000000000..6b6616027a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mr.res new file mode 100755 index 0000000000..6cafc25b7d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mt.res new file mode 100755 index 0000000000..db72e3827f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/mt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/my.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/my.res new file mode 100755 index 0000000000..2077dd8333 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/my.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb.res new file mode 100755 index 0000000000..5e38719e1e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb_NO.res new file mode 100755 index 0000000000..5e38719e1e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nb_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ne.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ne.res new file mode 100755 index 0000000000..a7231c7e99 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ne.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl.res new file mode 100755 index 0000000000..d50df38cbd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl_BE.res new file mode 100755 index 0000000000..995aa58808 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nl_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn.res new file mode 100755 index 0000000000..caf19cfb47 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn_NO.res new file mode 100755 index 0000000000..caf19cfb47 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/nn_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no.res new file mode 100755 index 0000000000..5e38719e1e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO.res new file mode 100755 index 0000000000..5e38719e1e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO_NY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO_NY.res new file mode 100755 index 0000000000..caf19cfb47 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/no_NO_NY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pl.res new file mode 100755 index 0000000000..cec48d2dcf Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt.res new file mode 100755 index 0000000000..2a76713ecc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt_PT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt_PT.res new file mode 100755 index 0000000000..c26b0089d3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/pt_PT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/rm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/rm.res new file mode 100755 index 0000000000..64c8c9362f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/rm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro.res new file mode 100755 index 0000000000..6b6616027a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro_MD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro_MD.res new file mode 100755 index 0000000000..6b6616027a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ro_MD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ru.res new file mode 100755 index 0000000000..001ee9e41e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_BA.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_CS.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_YU.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sh_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sl.res new file mode 100755 index 0000000000..aeefec5876 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_BA.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_CS.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_BA.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_CS.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_RS.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_YU.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Cyrl_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_BA.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_CS.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_ME.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_RS.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_YU.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_Latn_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_ME.res new file mode 100755 index 0000000000..ed262780b9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_RS.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_YU.res new file mode 100755 index 0000000000..88972e5ba1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sr_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv.res new file mode 100755 index 0000000000..aa23bc5cb9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv_FI.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv_FI.res new file mode 100755 index 0000000000..aa23bc5cb9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/sv_FI.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ta.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ta.res new file mode 100755 index 0000000000..47d6419a4b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/ta.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/te.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/te.res new file mode 100755 index 0000000000..081ec22a0c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/te.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th.res new file mode 100755 index 0000000000..86401b5936 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH.res new file mode 100755 index 0000000000..86401b5936 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH_TRADITIONAL.res new file mode 100755 index 0000000000..86401b5936 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/th_TH_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl.res new file mode 100755 index 0000000000..e3b1cd89fb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl_PH.res new file mode 100755 index 0000000000..e3b1cd89fb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tl_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tr.res new file mode 100755 index 0000000000..b937a85335 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/tr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/uk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/uk.res new file mode 100755 index 0000000000..d9489f77ad Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/uk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh.res new file mode 100755 index 0000000000..9b42f51b44 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_CN.res new file mode 100755 index 0000000000..9b42f51b44 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_HK.res new file mode 100755 index 0000000000..99f969eb9c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans.res new file mode 100755 index 0000000000..9b42f51b44 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_CN.res new file mode 100755 index 0000000000..9b42f51b44 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_HK.res new file mode 100755 index 0000000000..f824edb8af Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_MO.res new file mode 100755 index 0000000000..f824edb8af Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_SG.res new file mode 100755 index 0000000000..f824edb8af Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hans_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant.res new file mode 100755 index 0000000000..84c4cb5767 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_HK.res new file mode 100755 index 0000000000..99f969eb9c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_MO.res new file mode 100755 index 0000000000..84c4cb5767 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_TW.res new file mode 100755 index 0000000000..84c4cb5767 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_Hant_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_MO.res new file mode 100755 index 0000000000..84c4cb5767 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_SG.res new file mode 100755 index 0000000000..f824edb8af Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_TW.res new file mode 100755 index 0000000000..84c4cb5767 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/names/zh_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/af.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/af.res new file mode 100755 index 0000000000..9545cbf0da Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/af.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/agq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/agq.res new file mode 100755 index 0000000000..aa2c6de7dd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/agq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ak.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ak.res new file mode 100755 index 0000000000..b1b8a37095 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ak.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/am.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/am.res new file mode 100755 index 0000000000..a503d58f3a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/am.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ar.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ar.res new file mode 100755 index 0000000000..606a8fa2ef Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ar.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/as.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/as.res new file mode 100755 index 0000000000..5454b9611b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/as.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/asa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/asa.res new file mode 100755 index 0000000000..c8995047fc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/asa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az.res new file mode 100755 index 0000000000..6d90f7426c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_AZ.res new file mode 100755 index 0000000000..ff23f22775 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Cyrl.res new file mode 100755 index 0000000000..17decc7124 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn_AZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn_AZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/az_Latn_AZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bas.res new file mode 100755 index 0000000000..f93f25ceca Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/be.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/be.res new file mode 100755 index 0000000000..1e69d52040 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/be.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bem.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bem.res new file mode 100755 index 0000000000..247f05bbab Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bem.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bez.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bez.res new file mode 100755 index 0000000000..6857900fc4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bez.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bg.res new file mode 100755 index 0000000000..c8e1a2b5e9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bm.res new file mode 100755 index 0000000000..39679974df Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bn.res new file mode 100755 index 0000000000..d180e8bf95 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bo.res new file mode 100755 index 0000000000..c7277005b8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/br.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/br.res new file mode 100755 index 0000000000..10ec48d111 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/br.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/brx.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/brx.res new file mode 100755 index 0000000000..75f042f207 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/brx.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bs.res new file mode 100755 index 0000000000..ebd8b64f3c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/bs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ca.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ca.res new file mode 100755 index 0000000000..e87534ab2c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ca.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cgg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cgg.res new file mode 100755 index 0000000000..d8ff009d07 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cgg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/chr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/chr.res new file mode 100755 index 0000000000..0a37ac7eeb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/chr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cs.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cs.res new file mode 100755 index 0000000000..57119e7589 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cs.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cy.res new file mode 100755 index 0000000000..6972de15c5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/cy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/da.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/da.res new file mode 100755 index 0000000000..dd467862d1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/da.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dav.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de.res new file mode 100755 index 0000000000..a9cdc08348 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de_CH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de_CH.res new file mode 100755 index 0000000000..abd9d58c21 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/de_CH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dje.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dje.res new file mode 100755 index 0000000000..8617b66a50 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dje.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dua.res new file mode 100755 index 0000000000..9b2fbf6b31 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dyo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dyo.res new file mode 100755 index 0000000000..070b9471b7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/dyo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ebu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ebu.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ebu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ee.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ee.res new file mode 100755 index 0000000000..3e50747060 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ee.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/el.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/el.res new file mode 100755 index 0000000000..ec75b03de5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/el.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en.res new file mode 100755 index 0000000000..ade5ba430a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_RH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_RH.res new file mode 100755 index 0000000000..df1b86000a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_RH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_ZW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_ZW.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/en_ZW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eo.res new file mode 100755 index 0000000000..c05b13ddb7 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es.res new file mode 100755 index 0000000000..c174960315 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es_CL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es_CL.res new file mode 100755 index 0000000000..f5527082c9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/es_CL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/et.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/et.res new file mode 100755 index 0000000000..87fa13d2b3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/et.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eu.res new file mode 100755 index 0000000000..4e206be703 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/eu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ewo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ewo.res new file mode 100755 index 0000000000..917d0f7037 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ewo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa.res new file mode 100755 index 0000000000..5a73e92eec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa_AF.res new file mode 100755 index 0000000000..61b714b90b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fa_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ff.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ff.res new file mode 100755 index 0000000000..7588ddc3e9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ff.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fi.res new file mode 100755 index 0000000000..98cf981bdd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil.res new file mode 100755 index 0000000000..a99ba38177 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil_PH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fil_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fo.res new file mode 100755 index 0000000000..53f55fbe0d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fr.res new file mode 100755 index 0000000000..cba26e917c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/fr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ga.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ga.res new file mode 100755 index 0000000000..e62f8e1aa9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ga.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gl.res new file mode 100755 index 0000000000..b9f845b52f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gsw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gsw.res new file mode 100755 index 0000000000..756fccef1f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gsw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gu.res new file mode 100755 index 0000000000..ffcdd1ec84 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/guz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/guz.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/guz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gv.res new file mode 100755 index 0000000000..373083efed Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/gv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha.res new file mode 100755 index 0000000000..6ca4147f6c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_GH.res new file mode 100755 index 0000000000..1edc5961c2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_GH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_GH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_GH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NE.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NG.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_Latn_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NE.res new file mode 100755 index 0000000000..46a98886d0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NG.res new file mode 100755 index 0000000000..954922a1a3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ha_NG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/haw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/haw.res new file mode 100755 index 0000000000..960140795a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/haw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he.res new file mode 100755 index 0000000000..982d1da282 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he_IL.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/he_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hi.res new file mode 100755 index 0000000000..9bce6c4d55 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hr.res new file mode 100755 index 0000000000..fe3f289958 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hu.res new file mode 100755 index 0000000000..34917833fe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hy.res new file mode 100755 index 0000000000..1a57e56024 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/hy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id.res new file mode 100755 index 0000000000..04426128c8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id_ID.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/id_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ig.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ig.res new file mode 100755 index 0000000000..9788064b30 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ig.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ii.res new file mode 100755 index 0000000000..a699589408 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in.res new file mode 100755 index 0000000000..6a5ac33942 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in_ID.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in_ID.res new file mode 100755 index 0000000000..dcdcac2986 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/in_ID.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/is.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/is.res new file mode 100755 index 0000000000..d308332a38 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/is.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/it.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/it.res new file mode 100755 index 0000000000..733eb7f3e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/it.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw.res new file mode 100755 index 0000000000..e64e1b39bd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw_IL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw_IL.res new file mode 100755 index 0000000000..e586d07777 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/iw_IL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja.res new file mode 100755 index 0000000000..dcf9d9f428 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP_TRADITIONAL.res new file mode 100755 index 0000000000..4b6ec414e1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ja_JP_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/jmc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/jmc.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/jmc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ka.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ka.res new file mode 100755 index 0000000000..d374ec4164 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ka.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kab.res new file mode 100755 index 0000000000..76181bee15 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kam.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kam.res new file mode 100755 index 0000000000..3f47cc1509 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kam.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kde.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kde.res new file mode 100755 index 0000000000..d08cbcd1cb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kde.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kea.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kea.res new file mode 100755 index 0000000000..6af950050d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kea.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/khq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/khq.res new file mode 100755 index 0000000000..d1e93e48d2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/khq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ki.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ki.res new file mode 100755 index 0000000000..d534240bed Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ki.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk.res new file mode 100755 index 0000000000..061430d2a6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl_KZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_Cyrl_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_KZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_KZ.res new file mode 100755 index 0000000000..6cfb7f01dd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kk_KZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kl.res new file mode 100755 index 0000000000..c284d9a5b2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kln.res new file mode 100755 index 0000000000..b7de7fe0da Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/km.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/km.res new file mode 100755 index 0000000000..3ca46a8d32 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/km.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kn.res new file mode 100755 index 0000000000..c9a3b02328 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ko.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ko.res new file mode 100755 index 0000000000..6d9a5500a6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ko.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kok.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kok.res new file mode 100755 index 0000000000..fd67ceab6b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kok.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksb.res new file mode 100755 index 0000000000..644522c0e9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksf.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksf.res new file mode 100755 index 0000000000..60aca4f59b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ksf.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kw.res new file mode 100755 index 0000000000..373083efed Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/kw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lag.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lag.res new file mode 100755 index 0000000000..3f8e430862 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lag.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lg.res new file mode 100755 index 0000000000..802c31a2c6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ln.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ln.res new file mode 100755 index 0000000000..7603965d4d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ln.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lt.res new file mode 100755 index 0000000000..e4419897d3 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lu.res new file mode 100755 index 0000000000..9b99a36fa8 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luo.res new file mode 100755 index 0000000000..c9caf23b31 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luy.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luy.res new file mode 100755 index 0000000000..7ccd3f3add Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/luy.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lv.res new file mode 100755 index 0000000000..68b5e6a861 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/lv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mas.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mas.res new file mode 100755 index 0000000000..9672abf580 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mas.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mer.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mer.res new file mode 100755 index 0000000000..4115b1d0b1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mer.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mfe.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mfe.res new file mode 100755 index 0000000000..8b347e6a7d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mfe.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mg.res new file mode 100755 index 0000000000..992d6d529b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mgh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mgh.res new file mode 100755 index 0000000000..6e45dfd93d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mgh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mk.res new file mode 100755 index 0000000000..c92c5987f2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ml.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ml.res new file mode 100755 index 0000000000..0a94b08c39 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ml.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mo.res new file mode 100755 index 0000000000..3f8911a731 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mr.res new file mode 100755 index 0000000000..d241b3279b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ms.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ms.res new file mode 100755 index 0000000000..836ca11864 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ms.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mt.res new file mode 100755 index 0000000000..af3bf35004 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mua.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mua.res new file mode 100755 index 0000000000..05f67b6481 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/mua.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/my.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/my.res new file mode 100755 index 0000000000..5b29981170 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/my.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/naq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/naq.res new file mode 100755 index 0000000000..d07b51b47a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/naq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb.res new file mode 100755 index 0000000000..7e15803527 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb_NO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nb_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nd.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nd.res new file mode 100755 index 0000000000..19830d5d4a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nd.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ne.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ne.res new file mode 100755 index 0000000000..60c9d51591 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ne.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl.res new file mode 100755 index 0000000000..909b2687da Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl_BE.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl_BE.res new file mode 100755 index 0000000000..4579903a1d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nl_BE.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nmg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nmg.res new file mode 100755 index 0000000000..5f44c3087a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nmg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn.res new file mode 100755 index 0000000000..86888bc8ef Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn_NO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nn_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no.res new file mode 100755 index 0000000000..f11a728c15 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO.res new file mode 100755 index 0000000000..4c61d61206 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO_NY.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO_NY.res new file mode 100755 index 0000000000..4599f32a3c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/no_NO_NY.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nus.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nus.res new file mode 100755 index 0000000000..69060d906f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nus.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nyn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nyn.res new file mode 100755 index 0000000000..af9a45f546 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/nyn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/om.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/om.res new file mode 100755 index 0000000000..424b5ff719 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/om.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/or.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/or.res new file mode 100755 index 0000000000..840ade2791 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/or.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa.res new file mode 100755 index 0000000000..b2f48fbf9f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab.res new file mode 100755 index 0000000000..e58ad252bb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab_PK.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Arab_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru_IN.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_Guru_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_IN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_IN.res new file mode 100755 index 0000000000..5a7533dae2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_IN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_PK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_PK.res new file mode 100755 index 0000000000..a713857528 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pa_PK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pl.res new file mode 100755 index 0000000000..3bdb5e48e4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ps.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ps.res new file mode 100755 index 0000000000..a0a974dba4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ps.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt.res new file mode 100755 index 0000000000..ea42068e61 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt_PT.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt_PT.res new file mode 100755 index 0000000000..0b562d5aa9 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/pt_PT.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rm.res new file mode 100755 index 0000000000..92037c9480 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rn.res new file mode 100755 index 0000000000..1467430fd4 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro.res new file mode 100755 index 0000000000..ebc0d28b1b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro_MD.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro_MD.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ro_MD.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rof.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rof.res new file mode 100755 index 0000000000..da058ac68b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rof.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/root.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/root.res new file mode 100755 index 0000000000..9fbf1e8144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/root.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ru.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ru.res new file mode 100755 index 0000000000..b9b089c93a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ru.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rw.res new file mode 100755 index 0000000000..0fd3089d0f Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rwk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rwk.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/rwk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/saq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/saq.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/saq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sbp.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sbp.res new file mode 100755 index 0000000000..a5ebefb368 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sbp.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/seh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/seh.res new file mode 100755 index 0000000000..0ade70728c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/seh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ses.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ses.res new file mode 100755 index 0000000000..d1e93e48d2 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ses.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sg.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sg.res new file mode 100755 index 0000000000..499662c64c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sg.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh.res new file mode 100755 index 0000000000..0cdf3e0d66 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_BA.res new file mode 100755 index 0000000000..ba85740b9a Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sh_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi.res new file mode 100755 index 0000000000..ff860e586c Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn_MA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_MA.res new file mode 100755 index 0000000000..36bc365aec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Tfng.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Tfng.res new file mode 100755 index 0000000000..f297e333ac Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/shi_Tfng.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/si.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/si.res new file mode 100755 index 0000000000..b08aeb5c35 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/si.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sk.res new file mode 100755 index 0000000000..5e9cb7050d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sl.res new file mode 100755 index 0000000000..8faab15637 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sn.res new file mode 100755 index 0000000000..c489c8cb96 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/so.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/so.res new file mode 100755 index 0000000000..766200a922 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/so.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sq.res new file mode 100755 index 0000000000..77f2e0d1ca Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr.res new file mode 100755 index 0000000000..91376263c5 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_BA.res new file mode 100755 index 0000000000..dfc6b9cf5e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_BA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_CS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_RS.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Cyrl_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn.res new file mode 100755 index 0000000000..266122db55 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_BA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_BA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_BA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_CS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_CS.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_CS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_ME.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_RS.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_YU.res new file mode 100755 index 0000000000..0b452c9144 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_Latn_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_ME.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_ME.res new file mode 100755 index 0000000000..aac52f2add Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_ME.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_RS.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_RS.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_RS.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_YU.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_YU.res new file mode 100755 index 0000000000..b926e84bbe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sr_YU.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sv.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sv.res new file mode 100755 index 0000000000..bf75948540 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sv.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sw.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sw.res new file mode 100755 index 0000000000..55acd23d0d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/sw.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/swc.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/swc.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/swc.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ta.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ta.res new file mode 100755 index 0000000000..9674aea919 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ta.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/te.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/te.res new file mode 100755 index 0000000000..c03bd9400d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/te.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/teo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/teo.res new file mode 100755 index 0000000000..2c1b8ee29d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/teo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th.res new file mode 100755 index 0000000000..9aafa21b72 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH_TRADITIONAL.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH_TRADITIONAL.res new file mode 100755 index 0000000000..4341e54401 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/th_TH_TRADITIONAL.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ti.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ti.res new file mode 100755 index 0000000000..bdf72952b0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ti.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl.res new file mode 100755 index 0000000000..a70580492b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl_PH.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl_PH.res new file mode 100755 index 0000000000..6c39389184 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tl_PH.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/to.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/to.res new file mode 100755 index 0000000000..165cf07918 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/to.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tr.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tr.res new file mode 100755 index 0000000000..fae6421884 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tr.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/twq.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/twq.res new file mode 100755 index 0000000000..1f2fedb26e Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/twq.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm.res new file mode 100755 index 0000000000..90250c145b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn.res new file mode 100755 index 0000000000..e2742291fd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn_MA.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_Latn_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_MA.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_MA.res new file mode 100755 index 0000000000..fa1287bc54 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/tzm_MA.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uk.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uk.res new file mode 100755 index 0000000000..b4b2e23546 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uk.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ur.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ur.res new file mode 100755 index 0000000000..e22113a9f1 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/ur.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz.res new file mode 100755 index 0000000000..219149edbb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_AF.res new file mode 100755 index 0000000000..4243259061 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab.res new file mode 100755 index 0000000000..0e928cecea Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab_AF.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab_AF.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Arab_AF.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl_UZ.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Cyrl_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Latn.res new file mode 100755 index 0000000000..47ed9247e0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_UZ.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_UZ.res new file mode 100755 index 0000000000..ca4f1c3171 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/uz_UZ.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai.res new file mode 100755 index 0000000000..59eddbc887 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_LR.res new file mode 100755 index 0000000000..8d03de293b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Latn.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Latn.res new file mode 100755 index 0000000000..93358b79fe Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Latn.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii.res new file mode 100755 index 0000000000..20a61f02b6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii_LR.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii_LR.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vai_Vaii_LR.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vi.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vi.res new file mode 100755 index 0000000000..47258dd972 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vi.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vun.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vun.res new file mode 100755 index 0000000000..6b37a04e5b Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/vun.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/xog.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/xog.res new file mode 100755 index 0000000000..b23a30e396 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/xog.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yav.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yav.res new file mode 100755 index 0000000000..746d2d08fc Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yav.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yo.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yo.res new file mode 100755 index 0000000000..ef5c65ee88 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/yo.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh.res new file mode 100755 index 0000000000..3302474ccd Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_CN.res new file mode 100755 index 0000000000..b92fec8c89 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_HK.res new file mode 100755 index 0000000000..740476e738 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans.res new file mode 100755 index 0000000000..5ea9f5883d Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_CN.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_CN.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_CN.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_HK.res new file mode 100755 index 0000000000..57a54c98b0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_MO.res new file mode 100755 index 0000000000..bf85942827 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_SG.res new file mode 100755 index 0000000000..92553cd0f0 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hans_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant.res new file mode 100755 index 0000000000..c5535f2e79 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_HK.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_HK.res new file mode 100755 index 0000000000..ac628e4215 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_HK.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_MO.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_TW.res new file mode 100755 index 0000000000..81ba7eaedb Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_Hant_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_MO.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_MO.res new file mode 100755 index 0000000000..99708079ec Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_MO.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_SG.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_SG.res new file mode 100755 index 0000000000..6dc927e229 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_SG.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_TW.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_TW.res new file mode 100755 index 0000000000..27020e6762 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zh_TW.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zu.res b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zu.res new file mode 100755 index 0000000000..5d362079c6 Binary files /dev/null and b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/region/zu.res differ diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/curr/en.php b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/curr/en.php new file mode 100755 index 0000000000..cc090f604a --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/curr/en.php @@ -0,0 +1,1789 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array( + 'ADP' => array( + 'symbol' => 'ADP', + 'name' => 'Andorran Peseta', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'AED' => array( + 'symbol' => 'AED', + 'name' => 'United Arab Emirates Dirham', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AFA' => array( + 'symbol' => 'AFA', + 'name' => 'Afghan Afghani (1927-2002)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AFN' => array( + 'symbol' => 'AFN', + 'name' => 'Afghan Afghani', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ALK' => array( + 'symbol' => 'ALK', + 'name' => 'Albanian Lek (1946-1965)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ALL' => array( + 'symbol' => 'ALL', + 'name' => 'Albanian Lek', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'AMD' => array( + 'symbol' => 'AMD', + 'name' => 'Armenian Dram', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ANG' => array( + 'symbol' => 'ANG', + 'name' => 'Netherlands Antillean Guilder', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AOA' => array( + 'symbol' => 'AOA', + 'name' => 'Angolan Kwanza', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AOK' => array( + 'symbol' => 'AOK', + 'name' => 'Angolan Kwanza (1977-1991)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AON' => array( + 'symbol' => 'AON', + 'name' => 'Angolan New Kwanza (1990-2000)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AOR' => array( + 'symbol' => 'AOR', + 'name' => 'Angolan Readjusted Kwanza (1995-1999)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ARA' => array( + 'symbol' => 'ARA', + 'name' => 'Argentine Austral', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ARL' => array( + 'symbol' => 'ARL', + 'name' => 'Argentine Peso Ley (1970-1983)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ARM' => array( + 'symbol' => 'ARM', + 'name' => 'Argentine Peso (1881-1970)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ARP' => array( + 'symbol' => 'ARP', + 'name' => 'Argentine Peso (1983-1985)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ARS' => array( + 'symbol' => 'ARS', + 'name' => 'Argentine Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ATS' => array( + 'symbol' => 'ATS', + 'name' => 'Austrian Schilling', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AUD' => array( + 'symbol' => 'AU$', + 'name' => 'Australian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AWG' => array( + 'symbol' => 'AWG', + 'name' => 'Aruban Florin', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AZM' => array( + 'symbol' => 'AZM', + 'name' => 'Azerbaijani Manat (1993-2006)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'AZN' => array( + 'symbol' => 'AZN', + 'name' => 'Azerbaijani Manat', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BAD' => array( + 'symbol' => 'BAD', + 'name' => 'Bosnia-Herzegovina Dinar (1992-1994)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BAM' => array( + 'symbol' => 'BAM', + 'name' => 'Bosnia-Herzegovina Convertible Mark', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BAN' => array( + 'symbol' => 'BAN', + 'name' => 'Bosnia-Herzegovina New Dinar (1994-1997)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BBD' => array( + 'symbol' => 'BBD', + 'name' => 'Barbadian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BDT' => array( + 'symbol' => 'BDT', + 'name' => 'Bangladeshi Taka', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BEC' => array( + 'symbol' => 'BEC', + 'name' => 'Belgian Franc (convertible)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BEF' => array( + 'symbol' => 'BEF', + 'name' => 'Belgian Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BEL' => array( + 'symbol' => 'BEL', + 'name' => 'Belgian Franc (financial)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BGL' => array( + 'symbol' => 'BGL', + 'name' => 'Bulgarian Hard Lev', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BGM' => array( + 'symbol' => 'BGM', + 'name' => 'Bulgarian Socialist Lev', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BGN' => array( + 'symbol' => 'BGN', + 'name' => 'Bulgarian Lev', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BGO' => array( + 'symbol' => 'BGO', + 'name' => 'Bulgarian Lev (1879-1952)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BHD' => array( + 'symbol' => 'BHD', + 'name' => 'Bahraini Dinar', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'BIF' => array( + 'symbol' => 'BIF', + 'name' => 'Burundian Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'BMD' => array( + 'symbol' => 'BMD', + 'name' => 'Bermudan Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BND' => array( + 'symbol' => 'BND', + 'name' => 'Brunei Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BOB' => array( + 'symbol' => 'BOB', + 'name' => 'Bolivian Boliviano', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BOL' => array( + 'symbol' => 'BOL', + 'name' => 'Bolivian Boliviano (1863-1963)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BOP' => array( + 'symbol' => 'BOP', + 'name' => 'Bolivian Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BOV' => array( + 'symbol' => 'BOV', + 'name' => 'Bolivian Mvdol', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRB' => array( + 'symbol' => 'BRB', + 'name' => 'Brazilian New Cruzeiro (1967-1986)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRC' => array( + 'symbol' => 'BRC', + 'name' => 'Brazilian Cruzado (1986-1989)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRE' => array( + 'symbol' => 'BRE', + 'name' => 'Brazilian Cruzeiro (1990-1993)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRL' => array( + 'symbol' => 'R$', + 'name' => 'Brazilian Real', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRN' => array( + 'symbol' => 'BRN', + 'name' => 'Brazilian New Cruzado (1989-1990)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRR' => array( + 'symbol' => 'BRR', + 'name' => 'Brazilian Cruzeiro (1993-1994)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BRZ' => array( + 'symbol' => 'BRZ', + 'name' => 'Brazilian Cruzeiro (1942-1967)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BSD' => array( + 'symbol' => 'BSD', + 'name' => 'Bahamian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BTN' => array( + 'symbol' => 'BTN', + 'name' => 'Bhutanese Ngultrum', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BUK' => array( + 'symbol' => 'BUK', + 'name' => 'Burmese Kyat', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BWP' => array( + 'symbol' => 'BWP', + 'name' => 'Botswanan Pula', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BYB' => array( + 'symbol' => 'BYB', + 'name' => 'Belarusian New Ruble (1994-1999)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'BYR' => array( + 'symbol' => 'BYR', + 'name' => 'Belarusian Ruble', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'BZD' => array( + 'symbol' => 'BZD', + 'name' => 'Belize Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CAD' => array( + 'symbol' => 'CA$', + 'name' => 'Canadian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CDF' => array( + 'symbol' => 'CDF', + 'name' => 'Congolese Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CHE' => array( + 'symbol' => 'CHE', + 'name' => 'WIR Euro', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CHF' => array( + 'symbol' => 'CHF', + 'name' => 'Swiss Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 5, + ), + 'CHW' => array( + 'symbol' => 'CHW', + 'name' => 'WIR Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CLE' => array( + 'symbol' => 'CLE', + 'name' => 'Chilean Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CLF' => array( + 'symbol' => 'CLF', + 'name' => 'Chilean Unit of Account (UF)', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'CLP' => array( + 'symbol' => 'CLP', + 'name' => 'Chilean Peso', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'CNX' => array( + 'symbol' => 'CNX', + 'name' => 'Chinese People’s Bank Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CNY' => array( + 'symbol' => 'CN¥', + 'name' => 'Chinese Yuan', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'COP' => array( + 'symbol' => 'COP', + 'name' => 'Colombian Peso', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'COU' => array( + 'symbol' => 'COU', + 'name' => 'Colombian Real Value Unit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CRC' => array( + 'symbol' => 'CRC', + 'name' => 'Costa Rican Colón', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'CSD' => array( + 'symbol' => 'CSD', + 'name' => 'Serbian Dinar (2002-2006)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CSK' => array( + 'symbol' => 'CSK', + 'name' => 'Czechoslovak Hard Koruna', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CUC' => array( + 'symbol' => 'CUC', + 'name' => 'Cuban Convertible Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CUP' => array( + 'symbol' => 'CUP', + 'name' => 'Cuban Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CVE' => array( + 'symbol' => 'CVE', + 'name' => 'Cape Verdean Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CYP' => array( + 'symbol' => 'CYP', + 'name' => 'Cypriot Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'CZK' => array( + 'symbol' => 'CZK', + 'name' => 'Czech Republic Koruna', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'DDM' => array( + 'symbol' => 'DDM', + 'name' => 'East German Mark', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'DEM' => array( + 'symbol' => 'DEM', + 'name' => 'German Mark', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'DJF' => array( + 'symbol' => 'DJF', + 'name' => 'Djiboutian Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'DKK' => array( + 'symbol' => 'DKK', + 'name' => 'Danish Krone', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'DOP' => array( + 'symbol' => 'DOP', + 'name' => 'Dominican Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'DZD' => array( + 'symbol' => 'DZD', + 'name' => 'Algerian Dinar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ECS' => array( + 'symbol' => 'ECS', + 'name' => 'Ecuadorian Sucre', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ECV' => array( + 'symbol' => 'ECV', + 'name' => 'Ecuadorian Unit of Constant Value', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'EEK' => array( + 'symbol' => 'EEK', + 'name' => 'Estonian Kroon', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'EGP' => array( + 'symbol' => 'EGP', + 'name' => 'Egyptian Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ERN' => array( + 'symbol' => 'ERN', + 'name' => 'Eritrean Nakfa', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ESA' => array( + 'symbol' => 'ESA', + 'name' => 'Spanish Peseta (A account)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ESB' => array( + 'symbol' => 'ESB', + 'name' => 'Spanish Peseta (convertible account)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ESP' => array( + 'symbol' => 'ESP', + 'name' => 'Spanish Peseta', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ETB' => array( + 'symbol' => 'ETB', + 'name' => 'Ethiopian Birr', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'EUR' => array( + 'symbol' => '€', + 'name' => 'Euro', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'FIM' => array( + 'symbol' => 'FIM', + 'name' => 'Finnish Markka', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'FJD' => array( + 'symbol' => 'FJD', + 'name' => 'Fijian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'FKP' => array( + 'symbol' => 'FKP', + 'name' => 'Falkland Islands Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'FRF' => array( + 'symbol' => 'FRF', + 'name' => 'French Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GBP' => array( + 'symbol' => '£', + 'name' => 'British Pound Sterling', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GEK' => array( + 'symbol' => 'GEK', + 'name' => 'Georgian Kupon Larit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GEL' => array( + 'symbol' => 'GEL', + 'name' => 'Georgian Lari', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GHC' => array( + 'symbol' => 'GHC', + 'name' => 'Ghanaian Cedi (1979-2007)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GHS' => array( + 'symbol' => 'GHS', + 'name' => 'Ghanaian Cedi', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GIP' => array( + 'symbol' => 'GIP', + 'name' => 'Gibraltar Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GMD' => array( + 'symbol' => 'GMD', + 'name' => 'Gambian Dalasi', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GNF' => array( + 'symbol' => 'GNF', + 'name' => 'Guinean Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'GNS' => array( + 'symbol' => 'GNS', + 'name' => 'Guinean Syli', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GQE' => array( + 'symbol' => 'GQE', + 'name' => 'Equatorial Guinean Ekwele', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GRD' => array( + 'symbol' => 'GRD', + 'name' => 'Greek Drachma', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GTQ' => array( + 'symbol' => 'GTQ', + 'name' => 'Guatemalan Quetzal', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GWE' => array( + 'symbol' => 'GWE', + 'name' => 'Portuguese Guinea Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GWP' => array( + 'symbol' => 'GWP', + 'name' => 'Guinea-Bissau Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'GYD' => array( + 'symbol' => 'GYD', + 'name' => 'Guyanaese Dollar', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'HKD' => array( + 'symbol' => 'HK$', + 'name' => 'Hong Kong Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'HNL' => array( + 'symbol' => 'HNL', + 'name' => 'Honduran Lempira', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'HRD' => array( + 'symbol' => 'HRD', + 'name' => 'Croatian Dinar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'HRK' => array( + 'symbol' => 'HRK', + 'name' => 'Croatian Kuna', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'HTG' => array( + 'symbol' => 'HTG', + 'name' => 'Haitian Gourde', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'HUF' => array( + 'symbol' => 'HUF', + 'name' => 'Hungarian Forint', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'IDR' => array( + 'symbol' => 'IDR', + 'name' => 'Indonesian Rupiah', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'IEP' => array( + 'symbol' => 'IEP', + 'name' => 'Irish Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ILP' => array( + 'symbol' => 'ILP', + 'name' => 'Israeli Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ILR' => array( + 'symbol' => 'ILR', + 'name' => 'Israeli Sheqel (1980-1985)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ILS' => array( + 'symbol' => '₪', + 'name' => 'Israeli New Sheqel', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'INR' => array( + 'symbol' => '₹', + 'name' => 'Indian Rupee', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'IQD' => array( + 'symbol' => 'IQD', + 'name' => 'Iraqi Dinar', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'IRR' => array( + 'symbol' => 'IRR', + 'name' => 'Iranian Rial', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ISJ' => array( + 'symbol' => 'ISJ', + 'name' => 'Icelandic Króna (1918-1981)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ISK' => array( + 'symbol' => 'ISK', + 'name' => 'Icelandic Króna', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ITL' => array( + 'symbol' => 'ITL', + 'name' => 'Italian Lira', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'JMD' => array( + 'symbol' => 'JMD', + 'name' => 'Jamaican Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'JOD' => array( + 'symbol' => 'JOD', + 'name' => 'Jordanian Dinar', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'JPY' => array( + 'symbol' => '¥', + 'name' => 'Japanese Yen', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'KES' => array( + 'symbol' => 'KES', + 'name' => 'Kenyan Shilling', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KGS' => array( + 'symbol' => 'KGS', + 'name' => 'Kyrgystani Som', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KHR' => array( + 'symbol' => 'KHR', + 'name' => 'Cambodian Riel', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KMF' => array( + 'symbol' => 'KMF', + 'name' => 'Comorian Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'KPW' => array( + 'symbol' => 'KPW', + 'name' => 'North Korean Won', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'KRH' => array( + 'symbol' => 'KRH', + 'name' => 'South Korean Hwan (1953-1962)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KRO' => array( + 'symbol' => 'KRO', + 'name' => 'South Korean Won (1945-1953)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KRW' => array( + 'symbol' => '₩', + 'name' => 'South Korean Won', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'KWD' => array( + 'symbol' => 'KWD', + 'name' => 'Kuwaiti Dinar', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'KYD' => array( + 'symbol' => 'KYD', + 'name' => 'Cayman Islands Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'KZT' => array( + 'symbol' => 'KZT', + 'name' => 'Kazakhstani Tenge', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LAK' => array( + 'symbol' => 'LAK', + 'name' => 'Laotian Kip', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'LBP' => array( + 'symbol' => 'LBP', + 'name' => 'Lebanese Pound', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'LKR' => array( + 'symbol' => 'LKR', + 'name' => 'Sri Lankan Rupee', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LRD' => array( + 'symbol' => 'LRD', + 'name' => 'Liberian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LSL' => array( + 'symbol' => 'LSL', + 'name' => 'Lesotho Loti', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LTL' => array( + 'symbol' => 'LTL', + 'name' => 'Lithuanian Litas', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LTT' => array( + 'symbol' => 'LTT', + 'name' => 'Lithuanian Talonas', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LUC' => array( + 'symbol' => 'LUC', + 'name' => 'Luxembourgian Convertible Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LUF' => array( + 'symbol' => 'LUF', + 'name' => 'Luxembourgian Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'LUL' => array( + 'symbol' => 'LUL', + 'name' => 'Luxembourg Financial Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LVL' => array( + 'symbol' => 'LVL', + 'name' => 'Latvian Lats', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LVR' => array( + 'symbol' => 'LVR', + 'name' => 'Latvian Ruble', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'LYD' => array( + 'symbol' => 'LYD', + 'name' => 'Libyan Dinar', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'MAD' => array( + 'symbol' => 'MAD', + 'name' => 'Moroccan Dirham', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MAF' => array( + 'symbol' => 'MAF', + 'name' => 'Moroccan Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MCF' => array( + 'symbol' => 'MCF', + 'name' => 'Monegasque Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MDC' => array( + 'symbol' => 'MDC', + 'name' => 'Moldovan Cupon', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MDL' => array( + 'symbol' => 'MDL', + 'name' => 'Moldovan Leu', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MGA' => array( + 'symbol' => 'MGA', + 'name' => 'Malagasy Ariary', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MGF' => array( + 'symbol' => 'MGF', + 'name' => 'Malagasy Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MKD' => array( + 'symbol' => 'MKD', + 'name' => 'Macedonian Denar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MKN' => array( + 'symbol' => 'MKN', + 'name' => 'Macedonian Denar (1992-1993)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MLF' => array( + 'symbol' => 'MLF', + 'name' => 'Malian Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MMK' => array( + 'symbol' => 'MMK', + 'name' => 'Myanma Kyat', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MNT' => array( + 'symbol' => 'MNT', + 'name' => 'Mongolian Tugrik', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MOP' => array( + 'symbol' => 'MOP', + 'name' => 'Macanese Pataca', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MRO' => array( + 'symbol' => 'MRO', + 'name' => 'Mauritanian Ouguiya', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MTL' => array( + 'symbol' => 'MTL', + 'name' => 'Maltese Lira', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MTP' => array( + 'symbol' => 'MTP', + 'name' => 'Maltese Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MUR' => array( + 'symbol' => 'MUR', + 'name' => 'Mauritian Rupee', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'MVP' => array( + 'symbol' => 'MVP', + 'name' => 'Maldivian Rupee', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MVR' => array( + 'symbol' => 'MVR', + 'name' => 'Maldivian Rufiyaa', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MWK' => array( + 'symbol' => 'MWK', + 'name' => 'Malawian Kwacha', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MXN' => array( + 'symbol' => 'MX$', + 'name' => 'Mexican Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MXP' => array( + 'symbol' => 'MXP', + 'name' => 'Mexican Silver Peso (1861-1992)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MXV' => array( + 'symbol' => 'MXV', + 'name' => 'Mexican Investment Unit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MYR' => array( + 'symbol' => 'MYR', + 'name' => 'Malaysian Ringgit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MZE' => array( + 'symbol' => 'MZE', + 'name' => 'Mozambican Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MZM' => array( + 'symbol' => 'MZM', + 'name' => 'Mozambican Metical (1980-2006)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'MZN' => array( + 'symbol' => 'MZN', + 'name' => 'Mozambican Metical', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NAD' => array( + 'symbol' => 'NAD', + 'name' => 'Namibian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NGN' => array( + 'symbol' => 'NGN', + 'name' => 'Nigerian Naira', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NIC' => array( + 'symbol' => 'NIC', + 'name' => 'Nicaraguan Córdoba (1988-1991)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NIO' => array( + 'symbol' => 'NIO', + 'name' => 'Nicaraguan Córdoba', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NLG' => array( + 'symbol' => 'NLG', + 'name' => 'Dutch Guilder', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NOK' => array( + 'symbol' => 'NOK', + 'name' => 'Norwegian Krone', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NPR' => array( + 'symbol' => 'NPR', + 'name' => 'Nepalese Rupee', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'NZD' => array( + 'symbol' => 'NZ$', + 'name' => 'New Zealand Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'OMR' => array( + 'symbol' => 'OMR', + 'name' => 'Omani Rial', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'PAB' => array( + 'symbol' => 'PAB', + 'name' => 'Panamanian Balboa', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PEI' => array( + 'symbol' => 'PEI', + 'name' => 'Peruvian Inti', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PEN' => array( + 'symbol' => 'PEN', + 'name' => 'Peruvian Nuevo Sol', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PES' => array( + 'symbol' => 'PES', + 'name' => 'Peruvian Sol (1863-1965)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PGK' => array( + 'symbol' => 'PGK', + 'name' => 'Papua New Guinean Kina', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PHP' => array( + 'symbol' => 'PHP', + 'name' => 'Philippine Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PKR' => array( + 'symbol' => 'PKR', + 'name' => 'Pakistani Rupee', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'PLN' => array( + 'symbol' => 'PLN', + 'name' => 'Polish Zloty', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PLZ' => array( + 'symbol' => 'PLZ', + 'name' => 'Polish Zloty (1950-1995)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PTE' => array( + 'symbol' => 'PTE', + 'name' => 'Portuguese Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'PYG' => array( + 'symbol' => 'PYG', + 'name' => 'Paraguayan Guarani', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'QAR' => array( + 'symbol' => 'QAR', + 'name' => 'Qatari Rial', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'RHD' => array( + 'symbol' => 'RHD', + 'name' => 'Rhodesian Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ROL' => array( + 'symbol' => 'ROL', + 'name' => 'Romanian Leu (1952-2006)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'RON' => array( + 'symbol' => 'RON', + 'name' => 'Romanian Leu', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'RSD' => array( + 'symbol' => 'RSD', + 'name' => 'Serbian Dinar', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'RUB' => array( + 'symbol' => 'RUB', + 'name' => 'Russian Ruble', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'RUR' => array( + 'symbol' => 'RUR', + 'name' => 'Russian Ruble (1991-1998)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'RWF' => array( + 'symbol' => 'RWF', + 'name' => 'Rwandan Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'SAR' => array( + 'symbol' => 'SAR', + 'name' => 'Saudi Riyal', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SBD' => array( + 'symbol' => 'SBD', + 'name' => 'Solomon Islands Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SCR' => array( + 'symbol' => 'SCR', + 'name' => 'Seychellois Rupee', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SDD' => array( + 'symbol' => 'SDD', + 'name' => 'Sudanese Dinar (1992-2007)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SDG' => array( + 'symbol' => 'SDG', + 'name' => 'Sudanese Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SDP' => array( + 'symbol' => 'SDP', + 'name' => 'Sudanese Pound (1957-1998)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SEK' => array( + 'symbol' => 'SEK', + 'name' => 'Swedish Krona', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SGD' => array( + 'symbol' => 'SGD', + 'name' => 'Singapore Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SHP' => array( + 'symbol' => 'SHP', + 'name' => 'Saint Helena Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SIT' => array( + 'symbol' => 'SIT', + 'name' => 'Slovenian Tolar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SKK' => array( + 'symbol' => 'SKK', + 'name' => 'Slovak Koruna', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SLL' => array( + 'symbol' => 'SLL', + 'name' => 'Sierra Leonean Leone', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'SOS' => array( + 'symbol' => 'SOS', + 'name' => 'Somali Shilling', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'SRD' => array( + 'symbol' => 'SRD', + 'name' => 'Surinamese Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SRG' => array( + 'symbol' => 'SRG', + 'name' => 'Surinamese Guilder', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SSP' => array( + 'symbol' => 'SSP', + 'name' => 'South Sudanese Pound', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'STD' => array( + 'symbol' => 'STD', + 'name' => 'São Tomé and Príncipe Dobra', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'SUR' => array( + 'symbol' => 'SUR', + 'name' => 'Soviet Rouble', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SVC' => array( + 'symbol' => 'SVC', + 'name' => 'Salvadoran Colón', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'SYP' => array( + 'symbol' => 'SYP', + 'name' => 'Syrian Pound', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'SZL' => array( + 'symbol' => 'SZL', + 'name' => 'Swazi Lilangeni', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'THB' => array( + 'symbol' => '฿', + 'name' => 'Thai Baht', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TJR' => array( + 'symbol' => 'TJR', + 'name' => 'Tajikistani Ruble', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TJS' => array( + 'symbol' => 'TJS', + 'name' => 'Tajikistani Somoni', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TMM' => array( + 'symbol' => 'TMM', + 'name' => 'Turkmenistani Manat (1993-2009)', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'TMT' => array( + 'symbol' => 'TMT', + 'name' => 'Turkmenistani Manat', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TND' => array( + 'symbol' => 'TND', + 'name' => 'Tunisian Dinar', + 'fractionDigits' => 3, + 'roundingIncrement' => 0, + ), + 'TOP' => array( + 'symbol' => 'TOP', + 'name' => 'Tongan Paʻanga', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TPE' => array( + 'symbol' => 'TPE', + 'name' => 'Timorese Escudo', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TRL' => array( + 'symbol' => 'TRL', + 'name' => 'Turkish Lira (1922-2005)', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'TRY' => array( + 'symbol' => 'TRY', + 'name' => 'Turkish Lira', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TTD' => array( + 'symbol' => 'TTD', + 'name' => 'Trinidad and Tobago Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TWD' => array( + 'symbol' => 'NT$', + 'name' => 'New Taiwan Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'TZS' => array( + 'symbol' => 'TZS', + 'name' => 'Tanzanian Shilling', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'UAH' => array( + 'symbol' => 'UAH', + 'name' => 'Ukrainian Hryvnia', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UAK' => array( + 'symbol' => 'UAK', + 'name' => 'Ukrainian Karbovanets', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UGS' => array( + 'symbol' => 'UGS', + 'name' => 'Ugandan Shilling (1966-1987)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UGX' => array( + 'symbol' => 'UGX', + 'name' => 'Ugandan Shilling', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'USD' => array( + 'symbol' => '$', + 'name' => 'US Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'USN' => array( + 'symbol' => 'USN', + 'name' => 'US Dollar (Next day)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'USS' => array( + 'symbol' => 'USS', + 'name' => 'US Dollar (Same day)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UYI' => array( + 'symbol' => 'UYI', + 'name' => 'Uruguayan Peso (Indexed Units)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UYP' => array( + 'symbol' => 'UYP', + 'name' => 'Uruguayan Peso (1975-1993)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UYU' => array( + 'symbol' => 'UYU', + 'name' => 'Uruguayan Peso', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'UZS' => array( + 'symbol' => 'UZS', + 'name' => 'Uzbekistan Som', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'VEB' => array( + 'symbol' => 'VEB', + 'name' => 'Venezuelan Bolívar (1871-2008)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'VEF' => array( + 'symbol' => 'VEF', + 'name' => 'Venezuelan Bolívar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'VND' => array( + 'symbol' => '₫', + 'name' => 'Vietnamese Dong', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'VNN' => array( + 'symbol' => 'VNN', + 'name' => 'Vietnamese Dong (1978-1985)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'VUV' => array( + 'symbol' => 'VUV', + 'name' => 'Vanuatu Vatu', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'WST' => array( + 'symbol' => 'WST', + 'name' => 'Samoan Tala', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XAF' => array( + 'symbol' => 'FCFA', + 'name' => 'CFA Franc BEAC', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'XAG' => array( + 'symbol' => 'XAG', + 'name' => 'Silver', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XAU' => array( + 'symbol' => 'XAU', + 'name' => 'Gold', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XBA' => array( + 'symbol' => 'XBA', + 'name' => 'European Composite Unit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XBB' => array( + 'symbol' => 'XBB', + 'name' => 'European Monetary Unit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XBC' => array( + 'symbol' => 'XBC', + 'name' => 'European Unit of Account (XBC)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XBD' => array( + 'symbol' => 'XBD', + 'name' => 'European Unit of Account (XBD)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XCD' => array( + 'symbol' => 'EC$', + 'name' => 'East Caribbean Dollar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XDR' => array( + 'symbol' => 'XDR', + 'name' => 'Special Drawing Rights', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XEU' => array( + 'symbol' => 'XEU', + 'name' => 'European Currency Unit', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XFO' => array( + 'symbol' => 'XFO', + 'name' => 'French Gold Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XFU' => array( + 'symbol' => 'XFU', + 'name' => 'French UIC-Franc', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XOF' => array( + 'symbol' => 'CFA', + 'name' => 'CFA Franc BCEAO', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'XPD' => array( + 'symbol' => 'XPD', + 'name' => 'Palladium', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XPF' => array( + 'symbol' => 'CFPF', + 'name' => 'CFP Franc', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'XPT' => array( + 'symbol' => 'XPT', + 'name' => 'Platinum', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XRE' => array( + 'symbol' => 'XRE', + 'name' => 'RINET Funds', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XSU' => array( + 'symbol' => 'XSU', + 'name' => 'Sucre', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XTS' => array( + 'symbol' => 'XTS', + 'name' => 'Testing Currency Code', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XUA' => array( + 'symbol' => 'XUA', + 'name' => 'ADB Unit of Account', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'XXX' => array( + 'symbol' => 'XXX', + 'name' => 'Unknown Currency', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'YDD' => array( + 'symbol' => 'YDD', + 'name' => 'Yemeni Dinar', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'YER' => array( + 'symbol' => 'YER', + 'name' => 'Yemeni Rial', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'YUD' => array( + 'symbol' => 'YUD', + 'name' => 'Yugoslavian Hard Dinar (1966-1990)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'YUM' => array( + 'symbol' => 'YUM', + 'name' => 'Yugoslavian New Dinar (1994-2002)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'YUN' => array( + 'symbol' => 'YUN', + 'name' => 'Yugoslavian Convertible Dinar (1990-1992)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'YUR' => array( + 'symbol' => 'YUR', + 'name' => 'Yugoslavian Reformed Dinar (1992-1993)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZAL' => array( + 'symbol' => 'ZAL', + 'name' => 'South African Rand (financial)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZAR' => array( + 'symbol' => 'ZAR', + 'name' => 'South African Rand', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZMK' => array( + 'symbol' => 'ZMK', + 'name' => 'Zambian Kwacha', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ZRN' => array( + 'symbol' => 'ZRN', + 'name' => 'Zairean New Zaire (1993-1998)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZRZ' => array( + 'symbol' => 'ZRZ', + 'name' => 'Zairean Zaire (1971-1993)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZWD' => array( + 'symbol' => 'ZWD', + 'name' => 'Zimbabwean Dollar (1980-2008)', + 'fractionDigits' => 0, + 'roundingIncrement' => 0, + ), + 'ZWL' => array( + 'symbol' => 'ZWL', + 'name' => 'Zimbabwean Dollar (2009)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), + 'ZWR' => array( + 'symbol' => 'ZWR', + 'name' => 'Zimbabwean Dollar (2008)', + 'fractionDigits' => 2, + 'roundingIncrement' => 0, + ), +); diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/lang/en.php b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/lang/en.php new file mode 100755 index 0000000000..6a19599714 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/lang/en.php @@ -0,0 +1,568 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array( + 'aa' => 'Afar', + 'ab' => 'Abkhazian', + 'ace' => 'Achinese', + 'ach' => 'Acoli', + 'ada' => 'Adangme', + 'ady' => 'Adyghe', + 'ae' => 'Avestan', + 'af' => 'Afrikaans', + 'afa' => 'Afro-Asiatic Language', + 'afh' => 'Afrihili', + 'agq' => 'Aghem', + 'ain' => 'Ainu', + 'ak' => 'Akan', + 'akk' => 'Akkadian', + 'ale' => 'Aleut', + 'alg' => 'Algonquian Language', + 'alt' => 'Southern Altai', + 'am' => 'Amharic', + 'an' => 'Aragonese', + 'ang' => 'Old English', + 'anp' => 'Angika', + 'apa' => 'Apache Language', + 'ar' => 'Arabic', + 'ar_001' => 'Modern Standard Arabic', + 'arc' => 'Aramaic', + 'arn' => 'Araucanian', + 'arp' => 'Arapaho', + 'art' => 'Artificial Language', + 'arw' => 'Arawak', + 'as' => 'Assamese', + 'asa' => 'Asu', + 'ast' => 'Asturian', + 'ath' => 'Athapascan Language', + 'aus' => 'Australian Language', + 'av' => 'Avaric', + 'awa' => 'Awadhi', + 'ay' => 'Aymara', + 'az' => 'Azerbaijani', + 'ba' => 'Bashkir', + 'bad' => 'Banda', + 'bai' => 'Bamileke Language', + 'bal' => 'Baluchi', + 'ban' => 'Balinese', + 'bas' => 'Basaa', + 'bat' => 'Baltic Language', + 'be' => 'Belarusian', + 'bej' => 'Beja', + 'bem' => 'Bemba', + 'ber' => 'Berber', + 'bez' => 'Bena', + 'bg' => 'Bulgarian', + 'bh' => 'Bihari', + 'bho' => 'Bhojpuri', + 'bi' => 'Bislama', + 'bik' => 'Bikol', + 'bin' => 'Bini', + 'bla' => 'Siksika', + 'bm' => 'Bambara', + 'bn' => 'Bengali', + 'bnt' => 'Bantu', + 'bo' => 'Tibetan', + 'br' => 'Breton', + 'bra' => 'Braj', + 'brx' => 'Bodo', + 'bs' => 'Bosnian', + 'btk' => 'Batak', + 'bua' => 'Buriat', + 'bug' => 'Buginese', + 'byn' => 'Blin', + 'ca' => 'Catalan', + 'cad' => 'Caddo', + 'cai' => 'Central American Indian Language', + 'car' => 'Carib', + 'cau' => 'Caucasian Language', + 'cay' => 'Cayuga', + 'cch' => 'Atsam', + 'ce' => 'Chechen', + 'ceb' => 'Cebuano', + 'cel' => 'Celtic Language', + 'cgg' => 'Chiga', + 'ch' => 'Chamorro', + 'chb' => 'Chibcha', + 'chg' => 'Chagatai', + 'chk' => 'Chuukese', + 'chm' => 'Mari', + 'chn' => 'Chinook Jargon', + 'cho' => 'Choctaw', + 'chp' => 'Chipewyan', + 'chr' => 'Cherokee', + 'chy' => 'Cheyenne', + 'ckb' => 'Sorani Kurdish', + 'cmc' => 'Chamic Language', + 'co' => 'Corsican', + 'cop' => 'Coptic', + 'cpe' => 'English-based Creole or Pidgin', + 'cpf' => 'French-based Creole or Pidgin', + 'cpp' => 'Portuguese-based Creole or Pidgin', + 'cr' => 'Cree', + 'crh' => 'Crimean Turkish', + 'crp' => 'Creole or Pidgin', + 'cs' => 'Czech', + 'csb' => 'Kashubian', + 'cu' => 'Church Slavic', + 'cus' => 'Cushitic Language', + 'cv' => 'Chuvash', + 'cy' => 'Welsh', + 'da' => 'Danish', + 'dak' => 'Dakota', + 'dar' => 'Dargwa', + 'dav' => 'Taita', + 'day' => 'Dayak', + 'de' => 'German', + 'de_AT' => 'Austrian German', + 'de_CH' => 'Swiss High German', + 'del' => 'Delaware', + 'den' => 'Slave', + 'dgr' => 'Dogrib', + 'din' => 'Dinka', + 'dje' => 'Zarma', + 'doi' => 'Dogri', + 'dra' => 'Dravidian Language', + 'dsb' => 'Lower Sorbian', + 'dua' => 'Duala', + 'dum' => 'Middle Dutch', + 'dv' => 'Divehi', + 'dyo' => 'Jola-Fonyi', + 'dyu' => 'Dyula', + 'dz' => 'Dzongkha', + 'ebu' => 'Embu', + 'ee' => 'Ewe', + 'efi' => 'Efik', + 'egy' => 'Ancient Egyptian', + 'eka' => 'Ekajuk', + 'el' => 'Greek', + 'elx' => 'Elamite', + 'en' => 'English', + 'en_AU' => 'Australian English', + 'en_CA' => 'Canadian English', + 'en_GB' => 'British English', + 'en_US' => 'U.S. English', + 'enm' => 'Middle English', + 'eo' => 'Esperanto', + 'es' => 'Spanish', + 'es_419' => 'Latin American Spanish', + 'es_ES' => 'Iberian Spanish', + 'et' => 'Estonian', + 'eu' => 'Basque', + 'ewo' => 'Ewondo', + 'fa' => 'Persian', + 'fan' => 'Fang', + 'fat' => 'Fanti', + 'ff' => 'Fulah', + 'fi' => 'Finnish', + 'fil' => 'Filipino', + 'fiu' => 'Finno-Ugrian Language', + 'fj' => 'Fijian', + 'fo' => 'Faroese', + 'fon' => 'Fon', + 'fr' => 'French', + 'fr_CA' => 'Canadian French', + 'fr_CH' => 'Swiss French', + 'frm' => 'Middle French', + 'fro' => 'Old French', + 'frr' => 'Northern Frisian', + 'frs' => 'Eastern Frisian', + 'fur' => 'Friulian', + 'fy' => 'Western Frisian', + 'ga' => 'Irish', + 'gaa' => 'Ga', + 'gay' => 'Gayo', + 'gba' => 'Gbaya', + 'gd' => 'Scottish Gaelic', + 'gem' => 'Germanic Language', + 'gez' => 'Geez', + 'gil' => 'Gilbertese', + 'gl' => 'Galician', + 'gmh' => 'Middle High German', + 'gn' => 'Guarani', + 'goh' => 'Old High German', + 'gon' => 'Gondi', + 'gor' => 'Gorontalo', + 'got' => 'Gothic', + 'grb' => 'Grebo', + 'grc' => 'Ancient Greek', + 'gsw' => 'Swiss German', + 'gu' => 'Gujarati', + 'guz' => 'Gusii', + 'gv' => 'Manx', + 'gwi' => 'Gwichʼin', + 'ha' => 'Hausa', + 'hai' => 'Haida', + 'haw' => 'Hawaiian', + 'he' => 'Hebrew', + 'hi' => 'Hindi', + 'hil' => 'Hiligaynon', + 'him' => 'Himachali', + 'hit' => 'Hittite', + 'hmn' => 'Hmong', + 'ho' => 'Hiri Motu', + 'hr' => 'Croatian', + 'hsb' => 'Upper Sorbian', + 'ht' => 'Haitian', + 'hu' => 'Hungarian', + 'hup' => 'Hupa', + 'hy' => 'Armenian', + 'hz' => 'Herero', + 'ia' => 'Interlingua', + 'iba' => 'Iban', + 'id' => 'Indonesian', + 'ie' => 'Interlingue', + 'ig' => 'Igbo', + 'ii' => 'Sichuan Yi', + 'ijo' => 'Ijo', + 'ik' => 'Inupiaq', + 'ilo' => 'Iloko', + 'inc' => 'Indic Language', + 'ine' => 'Indo-European Language', + 'inh' => 'Ingush', + 'io' => 'Ido', + 'ira' => 'Iranian Language', + 'iro' => 'Iroquoian Language', + 'is' => 'Icelandic', + 'it' => 'Italian', + 'iu' => 'Inuktitut', + 'ja' => 'Japanese', + 'jbo' => 'Lojban', + 'jmc' => 'Machame', + 'jpr' => 'Judeo-Persian', + 'jrb' => 'Judeo-Arabic', + 'jv' => 'Javanese', + 'ka' => 'Georgian', + 'kaa' => 'Kara-Kalpak', + 'kab' => 'Kabyle', + 'kac' => 'Kachin', + 'kaj' => 'Jju', + 'kam' => 'Kamba', + 'kar' => 'Karen', + 'kaw' => 'Kawi', + 'kbd' => 'Kabardian', + 'kcg' => 'Tyap', + 'kde' => 'Makonde', + 'kea' => 'Kabuverdianu', + 'kfo' => 'Koro', + 'kg' => 'Kongo', + 'kha' => 'Khasi', + 'khi' => 'Khoisan Language', + 'kho' => 'Khotanese', + 'khq' => 'Koyra Chiini', + 'ki' => 'Kikuyu', + 'kj' => 'Kuanyama', + 'kk' => 'Kazakh', + 'kl' => 'Kalaallisut', + 'kln' => 'Kalenjin', + 'km' => 'Khmer', + 'kmb' => 'Kimbundu', + 'kn' => 'Kannada', + 'ko' => 'Korean', + 'kok' => 'Konkani', + 'kos' => 'Kosraean', + 'kpe' => 'Kpelle', + 'kr' => 'Kanuri', + 'krc' => 'Karachay-Balkar', + 'krl' => 'Karelian', + 'kro' => 'Kru', + 'kru' => 'Kurukh', + 'ks' => 'Kashmiri', + 'ksb' => 'Shambala', + 'ksf' => 'Bafia', + 'ksh' => 'Colognian', + 'ku' => 'Kurdish', + 'kum' => 'Kumyk', + 'kut' => 'Kutenai', + 'kv' => 'Komi', + 'kw' => 'Cornish', + 'ky' => 'Kirghiz', + 'la' => 'Latin', + 'lad' => 'Ladino', + 'lag' => 'Langi', + 'lah' => 'Lahnda', + 'lam' => 'Lamba', + 'lb' => 'Luxembourgish', + 'lez' => 'Lezghian', + 'lg' => 'Ganda', + 'li' => 'Limburgish', + 'ln' => 'Lingala', + 'lo' => 'Lao', + 'lol' => 'Mongo', + 'loz' => 'Lozi', + 'lt' => 'Lithuanian', + 'lu' => 'Luba-Katanga', + 'lua' => 'Luba-Lulua', + 'lui' => 'Luiseno', + 'lun' => 'Lunda', + 'luo' => 'Luo', + 'lus' => 'Lushai', + 'luy' => 'Luyia', + 'lv' => 'Latvian', + 'mad' => 'Madurese', + 'mag' => 'Magahi', + 'mai' => 'Maithili', + 'mak' => 'Makasar', + 'man' => 'Mandingo', + 'map' => 'Austronesian Language', + 'mas' => 'Masai', + 'mdf' => 'Moksha', + 'mdr' => 'Mandar', + 'men' => 'Mende', + 'mer' => 'Meru', + 'mfe' => 'Morisyen', + 'mg' => 'Malagasy', + 'mga' => 'Middle Irish', + 'mgh' => 'Makhuwa-Meetto', + 'mh' => 'Marshallese', + 'mi' => 'Maori', + 'mic' => 'Micmac', + 'min' => 'Minangkabau', + 'mis' => 'Miscellaneous Language', + 'mk' => 'Macedonian', + 'mkh' => 'Mon-Khmer Language', + 'ml' => 'Malayalam', + 'mn' => 'Mongolian', + 'mnc' => 'Manchu', + 'mni' => 'Manipuri', + 'mno' => 'Manobo Language', + 'mo' => 'Moldavian', + 'moh' => 'Mohawk', + 'mos' => 'Mossi', + 'mr' => 'Marathi', + 'ms' => 'Malay', + 'mt' => 'Maltese', + 'mua' => 'Mundang', + 'mun' => 'Munda Language', + 'mus' => 'Creek', + 'mwl' => 'Mirandese', + 'mwr' => 'Marwari', + 'my' => 'Burmese', + 'myn' => 'Mayan Language', + 'myv' => 'Erzya', + 'na' => 'Nauru', + 'nah' => 'Nahuatl', + 'nai' => 'North American Indian Language', + 'nap' => 'Neapolitan', + 'naq' => 'Nama', + 'nb' => 'Norwegian Bokmål', + 'nd' => 'North Ndebele', + 'nds' => 'Low German', + 'ne' => 'Nepali', + 'new' => 'Newari', + 'ng' => 'Ndonga', + 'nia' => 'Nias', + 'nic' => 'Niger-Kordofanian Language', + 'niu' => 'Niuean', + 'nl' => 'Dutch', + 'nl_BE' => 'Flemish', + 'nmg' => 'Kwasio', + 'nn' => 'Norwegian Nynorsk', + 'no' => 'Norwegian', + 'nog' => 'Nogai', + 'non' => 'Old Norse', + 'nqo' => 'N’Ko', + 'nr' => 'South Ndebele', + 'nso' => 'Northern Sotho', + 'nub' => 'Nubian Language', + 'nus' => 'Nuer', + 'nv' => 'Navajo', + 'nwc' => 'Classical Newari', + 'ny' => 'Nyanja', + 'nym' => 'Nyamwezi', + 'nyn' => 'Nyankole', + 'nyo' => 'Nyoro', + 'nzi' => 'Nzima', + 'oc' => 'Occitan', + 'oj' => 'Ojibwa', + 'om' => 'Oromo', + 'or' => 'Oriya', + 'os' => 'Ossetic', + 'osa' => 'Osage', + 'ota' => 'Ottoman Turkish', + 'oto' => 'Otomian Language', + 'pa' => 'Punjabi', + 'paa' => 'Papuan Language', + 'pag' => 'Pangasinan', + 'pal' => 'Pahlavi', + 'pam' => 'Pampanga', + 'pap' => 'Papiamento', + 'pau' => 'Palauan', + 'peo' => 'Old Persian', + 'phi' => 'Philippine Language', + 'phn' => 'Phoenician', + 'pi' => 'Pali', + 'pl' => 'Polish', + 'pon' => 'Pohnpeian', + 'pra' => 'Prakrit Language', + 'pro' => 'Old Provençal', + 'ps' => 'Pashto', + 'pt' => 'Portuguese', + 'pt_BR' => 'Brazilian Portuguese', + 'pt_PT' => 'Iberian Portuguese', + 'qu' => 'Quechua', + 'raj' => 'Rajasthani', + 'rap' => 'Rapanui', + 'rar' => 'Rarotongan', + 'rm' => 'Romansh', + 'rn' => 'Rundi', + 'ro' => 'Romanian', + 'roa' => 'Romance Language', + 'rof' => 'Rombo', + 'rom' => 'Romany', + 'root' => 'Root', + 'ru' => 'Russian', + 'rup' => 'Aromanian', + 'rw' => 'Kinyarwanda', + 'rwk' => 'Rwa', + 'sa' => 'Sanskrit', + 'sad' => 'Sandawe', + 'sah' => 'Sakha', + 'sai' => 'South American Indian Language', + 'sal' => 'Salishan Language', + 'sam' => 'Samaritan Aramaic', + 'saq' => 'Samburu', + 'sas' => 'Sasak', + 'sat' => 'Santali', + 'sbp' => 'Sangu', + 'sc' => 'Sardinian', + 'scn' => 'Sicilian', + 'sco' => 'Scots', + 'sd' => 'Sindhi', + 'se' => 'Northern Sami', + 'see' => 'Seneca', + 'seh' => 'Sena', + 'sel' => 'Selkup', + 'sem' => 'Semitic Language', + 'ses' => 'Koyraboro Senni', + 'sg' => 'Sango', + 'sga' => 'Old Irish', + 'sgn' => 'Sign Language', + 'sh' => 'Serbo-Croatian', + 'shi' => 'Tachelhit', + 'shn' => 'Shan', + 'si' => 'Sinhala', + 'sid' => 'Sidamo', + 'sio' => 'Siouan Language', + 'sit' => 'Sino-Tibetan Language', + 'sk' => 'Slovak', + 'sl' => 'Slovenian', + 'sla' => 'Slavic Language', + 'sm' => 'Samoan', + 'sma' => 'Southern Sami', + 'smi' => 'Sami Language', + 'smj' => 'Lule Sami', + 'smn' => 'Inari Sami', + 'sms' => 'Skolt Sami', + 'sn' => 'Shona', + 'snk' => 'Soninke', + 'so' => 'Somali', + 'sog' => 'Sogdien', + 'son' => 'Songhai', + 'sq' => 'Albanian', + 'sr' => 'Serbian', + 'srn' => 'Sranan Tongo', + 'srr' => 'Serer', + 'ss' => 'Swati', + 'ssa' => 'Nilo-Saharan Language', + 'ssy' => 'Saho', + 'st' => 'Southern Sotho', + 'su' => 'Sundanese', + 'suk' => 'Sukuma', + 'sus' => 'Susu', + 'sux' => 'Sumerian', + 'sv' => 'Swedish', + 'sw' => 'Swahili', + 'swb' => 'Comorian', + 'swc' => 'Congo Swahili', + 'syc' => 'Classical Syriac', + 'syr' => 'Syriac', + 'ta' => 'Tamil', + 'tai' => 'Tai Language', + 'te' => 'Telugu', + 'tem' => 'Timne', + 'teo' => 'Teso', + 'ter' => 'Tereno', + 'tet' => 'Tetum', + 'tg' => 'Tajik', + 'th' => 'Thai', + 'ti' => 'Tigrinya', + 'tig' => 'Tigre', + 'tiv' => 'Tiv', + 'tk' => 'Turkmen', + 'tkl' => 'Tokelau', + 'tl' => 'Tagalog', + 'tlh' => 'Klingon', + 'tli' => 'Tlingit', + 'tmh' => 'Tamashek', + 'tn' => 'Tswana', + 'to' => 'Tongan', + 'tog' => 'Nyasa Tonga', + 'tpi' => 'Tok Pisin', + 'tr' => 'Turkish', + 'trv' => 'Taroko', + 'ts' => 'Tsonga', + 'tsi' => 'Tsimshian', + 'tt' => 'Tatar', + 'tum' => 'Tumbuka', + 'tup' => 'Tupi Language', + 'tut' => 'Altaic Language', + 'tvl' => 'Tuvalu', + 'tw' => 'Twi', + 'twq' => 'Tasawaq', + 'ty' => 'Tahitian', + 'tyv' => 'Tuvinian', + 'tzm' => 'Central Morocco Tamazight', + 'udm' => 'Udmurt', + 'ug' => 'Uighur', + 'uga' => 'Ugaritic', + 'uk' => 'Ukrainian', + 'umb' => 'Umbundu', + 'und' => 'Unknown Language', + 'ur' => 'Urdu', + 'uz' => 'Uzbek', + 'vai' => 'Vai', + 've' => 'Venda', + 'vi' => 'Vietnamese', + 'vo' => 'Volapük', + 'vot' => 'Votic', + 'vun' => 'Vunjo', + 'wa' => 'Walloon', + 'wae' => 'Walser', + 'wak' => 'Wakashan Language', + 'wal' => 'Walamo', + 'war' => 'Waray', + 'was' => 'Washo', + 'wen' => 'Sorbian Language', + 'wo' => 'Wolof', + 'xal' => 'Kalmyk', + 'xh' => 'Xhosa', + 'xog' => 'Soga', + 'yao' => 'Yao', + 'yap' => 'Yapese', + 'yav' => 'Yangben', + 'yi' => 'Yiddish', + 'yo' => 'Yoruba', + 'ypk' => 'Yupik Language', + 'yue' => 'Cantonese', + 'za' => 'Zhuang', + 'zap' => 'Zapotec', + 'zbl' => 'Blissymbols', + 'zen' => 'Zenaga', + 'zh' => 'Chinese', + 'zh_Hans' => 'Simplified Chinese', + 'zh_Hant' => 'Traditional Chinese', + 'znd' => 'Zande', + 'zu' => 'Zulu', + 'zun' => 'Zuni', + 'zxx' => 'No linguistic content', + 'zza' => 'Zaza', +); diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/names/en.php b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/names/en.php new file mode 100755 index 0000000000..d24b01404a --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/names/en.php @@ -0,0 +1,278 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array( + 'af' => 'Afrikaans', + 'af_NA' => 'Afrikaans (Namibia)', + 'agq' => 'Aghem', + 'ak' => 'Akan', + 'am' => 'Amharic', + 'ar' => 'Arabic', + 'ar_DZ' => 'Arabic (Algeria)', + 'ar_JO' => 'Arabic (Jordan)', + 'ar_LB' => 'Arabic (Lebanon)', + 'ar_MA' => 'Arabic (Morocco)', + 'ar_QA' => 'Arabic (Qatar)', + 'ar_SA' => 'Arabic (Saudi Arabia)', + 'ar_SY' => 'Arabic (Syria)', + 'ar_TN' => 'Arabic (Tunisia)', + 'ar_YE' => 'Arabic (Yemen)', + 'as' => 'Assamese', + 'asa' => 'Asu', + 'az' => 'Azerbaijani', + 'az_Cyrl' => 'Azerbaijani (Cyrillic)', + 'az_Latn' => 'Azerbaijani (Latin)', + 'bas' => 'Basaa', + 'be' => 'Belarusian', + 'bem' => 'Bemba', + 'bez' => 'Bena', + 'bg' => 'Bulgarian', + 'bm' => 'Bambara', + 'bn' => 'Bengali', + 'bn_IN' => 'Bengali (India)', + 'bo' => 'Tibetan', + 'br' => 'Breton', + 'brx' => 'Bodo', + 'bs' => 'Bosnian', + 'ca' => 'Catalan', + 'cgg' => 'Chiga', + 'chr' => 'Cherokee', + 'chr_US' => 'Cherokee (United States)', + 'cs' => 'Czech', + 'cy' => 'Welsh', + 'da' => 'Danish', + 'dav' => 'Taita', + 'de' => 'German', + 'de_AT' => 'German (Austria)', + 'de_CH' => 'German (Switzerland)', + 'de_LI' => 'German (Liechtenstein)', + 'dje' => 'Zarma', + 'dua' => 'Duala', + 'dyo' => 'Jola-Fonyi', + 'ebu' => 'Embu', + 'ee' => 'Ewe', + 'el' => 'Greek', + 'el_CY' => 'Greek (Cyprus)', + 'en' => 'English', + 'en_AU' => 'English (Australia)', + 'en_BE' => 'English (Belgium)', + 'en_BW' => 'English (Botswana)', + 'en_BZ' => 'English (Belize)', + 'en_CA' => 'English (Canada)', + 'en_GB' => 'English (United Kingdom)', + 'en_HK' => 'English (Hong Kong SAR China)', + 'en_IE' => 'English (Ireland)', + 'en_IN' => 'English (India)', + 'en_JM' => 'English (Jamaica)', + 'en_MT' => 'English (Malta)', + 'en_NA' => 'English (Namibia)', + 'en_NZ' => 'English (New Zealand)', + 'en_PH' => 'English (Philippines)', + 'en_PK' => 'English (Pakistan)', + 'en_SG' => 'English (Singapore)', + 'en_TT' => 'English (Trinidad and Tobago)', + 'en_US' => 'English (United States)', + 'en_ZA' => 'English (South Africa)', + 'en_ZW' => 'English (Zimbabwe)', + 'eo' => 'Esperanto', + 'es' => 'Spanish', + 'es_419' => 'Spanish (Latin America)', + 'es_AR' => 'Spanish (Argentina)', + 'es_BO' => 'Spanish (Bolivia)', + 'es_CL' => 'Spanish (Chile)', + 'es_CO' => 'Spanish (Colombia)', + 'es_CR' => 'Spanish (Costa Rica)', + 'es_DO' => 'Spanish (Dominican Republic)', + 'es_EC' => 'Spanish (Ecuador)', + 'es_GQ' => 'Spanish (Equatorial Guinea)', + 'es_GT' => 'Spanish (Guatemala)', + 'es_HN' => 'Spanish (Honduras)', + 'es_MX' => 'Spanish (Mexico)', + 'es_NI' => 'Spanish (Nicaragua)', + 'es_PA' => 'Spanish (Panama)', + 'es_PE' => 'Spanish (Peru)', + 'es_PR' => 'Spanish (Puerto Rico)', + 'es_PY' => 'Spanish (Paraguay)', + 'es_SV' => 'Spanish (El Salvador)', + 'es_US' => 'Spanish (United States)', + 'es_UY' => 'Spanish (Uruguay)', + 'es_VE' => 'Spanish (Venezuela)', + 'et' => 'Estonian', + 'eu' => 'Basque', + 'ewo' => 'Ewondo', + 'fa' => 'Persian', + 'fa_AF' => 'Persian (Afghanistan)', + 'ff' => 'Fulah', + 'fi' => 'Finnish', + 'fil' => 'Filipino', + 'fil_PH' => 'Filipino (Philippines)', + 'fo' => 'Faroese', + 'fr' => 'French', + 'fr_BE' => 'French (Belgium)', + 'fr_CA' => 'French (Canada)', + 'fr_CH' => 'French (Switzerland)', + 'fr_LU' => 'French (Luxembourg)', + 'ga' => 'Irish', + 'gl' => 'Galician', + 'gsw' => 'Swiss German', + 'gu' => 'Gujarati', + 'guz' => 'Gusii', + 'gv' => 'Manx', + 'ha' => 'Hausa', + 'ha_Latn' => 'Hausa (Latin)', + 'haw' => 'Hawaiian', + 'haw_US' => 'Hawaiian (United States)', + 'he' => 'Hebrew', + 'hi' => 'Hindi', + 'hr' => 'Croatian', + 'hu' => 'Hungarian', + 'hy' => 'Armenian', + 'id' => 'Indonesian', + 'ig' => 'Igbo', + 'ii' => 'Sichuan Yi', + 'is' => 'Icelandic', + 'it' => 'Italian', + 'it_CH' => 'Italian (Switzerland)', + 'ja' => 'Japanese', + 'jmc' => 'Machame', + 'ka' => 'Georgian', + 'kab' => 'Kabyle', + 'kam' => 'Kamba', + 'kde' => 'Makonde', + 'kea' => 'Kabuverdianu', + 'khq' => 'Koyra Chiini', + 'ki' => 'Kikuyu', + 'kk' => 'Kazakh', + 'kk_Cyrl' => 'Kazakh (Cyrillic)', + 'kl' => 'Kalaallisut', + 'kln' => 'Kalenjin', + 'km' => 'Khmer', + 'kn' => 'Kannada', + 'ko' => 'Korean', + 'kok' => 'Konkani', + 'ksb' => 'Shambala', + 'ksf' => 'Bafia', + 'kw' => 'Cornish', + 'lag' => 'Langi', + 'lg' => 'Ganda', + 'ln' => 'Lingala', + 'lt' => 'Lithuanian', + 'lu' => 'Luba-Katanga', + 'luo' => 'Luo', + 'luy' => 'Luyia', + 'lv' => 'Latvian', + 'mas' => 'Masai', + 'mer' => 'Meru', + 'mfe' => 'Morisyen', + 'mg' => 'Malagasy', + 'mgh' => 'Makhuwa-Meetto', + 'mk' => 'Macedonian', + 'ml' => 'Malayalam', + 'mr' => 'Marathi', + 'ms' => 'Malay', + 'ms_BN' => 'Malay (Brunei)', + 'mt' => 'Maltese', + 'mua' => 'Mundang', + 'my' => 'Burmese', + 'my_MM' => 'Burmese (Myanmar [Burma])', + 'naq' => 'Nama', + 'nb' => 'Norwegian Bokmål', + 'nd' => 'North Ndebele', + 'ne' => 'Nepali', + 'ne_IN' => 'Nepali (India)', + 'nl' => 'Dutch', + 'nl_BE' => 'Dutch (Belgium)', + 'nmg' => 'Kwasio', + 'nn' => 'Norwegian Nynorsk', + 'nus' => 'Nuer', + 'nyn' => 'Nyankole', + 'om' => 'Oromo', + 'or' => 'Oriya', + 'pa' => 'Punjabi', + 'pa_Arab' => 'Punjabi (Arabic)', + 'pa_Guru' => 'Punjabi (Gurmukhi)', + 'pl' => 'Polish', + 'ps' => 'Pashto', + 'pt' => 'Portuguese', + 'pt_AO' => 'Portuguese (Angola)', + 'pt_GW' => 'Portuguese (Guinea-Bissau)', + 'pt_MZ' => 'Portuguese (Mozambique)', + 'pt_PT' => 'Portuguese (Portugal)', + 'pt_ST' => 'Portuguese (São Tomé and Príncipe)', + 'rm' => 'Romansh', + 'rn' => 'Rundi', + 'ro' => 'Romanian', + 'rof' => 'Rombo', + 'ru' => 'Russian', + 'ru_UA' => 'Russian (Ukraine)', + 'rw' => 'Kinyarwanda', + 'rwk' => 'Rwa', + 'saq' => 'Samburu', + 'sbp' => 'Sangu', + 'seh' => 'Sena', + 'ses' => 'Koyraboro Senni', + 'sg' => 'Sango', + 'shi' => 'Tachelhit', + 'shi_Tfng' => 'Tachelhit (Tifinagh)', + 'si' => 'Sinhala', + 'sk' => 'Slovak', + 'sl' => 'Slovenian', + 'sn' => 'Shona', + 'so' => 'Somali', + 'sq' => 'Albanian', + 'sr' => 'Serbian', + 'sr_Cyrl' => 'Serbian (Cyrillic)', + 'sr_Cyrl_BA' => 'Serbian (Cyrillic, Bosnia and Herzegovina)', + 'sr_Latn' => 'Serbian (Latin)', + 'sr_Latn_ME' => 'Serbian (Latin, Montenegro)', + 'sv' => 'Swedish', + 'sv_FI' => 'Swedish (Finland)', + 'sw' => 'Swahili', + 'sw_KE' => 'Swahili (Kenya)', + 'swc' => 'Congo Swahili', + 'ta' => 'Tamil', + 'te' => 'Telugu', + 'teo' => 'Teso', + 'th' => 'Thai', + 'ti' => 'Tigrinya', + 'ti_ER' => 'Tigrinya (Eritrea)', + 'to' => 'Tongan', + 'tr' => 'Turkish', + 'twq' => 'Tasawaq', + 'tzm' => 'Central Morocco Tamazight', + 'tzm_Latn' => 'Central Morocco Tamazight (Latin)', + 'uk' => 'Ukrainian', + 'ur' => 'Urdu', + 'ur_IN' => 'Urdu (India)', + 'uz' => 'Uzbek', + 'uz_Arab' => 'Uzbek (Arabic)', + 'uz_Cyrl' => 'Uzbek (Cyrillic)', + 'uz_Latn' => 'Uzbek (Latin)', + 'vai' => 'Vai', + 'vai_Latn' => 'Vai (Latin)', + 'vai_Latn_LR' => 'Vai (Latin, Liberia)', + 'vai_Vaii' => 'Vai (Vai)', + 'vai_Vaii_LR' => 'Vai (Vai, Liberia)', + 'vi' => 'Vietnamese', + 'vun' => 'Vunjo', + 'xog' => 'Soga', + 'yav' => 'Yangben', + 'yo' => 'Yoruba', + 'zh' => 'Chinese', + 'zh_Hans' => 'Simplified Chinese', + 'zh_Hans_HK' => 'Simplified Chinese (Hong Kong SAR China)', + 'zh_Hans_MO' => 'Simplified Chinese (Macau SAR China)', + 'zh_Hans_SG' => 'Simplified Chinese (Singapore)', + 'zh_Hant' => 'Traditional Chinese', + 'zh_Hant_HK' => 'Traditional Chinese (Hong Kong SAR China)', + 'zh_Hant_MO' => 'Traditional Chinese (Macau SAR China)', + 'zu' => 'Zulu', +); diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/region/en.php b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/region/en.php new file mode 100755 index 0000000000..b793ba45b9 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/stub/region/en.php @@ -0,0 +1,272 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array( + 'AC' => 'Ascension Island', + 'AD' => 'Andorra', + 'AE' => 'United Arab Emirates', + 'AF' => 'Afghanistan', + 'AG' => 'Antigua and Barbuda', + 'AI' => 'Anguilla', + 'AL' => 'Albania', + 'AM' => 'Armenia', + 'AN' => 'Netherlands Antilles', + 'AO' => 'Angola', + 'AQ' => 'Antarctica', + 'AR' => 'Argentina', + 'AS' => 'American Samoa', + 'AT' => 'Austria', + 'AU' => 'Australia', + 'AW' => 'Aruba', + 'AX' => 'Åland Islands', + 'AZ' => 'Azerbaijan', + 'BA' => 'Bosnia and Herzegovina', + 'BB' => 'Barbados', + 'BD' => 'Bangladesh', + 'BE' => 'Belgium', + 'BF' => 'Burkina Faso', + 'BG' => 'Bulgaria', + 'BH' => 'Bahrain', + 'BI' => 'Burundi', + 'BJ' => 'Benin', + 'BL' => 'Saint Barthélemy', + 'BM' => 'Bermuda', + 'BN' => 'Brunei', + 'BO' => 'Bolivia', + 'BQ' => 'Bonaire, Sint Eustatius, and Saba', + 'BR' => 'Brazil', + 'BS' => 'Bahamas', + 'BT' => 'Bhutan', + 'BV' => 'Bouvet Island', + 'BW' => 'Botswana', + 'BY' => 'Belarus', + 'BZ' => 'Belize', + 'CA' => 'Canada', + 'CC' => 'Cocos [Keeling] Islands', + 'CD' => 'Congo - Kinshasa', + 'CF' => 'Central African Republic', + 'CG' => 'Congo - Brazzaville', + 'CH' => 'Switzerland', + 'CI' => 'Côte d’Ivoire', + 'CK' => 'Cook Islands', + 'CL' => 'Chile', + 'CM' => 'Cameroon', + 'CN' => 'China', + 'CO' => 'Colombia', + 'CP' => 'Clipperton Island', + 'CR' => 'Costa Rica', + 'CS' => 'Serbia and Montenegro', + 'CU' => 'Cuba', + 'CV' => 'Cape Verde', + 'CW' => 'Curaçao', + 'CX' => 'Christmas Island', + 'CY' => 'Cyprus', + 'CZ' => 'Czech Republic', + 'DE' => 'Germany', + 'DG' => 'Diego Garcia', + 'DJ' => 'Djibouti', + 'DK' => 'Denmark', + 'DM' => 'Dominica', + 'DO' => 'Dominican Republic', + 'DZ' => 'Algeria', + 'EA' => 'Ceuta and Melilla', + 'EC' => 'Ecuador', + 'EE' => 'Estonia', + 'EG' => 'Egypt', + 'EH' => 'Western Sahara', + 'ER' => 'Eritrea', + 'ES' => 'Spain', + 'ET' => 'Ethiopia', + 'EU' => 'European Union', + 'FI' => 'Finland', + 'FJ' => 'Fiji', + 'FK' => 'Falkland Islands', + 'FM' => 'Micronesia', + 'FO' => 'Faroe Islands', + 'FR' => 'France', + 'GA' => 'Gabon', + 'GB' => 'United Kingdom', + 'GD' => 'Grenada', + 'GE' => 'Georgia', + 'GF' => 'French Guiana', + 'GG' => 'Guernsey', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GL' => 'Greenland', + 'GM' => 'Gambia', + 'GN' => 'Guinea', + 'GP' => 'Guadeloupe', + 'GQ' => 'Equatorial Guinea', + 'GR' => 'Greece', + 'GS' => 'South Georgia and the South Sandwich Islands', + 'GT' => 'Guatemala', + 'GU' => 'Guam', + 'GW' => 'Guinea-Bissau', + 'GY' => 'Guyana', + 'HK' => 'Hong Kong SAR China', + 'HM' => 'Heard Island and McDonald Islands', + 'HN' => 'Honduras', + 'HR' => 'Croatia', + 'HT' => 'Haiti', + 'HU' => 'Hungary', + 'IC' => 'Canary Islands', + 'ID' => 'Indonesia', + 'IE' => 'Ireland', + 'IL' => 'Israel', + 'IM' => 'Isle of Man', + 'IN' => 'India', + 'IO' => 'British Indian Ocean Territory', + 'IQ' => 'Iraq', + 'IR' => 'Iran', + 'IS' => 'Iceland', + 'IT' => 'Italy', + 'JE' => 'Jersey', + 'JM' => 'Jamaica', + 'JO' => 'Jordan', + 'JP' => 'Japan', + 'KE' => 'Kenya', + 'KG' => 'Kyrgyzstan', + 'KH' => 'Cambodia', + 'KI' => 'Kiribati', + 'KM' => 'Comoros', + 'KN' => 'Saint Kitts and Nevis', + 'KP' => 'North Korea', + 'KR' => 'South Korea', + 'KW' => 'Kuwait', + 'KY' => 'Cayman Islands', + 'KZ' => 'Kazakhstan', + 'LA' => 'Laos', + 'LB' => 'Lebanon', + 'LC' => 'Saint Lucia', + 'LI' => 'Liechtenstein', + 'LK' => 'Sri Lanka', + 'LR' => 'Liberia', + 'LS' => 'Lesotho', + 'LT' => 'Lithuania', + 'LU' => 'Luxembourg', + 'LV' => 'Latvia', + 'LY' => 'Libya', + 'MA' => 'Morocco', + 'MC' => 'Monaco', + 'MD' => 'Moldova', + 'ME' => 'Montenegro', + 'MF' => 'Saint Martin', + 'MG' => 'Madagascar', + 'MH' => 'Marshall Islands', + 'MK' => 'Macedonia', + 'ML' => 'Mali', + 'MM' => 'Myanmar [Burma]', + 'MN' => 'Mongolia', + 'MO' => 'Macau SAR China', + 'MP' => 'Northern Mariana Islands', + 'MQ' => 'Martinique', + 'MR' => 'Mauritania', + 'MS' => 'Montserrat', + 'MT' => 'Malta', + 'MU' => 'Mauritius', + 'MV' => 'Maldives', + 'MW' => 'Malawi', + 'MX' => 'Mexico', + 'MY' => 'Malaysia', + 'MZ' => 'Mozambique', + 'NA' => 'Namibia', + 'NC' => 'New Caledonia', + 'NE' => 'Niger', + 'NF' => 'Norfolk Island', + 'NG' => 'Nigeria', + 'NI' => 'Nicaragua', + 'NL' => 'Netherlands', + 'NO' => 'Norway', + 'NP' => 'Nepal', + 'NR' => 'Nauru', + 'NU' => 'Niue', + 'NZ' => 'New Zealand', + 'OM' => 'Oman', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PF' => 'French Polynesia', + 'PG' => 'Papua New Guinea', + 'PH' => 'Philippines', + 'PK' => 'Pakistan', + 'PL' => 'Poland', + 'PM' => 'Saint Pierre and Miquelon', + 'PN' => 'Pitcairn Islands', + 'PR' => 'Puerto Rico', + 'PS' => 'Palestinian Territories', + 'PT' => 'Portugal', + 'PW' => 'Palau', + 'PY' => 'Paraguay', + 'QA' => 'Qatar', + 'QO' => 'Outlying Oceania', + 'RE' => 'Réunion', + 'RO' => 'Romania', + 'RS' => 'Serbia', + 'RU' => 'Russia', + 'RW' => 'Rwanda', + 'SA' => 'Saudi Arabia', + 'SB' => 'Solomon Islands', + 'SC' => 'Seychelles', + 'SD' => 'Sudan', + 'SE' => 'Sweden', + 'SG' => 'Singapore', + 'SH' => 'Saint Helena', + 'SI' => 'Slovenia', + 'SJ' => 'Svalbard and Jan Mayen', + 'SK' => 'Slovakia', + 'SL' => 'Sierra Leone', + 'SM' => 'San Marino', + 'SN' => 'Senegal', + 'SO' => 'Somalia', + 'SR' => 'Suriname', + 'SS' => 'South Sudan', + 'ST' => 'São Tomé and Príncipe', + 'SV' => 'El Salvador', + 'SX' => 'Sint Maarten', + 'SY' => 'Syria', + 'SZ' => 'Swaziland', + 'TA' => 'Tristan da Cunha', + 'TC' => 'Turks and Caicos Islands', + 'TD' => 'Chad', + 'TF' => 'French Southern Territories', + 'TG' => 'Togo', + 'TH' => 'Thailand', + 'TJ' => 'Tajikistan', + 'TK' => 'Tokelau', + 'TL' => 'Timor-Leste', + 'TM' => 'Turkmenistan', + 'TN' => 'Tunisia', + 'TO' => 'Tonga', + 'TR' => 'Turkey', + 'TT' => 'Trinidad and Tobago', + 'TV' => 'Tuvalu', + 'TW' => 'Taiwan', + 'TZ' => 'Tanzania', + 'UA' => 'Ukraine', + 'UG' => 'Uganda', + 'UM' => 'U.S. Minor Outlying Islands', + 'US' => 'United States', + 'UY' => 'Uruguay', + 'UZ' => 'Uzbekistan', + 'VA' => 'Vatican City', + 'VC' => 'Saint Vincent and the Grenadines', + 'VE' => 'Venezuela', + 'VG' => 'British Virgin Islands', + 'VI' => 'U.S. Virgin Islands', + 'VN' => 'Vietnam', + 'VU' => 'Vanuatu', + 'WF' => 'Wallis and Futuna', + 'WS' => 'Samoa', + 'YE' => 'Yemen', + 'YT' => 'Mayotte', + 'ZA' => 'South Africa', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', +); diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/svn-info.txt b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/svn-info.txt new file mode 100755 index 0000000000..89cc96fd8b --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/49/svn-info.txt @@ -0,0 +1,7 @@ +SVN info data +============= + +URL: http://source.icu-project.org/repos/icu/icu/tags/release-49-1-2/source/data +Revision: 31869 +Author: mow +Date: 2012-05-29T14:09:58.982057Z diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/UPDATE.txt b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/UPDATE.txt new file mode 100755 index 0000000000..a3106637a9 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/UPDATE.txt @@ -0,0 +1,43 @@ +How to update the ICU data +========================== + +The build script is a handy tool to generate or update the ICU data that ships +with Symfony2. You can pass the desired ICU version to build and the path to +the ICU binaries. Both arguments are optional, if not provided, the script will +try to build the latest available ICU data using the binaries available in the +environment path: + + $ php build-data.php 49 + $ php build-data.php 49 /path/to/icu/bin + +It is recommended to use the ICU binaries in the same version of the desired +version to build the data files. + +You can use one of the versions available in the `icu.ini` file. To update to +a newer version, just update the SVN URL for the desired release URL. For each +major ICU release, try to use the latest release tag available. + +The script requires `svn` (used to download the ICU data) and the `genrb` and +`icu-config` ICU binaries. The PHP needs the extensions iconv and intl enabled. +It is recommended to use a PHP with the same intl/ICU version as the target +ICU version to build the data. + +.dat-package +------------ + +The individual *.res files can be combined into a single .dat-file. +Unfortunately, PHP's `ResourceBundle` class is currently not able to handle +.dat-files. + +Once it is, the following steps have to be followed to build the .dat-file: + +3. Package the resource bundles into a single file + + $ find . -name *.res | sed -e "s/\.\///g" > packagelist.txt + $ pkgdata -p region -T build -d . packagelist.txt + +4. Clean up + + $ rm -rf build packagelist.txt + +5. You can now move region.dat to replace the version bundled with Symfony2. diff --git a/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/build-data.php b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/build-data.php new file mode 100755 index 0000000000..0382cb8d35 --- /dev/null +++ b/vendor/symfony/locale/Symfony/Component/Locale/Resources/data/build-data.php @@ -0,0 +1,630 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +function bailout($message) +{ + exit($message."\n"); +} + +function check_dir($source) +{ + if (!file_exists($source)) { + bailout('The directory '.$source.' does not exist'); + } + + if (!is_dir($source)) { + bailout('The file '.$source.' is not a directory'); + } +} + +function check_command($command) +{ + exec('which '.$command, $output, $result); + + if ($result !== 0) { + bailout('The command "'.$command.'" is not installed'); + } +} + +function clear_directory($directory) +{ + $iterator = new \DirectoryIterator($directory); + + foreach ($iterator as $file) { + if (!$file->isDot()) { + if ($file->isDir()) { + clear_directory($file->getPathname()); + } else { + unlink($file->getPathname()); + } + } + } +} + +function make_directory($directory) +{ + if (!file_exists($directory)) { + mkdir($directory); + } + + if (!is_dir($directory)) { + bailout('The file '.$directory.' already exists but is no directory'); + } +} + +function list_files($directory, $extension) +{ + $files = array(); + $iterator = new \DirectoryIterator($directory); + + foreach ($iterator as $file) { + if (!$file->isDot() && substr($file->getFilename(), -strlen($extension)) === $extension) { + $files[] = substr($file->getFilename(), 0, -strlen($extension)); + } + } + + return $files; +} + +function genrb($source, $target, $icuBinPath = '', $params = '') +{ + exec($icuBinPath.'genrb --quiet '.$params.' -d '.$target.' '.$source.DIRECTORY_SEPARATOR.'*.txt', $output, $result); + + if ($result !== 0) { + bailout('genrb failed'); + } +} + +function genrb_file($target, $source, $locale, $icuBinPath = '') +{ + exec($icuBinPath.'genrb --quiet -d '.$target.' '.$source.DIRECTORY_SEPARATOR.$locale.'.txt', $output, $result); + + if ($result !== 0) { + bailout('genrb failed'); + } +} + +function load_resource_bundle($locale, $directory) +{ + $bundle = \ResourceBundle::create($locale, $directory); + + if (null === $bundle) { + bailout('The resource bundle for locale '.$locale.' could not be loaded from directory '.$directory); + } + + return $bundle; +} + +function get_data($index, $dataDir, $locale = 'en', $constraint = null) +{ + $data = array(); + $bundle = load_resource_bundle($locale, $dataDir); + + foreach ($bundle->get($index) as $code => $name) { + if (null !== $constraint) { + if ($constraint($code)) { + $data[$code] = $name; + } + continue; + } + + $data[$code] = $name; + } + + $collator = new \Collator($locale); + $collator->asort($data); + + return $data; +} + +function icu_version() +{ + exec('icu-config --version', $output, $result); + + if ($result !== 0 || !isset($output[0])) { + bailout('icu-config failed'); + } + + return $output[0]; +} + +function normalize_icu_version($version) +{ + preg_match('/^(?P[0-9]\.[0-9]|[0-9]{2,})/', $version, $matches); + + return $matches['version']; +} + +function download_icu_data($version) +{ + $icu = parse_ini_file(__DIR__.'/icu.ini'); + + if (!isset($icu[$version])) { + bailout('The version '.$version.' is not available in the datasource.ini file.'); + } + + $checkoutPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'data-'.$version; + + exec('svn checkout '.$icu[$version].' '.$checkoutPath, $output, $result); + + if ($result !== 0) { + bailout('svn failed'); + } + + return $checkoutPath; +} + +function is_icu_version_42_or_earlier($version) +{ + return version_compare($version, '4.4', '<'); +} + +function create_stub_datafile($locale, $target, $data) +{ + $template = <<