beyondcode / invoker-community

74 stars 2 forks source link

Getting this issue on project load, and one of the models are missing #326

Open bomshteyn opened 1 year ago

bomshteyn commented 1 year ago

OS: darwin Invoker Version: 2.10.0 Laravel Version: 9.46.0 Local project: unknown PHP Binary: /usr/local/bin/php Route: /project/placeholder?project=1722310

Error:

TypeError 

  _HumbugBox5bc770953b87\Roave\BetterReflection\SourceLocator\SourceStubber\ReflectionSourceStubber::formatType(): Argument #1 ($type) must be of type ReflectionNamedType, ReflectionUnionType given, called in phar:///tmp/forge_invoker.phar/vendor/roave/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php on line 267

  at phar:///tmp/forge_invoker.phar/vendor/roave/better-reflection/src/SourceLocator/SourceStubber/ReflectionSourceStubber.php:345
    341▕             return null;
    342▕         }
    343▕         return $parameterReflection->getDefaultValue();
    344▕     }
  ➜ 345▕     private function formatType(\ReflectionNamedType $type) : \_HumbugBox5bc770953b87\PhpParser\NodeAbstract
    346▕     {
    347▕         $name = $type->getName();
    348▕         $nameNode = $type->isBuiltin() || \in_array($name, ['self', 'parent'], \true) ? new \_HumbugBox5bc770953b87\PhpParser\Node\Name($name) : new \_HumbugBox5bc770953b87\PhpParser\Node\Name\FullyQualified($name);
    349▕         return $type->allowsNull() ? new \_HumbugBox5bc770953b87\PhpParser\Node\NullableType($nameNode) : $nameNode;

      +11 vendor frames 
  12  [internal]:0
      _HumbugBox5bc770953b87\Roave\BetterReflection\Reflection\ReflectionClass::_HumbugBox5bc770953b87\Roave\BetterReflection\Reflection\{closure}()

      +2 vendor frames 
  15  phar:///tmp/forge_invoker.phar/src/ModelLookupService.php:159
      _HumbugBox5bc770953b87\Roave\BetterReflection\Reflection\ReflectionClass::getTraitNames()