Skip to content

Commit 9f59c3a

Browse files
phpeekalcaeus
authored andcommitted
Ignores PHP CodeSniffer annotations.
1 parent b22e61d commit 9f59c3a

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

lib/Doctrine/Common/Annotations/AnnotationReader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ class AnnotationReader implements Reader
104104
'experimental' => true,
105105
// Slevomat Coding Standard
106106
'phpcsSuppress' => true,
107+
// PHP CodeSniffer
108+
'codingStandardsIgnoreStart' => true,
109+
'codingStandardsIgnoreEnd' => true,
107110
];
108111

109112
/**

tests/Doctrine/Tests/Common/Annotations/AnnotationReaderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\Common\Annotations\DocParser;
88
use Doctrine\Tests\Common\Annotations\Fixtures\Annotation\SingleUseAnnotation;
99
use Doctrine\Tests\Common\Annotations\Fixtures\ClassWithFullPathUseStatement;
10+
use Doctrine\Tests\Common\Annotations\Fixtures\ClassWithPHPCodeSnifferAnnotation;
1011
use Doctrine\Tests\Common\Annotations\Fixtures\ClassWithPhpCsSuppressAnnotation;
1112
use Doctrine\Tests\Common\Annotations\Fixtures\IgnoredNamespaces\AnnotatedAtClassLevel;
1213
use Doctrine\Tests\Common\Annotations\Fixtures\IgnoredNamespaces\AnnotatedAtMethodLevel;
@@ -156,4 +157,12 @@ public function testGloballyIgnoredAnnotationNotIgnored() : void
156157
spl_autoload_unregister($testLoader);
157158
}
158159
}
160+
161+
public function testPHPCodeSnifferAnnotationsAreIgnored()
162+
{
163+
$reader = $this->getReader();
164+
$ref = new \ReflectionClass(ClassWithPHPCodeSnifferAnnotation::class);
165+
166+
self::assertEmpty($reader->getClassAnnotations($ref));
167+
}
159168
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Doctrine\Tests\Common\Annotations\Fixtures;
4+
5+
/**
6+
* @codingStandardsIgnoreStart
7+
* @codingStandardsIgnoreEnd
8+
*/
9+
class ClassWithPHPCodeSnifferAnnotation
10+
{
11+
}

0 commit comments

Comments
 (0)