[NodeTypeResolver] prepare for standalone release

This commit is contained in:
Tomas Votruba 2018-08-10 08:35:21 +02:00
parent 2bbeffc74e
commit 2342219033
2 changed files with 42 additions and 20 deletions

View File

@ -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

View 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
}