T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/gositeme.com/public_html/whmcs/vendor/league/climate/src/Argument/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/gositeme.com/public_html/whmcs/vendor/league/climate/src/Argument/Filter.php
<?php

namespace League\CLImate\Argument;

class Filter
{
    protected $arguments = [];

    /**
     * Set the available arguments
     *
     * @param array $arguments
     */
    public function setArguments(array $arguments)
    {
        $this->arguments = $arguments;
    }

    /**
     * Retrieve optional arguments
     *
     * @return Argument[]
     */
    public function optional()
    {
        return $this->filterArguments(['isOptional']);
    }

    /**
     * Retrieve required arguments
     *
     * @return Argument[]
     */
    public function required()
    {
        return $this->filterArguments(['isRequired']);
    }

    /**
     * Retrieve arguments with prefix
     *
     * @return Argument[]
     */
    public function withPrefix()
    {
        return $this->filterArguments(['hasPrefix']);
    }

    /**
     * Retrieve arguments without prefix
     *
     * @return Argument[]
     */
    public function withoutPrefix()
    {
        return $this->filterArguments(['noPrefix']);
    }

    /**
     * Find all required arguments that don't have values after parsing.
     *
     * These arguments weren't defined on the command line.
     *
     * @return Argument[]
     */
    public function missing()
    {
        return $this->filterArguments(['isRequired', 'noValue']);
    }

    /**
     * Filter defined arguments as to whether they are required or not
     *
     * @param string[] $filters
     *
     * @return Argument[]
     */
    protected function filterArguments($filters = [])
    {
        $arguments = $this->arguments;

        foreach ($filters as $filter) {
            $arguments = array_filter($arguments, [$this, $filter]);
        }

        if (in_array('hasPrefix', $filters)) {
            usort($arguments, [$this, 'compareByPrefix']);
        }

        return array_values($arguments);
    }

    /**
     * Determine whether an argument as a prefix
     *
     * @param Argument $argument
     *
     * @return bool
     */
    protected function noPrefix($argument)
    {
        return !$argument->hasPrefix();
    }

    /**
     * Determine whether an argument as a prefix
     *
     * @param Argument $argument
     *
     * @return bool
     */
    protected function hasPrefix($argument)
    {
        return $argument->hasPrefix();
    }

    /**
     * Determine whether an argument is required
     *
     * @param Argument $argument
     *
     * @return bool
     */
    protected function isRequired($argument)
    {
        return $argument->isRequired();
    }

    /**
     * Determine whether an argument is optional
     *
     * @param Argument $argument
     *
     * @return bool
     */
    protected function isOptional($argument)
    {
        return !$argument->isRequired();
    }

    /**
     * Determine whether an argument is optional
     *
     * @param Argument $argument
     *
     * @return bool
     */
    protected function noValue($argument)
    {
        return $argument->values() == [];
    }

    /**
     * Compare two arguments by their short and long prefixes.
     *
     * @see usort()
     *
     * @param Argument $a
     * @param Argument $b
     *
     * @return int
     */
    public function compareByPrefix(Argument $a, Argument $b)
    {
        if ($this->prefixCompareString($a) < $this->prefixCompareString($b)) {
            return -1;
        }

        return 1;
    }

    /**
     * Prep the prefix string for comparison
     *
     * @param Argument $argument
     *
     * @return string
     */
    protected function prefixCompareString(Argument $argument)
    {
        return mb_strtolower($argument->longPrefix() ?: $argument->prefix() ?: '');
    }
}

CasperSecurity Mini