diff --git a/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/lib/Doctrine/Common/Annotations/Annotation/Enum.php index e122a7535..82f6241ec 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Enum.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Enum.php @@ -57,7 +57,7 @@ final class Enum public function __construct(array $values) { if ( ! isset($values['literal'])) { - $values['literal'] = array(); + $values['literal'] = []; } foreach ($values['value'] as $var) { diff --git a/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php index 175226a67..85ec3d6dd 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php @@ -43,7 +43,7 @@ final class IgnoreAnnotation public function __construct(array $values) { if (is_string($values['value'])) { - $values['value'] = array($values['value']); + $values['value'] = [$values['value']]; } if (!is_array($values['value'])) { throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); diff --git a/lib/Doctrine/Common/Annotations/Annotation/Target.php b/lib/Doctrine/Common/Annotations/Annotation/Target.php index f6c544535..a52972b8b 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Target.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Target.php @@ -39,13 +39,13 @@ final class Target /** * @var array */ - private static $map = array( + private static $map = [ 'ALL' => self::TARGET_ALL, 'CLASS' => self::TARGET_CLASS, 'METHOD' => self::TARGET_METHOD, 'PROPERTY' => self::TARGET_PROPERTY, 'ANNOTATION' => self::TARGET_ANNOTATION, - ); + ]; /** * @var array @@ -79,7 +79,7 @@ public function __construct(array $values) $values['value'] = null; } if (is_string($values['value'])){ - $values['value'] = array($values['value']); + $values['value'] = [$values['value']]; } if (!is_array($values['value'])){ throw new \InvalidArgumentException( diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index 121622776..6bf5ae96f 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -41,9 +41,9 @@ class AnnotationReader implements Reader * * @var array */ - private static $globalImports = array( + private static $globalImports = [ 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation', - ); + ]; /** * A list with annotations that are not causing exceptions when not resolved to an annotation class. @@ -52,7 +52,7 @@ class AnnotationReader implements Reader * * @var array */ - private static $globalIgnoredNames = array( + private static $globalIgnoredNames = [ // Annotation tags 'Annotation' => true, 'Attribute' => true, 'Attributes' => true, /* Can we enable this? 'Enum' => true, */ @@ -102,7 +102,7 @@ class AnnotationReader implements Reader 'startuml' => true, 'enduml' => true, // Symfony 3.3 Cache Adapter 'experimental' => true - ); + ]; /** * A list with annotations that are not causing exceptions when not resolved to an annotation class. @@ -111,7 +111,7 @@ class AnnotationReader implements Reader * * @var array */ - private static $globalIgnoredNamespaces = array(); + private static $globalIgnoredNamespaces = []; /** * Add a new annotation to the globally ignored annotation names with regard to exception handling. @@ -159,14 +159,14 @@ static public function addGlobalIgnoredNamespace($namespace) * * @var array */ - private $imports = array(); + private $imports = []; /** * In-memory cache mechanism to store ignored annotations per class. * * @var array */ - private $ignoredAnnotationNames = array(); + private $ignoredAnnotationNames = []; /** * Constructor. @@ -342,7 +342,7 @@ private function getMethodImports(ReflectionMethod $method) $class = $method->getDeclaringClass(); $classImports = $this->getClassImports($class); - $traitImports = array(); + $traitImports = []; foreach ($class->getTraits() as $trait) { if ($trait->hasMethod($method->getName()) @@ -367,7 +367,7 @@ private function getPropertyImports(ReflectionProperty $property) $class = $property->getDeclaringClass(); $classImports = $this->getClassImports($class); - $traitImports = array(); + $traitImports = []; foreach ($class->getTraits() as $trait) { if ($trait->hasProperty($property->getName())) { @@ -401,7 +401,7 @@ private function collectParsingMetadata(ReflectionClass $class) $this->imports[$name] = array_merge( self::$globalImports, $this->phpParser->parseClass($class), - array('__NAMESPACE__' => $class->getNamespaceName()) + ['__NAMESPACE__' => $class->getNamespaceName()] ); $this->ignoredAnnotationNames[$name] = $ignoredAnnotationNames; diff --git a/lib/Doctrine/Common/Annotations/CachedReader.php b/lib/Doctrine/Common/Annotations/CachedReader.php index 751c1b1b7..674b66be7 100644 --- a/lib/Doctrine/Common/Annotations/CachedReader.php +++ b/lib/Doctrine/Common/Annotations/CachedReader.php @@ -48,7 +48,7 @@ final class CachedReader implements Reader /** * @var array */ - private $loadedAnnotations = array(); + private $loadedAnnotations = []; /** * Constructor. @@ -172,7 +172,7 @@ public function getMethodAnnotation(\ReflectionMethod $method, $annotationName) */ public function clearLoadedAnnotations() { - $this->loadedAnnotations = array(); + $this->loadedAnnotations = []; } /** diff --git a/lib/Doctrine/Common/Annotations/DocLexer.php b/lib/Doctrine/Common/Annotations/DocLexer.php index d864540e0..fad4ae6c9 100644 --- a/lib/Doctrine/Common/Annotations/DocLexer.php +++ b/lib/Doctrine/Common/Annotations/DocLexer.php @@ -55,7 +55,7 @@ final class DocLexer extends AbstractLexer /** * @var array */ - protected $noCase = array( + protected $noCase = [ '@' => self::T_AT, ',' => self::T_COMMA, '(' => self::T_OPEN_PARENTHESIS, @@ -65,27 +65,27 @@ final class DocLexer extends AbstractLexer '=' => self::T_EQUALS, ':' => self::T_COLON, '\\' => self::T_NAMESPACE_SEPARATOR - ); + ]; /** * @var array */ - protected $withCase = array( + protected $withCase = [ 'true' => self::T_TRUE, 'false' => self::T_FALSE, 'null' => self::T_NULL - ); + ]; /** * {@inheritdoc} */ protected function getCatchablePatterns() { - return array( + return [ '[a-z_\\\][a-z0-9_\:\\\]*[a-z_][a-z0-9_]*', '(?:[+-]?[0-9]+(?:[\.][0-9]+)*)(?:[eE][+-]?[0-9]+)?', '"(?:""|[^"])*+"', - ); + ]; } /** @@ -93,7 +93,7 @@ protected function getCatchablePatterns() */ protected function getNonCatchablePatterns() { - return array('\s+', '\*+', '(.)'); + return ['\s+', '\*+', '(.)']; } /** diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php index 9321ea4b2..9a2a26d00 100644 --- a/lib/Doctrine/Common/Annotations/DocParser.php +++ b/lib/Doctrine/Common/Annotations/DocParser.php @@ -44,12 +44,12 @@ final class DocParser * * @var array */ - private static $classIdentifiers = array( + private static $classIdentifiers = [ DocLexer::T_IDENTIFIER, DocLexer::T_TRUE, DocLexer::T_FALSE, DocLexer::T_NULL - ); + ]; /** * The lexer. @@ -85,7 +85,7 @@ final class DocParser * * @var array */ - private $imports = array(); + private $imports = []; /** * This hashmap is used internally to cache results of class_exists() @@ -93,7 +93,7 @@ final class DocParser * * @var array */ - private $classExists = array(); + private $classExists = []; /** * Whether annotations that have not been imported should be ignored. @@ -107,7 +107,7 @@ final class DocParser * * @var string[] */ - private $namespaces = array(); + private $namespaces = []; /** * A list with annotations that are not causing exceptions when not resolved to an annotation class. @@ -117,7 +117,7 @@ final class DocParser * * @var bool[] indexed by annotation name */ - private $ignoredAnnotationNames = array(); + private $ignoredAnnotationNames = []; /** * A list with annotations in namespaced format @@ -125,7 +125,7 @@ final class DocParser * * @var bool[] indexed by namespace name */ - private $ignoredAnnotationNamespaces = array(); + private $ignoredAnnotationNamespaces = []; /** * @var string @@ -137,104 +137,104 @@ final class DocParser * * @var array */ - private static $annotationMetadata = array( - 'Doctrine\Common\Annotations\Annotation\Target' => array( + private static $annotationMetadata = [ + 'Doctrine\Common\Annotations\Annotation\Target' => [ 'is_annotation' => true, 'has_constructor' => true, - 'properties' => array(), + 'properties' => [], 'targets_literal' => 'ANNOTATION_CLASS', 'targets' => Target::TARGET_CLASS, 'default_property' => 'value', - 'attribute_types' => array( - 'value' => array( + 'attribute_types' => [ + 'value' => [ 'required' => false, 'type' =>'array', 'array_type'=>'string', 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attribute' => array( + ] + ], + ], + 'Doctrine\Common\Annotations\Annotation\Attribute' => [ 'is_annotation' => true, 'has_constructor' => false, 'targets_literal' => 'ANNOTATION_ANNOTATION', 'targets' => Target::TARGET_ANNOTATION, 'default_property' => 'name', - 'properties' => array( + 'properties' => [ 'name' => 'name', 'type' => 'type', 'required' => 'required' - ), - 'attribute_types' => array( - 'value' => array( + ], + 'attribute_types' => [ + 'value' => [ 'required' => true, 'type' =>'string', 'value' =>'string' - ), - 'type' => array( + ], + 'type' => [ 'required' =>true, 'type' =>'string', 'value' =>'string' - ), - 'required' => array( + ], + 'required' => [ 'required' =>false, 'type' =>'boolean', 'value' =>'boolean' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Attributes' => array( + ] + ], + ], + 'Doctrine\Common\Annotations\Annotation\Attributes' => [ 'is_annotation' => true, 'has_constructor' => false, 'targets_literal' => 'ANNOTATION_CLASS', 'targets' => Target::TARGET_CLASS, 'default_property' => 'value', - 'properties' => array( + 'properties' => [ 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( + ], + 'attribute_types' => [ + 'value' => [ 'type' =>'array', 'required' =>true, 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', 'value' =>'array' - ) - ), - ), - 'Doctrine\Common\Annotations\Annotation\Enum' => array( + ] + ], + ], + 'Doctrine\Common\Annotations\Annotation\Enum' => [ 'is_annotation' => true, 'has_constructor' => true, 'targets_literal' => 'ANNOTATION_PROPERTY', 'targets' => Target::TARGET_PROPERTY, 'default_property' => 'value', - 'properties' => array( + 'properties' => [ 'value' => 'value' - ), - 'attribute_types' => array( - 'value' => array( + ], + 'attribute_types' => [ + 'value' => [ 'type' => 'array', 'required' => true, - ), - 'literal' => array( + ], + 'literal' => [ 'type' => 'array', 'required' => false, - ), - ), - ), - ); + ], + ], + ], + ]; /** * Hash-map for handle types declaration. * * @var array */ - private static $typeMap = array( + private static $typeMap = [ 'float' => 'double', 'bool' => 'boolean', // allow uppercase Boolean in honor of George Boole 'Boolean' => 'boolean', 'int' => 'integer', - ); + ]; /** * Constructs a new DocParser. @@ -343,7 +343,7 @@ public function parse($input, $context = '') { $pos = $this->findInitialTokenPosition($input); if ($pos === null) { - return array(); + return []; } $this->context = $context; @@ -410,7 +410,7 @@ private function match($token) private function matchAny(array $tokens) { if ( ! $this->lexer->isNextTokenAny($tokens)) { - $this->syntaxError(implode(' or ', array_map(array($this->lexer, 'getLiteral'), $tokens))); + $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens))); } return $this->lexer->moveNext(); @@ -483,12 +483,12 @@ private function collectAnnotationMetadata($name) self::$metadataParser->setIgnoreNotImportedAnnotations(true); self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames); - self::$metadataParser->setImports(array( + self::$metadataParser->setImports([ 'enum' => 'Doctrine\Common\Annotations\Annotation\Enum', 'target' => 'Doctrine\Common\Annotations\Annotation\Target', 'attribute' => 'Doctrine\Common\Annotations\Annotation\Attribute', 'attributes' => 'Doctrine\Common\Annotations\Annotation\Attributes' - )); + ]); AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php'); AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Target.php'); @@ -500,16 +500,16 @@ private function collectAnnotationMetadata($name) $docComment = $class->getDocComment(); // Sets default values for annotation metadata - $metadata = array( + $metadata = [ 'default_property' => null, 'has_constructor' => (null !== $constructor = $class->getConstructor()) && $constructor->getNumberOfParameters() > 0, - 'properties' => array(), - 'property_types' => array(), - 'attribute_types' => array(), + 'properties' => [], + 'property_types' => [], + 'attribute_types' => [], 'targets_literal' => null, 'targets' => Target::TARGET_ALL, 'is_annotation' => false !== strpos($docComment, '@Annotation'), - ); + ]; // verify that the class is really meant to be an annotation if ($metadata['is_annotation']) { @@ -634,7 +634,7 @@ private function collectAttributeTypeMetadata(&$metadata, Attribute $attribute) */ private function Annotations() { - $annotations = array(); + $annotations = []; while (null !== $this->lexer->lookahead) { if (DocLexer::T_AT !== $this->lexer->lookahead['type']) { @@ -796,7 +796,7 @@ private function Annotation() if ($type['type'] === 'array') { // handle the case of a single value if ( ! is_array($values[$property])) { - $values[$property] = array($values[$property]); + $values[$property] = [$values[$property]]; } // checks if the attribute has array type declaration, such as "array" @@ -845,7 +845,7 @@ private function Annotation() */ private function MethodCall() { - $values = array(); + $values = []; if ( ! $this->lexer->isNextToken(DocLexer::T_OPEN_PARENTHESIS)) { return $values; @@ -869,7 +869,7 @@ private function MethodCall() */ private function Values() { - $values = array($this->Value()); + $values = [$this->Value()]; while ($this->lexer->isNextToken(DocLexer::T_COMMA)) { $this->match(DocLexer::T_COMMA); @@ -895,7 +895,7 @@ private function Values() $values['value'] = $value; } else { if ( ! is_array($values['value'])) { - $values['value'] = array($values['value']); + $values['value'] = [$values['value']]; } $values['value'][] = $value; @@ -1094,7 +1094,7 @@ private function FieldAssignment() */ private function Arrayx() { - $array = $values = array(); + $array = $values = []; $this->match(DocLexer::T_OPEN_CURLY_BRACES); @@ -1150,16 +1150,16 @@ private function ArrayEntry() if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) { $key = $this->Constant(); } else { - $this->matchAny(array(DocLexer::T_INTEGER, DocLexer::T_STRING)); + $this->matchAny([DocLexer::T_INTEGER, DocLexer::T_STRING]); $key = $this->lexer->token['value']; } - $this->matchAny(array(DocLexer::T_EQUALS, DocLexer::T_COLON)); + $this->matchAny([DocLexer::T_EQUALS, DocLexer::T_COLON]); - return array($key, $this->PlainValue()); + return [$key, $this->PlainValue()]; } - return array(null, $this->Value()); + return [null, $this->Value()]; } /** diff --git a/lib/Doctrine/Common/Annotations/FileCacheReader.php b/lib/Doctrine/Common/Annotations/FileCacheReader.php index fd2fedee1..40141af28 100644 --- a/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ b/lib/Doctrine/Common/Annotations/FileCacheReader.php @@ -49,12 +49,12 @@ class FileCacheReader implements Reader /** * @var array */ - private $loadedAnnotations = array(); + private $loadedAnnotations = []; /** * @var array */ - private $classNameHashes = array(); + private $classNameHashes = []; /** * @var int @@ -285,6 +285,6 @@ public function getPropertyAnnotation(\ReflectionProperty $property, $annotation */ public function clearLoadedAnnotations() { - $this->loadedAnnotations = array(); + $this->loadedAnnotations = []; } } diff --git a/lib/Doctrine/Common/Annotations/IndexedReader.php b/lib/Doctrine/Common/Annotations/IndexedReader.php index bf7fbdcdd..4e8c3c8c3 100644 --- a/lib/Doctrine/Common/Annotations/IndexedReader.php +++ b/lib/Doctrine/Common/Annotations/IndexedReader.php @@ -46,7 +46,7 @@ public function __construct(Reader $reader) */ public function getClassAnnotations(\ReflectionClass $class) { - $annotations = array(); + $annotations = []; foreach ($this->delegate->getClassAnnotations($class) as $annot) { $annotations[get_class($annot)] = $annot; } @@ -67,7 +67,7 @@ public function getClassAnnotation(\ReflectionClass $class, $annotation) */ public function getMethodAnnotations(\ReflectionMethod $method) { - $annotations = array(); + $annotations = []; foreach ($this->delegate->getMethodAnnotations($method) as $annot) { $annotations[get_class($annot)] = $annot; } @@ -88,7 +88,7 @@ public function getMethodAnnotation(\ReflectionMethod $method, $annotation) */ public function getPropertyAnnotations(\ReflectionProperty $property) { - $annotations = array(); + $annotations = []; foreach ($this->delegate->getPropertyAnnotations($property) as $annot) { $annotations[get_class($annot)] = $annot; } @@ -114,6 +114,6 @@ public function getPropertyAnnotation(\ReflectionProperty $property, $annotation */ public function __call($method, $args) { - return call_user_func_array(array($this->delegate, $method), $args); + return call_user_func_array([$this->delegate, $method], $args); } } diff --git a/lib/Doctrine/Common/Annotations/PhpParser.php b/lib/Doctrine/Common/Annotations/PhpParser.php index c2d477049..ec871813b 100644 --- a/lib/Doctrine/Common/Annotations/PhpParser.php +++ b/lib/Doctrine/Common/Annotations/PhpParser.php @@ -43,13 +43,13 @@ public function parseClass(\ReflectionClass $class) } if (false === $filename = $class->getFileName()) { - return array(); + return []; } $content = $this->getFileContent($filename, $class->getStartLine()); if (null === $content) { - return array(); + return []; } $namespace = preg_quote($class->getNamespaceName()); diff --git a/lib/Doctrine/Common/Annotations/TokenParser.php b/lib/Doctrine/Common/Annotations/TokenParser.php index bf1b71339..03d9320ab 100644 --- a/lib/Doctrine/Common/Annotations/TokenParser.php +++ b/lib/Doctrine/Common/Annotations/TokenParser.php @@ -103,7 +103,7 @@ public function parseUseStatement() $groupRoot = ''; $class = ''; $alias = ''; - $statements = array(); + $statements = []; $explicitAlias = false; while (($token = $this->next())) { $isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR; @@ -145,7 +145,7 @@ public function parseUseStatement() */ public function parseUseStatements($namespaceName) { - $statements = array(); + $statements = []; while (($token = $this->next())) { if ($token[0] === T_USE) { $statements = array_merge($statements, $this->parseUseStatement()); @@ -158,7 +158,7 @@ public function parseUseStatements($namespaceName) // Get fresh array for new namespace. This is to prevent the parser to collect the use statements // for a previous namespace with the same name. This is the case if a namespace is defined twice // or if a namespace with the same name is commented out. - $statements = array(); + $statements = []; } return $statements; diff --git a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php index 13d7a0937..231c203f4 100644 --- a/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php @@ -35,7 +35,7 @@ public function testAnnotations() $methodAnnots = $reader->getMethodAnnotations($getField1Method); self::assertCount(1, $methodAnnots); self::assertInstanceOf($annotName, $annot = $reader->getMethodAnnotation($getField1Method, $annotName)); - self::assertEquals(array(1, 2, 'three'), $annot->value); + self::assertEquals([1, 2, 'three'], $annot->value); $field2Prop = $class->getProperty('field2'); $propAnnots = $reader->getPropertyAnnotations($field2Prop); @@ -52,7 +52,7 @@ public function testAnnotations() $dummyAnnot = $reader->getMethodAnnotation($class->getMethod('getField1'), DummyAnnotation::class); self::assertEquals('', $dummyAnnot->dummyValue); - self::assertEquals(array(1, 2, 'three'), $dummyAnnot->value); + self::assertEquals([1, 2, 'three'], $dummyAnnot->value); $dummyAnnot = $reader->getMethodAnnotation($class->getMethod('getField3'), DummyAnnotation::class); self::assertEquals('\d{4}-[01]\d-[0-3]\d [0-2]\d:[0-5]\d:[0-5]\d', $dummyAnnot->value); diff --git a/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php b/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php index f450d8897..69a953e15 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php @@ -34,14 +34,14 @@ class TargetTest extends TestCase */ public function testValidMixedTargets() { - $target = new Target(array('value' => array('ALL'))); + $target = new Target(['value' => ['ALL']]); self::assertEquals(Target::TARGET_ALL, $target->targets); - $target = new Target(array('value' => array('METHOD', 'METHOD'))); + $target = new Target(['value' => ['METHOD', 'METHOD']]); self::assertEquals(Target::TARGET_METHOD, $target->targets); self::assertNotEquals(Target::TARGET_PROPERTY, $target->targets); - $target = new Target(array('value' => array('PROPERTY', 'METHOD'))); + $target = new Target(['value' => ['PROPERTY', 'METHOD']]); self::assertEquals(Target::TARGET_METHOD | Target::TARGET_PROPERTY, $target->targets); } } diff --git a/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php index b58134f0a..4e724bc98 100644 --- a/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php @@ -64,7 +64,7 @@ public function testOmitNotRegisteredAnnotation() $ref = new \ReflectionClass(Fixtures\ClassWithNotRegisteredAnnotationUsed::class); $annotations = $reader->getMethodAnnotations($ref->getMethod('methodWithNotRegisteredAnnotation')); - self::assertEquals(array(), $annotations); + self::assertEquals([], $annotations); } /** diff --git a/tests/Doctrine/Tests/Common/Annotations/AnnotationRegistryTest.php b/tests/Doctrine/Tests/Common/Annotations/AnnotationRegistryTest.php index 3e195d14b..4ee86442a 100644 --- a/tests/Doctrine/Tests/Common/Annotations/AnnotationRegistryTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/AnnotationRegistryTest.php @@ -14,7 +14,7 @@ class AnnotationRegistryTest extends TestCase */ public function testReset() : void { - $data = array('foo' => 'bar'); + $data = ['foo' => 'bar']; $this->setStaticField($this->class, 'autoloadNamespaces', $data); $this->setStaticField($this->class, 'loaders', $data); @@ -33,10 +33,10 @@ public function testReset() : void */ public function testRegisterAutoloadNamespaces() : void { - $this->setStaticField($this->class, 'autoloadNamespaces', array('foo' => 'bar')); + $this->setStaticField($this->class, 'autoloadNamespaces', ['foo' => 'bar']); - AnnotationRegistry::registerAutoloadNamespaces(array('test' => 'bar')); - self::assertSame(array('foo' => 'bar', 'test' => 'bar'), $this->getStaticField($this->class, 'autoloadNamespaces')); + AnnotationRegistry::registerAutoloadNamespaces(['test' => 'bar']); + self::assertSame(['foo' => 'bar', 'test' => 'bar'], $this->getStaticField($this->class, 'autoloadNamespaces')); } /** diff --git a/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php b/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php index 587b7fe0a..9f60cf5d8 100644 --- a/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/CachedReaderTest.php @@ -103,7 +103,7 @@ protected function doTestCacheStale($className, $lastCacheModification) ->expects($this->at(0)) ->method('fetch') ->with($this->equalTo($cacheKey)) - ->will($this->returnValue(array())) // Result was cached, but there was no annotation + ->will($this->returnValue([])) // Result was cached, but there was no annotation ; $cache ->expects($this->at(1)) @@ -126,7 +126,7 @@ protected function doTestCacheStale($className, $lastCacheModification) $route = new Route(); $route->pattern = '/someprefix'; - self::assertEquals(array($route), $reader->getClassAnnotations(new \ReflectionClass($className))); + self::assertEquals([$route], $reader->getClassAnnotations(new \ReflectionClass($className))); } protected function doTestCacheFresh($className, $lastCacheModification) @@ -141,7 +141,7 @@ protected function doTestCacheFresh($className, $lastCacheModification) ->expects($this->at(0)) ->method('fetch') ->with($this->equalTo($cacheKey)) - ->will($this->returnValue(array($route))); // Result was cached, but there was an annotation; + ->will($this->returnValue([$route])); // Result was cached, but there was an annotation; $cache ->expects($this->at(1)) ->method('fetch') @@ -151,7 +151,7 @@ protected function doTestCacheFresh($className, $lastCacheModification) $reader = new CachedReader(new AnnotationReader(), $cache, true); - $this->assertEquals(array($route), $reader->getClassAnnotations(new \ReflectionClass($className))); + $this->assertEquals([$route], $reader->getClassAnnotations(new \ReflectionClass($className))); } protected function getReader() diff --git a/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php index f2038bc18..4c9d6c42c 100644 --- a/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/DocLexerTest.php @@ -31,74 +31,73 @@ public function testScannerTokenizesDocBlockWhitConstants() $lexer = new DocLexer(); $docblock = '@AnnotationWithConstants(PHP_EOL, ClassWithConstants::SOME_VALUE, ClassWithConstants::CONSTANT_, ClassWithConstants::CONST_ANT3, \Doctrine\Tests\Common\Annotations\Fixtures\InterfaceWithConstants::SOME_VALUE)'; - $tokens = array ( - array( + $tokens = [ + [ 'value' => '@', 'position' => 0, 'type' => DocLexer::T_AT, - ), - array( + ], + [ 'value' => 'AnnotationWithConstants', 'position' => 1, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => '(', 'position' => 24, 'type' => DocLexer::T_OPEN_PARENTHESIS, - ), - array( + ], + [ 'value' => 'PHP_EOL', 'position' => 25, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => ',', 'position' => 32, 'type' => DocLexer::T_COMMA, - ), - array( + ], + [ 'value' => 'ClassWithConstants::SOME_VALUE', 'position' => 34, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => ',', 'position' => 64, 'type' => DocLexer::T_COMMA, - ), - array( + ], + [ 'value' => 'ClassWithConstants::CONSTANT_', 'position' => 66, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => ',', 'position' => 95, 'type' => DocLexer::T_COMMA, - ), - array( + ], + [ 'value' => 'ClassWithConstants::CONST_ANT3', 'position' => 97, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => ',', 'position' => 127, 'type' => DocLexer::T_COMMA, - ), - array( + ], + [ 'value' => '\\Doctrine\\Tests\\Common\\Annotations\\Fixtures\\InterfaceWithConstants::SOME_VALUE', 'position' => 129, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => ')', 'position' => 207, 'type' => DocLexer::T_CLOSE_PARENTHESIS, - ) - - ); + ] + ]; $lexer->setInput($docblock); @@ -119,28 +118,28 @@ public function testScannerTokenizesDocBlockWhitInvalidIdentifier() $lexer = new DocLexer(); $docblock = '@Foo\3.42'; - $tokens = array ( - array( + $tokens = [ + [ 'value' => '@', 'position' => 0, 'type' => DocLexer::T_AT, - ), - array( + ], + [ 'value' => 'Foo', 'position' => 1, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => '\\', 'position' => 4, 'type' => DocLexer::T_NAMESPACE_SEPARATOR, - ), - array( + ], + [ 'value' => 3.42, 'position' => 5, 'type' => DocLexer::T_FLOAT, - ) - ); + ] + ]; $lexer->setInput($docblock); @@ -175,33 +174,33 @@ public function testRecognizesDoubleQuotesEscapeSequence() $lexer = new DocLexer(); $docblock = '@Foo("""' . "\n" . '""")'; - $tokens = array ( - array( + $tokens = [ + [ 'value' => '@', 'position' => 0, 'type' => DocLexer::T_AT, - ), - array( + ], + [ 'value' => 'Foo', 'position' => 1, 'type' => DocLexer::T_IDENTIFIER, - ), - array( + ], + [ 'value' => '(', 'position' => 4, 'type' => DocLexer::T_OPEN_PARENTHESIS, - ), - array( + ], + [ 'value' => "\"\n\"", 'position' => 5, 'type' => DocLexer::T_STRING, - ), - array( + ], + [ 'value' => ')', 'position' => 12, 'type' => DocLexer::T_CLOSE_PARENTHESIS, - ), - ); + ], + ]; $lexer->setInput($docblock); diff --git a/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php index e4ea46660..f1f8b5176 100644 --- a/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/DocParserTest.php @@ -308,9 +308,9 @@ public function testAnnotationTarget() { $parser = new DocParser; - $parser->setImports(array( + $parser->setImports([ '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - )); + ]); $class = new \ReflectionClass(Fixtures\ClassWithValidAnnotationTarget::class); @@ -387,134 +387,134 @@ public function testAnnotationTarget() public function getAnnotationVarTypeProviderValid() { //({attribute name}, {attribute value}) - return array( + return [ // mixed type - array('mixed', '"String Value"'), - array('mixed', 'true'), - array('mixed', 'false'), - array('mixed', '1'), - array('mixed', '1.2'), - array('mixed', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), + ['mixed', '"String Value"'], + ['mixed', 'true'], + ['mixed', 'false'], + ['mixed', '1'], + ['mixed', '1.2'], + ['mixed', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'], // boolean type - array('boolean', 'true'), - array('boolean', 'false'), + ['boolean', 'true'], + ['boolean', 'false'], // alias for internal type boolean - array('bool', 'true'), - array('bool', 'false'), + ['bool', 'true'], + ['bool', 'false'], // integer type - array('integer', '0'), - array('integer', '1'), - array('integer', '123456789'), - array('integer', '9223372036854775807'), + ['integer', '0'], + ['integer', '1'], + ['integer', '123456789'], + ['integer', '9223372036854775807'], // alias for internal type double - array('float', '0.1'), - array('float', '1.2'), - array('float', '123.456'), + ['float', '0.1'], + ['float', '1.2'], + ['float', '123.456'], // string type - array('string', '"String Value"'), - array('string', '"true"'), - array('string', '"123"'), + ['string', '"String Value"'], + ['string', '"true"'], + ['string', '"123"'], // array type - array('array', '{@AnnotationExtendsAnnotationTargetAll}'), - array('array', '{@AnnotationExtendsAnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll}'), + ['array', '{@AnnotationExtendsAnnotationTargetAll}'], + ['array', '{@AnnotationExtendsAnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll}'], - array('arrayOfIntegers', '1'), - array('arrayOfIntegers', '{1}'), - array('arrayOfIntegers', '{1,2,3,4}'), - array('arrayOfAnnotations', '@AnnotationExtendsAnnotationTargetAll'), - array('arrayOfAnnotations', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), - array('arrayOfAnnotations', '{@AnnotationExtendsAnnotationTargetAll, @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'), + ['arrayOfIntegers', '1'], + ['arrayOfIntegers', '{1}'], + ['arrayOfIntegers', '{1,2,3,4}'], + ['arrayOfAnnotations', '@AnnotationExtendsAnnotationTargetAll'], + ['arrayOfAnnotations', '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'], + ['arrayOfAnnotations', '{@AnnotationExtendsAnnotationTargetAll, @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll}'], // annotation instance - array('annotation', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'), - array('annotation', '@AnnotationExtendsAnnotationTargetAll'), - ); + ['annotation', '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll'], + ['annotation', '@AnnotationExtendsAnnotationTargetAll'], + ]; } public function getAnnotationVarTypeProviderInvalid() { //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( + return [ // boolean type - array('boolean','boolean','1','integer'), - array('boolean','boolean','1.2','double'), - array('boolean','boolean','"str"','string'), - array('boolean','boolean','{1,2,3}','array'), - array('boolean','boolean','@Name', 'an instance of Doctrine\Tests\Common\Annotations\Name'), + ['boolean','boolean','1','integer'], + ['boolean','boolean','1.2','double'], + ['boolean','boolean','"str"','string'], + ['boolean','boolean','{1,2,3}','array'], + ['boolean','boolean','@Name', 'an instance of Doctrine\Tests\Common\Annotations\Name'], // alias for internal type boolean - array('bool','bool', '1','integer'), - array('bool','bool', '1.2','double'), - array('bool','bool', '"str"','string'), - array('bool','bool', '{"str"}','array'), + ['bool','bool', '1','integer'], + ['bool','bool', '1.2','double'], + ['bool','bool', '"str"','string'], + ['bool','bool', '{"str"}','array'], // integer type - array('integer','integer', 'true','boolean'), - array('integer','integer', 'false','boolean'), - array('integer','integer', '1.2','double'), - array('integer','integer', '"str"','string'), - array('integer','integer', '{"str"}','array'), - array('integer','integer', '{1,2,3,4}','array'), + ['integer','integer', 'true','boolean'], + ['integer','integer', 'false','boolean'], + ['integer','integer', '1.2','double'], + ['integer','integer', '"str"','string'], + ['integer','integer', '{"str"}','array'], + ['integer','integer', '{1,2,3,4}','array'], // alias for internal type double - array('float','float', 'true','boolean'), - array('float','float', 'false','boolean'), - array('float','float', '123','integer'), - array('float','float', '"str"','string'), - array('float','float', '{"str"}','array'), - array('float','float', '{12.34}','array'), - array('float','float', '{1,2,3}','array'), + ['float','float', 'true','boolean'], + ['float','float', 'false','boolean'], + ['float','float', '123','integer'], + ['float','float', '"str"','string'], + ['float','float', '{"str"}','array'], + ['float','float', '{12.34}','array'], + ['float','float', '{1,2,3}','array'], // string type - array('string','string', 'true','boolean'), - array('string','string', 'false','boolean'), - array('string','string', '12','integer'), - array('string','string', '1.2','double'), - array('string','string', '{"str"}','array'), - array('string','string', '{1,2,3,4}','array'), + ['string','string', 'true','boolean'], + ['string','string', 'false','boolean'], + ['string','string', '12','integer'], + ['string','string', '1.2','double'], + ['string','string', '{"str"}','array'], + ['string','string', '{1,2,3,4}','array'], // annotation instance - array('annotation', AnnotationTargetAll::class, 'true','boolean'), - array('annotation', AnnotationTargetAll::class, 'false','boolean'), - array('annotation', AnnotationTargetAll::class, '12','integer'), - array('annotation', AnnotationTargetAll::class, '1.2','double'), - array('annotation', AnnotationTargetAll::class, '{"str"}','array'), - array('annotation', AnnotationTargetAll::class, '{1,2,3,4}','array'), - array('annotation', AnnotationTargetAll::class, '@Name','an instance of Doctrine\Tests\Common\Annotations\Name'), - ); + ['annotation', AnnotationTargetAll::class, 'true','boolean'], + ['annotation', AnnotationTargetAll::class, 'false','boolean'], + ['annotation', AnnotationTargetAll::class, '12','integer'], + ['annotation', AnnotationTargetAll::class, '1.2','double'], + ['annotation', AnnotationTargetAll::class, '{"str"}','array'], + ['annotation', AnnotationTargetAll::class, '{1,2,3,4}','array'], + ['annotation', AnnotationTargetAll::class, '@Name','an instance of Doctrine\Tests\Common\Annotations\Name'], + ]; } public function getAnnotationVarTypeArrayProviderInvalid() { //({attribute name}, {type declared type}, {attribute value} , {given type or class}) - return array( - array('arrayOfIntegers', 'integer', 'true', 'boolean'), - array('arrayOfIntegers', 'integer', 'false', 'boolean'), - array('arrayOfIntegers', 'integer', '{true,true}', 'boolean'), - array('arrayOfIntegers', 'integer', '{1,true}', 'boolean'), - array('arrayOfIntegers', 'integer', '{1,2,1.2}', 'double'), - array('arrayOfIntegers', 'integer', '{1,2,"str"}', 'string'), - - array('arrayOfStrings', 'string', 'true', 'boolean'), - array('arrayOfStrings', 'string', 'false', 'boolean'), - array('arrayOfStrings', 'string', '{true,true}', 'boolean'), - array('arrayOfStrings', 'string', '{"foo",true}', 'boolean'), - array('arrayOfStrings', 'string', '{"foo","bar",1.2}', 'double'), - array('arrayOfStrings', 'string', '1', 'integer'), - - array('arrayOfAnnotations', AnnotationTargetAll::class, 'true', 'boolean'), - array('arrayOfAnnotations', AnnotationTargetAll::class, 'false', 'boolean'), - array('arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'), - array('arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'), - array('arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,1.2}', 'double'), - array('arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll,"str"}', 'string'), - ); + return [ + ['arrayOfIntegers', 'integer', 'true', 'boolean'], + ['arrayOfIntegers', 'integer', 'false', 'boolean'], + ['arrayOfIntegers', 'integer', '{true,true}', 'boolean'], + ['arrayOfIntegers', 'integer', '{1,true}', 'boolean'], + ['arrayOfIntegers', 'integer', '{1,2,1.2}', 'double'], + ['arrayOfIntegers', 'integer', '{1,2,"str"}', 'string'], + + ['arrayOfStrings', 'string', 'true', 'boolean'], + ['arrayOfStrings', 'string', 'false', 'boolean'], + ['arrayOfStrings', 'string', '{true,true}', 'boolean'], + ['arrayOfStrings', 'string', '{"foo",true}', 'boolean'], + ['arrayOfStrings', 'string', '{"foo","bar",1.2}', 'double'], + ['arrayOfStrings', 'string', '1', 'integer'], + + ['arrayOfAnnotations', AnnotationTargetAll::class, 'true', 'boolean'], + ['arrayOfAnnotations', AnnotationTargetAll::class, 'false', 'boolean'], + ['arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'], + ['arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,true}', 'boolean'], + ['arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,1.2}', 'double'], + ['arrayOfAnnotations', AnnotationTargetAll::class, '{@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationTargetAll,@AnnotationExtendsAnnotationTargetAll,"str"}', 'string'], + ]; } /** @@ -762,96 +762,96 @@ public function testAnnotationEnumInvalidLiteralDeclarationException() public function getConstantsProvider() { - $provider[] = array( + $provider[] = [ '@AnnotationWithConstants(PHP_EOL)', PHP_EOL - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(AnnotationWithConstants::INTEGER)', AnnotationWithConstants::INTEGER - ); - $provider[] = array( + ]; + $provider[] = [ '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants(AnnotationWithConstants::STRING)', AnnotationWithConstants::STRING - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::FLOAT)', AnnotationWithConstants::FLOAT - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(ClassWithConstants::SOME_VALUE)', ClassWithConstants::SOME_VALUE - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_)', ClassWithConstants::OTHER_KEY_ - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(ClassWithConstants::OTHER_KEY_2)', ClassWithConstants::OTHER_KEY_2 - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\ClassWithConstants::SOME_VALUE)', ClassWithConstants::SOME_VALUE - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(InterfaceWithConstants::SOME_VALUE)', InterfaceWithConstants::SOME_VALUE - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants(\Doctrine\Tests\Common\Annotations\Fixtures\InterfaceWithConstants::SOME_VALUE)', InterfaceWithConstants::SOME_VALUE - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants({AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT})', - array(AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT) - ); - $provider[] = array( + [AnnotationWithConstants::STRING, AnnotationWithConstants::INTEGER, AnnotationWithConstants::FLOAT] + ]; + $provider[] = [ '@AnnotationWithConstants({ AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER })', - array(AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( + [AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER] + ]; + $provider[] = [ '@AnnotationWithConstants({ Doctrine\Tests\Common\Annotations\Fixtures\InterfaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER })', - array(InterfaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( + [InterfaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER] + ]; + $provider[] = [ '@AnnotationWithConstants({ \Doctrine\Tests\Common\Annotations\Fixtures\InterfaceWithConstants::SOME_KEY = AnnotationWithConstants::INTEGER })', - array(InterfaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER) - ); - $provider[] = array( + [InterfaceWithConstants::SOME_KEY => AnnotationWithConstants::INTEGER] + ]; + $provider[] = [ '@AnnotationWithConstants({ AnnotationWithConstants::STRING = AnnotationWithConstants::INTEGER, ClassWithConstants::SOME_KEY = ClassWithConstants::SOME_VALUE, Doctrine\Tests\Common\Annotations\Fixtures\ClassWithConstants::SOME_KEY = InterfaceWithConstants::SOME_VALUE })', - array( + [ AnnotationWithConstants::STRING => AnnotationWithConstants::INTEGER, ClassWithConstants::SOME_KEY => ClassWithConstants::SOME_VALUE, ClassWithConstants::SOME_KEY => InterfaceWithConstants::SOME_VALUE - ) - ); - $provider[] = array( + ] + ]; + $provider[] = [ '@AnnotationWithConstants(AnnotationWithConstants::class)', AnnotationWithConstants::class - ); - $provider[] = array( + ]; + $provider[] = [ '@AnnotationWithConstants({AnnotationWithConstants::class = AnnotationWithConstants::class})', - array(AnnotationWithConstants::class => AnnotationWithConstants::class) - ); - $provider[] = array( + [AnnotationWithConstants::class => AnnotationWithConstants::class] + ]; + $provider[] = [ '@AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::class)', AnnotationWithConstants::class - ); - $provider[] = array( + ]; + $provider[] = [ '@Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants(Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants::class)', AnnotationWithConstants::class - ); + ]; return $provider; } @@ -861,11 +861,11 @@ public function getConstantsProvider() public function testSupportClassConstants($docblock, $expected) { $parser = $this->createTestParser(); - $parser->setImports(array( + $parser->setImports([ 'classwithconstants' => ClassWithConstants::class, 'interfacewithconstants' => InterfaceWithConstants::class, 'annotationwithconstants' => AnnotationWithConstants::class - )); + ]); $result = $parser->parse($docblock); self::assertInstanceOf(AnnotationWithConstants::class, $annotation = $result[0]); @@ -1020,7 +1020,7 @@ public function testAnnotationWithoutClassIsIgnoredWithoutWarning() public function testIgnoreWholeNamespaces($ignoreAnnotationName, $input) { $parser = new DocParser(); - $parser->setIgnoredAnnotationNamespaces(array($ignoreAnnotationName => true)); + $parser->setIgnoredAnnotationNamespaces([$ignoreAnnotationName => true]); $result = $parser->parse($input); self::assertEmpty($result); @@ -1028,25 +1028,25 @@ public function testIgnoreWholeNamespaces($ignoreAnnotationName, $input) public function provideTestIgnoreWholeNamespaces() { - return array( - array('Namespace', '@Namespace'), - array('Namespace\\', '@Namespace'), + return [ + ['Namespace', '@Namespace'], + ['Namespace\\', '@Namespace'], - array('Namespace', '@Namespace\Subnamespace'), - array('Namespace\\', '@Namespace\Subnamespace'), + ['Namespace', '@Namespace\Subnamespace'], + ['Namespace\\', '@Namespace\Subnamespace'], - array('Namespace', '@Namespace\Subnamespace\SubSubNamespace'), - array('Namespace\\', '@Namespace\Subnamespace\SubSubNamespace'), + ['Namespace', '@Namespace\Subnamespace\SubSubNamespace'], + ['Namespace\\', '@Namespace\Subnamespace\SubSubNamespace'], - array('Namespace\Subnamespace', '@Namespace\Subnamespace'), - array('Namespace\Subnamespace\\', '@Namespace\Subnamespace'), + ['Namespace\Subnamespace', '@Namespace\Subnamespace'], + ['Namespace\Subnamespace\\', '@Namespace\Subnamespace'], - array('Namespace\Subnamespace', '@Namespace\Subnamespace\SubSubNamespace'), - array('Namespace\Subnamespace\\', '@Namespace\Subnamespace\SubSubNamespace'), + ['Namespace\Subnamespace', '@Namespace\Subnamespace\SubSubNamespace'], + ['Namespace\Subnamespace\\', '@Namespace\Subnamespace\SubSubNamespace'], - array('Namespace\Subnamespace\SubSubNamespace', '@Namespace\Subnamespace\SubSubNamespace'), - array('Namespace\Subnamespace\SubSubNamespace\\', '@Namespace\Subnamespace\SubSubNamespace'), - ); + ['Namespace\Subnamespace\SubSubNamespace', '@Namespace\Subnamespace\SubSubNamespace'], + ['Namespace\Subnamespace\SubSubNamespace\\', '@Namespace\Subnamespace\SubSubNamespace'], + ]; } /** @@ -1056,7 +1056,7 @@ public function testNotAnAnnotationClassIsIgnoredWithoutWarning() { $parser = new DocParser(); $parser->setIgnoreNotImportedAnnotations(true); - $parser->setIgnoredAnnotationNames(array(\PHPUnit\Framework\TestCase::class => true)); + $parser->setIgnoredAnnotationNames([\PHPUnit\Framework\TestCase::class => true]); $result = $parser->parse('@\PHPUnit\Framework\TestCase'); self::assertEmpty($result); @@ -1113,9 +1113,9 @@ public function testAutoloadAnnotation() AnnotationRegistry::registerAutoloadNamespace('Doctrine\Tests\Common\Annotations\Fixtures\Annotation', __DIR__ . '/../../../../'); - $parser->setImports(array( + $parser->setImports([ 'autoload' => Fixtures\Annotation\Autoload::class, - )); + ]); $annotations = $parser->parse('@Autoload'); self::assertCount(1, $annotations); @@ -1126,10 +1126,10 @@ public function createTestParser() { $parser = new DocParser(); $parser->setIgnoreNotImportedAnnotations(true); - $parser->setImports(array( + $parser->setImports([ 'name' => Name::class, '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations', - )); + ]); return $parser; } @@ -1277,7 +1277,7 @@ public function testTrailingCommaIsAllowed() "Bar", })'); self::assertCount(1, $annots); - self::assertEquals(array('Foo', 'Bar'), $annots[0]->value); + self::assertEquals(['Foo', 'Bar'], $annots[0]->value); } public function testTabPrefixIsAllowed() @@ -1309,7 +1309,7 @@ public function testArrayWithColon() $annots = $parser->parse('@Name({"foo": "bar"})'); self::assertCount(1, $annots); - self::assertEquals(array('foo' => 'bar'), $annots[0]->value); + self::assertEquals(['foo' => 'bar'], $annots[0]->value); } /** @@ -1331,7 +1331,7 @@ public function testEmptyArray() $annots = $parser->parse('@Name({"foo": {}})'); self::assertCount(1, $annots); - self::assertEquals(array('foo' => array()), $annots[0]->value); + self::assertEquals(['foo' => []], $annots[0]->value); } public function testKeyHasNumber() @@ -1340,7 +1340,7 @@ public function testKeyHasNumber() $annots = $parser->parse('@SettingsAnnotation(foo="test", bar2="test")'); self::assertCount(1, $annots); - self::assertEquals(array('foo' => 'test', 'bar2' => 'test'), $annots[0]->settings); + self::assertEquals(['foo' => 'test', 'bar2' => 'test'], $annots[0]->settings); } /** diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php index 332544fa3..5aa915b12 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Annotation/Secure.php @@ -10,7 +10,7 @@ class Secure public function __construct(array $values) { if (is_string($values['value'])) { - $values['value'] = array($values['value']); + $values['value'] = [$values['value']]; } $this->roles = $values['value']; diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php index d537a6cc7..b73ea3dd3 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php @@ -17,7 +17,7 @@ class Controller */ public function indexAction() { - return array(); + return []; } /** @@ -26,7 +26,7 @@ public function indexAction() */ public function helloAction($name) { - return array('name' => $name); + return ['name' => $name]; } /** @@ -46,7 +46,7 @@ public function contactAction() return new RedirectResponse($this->generateUrl('_demo')); } - return array('form' => $form); + return ['form' => $form]; } /** @@ -165,7 +165,7 @@ private function updateFieldAceProperty($name, array $changes) { $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); - $currentIds = array(); + $currentIds = []; foreach ($changes[1] as $field => $new) { for ($i=0,$c=count($new); $i<$c; $i++) { $ace = $new[$i]; @@ -224,7 +224,7 @@ private function updateAceProperty($name, array $changes) $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); - $currentIds = array(); + $currentIds = []; for ($i=0,$c=count($new); $i<$c; $i++) { $ace = $new[$i]; @@ -276,7 +276,7 @@ private function updateAces(\SplObjectStorage $aces) { foreach ($aces as $ace) { $propertyChanges = $aces->offsetGet($ace); - $sets = array(); + $sets = []; if (isset($propertyChanges['mask'])) { $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]); diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithParentClass.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithParentClass.php index 12bc2f946..a7af1312c 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithParentClass.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithParentClass.php @@ -17,6 +17,6 @@ class ControllerWithParentClass extends AbstractController */ public function indexAction() { - return array(); + return []; } } diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithTrait.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithTrait.php index cb3e7d052..5b0fcde4a 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithTrait.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/ControllerWithTrait.php @@ -20,6 +20,6 @@ class ControllerWithTrait */ public function indexAction() { - return array(); + return []; } } diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php index ff04122f2..b601588b1 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespacedSingleClassLOC1000.php @@ -29,7 +29,7 @@ public function test1() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -54,7 +54,7 @@ public function test2() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -79,7 +79,7 @@ public function test3() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -104,7 +104,7 @@ public function test4() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -129,7 +129,7 @@ public function test5() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -154,7 +154,7 @@ public function test6() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -179,7 +179,7 @@ public function test7() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -204,7 +204,7 @@ public function test8() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -230,7 +230,7 @@ public function test9() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -255,7 +255,7 @@ public function test10() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -280,7 +280,7 @@ public function test11() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -305,7 +305,7 @@ public function test12() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -330,7 +330,7 @@ public function test13() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -355,7 +355,7 @@ public function test14() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -380,7 +380,7 @@ public function test15() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -405,7 +405,7 @@ public function test16() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -430,7 +430,7 @@ public function test17() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -456,7 +456,7 @@ public function test18() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -481,7 +481,7 @@ public function test19() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -506,7 +506,7 @@ public function test20() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -531,7 +531,7 @@ public function test21() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -556,7 +556,7 @@ public function test22() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -581,7 +581,7 @@ public function test23() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -606,7 +606,7 @@ public function test24() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -631,7 +631,7 @@ public function test25() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -656,7 +656,7 @@ public function test26() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -681,7 +681,7 @@ public function test27() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -707,7 +707,7 @@ public function test28() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -732,7 +732,7 @@ public function test29() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array =[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -757,7 +757,7 @@ public function test30() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -782,7 +782,7 @@ public function test31() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -807,7 +807,7 @@ public function test32() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -832,7 +832,7 @@ public function test33() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -857,7 +857,7 @@ public function test34() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -882,7 +882,7 @@ public function test35() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -907,7 +907,7 @@ public function test36() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -932,7 +932,7 @@ public function test37() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -958,7 +958,7 @@ public function test38() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -983,7 +983,7 @@ public function test39() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php index 5e163b429..daf79474c 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/SingleClassLOC1000.php @@ -27,7 +27,7 @@ public function test1() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -52,7 +52,7 @@ public function test2() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -77,7 +77,7 @@ public function test3() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -102,7 +102,7 @@ public function test4() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -127,7 +127,7 @@ public function test5() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -152,7 +152,7 @@ public function test6() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -177,7 +177,7 @@ public function test7() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -202,7 +202,7 @@ public function test8() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -228,7 +228,7 @@ public function test9() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -253,7 +253,7 @@ public function test10() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -278,7 +278,7 @@ public function test11() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -303,7 +303,7 @@ public function test12() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -328,7 +328,7 @@ public function test13() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -353,7 +353,7 @@ public function test14() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -378,7 +378,7 @@ public function test15() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -403,7 +403,7 @@ public function test16() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -428,7 +428,7 @@ public function test17() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -454,7 +454,7 @@ public function test18() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -479,7 +479,7 @@ public function test19() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -504,7 +504,7 @@ public function test20() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -529,7 +529,7 @@ public function test21() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -554,7 +554,7 @@ public function test22() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -579,7 +579,7 @@ public function test23() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -604,7 +604,7 @@ public function test24() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -629,7 +629,7 @@ public function test25() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -654,7 +654,7 @@ public function test26() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -679,7 +679,7 @@ public function test27() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -705,7 +705,7 @@ public function test28() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -730,7 +730,7 @@ public function test29() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -755,7 +755,7 @@ public function test30() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -780,7 +780,7 @@ public function test31() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -805,7 +805,7 @@ public function test32() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -830,7 +830,7 @@ public function test33() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -855,7 +855,7 @@ public function test34() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -880,7 +880,7 @@ public function test35() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -905,7 +905,7 @@ public function test36() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -930,7 +930,7 @@ public function test37() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -956,7 +956,7 @@ public function test38() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } @@ -981,7 +981,7 @@ public function test39() echo $this->test1; echo $this->test2; echo $this->test3; - $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; foreach ($array as $key => $value) { echo $key . ' => ' . $value; } diff --git a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Traits/SecretRouteTrait.php b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Traits/SecretRouteTrait.php index f77fbda91..ada9ab3a6 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Fixtures/Traits/SecretRouteTrait.php +++ b/tests/Doctrine/Tests/Common/Annotations/Fixtures/Traits/SecretRouteTrait.php @@ -13,6 +13,6 @@ trait SecretRouteTrait */ public function secretAction() { - return array(); + return []; } } diff --git a/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php b/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php index 8bf5e40d8..fcb2c40f0 100644 --- a/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/PerformanceTest.php @@ -79,19 +79,19 @@ public function testReadPerformance() */ public function testDocParsePerformance() { - $imports = array( + $imports = [ 'ignorephpdoc' => 'Annotations\Annotation\IgnorePhpDoc', 'ignoreannotation' => 'Annotations\Annotation\IgnoreAnnotation', 'route' => Fixtures\Annotation\Route::class, 'template' => Fixtures\Annotation\Template::class, '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Fixtures', - ); - $ignored = array( + ]; + $ignored = [ 'access', 'author', 'copyright', 'deprecated', 'example', 'ignore', 'internal', 'link', 'see', 'since', 'tutorial', 'version', 'package', 'subpackage', 'name', 'global', 'param', 'return', 'staticvar', 'static', 'var', 'throws', 'inheritdoc', - ); + ]; $method = $this->getMethod(); $methodComment = $method->getDocComment(); diff --git a/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php index 2c992a18b..d1f2332a0 100644 --- a/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/PhpParserTest.php @@ -17,10 +17,10 @@ public function testParseClassWithMultipleClassesInFile() $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\MultipleClassesInFile'); $parser = new PhpParser(); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testParseClassWithMultipleImportsInUseStatement() @@ -28,10 +28,10 @@ public function testParseClassWithMultipleImportsInUseStatement() $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\MultipleImportsInUseStatement'); $parser = new PhpParser(); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } /** @@ -42,17 +42,17 @@ public function testParseClassWithGroupUseStatement() $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\GroupUseStatement'); $parser = new PhpParser(); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'supersecure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testParseClassWhenNotUserDefined() { $parser = new PhpParser(); - self::assertEquals(array(), $parser->parseClass(new \ReflectionClass(\stdClass::class))); + self::assertEquals([], $parser->parseClass(new \ReflectionClass(\stdClass::class))); } public function testClassFileDoesNotExist() @@ -66,7 +66,7 @@ public function testClassFileDoesNotExist() ->will($this->returnValue('/valid/class/Fake.php(35) : eval()d code')); $parser = new PhpParser(); - self::assertEquals(array(), $parser->parseClass($class)); + self::assertEquals([], $parser->parseClass($class)); } public function testParseClassWhenClassIsNotNamespaced() @@ -74,10 +74,10 @@ public function testParseClassWhenClassIsNotNamespaced() $parser = new PhpParser(); $class = new ReflectionClass(\AnnotationsTestsFixturesNonNamespacedClass::class); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testParseClassWhenClassIsInterface() @@ -85,9 +85,9 @@ public function testParseClassWhenClassIsInterface() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\TestInterface'); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testClassWithFullyQualifiedUseStatements() @@ -95,11 +95,11 @@ public function testClassWithFullyQualifiedUseStatements() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\ClassWithFullyQualifiedUseStatements'); - self::assertEquals(array( + self::assertEquals([ 'secure' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => '\\' . __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testNamespaceAndClassCommentedOut() @@ -107,10 +107,10 @@ public function testNamespaceAndClassCommentedOut() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceAndClassCommentedOut'); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testEqualNamespacesPerFileWithClassAsFirst() @@ -118,10 +118,10 @@ public function testEqualNamespacesPerFileWithClassAsFirst() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsFirst'); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testEqualNamespacesPerFileWithClassAsLast() @@ -129,10 +129,10 @@ public function testEqualNamespacesPerFileWithClassAsLast() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\EqualNamespacesPerFileWithClassAsLast'); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testDifferentNamespacesPerFileWithClassAsFirst() @@ -140,9 +140,9 @@ public function testDifferentNamespacesPerFileWithClassAsFirst() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsFirst'); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testDifferentNamespacesPerFileWithClassAsLast() @@ -150,9 +150,9 @@ public function testDifferentNamespacesPerFileWithClassAsLast() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\DifferentNamespacesPerFileWithClassAsLast'); - self::assertEquals(array( + self::assertEquals([ 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testGlobalNamespacesPerFileWithClassAsFirst() @@ -160,10 +160,10 @@ public function testGlobalNamespacesPerFileWithClassAsFirst() $parser = new PhpParser(); $class = new \ReflectionClass(\GlobalNamespacesPerFileWithClassAsFirst::class); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testGlobalNamespacesPerFileWithClassAsLast() @@ -171,10 +171,10 @@ public function testGlobalNamespacesPerFileWithClassAsLast() $parser = new PhpParser(); $class = new ReflectionClass(\GlobalNamespacesPerFileWithClassAsLast::class); - self::assertEquals(array( + self::assertEquals([ 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testNamespaceWithClosureDeclaration() @@ -182,11 +182,11 @@ public function testNamespaceWithClosureDeclaration() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } public function testIfPointerResetsOnMultipleParsingTries() @@ -194,17 +194,17 @@ public function testIfPointerResetsOnMultipleParsingTries() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\NamespaceWithClosureDeclaration'); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); - self::assertEquals(array( + self::assertEquals([ 'secure' => __NAMESPACE__ . '\Fixtures\Annotation\Secure', 'route' => __NAMESPACE__ . '\Fixtures\Annotation\Route', 'template' => __NAMESPACE__ . '\Fixtures\Annotation\Template', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } /** @@ -216,9 +216,9 @@ public function testClassWithClosure() $parser = new PhpParser(); $class = new ReflectionClass(__NAMESPACE__ . '\Fixtures\ClassWithClosure'); - self::assertEquals(array( + self::assertEquals([ 'annotationtargetall' => __NAMESPACE__ . '\Fixtures\AnnotationTargetAll', 'annotationtargetannotation' => __NAMESPACE__ . '\Fixtures\AnnotationTargetAnnotation', - ), $parser->parseClass($class)); + ], $parser->parseClass($class)); } } diff --git a/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php index 300e355e8..8bca8fba5 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php +++ b/tests/Doctrine/Tests/Common/Annotations/Ticket/DCOM58Test.php @@ -31,9 +31,9 @@ public function testIssueGlobalNamespace() { $docblock = '@Entity'; $parser = new DocParser(); - $parser->setImports(array( + $parser->setImports([ '__NAMESPACE__' => 'Doctrine\Tests\Common\Annotations\Ticket\Doctrine\ORM\Mapping' - )); + ]); $annots = $parser->parse($docblock);