From f24ca23d7e2be7a1866b280af97be940d5e65975 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 2 Apr 2020 10:24:47 +0200 Subject: [PATCH 01/14] Master is now 1.11.x-dev --- .doctrine-project.json | 29 ++++++++++++++++++++++------- composer.json | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.doctrine-project.json b/.doctrine-project.json index 25d470860..2fd7124d6 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -5,25 +5,40 @@ "docsSlug": "doctrine-annotations", "versions": [ { - "name": "1.9", - "branchName": "1.9", - "slug": "1.9", + "name": "1.11", + "branchName": "1.11", + "slug": "1.11", "aliases": [ "latest" ], "upcoming": true }, { - "name": "1.8", - "branchName": "1.8", - "slug": "1.8", - "current": true, + "name": "1.10", + "branchName": "1.10", + "slug": "1.10", "aliases": [ "current", "stable" ], + "current": true, "maintained": true }, + { + "name": "1.9", + "branchName": "1.9", + "slug": "1.9", + "aliases": [ + "latest" + ], + "maintained": false + }, + { + "name": "1.8", + "branchName": "1.8", + "slug": "1.8", + "maintained": false + }, { "name": "1.7", "branchName": "1.7", diff --git a/composer.json b/composer.json index e43a2398a..dd346eec7 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.9.x-dev" + "dev-master": "1.11.x-dev" } } } From 109bec18284324a6acc8b453642e580f8219f681 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Tue, 7 Apr 2020 23:03:02 +0200 Subject: [PATCH 02/14] Update website metadata for master branch --- .doctrine-project.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.doctrine-project.json b/.doctrine-project.json index 2fd7124d6..e446a1c9c 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -6,11 +6,8 @@ "versions": [ { "name": "1.11", - "branchName": "1.11", - "slug": "1.11", - "aliases": [ - "latest" - ], + "branchName": "master", + "slug": "latest", "upcoming": true }, { @@ -28,9 +25,6 @@ "name": "1.9", "branchName": "1.9", "slug": "1.9", - "aliases": [ - "latest" - ], "maintained": false }, { From 4bdfb270bf6ff4f18f7f62a65e1be6a92c57311c Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Thu, 9 Apr 2020 21:29:21 +0200 Subject: [PATCH 03/14] Set x-patch version to branches in website config --- .doctrine-project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.doctrine-project.json b/.doctrine-project.json index e446a1c9c..38553aa66 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -12,7 +12,7 @@ }, { "name": "1.10", - "branchName": "1.10", + "branchName": "1.10.x", "slug": "1.10", "aliases": [ "current", @@ -23,7 +23,7 @@ }, { "name": "1.9", - "branchName": "1.9", + "branchName": "1.9.x", "slug": "1.9", "maintained": false }, From 0988e7dadaad49b865f0690d55785bc0a0e0863d Mon Sep 17 00:00:00 2001 From: Josef Kufner Date: Tue, 5 May 2020 21:14:12 +0200 Subject: [PATCH 04/14] Use ::class constants instead of strings to ease future refactorings --- .../Common/Annotations/AnnotationReader.php | 2 +- lib/Doctrine/Common/Annotations/DocParser.php | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index 107d1bb77..a767f7bee 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -42,7 +42,7 @@ class AnnotationReader implements Reader * @var array */ private static $globalImports = [ - 'ignoreannotation' => 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation', + 'ignoreannotation' => Annotation\IgnoreAnnotation::class, ]; /** diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php index e1f5de315..3ac48e3fc 100644 --- a/lib/Doctrine/Common/Annotations/DocParser.php +++ b/lib/Doctrine/Common/Annotations/DocParser.php @@ -138,7 +138,7 @@ final class DocParser * @var array */ private static $annotationMetadata = [ - 'Doctrine\Common\Annotations\Annotation\Target' => [ + Annotation\Target::class => [ 'is_annotation' => true, 'has_constructor' => true, 'properties' => [], @@ -154,7 +154,7 @@ final class DocParser ] ], ], - 'Doctrine\Common\Annotations\Annotation\Attribute' => [ + Annotation\Attribute::class => [ 'is_annotation' => true, 'has_constructor' => false, 'targets_literal' => 'ANNOTATION_ANNOTATION', @@ -183,7 +183,7 @@ final class DocParser ] ], ], - 'Doctrine\Common\Annotations\Annotation\Attributes' => [ + Annotation\Attributes::class => [ 'is_annotation' => true, 'has_constructor' => false, 'targets_literal' => 'ANNOTATION_CLASS', @@ -196,12 +196,12 @@ final class DocParser 'value' => [ 'type' =>'array', 'required' =>true, - 'array_type'=>'Doctrine\Common\Annotations\Annotation\Attribute', - 'value' =>'array' + 'array_type'=>Annotation\Attribute::class, + 'value' =>'array<' . Annotation\Attribute::class . '>' ] ], ], - 'Doctrine\Common\Annotations\Annotation\Enum' => [ + Annotation\Enum::class => [ 'is_annotation' => true, 'has_constructor' => true, 'targets_literal' => 'ANNOTATION_PROPERTY', @@ -484,10 +484,10 @@ private function collectAnnotationMetadata($name) self::$metadataParser->setIgnoreNotImportedAnnotations(true); self::$metadataParser->setIgnoredAnnotationNames($this->ignoredAnnotationNames); 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' + 'enum' => Annotation\Enum::class, + 'target' => Annotation\Target::class, + 'attribute' => Annotation\Attribute::class, + 'attributes' => Annotation\Attributes::class ]); AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Enum.php'); From 8c229028f3f88dc0c3280c5bac7ab60911a91966 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Tue, 8 May 2018 02:26:11 +0200 Subject: [PATCH 05/14] Drop copyright headers --- lib/Doctrine/Common/Annotations/Annotation.php | 17 ----------------- .../Annotations/Annotation/Attribute.php | 18 ------------------ .../Annotations/Annotation/Attributes.php | 18 ------------------ .../Common/Annotations/Annotation/Enum.php | 18 ------------------ .../Annotation/IgnoreAnnotation.php | 17 ----------------- .../Common/Annotations/Annotation/Required.php | 18 ------------------ .../Common/Annotations/Annotation/Target.php | 18 ------------------ .../Common/Annotations/AnnotationException.php | 17 ----------------- .../Common/Annotations/AnnotationReader.php | 17 ----------------- .../Common/Annotations/AnnotationRegistry.php | 17 ----------------- .../Common/Annotations/CachedReader.php | 17 ----------------- lib/Doctrine/Common/Annotations/DocLexer.php | 17 ----------------- lib/Doctrine/Common/Annotations/DocParser.php | 17 ----------------- .../Common/Annotations/FileCacheReader.php | 17 ----------------- .../Common/Annotations/IndexedReader.php | 17 ----------------- lib/Doctrine/Common/Annotations/PhpParser.php | 17 ----------------- lib/Doctrine/Common/Annotations/Reader.php | 17 ----------------- .../Annotations/SimpleAnnotationReader.php | 17 ----------------- .../Common/Annotations/TokenParser.php | 17 ----------------- .../Annotations/Annotation/TargetTest.php | 17 ----------------- 20 files changed, 345 deletions(-) diff --git a/lib/Doctrine/Common/Annotations/Annotation.php b/lib/Doctrine/Common/Annotations/Annotation.php index a79a0f8f0..32b2222c4 100644 --- a/lib/Doctrine/Common/Annotations/Annotation.php +++ b/lib/Doctrine/Common/Annotations/Annotation.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/Annotation/Attribute.php b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php index dbef6df08..4bc2ad7b2 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Attribute.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Attribute.php @@ -1,23 +1,5 @@ . - */ - namespace Doctrine\Common\Annotations\Annotation; /** diff --git a/lib/Doctrine/Common/Annotations/Annotation/Attributes.php b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php index 53134e309..47f6c4605 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Attributes.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Attributes.php @@ -1,23 +1,5 @@ . - */ - namespace Doctrine\Common\Annotations\Annotation; /** diff --git a/lib/Doctrine/Common/Annotations/Annotation/Enum.php b/lib/Doctrine/Common/Annotations/Annotation/Enum.php index 82f6241ec..bb0c74586 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Enum.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Enum.php @@ -1,23 +1,5 @@ . - */ - namespace Doctrine\Common\Annotations\Annotation; /** diff --git a/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php index 85ec3d6dd..2c4171ab4 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php +++ b/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations\Annotation; diff --git a/lib/Doctrine/Common/Annotations/Annotation/Required.php b/lib/Doctrine/Common/Annotations/Annotation/Required.php index d67f96068..2d64c4e3e 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Required.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Required.php @@ -1,23 +1,5 @@ . - */ - namespace Doctrine\Common\Annotations\Annotation; /** diff --git a/lib/Doctrine/Common/Annotations/Annotation/Target.php b/lib/Doctrine/Common/Annotations/Annotation/Target.php index a52972b8b..d4f3326e1 100644 --- a/lib/Doctrine/Common/Annotations/Annotation/Target.php +++ b/lib/Doctrine/Common/Annotations/Annotation/Target.php @@ -1,23 +1,5 @@ . - */ - namespace Doctrine\Common\Annotations\Annotation; /** diff --git a/lib/Doctrine/Common/Annotations/AnnotationException.php b/lib/Doctrine/Common/Annotations/AnnotationException.php index d06fe663c..74732e8e6 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationException.php +++ b/lib/Doctrine/Common/Annotations/AnnotationException.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index a767f7bee..0e533f84a 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php index ceb7eb7e0..7a1aef7c0 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationRegistry.php +++ b/lib/Doctrine/Common/Annotations/AnnotationRegistry.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/CachedReader.php b/lib/Doctrine/Common/Annotations/CachedReader.php index 8ed16f1a0..504ad0b9a 100644 --- a/lib/Doctrine/Common/Annotations/CachedReader.php +++ b/lib/Doctrine/Common/Annotations/CachedReader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/DocLexer.php b/lib/Doctrine/Common/Annotations/DocLexer.php index 8182f6c6e..cc3da1d69 100644 --- a/lib/Doctrine/Common/Annotations/DocLexer.php +++ b/lib/Doctrine/Common/Annotations/DocLexer.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/DocParser.php b/lib/Doctrine/Common/Annotations/DocParser.php index 3ac48e3fc..edbb5a18c 100644 --- a/lib/Doctrine/Common/Annotations/DocParser.php +++ b/lib/Doctrine/Common/Annotations/DocParser.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/FileCacheReader.php b/lib/Doctrine/Common/Annotations/FileCacheReader.php index 40141af28..a9b9de745 100644 --- a/lib/Doctrine/Common/Annotations/FileCacheReader.php +++ b/lib/Doctrine/Common/Annotations/FileCacheReader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/IndexedReader.php b/lib/Doctrine/Common/Annotations/IndexedReader.php index 4e8c3c8c3..bf2334506 100644 --- a/lib/Doctrine/Common/Annotations/IndexedReader.php +++ b/lib/Doctrine/Common/Annotations/IndexedReader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/PhpParser.php b/lib/Doctrine/Common/Annotations/PhpParser.php index ec871813b..686cc04d8 100644 --- a/lib/Doctrine/Common/Annotations/PhpParser.php +++ b/lib/Doctrine/Common/Annotations/PhpParser.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/Reader.php b/lib/Doctrine/Common/Annotations/Reader.php index 4774f8731..8f34c5b2b 100644 --- a/lib/Doctrine/Common/Annotations/Reader.php +++ b/lib/Doctrine/Common/Annotations/Reader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php index d4757eea2..d20b52d2b 100644 --- a/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/lib/Doctrine/Common/Annotations/TokenParser.php b/lib/Doctrine/Common/Annotations/TokenParser.php index 03d9320ab..4c8ba5b97 100644 --- a/lib/Doctrine/Common/Annotations/TokenParser.php +++ b/lib/Doctrine/Common/Annotations/TokenParser.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Common\Annotations; diff --git a/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php b/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php index 69a953e15..36c71b7c6 100644 --- a/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php +++ b/tests/Doctrine/Tests/Common/Annotations/Annotation/TargetTest.php @@ -1,21 +1,4 @@ . - */ namespace Doctrine\Tests\Common\Annotations\Annotation; From 6642afba79b074bab3c5fb0ad9c85c9740bcd6bd Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 7 May 2020 13:06:51 +0200 Subject: [PATCH 06/14] Deprecate SimpleAnnotationReader --- lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php index d20b52d2b..0dd139374 100644 --- a/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php @@ -11,6 +11,7 @@ * @since 2.2 * @author Johannes M. Schmitt * @author Fabio B. Silva + * @deprecated Deprecated in favour of using AnnotationReader */ class SimpleAnnotationReader implements Reader { From 7b2737dd0fcf5ecabdb3bf3924d728a97b6a0e57 Mon Sep 17 00:00:00 2001 From: AzJezz Date: Sun, 13 May 2018 17:30:03 +0100 Subject: [PATCH 07/14] Update annotations.rst --- docs/en/annotations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/annotations.rst b/docs/en/annotations.rst index 1984dba5f..3fdf7cd96 100644 --- a/docs/en/annotations.rst +++ b/docs/en/annotations.rst @@ -13,7 +13,7 @@ Take a look at the following code snippet: namespace MyProject\Entities; use Doctrine\ORM\Mapping AS ORM; - use Symfony\Component\Validation\Constraints AS Assert; + use Symfony\Component\Validator\Constraints AS Assert; /** * @author Benjamin Eberlei From dbebab3556c0c9cf62b971ebced902ea6795214a Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Mon, 21 May 2018 22:02:55 +0200 Subject: [PATCH 08/14] Change Annotation::value to mixed `string` is wrong as it can also be `null` or an `array`. Merging this (and tagging a new bugfix release) would help me with https://github.com/doctrine/mongodb-odm/pull/1803 :) --- lib/Doctrine/Common/Annotations/Annotation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Annotations/Annotation.php b/lib/Doctrine/Common/Annotations/Annotation.php index 32b2222c4..9defff90e 100644 --- a/lib/Doctrine/Common/Annotations/Annotation.php +++ b/lib/Doctrine/Common/Annotations/Annotation.php @@ -15,7 +15,7 @@ class Annotation /** * Value property. Common among all derived classes. * - * @var string + * @var mixed */ public $value; From f4f485c1ddb2ab3820e2db8866e7b6892948a303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 12 Aug 2018 16:27:43 +0200 Subject: [PATCH 09/14] Document correct method usage The second argument is supposed to be the Annotation you want to get, the property name is already contained in $property. --- docs/en/index.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/index.rst b/docs/en/index.rst index 7a6be485b..abcd8770c 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -73,7 +73,10 @@ annotations of a class. A common one is $property = $reflectionClass->getProperty('bar'); $reader = new AnnotationReader(); - $myAnnotation = $reader->getPropertyAnnotation($property, 'bar'); + $myAnnotation = $reader->getPropertyAnnotation( + $property, + MyAnnotation::class + ); echo $myAnnotation->myProperty; // result: "value" From d52545e7e23e731962f937040a62977b3ca80f18 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Fri, 31 Aug 2018 23:26:45 +0200 Subject: [PATCH 10/14] Update homepage --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dd346eec7..06f5b502f 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "Docblock Annotations Parser", "keywords": ["annotations", "docblock", "parser"], - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "license": "MIT", "authors": [ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, From 2e19a485cb0f33bd39c0064f13ecab79fda444df Mon Sep 17 00:00:00 2001 From: Alexey Kopytko Date: Tue, 29 Jan 2019 12:29:28 +0900 Subject: [PATCH 11/14] Mention coding standard requirements in the README Relevant discussion: https://github.com/doctrine/annotations/pull/235#discussion_r250589084 --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a53b91f2b..bf07cd514 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,11 @@ Docblock Annotations Parser library (extracted from [Doctrine Common](https://gi See the [doctrine-project website](https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/index.html). +## Contributing + +When making a pull request, make sure your changes follow the +[Coding Standard Guidelines](https://www.doctrine-project.org/projects/doctrine-coding-standard/en/latest/reference/index.html#introduction). + ## Changelog See [CHANGELOG.md](CHANGELOG.md). From 39d20fa65a0ce86479e701fc350b90642e7b02e3 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Tue, 19 Feb 2019 04:39:05 +0100 Subject: [PATCH 12/14] Extract implicitly ignored annotation names to separate class --- .../Common/Annotations/AnnotationReader.php | 59 +------ .../ImplicitlyIgnoredAnnotationNames.php | 145 ++++++++++++++++++ 2 files changed, 146 insertions(+), 58 deletions(-) create mode 100644 lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php diff --git a/lib/Doctrine/Common/Annotations/AnnotationReader.php b/lib/Doctrine/Common/Annotations/AnnotationReader.php index 0e533f84a..68dd54b67 100644 --- a/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -35,64 +35,7 @@ class AnnotationReader implements Reader * * @var array */ - private static $globalIgnoredNames = [ - // Annotation tags - 'Annotation' => true, 'Attribute' => true, 'Attributes' => true, - /* Can we enable this? 'Enum' => true, */ - 'Required' => true, - 'Target' => true, - // Widely used tags (but not existent in phpdoc) - 'fix' => true , 'fixme' => true, - 'override' => true, - // PHPDocumentor 1 tags - 'abstract'=> true, 'access'=> true, - 'code' => true, - 'deprec'=> true, - 'endcode' => true, 'exception'=> true, - 'final'=> true, - 'ingroup' => true, 'inheritdoc'=> true, 'inheritDoc'=> true, - 'magic' => true, - 'name'=> true, - 'toc' => true, 'tutorial'=> true, - 'private' => true, - 'static'=> true, 'staticvar'=> true, 'staticVar'=> true, - 'throw' => true, - // PHPDocumentor 2 tags. - 'api' => true, 'author'=> true, - 'category'=> true, 'copyright'=> true, - 'deprecated'=> true, - 'example'=> true, - 'filesource'=> true, - 'global'=> true, - 'ignore'=> true, /* Can we enable this? 'index' => true, */ 'internal'=> true, - 'license'=> true, 'link'=> true, - 'method' => true, - 'package'=> true, 'param'=> true, 'property' => true, 'property-read' => true, 'property-write' => true, - 'return'=> true, - 'see'=> true, 'since'=> true, 'source' => true, 'subpackage'=> true, - 'throws'=> true, 'todo'=> true, 'TODO'=> true, - 'usedby'=> true, 'uses' => true, - 'var'=> true, 'version'=> true, - // PHPUnit tags - 'codeCoverageIgnore' => true, 'codeCoverageIgnoreStart' => true, 'codeCoverageIgnoreEnd' => true, - // PHPCheckStyle - 'SuppressWarnings' => true, - // PHPStorm - 'noinspection' => true, - // PEAR - 'package_version' => true, - // PlantUML - 'startuml' => true, 'enduml' => true, - // Symfony 3.3 Cache Adapter - 'experimental' => true, - // Slevomat Coding Standard - 'phpcsSuppress' => true, - // PHP CodeSniffer - 'codingStandardsIgnoreStart' => true, - 'codingStandardsIgnoreEnd' => true, - // PHPStan - 'template' => true, 'implements' => true, 'extends' => true, 'use' => true, - ]; + private static $globalIgnoredNames = ImplicitlyIgnoredAnnotationNames::LIST; /** * A list with annotations that are not causing exceptions when not resolved to an annotation class. diff --git a/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php new file mode 100644 index 000000000..a7768d8a6 --- /dev/null +++ b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php @@ -0,0 +1,145 @@ + true, + 'Attribute' => true, + 'Attributes' => true, + /* Can we enable this? 'Enum' => true, */ + 'Required' => true, + 'Target' => true, + ]; + + private const WidelyUsedNonStandard = [ + 'fix' => true, + 'fixme' => true, + 'override' => true, + ]; + + private const PhpDocumentor1 = [ + 'abstract' => true, + 'access' => true, + 'code' => true, + 'deprec' => true, + 'endcode' => true, + 'exception' => true, + 'final' => true, + 'ingroup' => true, + 'inheritdoc' => true, + 'inheritDoc' => true, + 'magic' => true, + 'name' => true, + 'private' => true, + 'static' => true, + 'staticvar' => true, + 'staticVar' => true, + 'toc' => true, + 'tutorial' => true, + 'throw' => true, + ]; + + private const PhpDocumentor2 = [ + 'api' => true, + 'author' => true, + 'category' => true, + 'copyright' => true, + 'deprecated' => true, + 'example' => true, + 'filesource' => true, + 'global' => true, + 'ignore' => true, + /* Can we enable this? 'index' => true, */ + 'internal' => true, + 'license' => true, + 'link' => true, + 'method' => true, + 'package' => true, + 'param' => true, + 'property' => true, + 'property-read' => true, + 'property-write' => true, + 'return' => true, + 'see' => true, + 'since' => true, + 'source' => true, + 'subpackage' => true, + 'throws' => true, + 'todo' => true, + 'TODO' => true, + 'usedby' => true, + 'uses' => true, + 'var' => true, + 'version' => true, + ]; + + private const PHPUnit = [ + 'codeCoverageIgnore' => true, + 'codeCoverageIgnoreEnd' => true, + 'codeCoverageIgnoreStart' => true, + ]; + + private const PhpCheckStyle = [ + 'SuppressWarnings' => true, + ]; + + private const PhpStorm = [ + 'noinspection' => true, + ]; + + private const PEAR = [ + 'package_version' => true, + ]; + + private const PlainUML = [ + 'startuml' => true, + 'enduml' => true, + ]; + + private const Symfony = [ + 'experimental' => true, + ]; + + private const PhpCodeSniffer = [ + 'codingStandardsIgnoreStart' => true, + 'codingStandardsIgnoreEnd' => true, + ]; + + private const SlevomatCodingStandard = [ + 'phpcsSuppress' => true, + ]; + + private const PhpStan = [ + 'extends' => true, + 'implements' => true, + 'template' => true, + 'use' => true, + ]; + + public const LIST = self::Reserved + + self::WidelyUsedNonStandard + + self::PhpDocumentor1 + + self::PhpDocumentor2 + + self::PHPUnit + + self::PhpCheckStyle + + self::PhpStorm + + self::PEAR + + self::PlainUML + + self::Symfony + + self::SlevomatCodingStandard + + self::PhpCodeSniffer + + self::PhpStan; + + private function __construct() + { + } +} From e86ec4811af7050163de0ffeca9e6def51ae9a48 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Tue, 5 Mar 2019 22:40:27 -0800 Subject: [PATCH 13/14] Ignore all PHPUnit annotations --- .../ImplicitlyIgnoredAnnotationNames.php | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php index a7768d8a6..169a46558 100644 --- a/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php +++ b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php @@ -83,9 +83,39 @@ final class ImplicitlyIgnoredAnnotationNames ]; private const PHPUnit = [ - 'codeCoverageIgnore' => true, - 'codeCoverageIgnoreEnd' => true, - 'codeCoverageIgnoreStart' => true, + 'author' => true, + 'after' => true, + 'afterClass' => true, + 'backupGlobals' => true, + 'backupStaticAttributes' => true, + 'before' => true, + 'beforeClass' => true, + 'codeCoverageIgnore' => true, + 'codeCoverageIgnoreStart' => true, + 'codeCoverageIgnoreEnd' => true, + 'covers' => true, + 'coversDefaultClass' => true, + 'coversNothing' => true, + 'dataProvider' => true, + 'depends' => true, + 'doesNotPerformAssertions' => true, + 'expectedException' => true, + 'expectedExceptionCode' => true, + 'expectedExceptionMessage' => true, + 'expectedExceptionMessageRegExp' => true, + 'group' => true, + 'large' => true, + 'medium' => true, + 'preserveGlobalState' => true, + 'requires' => true, + 'runTestsInSeparateProcesses' => true, + 'runInSeparateProcess' => true, + 'small' => true, + 'test' => true, + 'testdox' => true, + 'testWith' => true, + 'ticket' => true, + 'uses' => true, ]; private const PhpCheckStyle = [ From 9a3d7afe57d11a3a434b0543a24982734404fb65 Mon Sep 17 00:00:00 2001 From: Aerendir Date: Wed, 23 Sep 2020 19:56:58 +0200 Subject: [PATCH 14/14] Fix #361. --- .../Annotations/ImplicitlyIgnoredAnnotationNames.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php index 8701e3db8..797bc5972 100644 --- a/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php +++ b/lib/Doctrine/Common/Annotations/ImplicitlyIgnoredAnnotationNames.php @@ -145,6 +145,10 @@ final class ImplicitlyIgnoredAnnotationNames 'use' => true, ]; + private const Phan = [ + 'suppress' => true, + ]; + public const LIST = self::Reserved + self::WidelyUsedNonStandard + self::PhpDocumentor1 @@ -157,7 +161,8 @@ final class ImplicitlyIgnoredAnnotationNames + self::Symfony + self::SlevomatCodingStandard + self::PhpCodeSniffer - + self::PhpStan; + + self::PhpStan + + self::Phan; private function __construct() {