Skip to content

Commit

Permalink
Merge pull request #423 from doctrine/1.13.x-merge-up-into-1.14.x_O2t…
Browse files Browse the repository at this point in the history
…JenRp

Merge release 1.13.2 into 1.14.x
  • Loading branch information
greg0ire committed Aug 5, 2021
2 parents 5e802cc + 5b668ae commit 732ea12
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ IDE Support

Some IDEs already provide support for annotations:

- Eclipse via the `Symfony2 Plugin <http://symfony.dubture.com/>`_
- Eclipse via the `Symfony2 Plugin <https://github.com/pulse00/Symfony-2-Eclipse-Plugin>`_
- PhpStorm via the `PHP Annotations Plugin <https://plugins.jetbrains.com/plugin/7320-php-annotations>`_ or the `Symfony Plugin <https://plugins.jetbrains.com/plugin/7219-symfony-support>`_

.. _Read more about handling annotations.: annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
final class ImplicitlyIgnoredAnnotationNames
{
private const Reserved = [
'Annotation' => true,
'Attribute' => true,
'Attributes' => true,
'Annotation' => true,
'Attribute' => true,
'Attributes' => true,
/* Can we enable this? 'Enum' => true, */
'Required' => true,
'Target' => true,
'Required' => true,
'Target' => true,
'NamedArgumentConstructor' => true,
];

private const WidelyUsedNonStandard = [
Expand Down Expand Up @@ -138,16 +139,21 @@ final class ImplicitlyIgnoredAnnotationNames

private const SlevomatCodingStandard = ['phpcsSuppress' => true];

private const PhpStan = [
private const Phan = ['suppress' => true];

private const Rector = ['noRector' => true];

private const StaticAnalysis = [
// PHPStan, Psalm
'extends' => true,
'implements' => true,
'template' => true,
'use' => true,
];

private const Phan = ['suppress' => true];

private const Rector = ['noRector' => true];
// Psalm
'pure' => true,
'immutable' => true,
];

public const LIST = self::Reserved
+ self::WidelyUsedNonStandard
Expand All @@ -161,9 +167,9 @@ final class ImplicitlyIgnoredAnnotationNames
+ self::Symfony
+ self::SlevomatCodingStandard
+ self::PhpCodeSniffer
+ self::PhpStan
+ self::Phan
+ self::Rector;
+ self::Rector
+ self::StaticAnalysis;

private function __construct()
{
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden">
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php</exclude-pattern>
<exclude-pattern>*/tests/Doctrine/Tests/Common/Annotations/Fixtures/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash.UseStartsWithBackslash">
Expand Down
11 changes: 8 additions & 3 deletions tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ public function testIgnoresAnnotationsNotPrefixedWithWhitespace(): void

$annotation = $reader->getClassAnnotation(
new ReflectionClass(new TestIgnoresNonAnnotationsClass()),
Name::class
NameBar::class
);
self::assertInstanceOf(Name::class, $annotation);
self::assertInstanceOf(NameBar::class, $annotation);
}

private static $testResetsPhpParserAfterUseRun = false;
Expand Down Expand Up @@ -594,7 +594,8 @@ class TestParseAnnotationClass
}

/**
* @Name
* @NameBar
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class TestIgnoresNonAnnotationsClass
{
Expand Down Expand Up @@ -666,6 +667,10 @@ class DummyClass2
public $id;
}

/** @Annotation */
class NameBar extends Annotation
{
}
/** @Annotation */
class DummyId extends Annotation
{
Expand Down

0 comments on commit 732ea12

Please sign in to comment.