@param $arg

@return mixed
162827
public function restoreBackup($arg)
    {
        $backup = 'no';
        $web = 'no';
        $dns = 'no';
        $mail = 'no';
        $db = 'no';
        $cron = 'no';
        $udir = 'no';
        extract($arg, EXTR_OVERWRITE);

        return $this->send('v-schedule-user-restore', $this->userName, $backup, $web, $dns, $mail, $db,
            $cron, $udir);
    }
861008
function raw($arg) {
        $fw=Base::instance();
        return $fw->recursive($arg,
            function($val) use($fw) {
                return is_string($val)?$fw->decode($val):$val;
            }
        );
    }
377638
public static function parseArgs(array $args)
    {
        $result = [
            'name'   => null,
            'work'   => null,
            'weight' => 1,
            'backup' => false,
        ];
        foreach ($args as $arg) {
            //find work
            if (is_callable($arg)) {
                $result['work'] = $arg;
            }
            //find weight, backup, name
            if (is_string($arg) || is_numeric($arg)) {
                $arg = preg_replace('/\s+/', ' ', "$arg");
                $subArgs = explode(' ', trim($arg));
                foreach ($subArgs as $subArg) {
                    if (preg_match('/^[0-9]+$/', $subArg)) {
                        $result['weight'] = intval($subArg);
                    } elseif (preg_match('/(backup)/', strtolower($subArg))) {
                        $result['backup'] = true;
                    } else {
                        $result['name'] = $subArg;
                    }
                }
            }
        }

        return $result;
    }
231553
protected function parseArgument($arg)
    {
        //if it's a literal string value
        if (strpos($arg, '"') === 0
            || strpos($arg, "'") === 0
        ) {
            return "'" . str_replace("'", '\\\'', substr($arg, 1, -1)) . "'";
        }
        
        //if it's null
        if (strtolower($arg) === 'null'
            || strtolower($arg) === 'true'
            || strtolower($arg) === 'false'
            || is_numeric($arg)
        ) {
            return $arg;
        }
        
        $arg = str_replace(array('[', ']', '(', ')'), '', $arg);
        $arg = str_replace("'", '\\\'', $arg);
        return sprintf(self::BLOCK_ARGUMENT_VALUE, $arg);
    }
1017936
protected function processArgs(array $args) {
		foreach ($args as &$arg) {
			if (is_array($arg)) {
				$arg = $this->processArgs($arg);
				continue;
			}
			
			if ($arg instanceof Argument\ArgumentInterface) {
				$arg = $arg->getValue();
			}
		}
		unset($arg);
		
		return $args;
	}
574098
protected static function _formatCalledArgument($arg)
        {
            $out = '';
            if (is_object($arg)) {
                $out .= sprintf("&%s#%s#", get_class($arg), spl_object_hash($arg));

            } else if (is_resource($arg)) {
                $out .= '#[' . get_resource_type($arg) . ']';
            } else if (Arrays::isArray($arg)) {
                $isAssociative = false;
                $args = array();
                foreach ($arg as $k => $v) {
                    if (!is_numeric($k)) {
                        $isAssociative = true;
                    }
                    $args[$k] = static::_formatCalledArgument($v);
                }
                if ($isAssociative) {
                    $arr = array();
                    foreach ($args as $k => $v) {
                        $arr[] = static::_formatCalledArgument($k) . ' => ' . $v;
                    }
                    $out .= 'array(' . join(', ', $arr) . ')';
                } else {
                    $out .= 'array(' . join(', ', $args) . ')';
                }
            } else if (is_null($arg)) {
                $out .= 'NULL';
            } else if (is_numeric($arg) || is_float($arg)) {
                $out .= $arg;
            } else if (is_string($arg)) {
                if (strlen($arg) > static::$argLength) {
                    $arg = substr($arg, 0, static::$argLength) . "...";
                }
                $arg = strtr($arg, array("\t" => '\t', "\r" => '\r', "\n" => '\n', "'" => '\\\''));
                $out .= "'" . $arg . "'";
            } else if (is_bool($arg)) {
                $out .= $arg === true ? 'true' : 'false';
            }

            return $out;
        }
37826
public static function ArgString($arg){

		$type = gettype($arg);

		if( $type === 'object'){
			$string = $arg->cache_string;
			unset($arg->cache_string);
			return $string;

		}elseif( $type === 'array' ){
			$string = ' Array(';
			foreach($arg as $k => $a){
				$string .= var_export($k,true).' => '.self::ArgString($a).',';
			}
			return $string . ')';
		}

		return var_export($arg,true);
	}
