mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-16 22:04:54 +01:00
[NodeTypeResolver] improve README
This commit is contained in:
parent
68109ace87
commit
acb27015fa
@ -17,7 +17,7 @@ Anonymous classes are skipped.
|
|||||||
|
|
||||||
## How it helps you?
|
## How it helps you?
|
||||||
|
|
||||||
You can get `class`
|
### 1. You can get `class`
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$class = (string) $node->getAttribute(Attribute::CLASS_NAME);
|
$class = (string) $node->getAttribute(Attribute::CLASS_NAME);
|
||||||
@ -38,7 +38,7 @@ if ($fqnName->toString() === 'Symfony\Component\Console\Command') {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
or `type` attribute:
|
### 2. Or `type` attribute:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
/** @var string $type */
|
/** @var string $type */
|
||||||
@ -49,4 +49,4 @@ if ($type === 'Nette\Application\UI\Form') {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
...in any Rector you create.
|
...in any Rector you create.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user