Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); namespace Larastan\Larastan\ReturnTypes; use Illuminate\..
Decoded Output download
<?php
declare(strict_types=1);
namespace Larastan\Larastan\ReturnTypes;
use Illuminate\Contracts\Container\Container;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Type\DynamicMethodReturnTypeExtension;
use PHPStan\Type\Type;
use function in_array;
final class ContainerMakeDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{
public function __construct(
private AppMakeHelper $appMakeHelper,
) {
}
public function getClass(): string
{
return Container::class;
}
public function isMethodSupported(MethodReflection $methodReflection): bool
{
return in_array($methodReflection->getName(), ['make', 'makeWith', 'resolve'], true);
}
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
{
return $this->appMakeHelper->resolveTypeFromCall($methodCall, $scope);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace Larastan\Larastan\ReturnTypes;
use Illuminate\Contracts\Container\Container;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Type\DynamicMethodReturnTypeExtension;
use PHPStan\Type\Type;
use function in_array;
final class ContainerMakeDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{
public function __construct(
private AppMakeHelper $appMakeHelper,
) {
}
public function getClass(): string
{
return Container::class;
}
public function isMethodSupported(MethodReflection $methodReflection): bool
{
return in_array($methodReflection->getName(), ['make', 'makeWith', 'resolve'], true);
}
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
{
return $this->appMakeHelper->resolveTypeFromCall($methodCall, $scope);
}
}
Function Calls
None |
Stats
MD5 | bd480d38df162bf16c4c0190475c868d |
Eval Count | 0 |
Decode Time | 86 ms |