mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
[NodeTypeResolver] prepare for standalone release
This commit is contained in:
parent
2bbeffc74e
commit
2342219033
@ -2,25 +2,10 @@
|
||||
|
||||
This package detects **class, interface and trait types** for classes, variables and properties. Those types are resolved by `NodeTypeResolver` service.
|
||||
|
||||
Anonymous classes are included, e.g.:
|
||||
Includes also:
|
||||
|
||||
```php
|
||||
$someAnonymousClass = new class extends SomeClass
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
includes types:
|
||||
|
||||
```php
|
||||
['SomeClass']
|
||||
```
|
||||
|
||||
## How it works?
|
||||
|
||||
1. Traverse all nodes
|
||||
2. Detect variable assigns, property use, method arguments
|
||||
3. Resolve types
|
||||
- Anonymous classes
|
||||
- Traits of parent classes
|
||||
|
||||
## How it helps you?
|
||||
|
||||
@ -78,5 +63,4 @@ final class SomeRector
|
||||
|
||||
### Inspiration
|
||||
|
||||
- https://github.com/Roave/BetterReflection/pull/224
|
||||
- https://github.com/phpactor/worse-reflection/blob/master/lib/Core/Inference/SymbolContextResolver.php
|
||||
@todo phpstan + silverstripe
|
||||
|
38
packages/NodeTypeResolver/composer.json
Normal file
38
packages/NodeTypeResolver/composer.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "rector/node-type-resolver",
|
||||
"description": "This package detects class, interface and trait types for classes, variables and properties.",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{ "name": "Tomas Votruba", "email": "tomas.vot@gmail.com", "homepage": "https://tomasvotruba.com" }
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.1",
|
||||
"nikic/php-parser": "^4.0.3",
|
||||
"phpstan/phpstan": "^0.10.2",
|
||||
"symfony/dependency-injection": "^3.4|^4.0",
|
||||
"symfony/finder": "^3.4|^4.0",
|
||||
"symplify/better-phpdoc-parser": "^4.7",
|
||||
"symplify/package-builder": "^4.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Rector\\NodeTypeResolver\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Rector\\NodeTypeResolver\\Tests\\": "tests"
|
||||
},
|
||||
"classmap": [
|
||||
"tests"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user