-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eac85cd
commit 1df960d
Showing
2 changed files
with
49 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* Parser Reflection API | ||
* | ||
* @copyright Copyright 2015, Lisachenko Alexander <[email protected]> | ||
* | ||
* This source file is subject to the license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Go\ParserReflection; | ||
|
||
use Go\ParserReflection\Traits\InternalPropertiesEmulationTrait; | ||
use ReflectionAttribute as BaseReflectionAttribute; | ||
use PhpParser\Node; | ||
use Reflector; | ||
|
||
class ReflectionAttribute extends BaseReflectionAttribute | ||
{ | ||
use InternalPropertiesEmulationTrait; | ||
|
||
public function __construct( | ||
string $attributeName, | ||
private ?Node\Attribute $attributeNode = null, | ||
private ?Node\Stmt\ClassLike $classLikeNode = null, | ||
private ?Reflector $declaringReflector = null | ||
) { | ||
$this->attributeNode ??= ReflectionEngine::parseAttribute($attributeName); | ||
$this->classLikeNode ??= ReflectionEngine::parseClass($attributeName); | ||
} | ||
|
||
public function __debugInfo(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getNode(): Node\Attribute | ||
{ | ||
return $this->attributeNode; | ||
} | ||
} |
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