!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/Methods/   drwxrwxrwx
Free 12.96 GB of 57.97 GB (22.36%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
NunoMaduro\Larastan\Methods;

use 
Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use 
Illuminate\Database\Eloquent\Model;
use 
Illuminate\Database\Query\Builder as QueryBuilder;
use 
NunoMaduro\Larastan\Concerns;
use 
NunoMaduro\Larastan\Reflection\EloquentBuilderMethodReflection;
use 
PHPStan\Reflection\BrokerAwareExtension;
use 
PHPStan\Reflection\ClassReflection;
use 
PHPStan\Reflection\MethodReflection;
use 
PHPStan\Reflection\MethodsClassReflectionExtension;
use 
PHPStan\Reflection\ParametersAcceptorSelector;
use 
PHPStan\Type\Generic\GenericObjectType;
use 
PHPStan\Type\Generic\TemplateMixedType;
use 
PHPStan\Type\MixedType;
use 
PHPStan\Type\ObjectType;
use 
PHPStan\Type\Type;

final class 
EloquentBuilderForwardsCallsExtension implements MethodsClassReflectionExtensionBrokerAwareExtension
{
    use 
Concerns\HasBroker;

    
/**
     * The methods that should be returned from query builder.
     *
     * @var string[]
     */
    
protected $passthru = [
        
'insert''insertOrIgnore''insertGetId''insertUsing''getBindings''toSql''dump''dd',
        
'exists''doesntExist''count''min''max''avg''average''sum''getConnection',
    ];

    
/** @var array<string, MethodReflection> */
    
private static $cache = [];

    
/** @var BuilderHelper */
    
private $builderHelper;

    public function 
__construct(BuilderHelper $builderHelper)
    {
        
$this->builderHelper $builderHelper;
    }

    private function 
getBuilderReflection(): ClassReflection
    
{
        return 
$this->broker->getClass(QueryBuilder::class);
    }

    public function 
hasMethod(ClassReflection $classReflectionstring $methodName): bool
    
{
        if (
array_key_exists($classReflection->getCacheKey().'-'.$methodNameself::$cache)) {
            return 
true;
        }

        
$methodReflection $this->findMethod($classReflection$methodName);

        if (
$methodReflection !== null && $classReflection->isGeneric()) {
            
self::$cache[$classReflection->getCacheKey().'-'.$methodName] = $methodReflection;

            return 
true;
        }

        return 
false;
    }

    public function 
getMethod(ClassReflection $classReflectionstring $methodName): MethodReflection
    
{
        return 
self::$cache[$classReflection->getCacheKey().'-'.$methodName];
    }

    private function 
findMethod(ClassReflection $classReflectionstring $methodName): ?MethodReflection
    
{
        if (
$classReflection->getName() !== EloquentBuilder::class && ! $classReflection->isSubclassOf(EloquentBuilder::class)) {
            return 
null;
        }

        if (
in_array($methodName$this->passthrutrue)) {
            
$methodReflection $this->getBuilderReflection()->getNativeMethod($methodName);

            
$parametersAcceptor ParametersAcceptorSelector::selectSingle($methodReflection->getVariants());
            
$returnType $parametersAcceptor->getReturnType();

            if (
$returnType instanceof MixedType) {
                
$returnType $returnType->subtract(new ObjectType(EloquentBuilder::class));
            }

            return new 
EloquentBuilderMethodReflection(
                
$methodName$classReflection$methodReflection,
                
$parametersAcceptor->getParameters(),
                
$returnType,
                
$parametersAcceptor->isVariadic()
            );
        }

        
$templateTypeMap $classReflection->getActiveTemplateTypeMap();

        
/** @var Type|ObjectType|TemplateMixedType|null $modelType */
        
$modelType $templateTypeMap->getType('TModelClass');

        if (
$modelType === null) {
            return 
null;
        }

        if (
$this->getBuilderReflection()->hasNativeMethod($methodName)) {
            
$methodReflection $this->getBuilderReflection()->getNativeMethod($methodName);
            if (
$classReflection->isSubclassOf(EloquentBuilder::class)) {
                
$builderClass $classReflection->getName();
            } elseif (
$modelType instanceof ObjectType) {
                
$builderClass $this->builderHelper->determineBuilderType($modelType->getClassName());
            } else {
                
$builderClass EloquentBuilder::class;
            }

            if (
$modelType instanceof TemplateMixedType) {
                
/** @var string $builderClass */
                
$builderClass $modelType->getScope()->getClassName();
            }

            
$parametersAcceptor ParametersAcceptorSelector::selectSingle($methodReflection->getVariants());

            return new 
EloquentBuilderMethodReflection(
                
$methodName$classReflection$methodReflection,
                
$parametersAcceptor->getParameters(),
                new 
GenericObjectType($builderClass, [$modelType]),
                
$parametersAcceptor->isVariadic()
            );
        }

        if (
$modelType instanceof ObjectType && $modelType->getClassName() !== Model::class) {
            if (
$classReflection->isSubclassOf(EloquentBuilder::class)) {
                
$eloquentBuilderClass $classReflection->getName();
            } else {
                
$eloquentBuilderClass $this->builderHelper->determineBuilderType($modelType->getClassName());
            }

            
$returnMethodReflection $this->builderHelper->getMethodReflectionFromBuilder(
                
$classReflection,
                
$methodName,
                
$modelType->getClassName(),
                new 
GenericObjectType($eloquentBuilderClass, [new ObjectType($modelType->getClassName())])
            );

            if (
$returnMethodReflection !== null) {
                return 
$returnMethodReflection;
            }
        }

        return 
null;
    }
}

:: 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.0067 ]--