Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rector-Prefixed] Call to a member function getByType() on null #3247

Closed
decad7never opened this issue Apr 24, 2020 · 1 comment · Fixed by #3253
Closed

[Rector-Prefixed] Call to a member function getByType() on null #3247

decad7never opened this issue Apr 24, 2020 · 1 comment · Fixed by #3253
Labels

Comments

@decad7never
Copy link

Bug Report

Subject Details
Rector version Rector 0.8.x-dev@8896f0a
Installed as composer

When i try to scan my folder we get the following error message, and the scan stop:

PHP Fatal error: Uncaught Error: Call to a member function getByType() on null in phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php:38
Stack trace:
#0 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer.php(46): Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer\DoctrineRelationPropertyTypeInferer->inferProperty(Object(PhpParser\Node\Stmt\Property))
#1 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/php74/src/Rector/Property/TypedPropertyRector.php(88): Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer->inferProperty(Object(PhpParser\Node\Stmt\Property))
#2 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/src/Rector/AbstractRector.php(111): Rector\Php74\Rector\Property\TypedPropertyRector->refactor(Object(PhpParser\Node\Stmt\Property in phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php on line 38
Fatal error: Uncaught Error: Call to a member function getByType() on null in phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php:38
Stack trace:
#0 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer.php(46): Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer\DoctrineRelationPropertyTypeInferer->inferProperty(Object(PhpParser\Node\Stmt\Property))
#1 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/php74/src/Rector/Property/TypedPropertyRector.php(88): Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer->inferProperty(Object(PhpParser\Node\Stmt\Property))
#2 phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/src/Rector/AbstractRector.php(111): Rector\Php74\Rector\Property\TypedPropertyRector->refactor(Object(PhpParser\Node\Stmt\Property in phar:///xxxxx/xxxxx/xxxxx/xxx/xxxxxx/vendor/rector/rector-prefixed/rector/rules/type-declaration/src/TypeInferer/PropertyTypeInferer/DoctrineRelationPropertyTypeInferer.php on line 38

Its not simple to found the source of this issue.

Thanks for a solution.

Regards

decad7

@TomasVotruba
Copy link
Member

Thanks for the report.

This should fix it: #3253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants