Brand core API URL arg.

@since 160629 Brand URL args.

@param string $arg Arg to create.

@return string URL arg.
199494
public function brandCoreApiArg(string $arg = ''): string
    {
        if ($this->App->Parent) { // Looking for the root core.
            return $this->App->Parent->Utils->§BrandUrl->brandCoreApiArg($arg);
        }
        return $this->brandApiArg($arg);
    }
976848
public function arg(string $arg): ProcessBuilder
    {
        if ($arg === '') {
            return $this;
        }

        $this->arguments[] = $arg;

        return $this;
    }
398713
public function setArgument(Argument $arg)
    {
        if ($this->mode == Getopt::NO_ARGUMENT) {
            throw new \InvalidArgumentException("Option should not have any argument");
        }
        $this->argument = $arg;
        return $this;
    }
1198802
protected function initMediaResource(&$arg)
    {
        if (is_string($arg)) {
            $mr = new MediaResource();
            $mr->setUrl($arg);
        } else {
            $mr = $arg;
        }

        $mr->setHttpClient($this->httpClient);
        $mr->setStore($this->storage);
        return $mr;
    }
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;
	}
435418
static protected function getArgument($arg)
    {

        switch (mb_strtolower(gettype($arg))) {
            case 'string' :
                return ('"' . str_replace(array("\n", "\""), array('', '\"'), $arg) . '"');

            case 'boolean' :
                return ( bool )$arg;

            case 'object' :
                return 'object(' . get_class($arg) . ')';

            case 'array' :
                return 'array[' . count($arg) . ']';

            case 'resource' :
                return 'resource(' . get_resource_type($arg) . ')';

            default :
                return var_export($arg, true);
        }
    }
35807
public function toBrandCoreApi(string $uri = ''): string
    {
        if ($this->App->Parent) { // Looking for the root core.
            return $this->App->Parent->Utils->§BrandUrl->toBrandCoreApi($uri);
        }
        return $this->toBrandApi($uri);
    }
1273551
public static function signature($args = [])
	{
		$values = array_map(function ($v) {
			return is_string($v)
				? "'$v'"
				: (is_bool($v)
					? !! $v ? 'true' : 'false'
					: $v);
		}, $args);
		return '(' . implode(', ', $values) . ')';
	}
434305
public function agent($arg = null)
    {
        $agent = new Agent();

        if ($arg) {
            return $agent->is($arg);
        }
        
        return new Agent();
    }
156123
public function url( array $args = []) {
		$url = get_term_link( $this->term );
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
79485
public function setUrl($arg) {
        if ($this->type != self::MINI_PROGRAM) {
            $this->setType(self::VIEW);
        }
        $this->url = (string)$arg;
        return $this;
    }
730516
public function brandParentArg(string $arg = ''): string
    {
        return $this->App->Parent ? $this->App->Parent->Utils->§BrandUrl->brandArg($arg) : $this->brandArg($arg);
    }
262904
public function brandParentStatsArg(string $arg = ''): string
    {
        return $this->App->Parent ? $this->App->Parent->Utils->§BrandUrl->brandStatsArg($arg) : $this->brandStatsArg($arg);
    }
1120868
public function get($args)
    {
        $dataItem = $this->create($args);
        if ($dataItem->hasId()) {
            $dataItem = $this->getById($dataItem->getId());
        }
        return $dataItem;
    }
210895
private static function formatArgsForExpression(array $args)
    {
        $mapping = [];
        foreach ($args as $name => $config) {
            $mapping[] = \sprintf('%s: "%s"', $name, $config['type']);
        }

        return \sprintf('arguments({%s}, args)', \implode(', ', $mapping));
    }
530855
public function where(...$args): AliasDecorator
    {
        if ($args[0] instanceof \Closure) {
            call_user_func($args[0], $this);

            return $this;
        }

        //We have to prepare only first argument
        $args[0] = $this->prepare($args[0]);

        //Routing where
        call_user_func_array([$this->query, $this->target], $args);

        return $this;
    }
944731
private function getItemId($args)
    {
        $entity = $args->getEntity();
        if ($entity instanceof Item) {
            return $entity->getId();
        }
        return null;
    }