| @@ 8-23 (lines=16) @@ | ||
| 5 | use PhpParser\Node\Stmt; |
|
| 6 | use PhpParser\Node\Stmt\ClassMethod as BaseClassMethod; |
|
| 7 | ||
| 8 | class ClassMethod |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @param \PhpParser\Node\Stmt $context |
|
| 12 | * @param \PhpParser\Node\Stmt\ClassMethod $classMethod |
|
| 13 | * @return string |
|
| 14 | */ |
|
| 15 | public static function getFullyQualifiedName(Stmt $context, BaseClassMethod $classMethod) |
|
| 16 | { |
|
| 17 | $namespace = $context->name->toString(); |
|
| 18 | if (isset($context->namespacedName)) { |
|
| 19 | $namespace = $context->namespacedName->toString(); |
|
| 20 | } |
|
| 21 | return $namespace . '::' . $classMethod->name->toString(); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||
| @@ 8-23 (lines=16) @@ | ||
| 5 | use PhpParser\Node\Stmt; |
|
| 6 | use PhpParser\Node\Stmt\Property as BaseProperty; |
|
| 7 | ||
| 8 | class Property |
|
| 9 | { |
|
| 10 | /** |
|
| 11 | * @param \PhpParser\Node\Stmt $context |
|
| 12 | * @param \PhpParser\Node\Stmt\Property $property |
|
| 13 | * @return string |
|
| 14 | */ |
|
| 15 | public static function getFullyQualifiedName(Stmt $context, BaseProperty $property) |
|
| 16 | { |
|
| 17 | $namespace = $context->name; |
|
| 18 | if (isset($context->namespacedName)) { |
|
| 19 | $namespace = $context->namespacedName->toString(); |
|
| 20 | } |
|
| 21 | return $namespace . '::$' . $property->props[0]->name; |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||