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

CarbonImmutable Macro Causes PHPStan Internal Error #9705

Closed
LukeAbell opened this issue Jul 31, 2023 · 4 comments
Closed

CarbonImmutable Macro Causes PHPStan Internal Error #9705

LukeAbell opened this issue Jul 31, 2023 · 4 comments

Comments

@LukeAbell
Copy link

LukeAbell commented Jul 31, 2023

Bug report

When using a CarbonImmutable macro in Laravel v10, PHPStan throws an error.

Internal error: Internal error: No closure found on line 161 in AppServiceProvider.php.

Line 161:

CarbonImmutable::macro('toCustomDisplayFormat', function (): string {
	return $this->format(AppServiceProvider::TIME_FORMAT_DISPLAY);
});

It does not error when using standard Carbon macros, but we use CarbonImmutable everywhere so need them defined there.

Stack Trace

#0 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/ClosureSourceLocator.php(132):
PHPStan\BetterReflection\SourceLocator\Exception\NoClosureOnLine::create('/Users/lukeabel...', 161)
#1 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/ClosureSourceLocator.php(147):
PhpParser\NodeVisitorAbstract@anonymous->getClosureNodes()
#2 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/ClosureSourceLocator.php(54):
PHPStan\BetterReflection\SourceLocator\Type\ClosureSourceLocator->getReflectionFunction(Object(PHPStan\BetterReflection\Reflector\DefaultReflector), Object(PHPStan\BetterReflection\Identifier\IdentifierType))
#3 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/SourceLocator/Type/AggregateSourceLocator.php(26):
PHPStan\BetterReflection\SourceLocator\Type\ClosureSourceLocator->locateIdentifier(Object(PHPStan\BetterReflection\Reflector\DefaultReflector), Object(PHPStan\BetterReflection\Identifier\Identifier))
#4 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/DefaultReflector.php(58):
PHPStan\BetterReflection\SourceLocator\Type\AggregateSourceLocator->locateIdentifier(Object(PHPStan\BetterReflection\Reflector\DefaultReflector), Object(PHPStan\BetterReflection\Identifier\Identifier))
#5 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionFunction.php(72):
PHPStan\BetterReflection\Reflector\DefaultReflector->reflectFunction('{closure}')
#6 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php(130): PHPStan\BetterReflection\Reflection\ReflectionFunction::createFromClosure(Object(Closure))
#7 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php(87): Carbon\PHPStan\AbstractMacro->getReflectionFunction(Object(Closure))
#8 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php(82): Carbon\PHPStan\AbstractMacro->construct('Carbon\CarbonIm...', 'toSailTimeDispl...', Object(Closure))
#9 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php(66): Carbon\PHPStan\MacroScanner->getMethod('Carbon\CarbonIm...', 'toSailTimeDispl...')
#10 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php(462): Carbon\PHPStan\MacroExtension->getMethod(Object(PHPStan\Reflection\ClassReflection),
'toSailTimeDispl...')
#11 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Type/ObjectType.php(584): PHPStan\Reflection\ClassReflection->getMethod('toSailTimeDispl...',
Object(PHPStan\Analyser\MutatingScope))
#12 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Type/ObjectType.php(561): PHPStan\Type\ObjectType->getUnresolvedMethodPrototype('toSailTimeDispl...',
Object(PHPStan\Analyser\MutatingScope))
#13 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3412): PHPStan\Type\ObjectType->getMethod('toSailTimeDispl...',
Object(PHPStan\Analyser\MutatingScope))
#14 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1747): PHPStan\Analyser\MutatingScope->getMethodReflection(Object(PHPStan\Type\ObjectType),
'toSailTimeDispl...')
#15 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(2904):
PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\MethodCall), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#16 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1884):
PHPStan\Analyser\NodeScopeResolver->processArgs(Object(PHPStan\Reflection\Php\PhpMethodReflection), Object(PHPStan\Reflection\FunctionVariantWithPhpDocs), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure),
Object(PHPStan\Analyser\ExpressionContext), NULL)
#17 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1731):
PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\StaticCall), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#18 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1585):
PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\MethodCall), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#19 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3007):
PHPStan\Analyser\NodeScopeResolver->PHPStan\Analyser{closure}(Object(PHPStan\Analyser\MutatingScope))
#20 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1593):
PHPStan\Analyser\NodeScopeResolver->processAssignVar(Object(PHPStan\Analyser\MutatingScope), Object(PhpParser\Node\Expr\Variable), Object(PhpParser\Node\Expr\MethodCall), Object(Closure),
Object(PHPStan\Analyser\ExpressionContext), Object(Closure), true)
#21 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(599): PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\Assign),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#22 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384):
PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Expression), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#23 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(766):
PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\Foreach
), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#24 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Foreach
),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#25 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(557):
PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\ClassMethod), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#26 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3594):
PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\ClassMethod), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#27 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3610):
PHPStan\Analyser\NodeScopeResolver->processNodesForCalledMethod(Object(PhpParser\Node\Stmt\Class_), '/Users/lukeabel...', Object(PHPStan\Reflection\ResolvedMethodReflection), Object(Closure))
#28 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3606): PHPStan\Analyser\NodeScopeResolver->processNodesForCalledMethod(Array,
'/Users/lukeabel...', Object(PHPStan\Reflection\ResolvedMethodReflection), Object(Closure))
#29 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3610):
PHPStan\Analyser\NodeScopeResolver->processNodesForCalledMethod(Object(PhpParser\Node\Stmt\Namespace_), '/Users/lukeabel...', Object(PHPStan\Reflection\ResolvedMethodReflection), Object(Closure))
#30 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3540): PHPStan\Analyser\NodeScopeResolver->processNodesForCalledMethod(Array,
'/Users/lukeabel...', Object(PHPStan\Reflection\ResolvedMethodReflection), Object(Closure))
#31 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1776):
PHPStan\Analyser\NodeScopeResolver->processCalledMethod(Object(PHPStan\Reflection\ResolvedMethodReflection))
#32 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(2001):
PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\MethodCall), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#33 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(1986):
PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\ArrayItem), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#34 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(577): PHPStan\Analyser\NodeScopeResolver->processExprNode(Object(PhpParser\Node\Expr\Array_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\ExpressionContext))
#35 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Return_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#36 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1038): PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Expr\Closure),
Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#37 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(562): PHPStan\Analyser\MutatingScope->resolveType('function (int $...',
Object(PhpParser\Node\Expr\Closure))
#38 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ParametersAcceptorSelector.php(129): PHPStan\Analyser\MutatingScope->getType(Object(PhpParser\Node\Expr\Closure))
#39 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(3424):
PHPStan\Reflection\ParametersAcceptorSelector::selectFromArgs(Object(PHPStan\Analyser\MutatingScope), Array, Array)
#40 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1366):
PHPStan\Analyser\MutatingScope->methodCallReturnType(Object(PHPStan\Type\Generic\GenericObjectType), 'mapWithKeys', Object(PhpParser\Node\Expr\MethodCall))
#41 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1372): PHPStan\Analyser\MutatingScope->PHPStan\Analyser{closure}()
#42 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(562): PHPStan\Analyser\MutatingScope->resolveType('\Illuminate\Sup...',
Object(PhpParser\Node\Expr\MethodCall))
#43 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1366): PHPStan\Analyser\MutatingScope->getType(Object(PhpParser\Node\Expr\MethodCall))
#44 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(1372): PHPStan\Analyser\MutatingScope->PHPStan\Analyser{closure}()
#45 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/MutatingScope.php(562): PHPStan\Analyser\MutatingScope->resolveType('\Illuminate\Sup...',
Object(PhpParser\Node\Expr\MethodCall))
#46 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Rules/FunctionReturnTypeCheck.php(53): PHPStan\Analyser\MutatingScope->getType(Object(PhpParser\Node\Expr\MethodCall))
#47 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Rules/Methods/ReturnTypeRule.php(43):
PHPStan\Rules\FunctionReturnTypeCheck->checkReturnType(Object(PHPStan\Analyser\MutatingScope), Object(PHPStan\Type\ArrayType), Object(PhpParser\Node\Expr\MethodCall), Object(PhpParser\Node\Stmt\Return_), 'Method
App\Cont...', 'Method App\Cont...', 'Method App\Cont...', 'Method App\Cont...', false)
#48 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(104): PHPStan\Rules\Methods\ReturnTypeRule->processNode(Object(PhpParser\Node\Stmt\Return_),
Object(PHPStan\Analyser\MutatingScope))
#49 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Node/ClassStatementsGatherer.php(108):
PHPStan\Analyser\FileAnalyser->PHPStan\Analyser{closure}(Object(PhpParser\Node\Stmt\Return_), Object(PHPStan\Analyser\MutatingScope))
#50 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(539): PHPStan\Node\ClassStatementsGatherer->invoke(Object(PhpParser\Node\Stmt\Return),
Object(PHPStan\Analyser\MutatingScope))
#51 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(441):
PHPStan\Analyser\NodeScopeResolver::PHPStan\Analyser{closure}(Object(PhpParser\Node\Stmt\Return
), Object(PHPStan\Analyser\MutatingScope))
#52 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Return_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#53 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(557):
PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\ClassMethod), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#54 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384):
PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\ClassMethod), Object(PHPStan\Analyser\MutatingScope), Object(PHPStan\Node\ClassStatementsGatherer),
Object(PHPStan\Analyser\StatementContext))
#55 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(640): PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\Class_),
Array, Object(PHPStan\Analyser\MutatingScope), Object(PHPStan\Node\ClassStatementsGatherer), Object(PHPStan\Analyser\StatementContext))
#56 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(384): PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Class_),
Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#57 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(612):
PHPStan\Analyser\NodeScopeResolver->processStmtNodes(Object(PhpParser\Node\Stmt\Namespace_), Array, Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#58 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(353):
PHPStan\Analyser\NodeScopeResolver->processStmtNode(Object(PhpParser\Node\Stmt\Namespace_), Object(PHPStan\Analyser\MutatingScope), Object(Closure), Object(PHPStan\Analyser\StatementContext))
#59 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(173): PHPStan\Analyser\NodeScopeResolver->processNodes(Array,
Object(PHPStan\Analyser\MutatingScope), Object(Closure))
#60 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(130): PHPStan\Analyser\FileAnalyser->analyseFile('/Users/lukeabel...', Array,
Object(PHPStan\Rules\LazyRegistry), Object(PHPStan\Collectors\Registry), NULL)
#61 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
PHPStan\Command\WorkerCommand->PHPStan\Command{closure}(Array)
#62 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/clue/ndjson-react/src/Decoder.php(117): _PHPStan_d55c4f2c2\Evenement\EventEmitter->emit('data', Array)
#63 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
_PHPStan_d55c4f2c2\Clue\React\NDJson\Decoder->handleData(Array)
#64 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/Util.php(62): _PHPStan_d55c4f2c2\Evenement\EventEmitter->emit('data', Array)
#65 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(97):
_PHPStan_d55c4f2c2\React\Stream\Util::_PHPStan_d55c4f2c2\React\Stream{closure}('{"action":"anal...')
#66 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/react/stream/src/DuplexResourceStream.php(154): _PHPStan_d55c4f2c2\Evenement\EventEmitter->emit('data', Array)
#67 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(201): _PHPStan_d55c4f2c2\React\Stream\DuplexResourceStream->handleData(Resource
id #9095)
#68 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/react/event-loop/src/StreamSelectLoop.php(173):
_PHPStan_d55c4f2c2\React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#69 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/src/Command/WorkerCommand.php(96): _PHPStan_d55c4f2c2\React\EventLoop\StreamSelectLoop->run()
#70 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php(259):
PHPStan\Command\WorkerCommand->execute(Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Output\ConsoleOutput))
#71 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(870):
_PHPStan_d55c4f2c2\Symfony\Component\Console\Command\Command->run(Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Output\ConsoleOutput))
#72 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(261):
_PHPStan_d55c4f2c2\Symfony\Component\Console\Application->doRunCommand(Object(PHPStan\Command\WorkerCommand), Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Input\ArgvInput),
Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Output\ConsoleOutput))
#73 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(157):
_PHPStan_d55c4f2c2\Symfony\Component\Console\Application->doRun(Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_d55c4f2c2\Symfony\Component\Console\Output\ConsoleOutput))
#74 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(124): _PHPStan_d55c4f2c2\Symfony\Component\Console\Application->run()
#75 phar:///Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(125): _PHPStan_d55c4f2c2{closure}()
#76 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/phpstan/phpstan/phpstan(8): require('phar:///Users/l...')
#77 /Users/lukeabell/Sync/Git/SailAMX/sail-amx/vendor/bin/phpstan(119): include('/Users/lukeabel...')
#78 {main}

Code snippet that reproduces the problem

I don't know how to reproduce the issue on /try since carbon is not supported.

Expected output

I expect it not to crash PHPStan.

Did PHPStan help you today? Did it make you happy in any way?

Love PHPStan!!

@mergeable
Copy link

mergeable bot commented Jul 31, 2023

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Looks like a problem here: https://github.com/briannesbitt/Carbon/tree/master/src/Carbon/PHPStan

Please open an issue in https://github.com/briannesbitt. Thanks.

@ondrejmirtes
Copy link
Member

Hi, I've fixed a similar problem, it might have fixed this problem too: #9776

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants