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 5f58768
Showing
5 changed files
with
131 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
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
31 changes: 31 additions & 0 deletions
31
...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,31 @@ | ||
<?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; | ||
|
||
/** | ||
* @AnnotationWithConstants(self::VALUE_FOR_CLASS) | ||
*/ | ||
private $classProperty; | ||
|
||
|
||
/** | ||
* @AnnotationWithConstants(self::VALUE_FOR_CLASS) | ||
*/ | ||
public function classMethod(): void | ||
{ | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...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,21 @@ | ||
<?php | ||
|
||
|
||
namespace Doctrine\Tests\Common\Annotations\Fixtures\Traits; | ||
|
||
use Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithConstants; | ||
|
||
trait TraitWithSelfConstantReferenceTrait | ||
{ | ||
/** | ||
* @AnnotationWithConstants(self::VALUE_FOR_TRAIT) | ||
*/ | ||
private $traitProperty; | ||
|
||
/** | ||
* @AnnotationWithConstants(self::VALUE_FOR_TRAIT) | ||
*/ | ||
public function traitMethod(): void | ||
{ | ||
} | ||
} |