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

Exception thrown while running phpstan #242

Closed
driade opened this issue Dec 11, 2020 · 2 comments
Closed

Exception thrown while running phpstan #242

driade opened this issue Dec 11, 2020 · 2 comments

Comments

@driade
Copy link

driade commented Dec 11, 2020

Version: 2.5.6

Bug Description

PHP Fatal error: Uncaught Nette\DI\ServiceCreationException: Method PHPStan\Reflection\FunctionReflectionFactory::create() used in service '24' has not return type hint or annotation @return. in /var/www/arge/src/vendor/nette/di/src/DI/ContainerBuilder.php:419
Stack trace:
#0 /var/www/arge/src/vendor/nette/di/src/DI/ContainerBuilder.php(322): Nette\DI\ContainerBuilder->resolveImplement(Object(Nette\DI\ServiceDefinition), 24)
#1 /var/www/arge/src/vendor/nette/di/src/DI/Compiler.php(249): Nette\DI\ContainerBuilder->prepareClassList()
#2 /var/www/arge/src/vendor/nette/di/src/DI/Compiler.php(177): Nette\DI\Compiler->generateCode()
#3 /var/www/arge/src/vendor/nette/bootstrap/src/Bootstrap/Configurator.php(306): Nette\DI\Compiler->compile()
#4 [internal function]: Nette\Configurator->generateContainer(Object(Nette\DI\Compiler))
#5 /var/www/arge/src/vendor/nette/di/src/DI/ContainerLoader.php(125): call_user_func_array(Array, Array)
#6 /var/www/arge/src/vendor/nette/di/src/DI/ContainerLoader.php(85): Nette\DI\ContainerLoader->generat in /var/www/arge/src/vendor/nette/di/src/DI/ContainerBuilder.php on line 419

The very code that seems to be problem is

interface FunctionReflectionFactory
{

    public function create(
        \ReflectionFunction $reflection,
        array $phpDocParameterTypes,
        Type $phpDocReturnType = null
    ): FunctionReflection;

}

Steps To Reproduce

I've got this error in Laravel 5.4 installation, with php 7.0, while trying to run phpstan 0.9.3

Expected Behavior

Not an exception to be thrown. It's works with 2.5.5

@driade
Copy link
Author

driade commented Dec 11, 2020

Thanks in advance.

dg added a commit that referenced this issue Dec 13, 2020
@dg
Copy link
Member

dg commented Dec 13, 2020

Fixed in v2.5.7

@dg dg closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants