forked from doctrine/annotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow usage of self:: accessor for constants
ex: @annotation(self::VALUE) Fixes doctrine#269
- Loading branch information
1 parent
2dceb19
commit 68d932b
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ctrine/Tests/Common/Annotations/Fixtures/ClassWithAnnotationWithSelfConstantReference.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\Common\Annotations\Fixtures; | ||
use Doctrine\Tests\Common\Annotations\Fixtures\Traits\TraitWithSelfConstantReferenceTrait; | ||
|
||
/** @AnnotationWithConstants(self::VALUE_FOR_CLASS) */ | ||
class ClassWithAnnotationWithSelfConstantReference | ||
{ | ||
public const VALUE_FOR_CLASS = 'ClassWithAnnotationWithSelfConstantReference.VALUE_FROM_CLASS'; | ||
public const VALUE_FOR_TRAIT = 'ClassWithAnnotationWithSelfConstantReference.VALUE_FOR_TRAIT'; | ||
|
||
use TraitWithSelfConstantReferenceTrait; | ||
|
||
/** | ||
* @var mixed | ||
* @AnnotationWithConstants(self::VALUE_FOR_CLASS) | ||
*/ | ||
private $classProperty; | ||
|
||
/** @AnnotationWithConstants(self::VALUE_FOR_CLASS) */ | ||
public function classMethod(): void | ||
{ | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...Doctrine/Tests/Common/Annotations/Fixtures/Traits/TraitWithSelfConstantReferenceTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\Common\Annotations\Fixtures\Traits; | ||
|
||
use Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants; | ||
|
||
trait TraitWithSelfConstantReferenceTrait | ||
{ | ||
/** | ||
* @var mixed | ||
* @AnnotationWithConstants(self::VALUE_FOR_TRAIT) | ||
*/ | ||
private $traitProperty; | ||
|
||
/** @AnnotationWithConstants(self::VALUE_FOR_TRAIT) */ | ||
public function traitMethod(): void | ||
{ | ||
} | ||
} |