beyondcode / invoker-community

74 stars 2 forks source link

invoker does not show all models and gives an error at every start. #314

Closed furkansabaz closed 1 year ago

furkansabaz commented 1 year ago

OS: darwin Invoker Version: 2.9.0 Laravel Version: 8.83.15 Local project: unknown PHP Binary: /opt/homebrew/bin/php Route: /project/placeholder?project=remote-pij4jKHXHZHxc2PoGGWkEt

Error:

TypeError 

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

  at phar:///tmp/apifitymecom_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) : \_HumbugBoxf4b902e0e9ad\PhpParser\NodeAbstract
    346▕     {
    347▕         $name = $type->getName();
    348▕         $nameNode = $type->isBuiltin() || \in_array($name, ['self', 'parent'], \true) ? new \_HumbugBoxf4b902e0e9ad\PhpParser\Node\Name($name) : new \_HumbugBoxf4b902e0e9ad\PhpParser\Node\Name\FullyQualified($name);
    349▕         return $type->allowsNull() ? new \_HumbugBoxf4b902e0e9ad\PhpParser\Node\NullableType($nameNode) : $nameNode;

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

      +2 vendor frames 
  15  phar:///tmp/apifitymecom_invoker.phar/src/ModelLookupService.php:159
      _HumbugBoxf4b902e0e9ad\Roave\BetterReflection\Reflection\ReflectionClass::getTraitNames()
mpociot commented 1 year ago

This will be fixed in the upcoming version.