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\Types; use PHPStan\Analyser\..

Decoded Output download

<?php

declare(strict_types=1);

namespace Larastan\Larastan\Types;

use PHPStan\Analyser\NameScope;
use PHPStan\PhpDoc\TypeNodeResolverExtension;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Type\Type;

/**
 * Ensures a 'view-string' type in PHPDoc is recognised to be of type ViewStringType.
 */
class ViewStringTypeNodeResolverExtension implements TypeNodeResolverExtension
{
    public function resolve(TypeNode $typeNode, NameScope $nameScope): Type|null
    {
        if ($typeNode instanceof IdentifierTypeNode && $typeNode->__toString() === 'view-string') {
            return new ViewStringType();
        }

        return null;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Larastan\Larastan\Types;

use PHPStan\Analyser\NameScope;
use PHPStan\PhpDoc\TypeNodeResolverExtension;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Type\Type;

/**
 * Ensures a 'view-string' type in PHPDoc is recognised to be of type ViewStringType.
 */
class ViewStringTypeNodeResolverExtension implements TypeNodeResolverExtension
{
    public function resolve(TypeNode $typeNode, NameScope $nameScope): Type|null
    {
        if ($typeNode instanceof IdentifierTypeNode && $typeNode->__toString() === 'view-string') {
            return new ViewStringType();
        }

        return null;
    }
}

Function Calls

None

Variables

None

Stats

MD5 9e8ada1e5d6a88e22d59cb56ea92abd9
Eval Count 0
Decode Time 103 ms