beyondcode / invoker-community

74 stars 2 forks source link

Bug when I open the app #302

Closed domthomas-dev closed 1 year ago

domthomas-dev commented 2 years ago

OS: darwin Invoker Version: 2.9.0 Laravel Version: 9.20.0 Local project: true PHP Binary: /opt/homebrew/bin/php Route: /project/placeholder?project=local-sjFdgfRankCQUy4zp4WHhL

Error:

AssertionError 

  assert($returnType instanceof \ReflectionNamedType || $returnType === null)

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/vendor/roave/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php:265
    261▕             $this->addMethodFlags($methodNode, $methodReflection);
    262▕             $this->addDocComment($methodNode, $methodReflection);
    263▕             $this->addParameters($methodNode, $methodReflection);
    264▕             $returnType = $methodReflection->getReturnType();
  ➜ 265▕             \assert($returnType instanceof \ReflectionNamedType || $returnType === null);
    266▕             if ($methodReflection->getReturnType() !== null) {
    267▕                 $methodNode->setReturnType($this->formatType($returnType));
    268▕             }
    269▕             $classNode->addStmt($methodNode);

      +11 vendor frames 
  12  [internal]:0
      _HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\ReflectionClass::_HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\{closure}(Object(_HumbugBoxf4b902e0e9ad\PhpParser\Node\Name\FullyQualified))

      +2 vendor frames 
  15  phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/ModelLookupService.php:159
      _HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\ReflectionClass::getTraitNames()
mechelon commented 2 years ago

Which PHP version do you use?

frodeknutsen commented 2 years ago

I'm getting that exact same error in our project. php 8.1.8

da-sie commented 1 year ago

Same error in 8.1.10 and 8.1.11

mpociot commented 1 year ago

This error will be gone in the next Invoker version.