671107
public static function load($arg)
    {
        if (is_object($arg) && $arg instanceof Entity) {
            $class = get_class($arg);
        } elseif (is_object($arg) && $arg instanceof Collection) {
            $class = $arg->getEntityClass();
        } elseif (is_object($arg) && $arg instanceof Reflection) {

            $class = $arg->getClassName();
            if (!isset(self::$registered[$class])) {
                return self::$registered[$class] = $arg;
            }
            return $arg;
        } elseif (is_string($arg)) {
            $class = $arg;
        } else {
            throw new Exception\InvalidArgumentException(
                "Entity identifier must be object, collection, class or name!",
                $arg
            );
        }

        if (!is_subclass_of($class, "UniMapper\Entity")) {
            $class = Convention::nameToClass($arg, Convention::ENTITY_MASK);
        }

        if (!class_exists($class)) {
            throw new Exception\InvalidArgumentException(
                "Entity class " . $class . " not found!"
            );
        }

        if (isset(self::$registered[$class])) {
            return self::$registered[$class];
        }

        return self::$registered[$class] = new Reflection($class);
    }
590437
public function get_check( $arg ) {
		$item = $this->get( $arg );

		if ( ! $item ) {
			\WP_CLI::error( sprintf( $this->msg, $arg ) );
		}

		return $item;
	}
869529
public function filter_arguments( $arg ) {
		$patterns = array(
			'url=', 'path=', 'user=', 'skip-plugins=?', 'skip-themes=?',
			'require=', 'no-color', 'color', 'prompt', 'allow-root',
		);

		foreach ( $patterns as $pattern ) {
			if ( preg_match( "~^--{$pattern}~i", $arg ) ) {
				return false;
			}
		}

		return true;
	}
293404
public function getArg($key='')
    {

        if(isset($this->args[$key])){
            return $this->args[$key];
        } else {
            return null;
        }
    }
942605
public function get(string $key, $arg = null)
    {
        $widget = $this->getWidgetFromConfig($key);

        return $widget->handler($arg);
    }
913648
public function getOrderBy($arg)
    {
        // Check if there are phrases in $arg should handle as it is
        $phrase = explode("\"", $arg);
        if (count($phrase) > 2) {
            // Re-init $arg variable 
            // (It will contain the rest of $arg except phrases).
            $arg = '';
            for ($i = 0; $i < count($phrase); $i++) {
                if ($i % 2 == 0 && $phrase[$i] != '') {
                    // Re-build $arg variable after restricting phrases
                    $arg .= $phrase[$i];
                } elseif ($i % 2 == 1 && $phrase[$i] != '') {
                    // Handle phrases using reqular LIKE matching in MySQL
                    $wordOrder[] = $this->getWordLike($phrase[$i]);
                }
            }
        }
        
        // Handle normal $arg using lex's and regular expresion
        $words = explode(' ', $arg);
        foreach ($words as $word) {
            if ($word != '') {
                $wordOrder[] = 'CASE WHEN ' . 
                               $this->getWordRegExp($word) . 
                               ' THEN 1 ELSE 0 END';
            }
        }
        
        $order = '((' . implode(') + (', $wordOrder) . ')) DESC';
        
        return $order;
    }
1003222
public function group(array $args) {
        $groupedArgs = [
            'arguments' => [],
            'options' => [],
        ];

        $option = 'arguments';

        foreach ($args as $arg) {
            if ($this->isOptionNameOrAlias($arg)) {
                $option = $arg;

                if ( ! array_has($groupedArgs, $option)) {
                    $groupedArgs[$option] = [];
                    $groupedArgs['options'][$option] = 1;
                } else {
                    $groupedArgs['options'][$option] += 1;
                }
            } else {
                $groupedArgs[$option][] = $arg;
            }
        }

        return $groupedArgs;
    }
509206
public static function DaysFromDuration( $arg )
	{
		if ( $arg instanceof Undefined )
			return Undefined::getValue();

		/**
		 * @var DurationValue $duration
		 */
		$duration = $arg;

		$days = $duration->getDays() * ( $duration->getInverted() ? -1 : 1 );
		return Integer::FromValue( $days );
	}
307858
public static function instance( $args = array() ) {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self( $args );
		}

		return self::$instance;
	}
439203
public function count($arg = null)
    {
        if (is_null($arg)) {
            $arg = '*';
        }

        return $this->expr('count([count])')->setCustom('count', $this->bt($arg));
    }