Checks if a menu should be cached.

@param object $args Menu args.

@return bool Whether or not the menu should be cached.
512900
private function should_cache_menu( $args ) {

		$should_cache_menu = true;

		if ( ! empty( $args->theme_location ) ) {
			$theme_locations = $this->theme_locations();
			if ( $theme_locations ) {
				$should_cache_menu = in_array( $args->theme_location, $theme_locations, true );
			}
		}

		/**
		 * Filters the caching condition of a single menu.
		 *
		 * @since 1.0.0
		 *
		 * @param bool   $should_cache_menu Whether or not the menu should be cached.
		 * @param object $args              Menu args.
		 */
		return (bool) apply_filters( self::FILTER_SHOULD_CACHE_MENU, $should_cache_menu, $args );
	}
454166
private function menu_key( $args ) {

		$key_argument = $this->key_argument;

		if ( ! isset( $args->{$key_argument} ) || ! is_string( $args->{$key_argument} ) ) {
			$key = 'cached_menu_' . md5( wp_json_encode( $args ) );

			/**
			 * Filters the key of a single menu.
			 *
			 * @since 1.0.0
			 *
			 * @param string $key  Current key.
			 * @param object $args Menu args.
			 */
			$args->{$key_argument} = (string) apply_filters( self::FILTER_KEY, $key, $args );
		}

		return $args->{$key_argument};
	}
1241534
public function isEmpty(...$args): bool
    {
        if (!count($args)) {
            //test to see if it's empty
            return empty($this->data);
        }

        $separator = '--'. md5(uniqid()) . '--';

        $data = $this->getDot(implode($separator, $args), $separator);

        //if it's bool
        if (is_bool($data)) {
            //it's something
            return false;
        }

        //if it's scalar
        if (is_scalar($data)) {
            return !strlen($data);
        }

        return empty($data);
    }
1209263
public function handleAdd(Args $args)
    {
        $flags = $args->isOptionSet('force')
            ? RepositoryManager::OVERRIDE | RepositoryManager::IGNORE_FILE_NOT_FOUND
            : 0;
        $repositoryPath = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);
        $pathReferences = $args->getArgument('file');

        $this->repoManager->addRootPathMapping(new PathMapping($repositoryPath, $pathReferences), $flags);

        return 0;
    }
400606
public function executeOne(...$args)
    {
        if ($this->isEmpty()) {
            return false;
        }
        $cb = $this->extract();
        if ($cb) {
            $cb(...$args);
        }
        return true;
    }
1281817
public function beforeFetch(&$args) {
        $model = $args[0];
        if ($model->isCmsContext()) {
            $model = &$args[0];
            $this->bindWithChapters($model);
        }
    }
144305
public function matchCommand(Args $args)
    {
        $this->args = $args;
        return $this->getTarget($args->getCommand());
    }
1095227
private function cmdReset($args)
    {
        $cmd = new ResetCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
686914
protected function serializeArguments(array $args)
    {
        // first we have to sort the args by key to avoid that different orders
        // lead to different cache entries!
        ksort($args);

        $result = '';
        $invalidKeys = array('userid', 'apikey', 'keyid', 'vcode');
        foreach ($args as $key => $value) {
            $key   = trim($key);
            $value = trim($value);
            if (empty($value) || in_array($key, $invalidKeys)) {
                // ignore the invalid keys...
                continue;
            }
            $result .= ';' . $key . '=' . $value;
        }

        return $result;
    }
926738
public function cascade_data($args = array())
    {
        if (!$this->hasChildren()) {
            return false;
        }

        if (count($args) >= 2) {
            $this->children()->data($args[0], $args[1]);
        } else {
            $this->children()->data($args[0]);
        }

        return true;
    }
1342230
public function hasJson(...$args): bool
    {
        if (!count($args)) {
            return $this->exists('json');
        }

        return $this->exists('json', ...$args);
    }
39688
public function executeOne(...$args)
    {
        if ($this->isEmpty()) {
            return false;
        }
        $cb = $this->shift();
        if ($cb) {
            $cb(...$args);
            if ($cb instanceof CallbackWrapper) {
                $cb->cancel();
            }
        }
        return true;
    }
945496
public function main(array $args = array()) {
        $publicMethods = $this->getPublicMethods();
        if (!array_key_exists(0, $args)) {
            if (in_array('help', $publicMethods)) {
                $args[0] = 'help';
            } else {
                Garp_Cli::errorOut(
                    "No method selected. Available methods: \n " .
                    implode("\n ", $publicMethods)
                );
                return false;
            }
        }

        $methodName = $args[0];
        if (!in_array($methodName, $publicMethods)) {
            Garp_Cli::errorOut('Unknown command \'' . $methodName . '\'');
            return false;
        }
        unset($args[0]);
        $args = $this->_remapArguments($args);
        if (!$this->_validateArguments($methodName, $args)) {
            // Note, _validateArguments also provides the CLI feedback
            return false;
        }
        $result = call_user_func_array(array($this, $methodName), array($args));
        return $result;
    }
334812
private function _isCached() 
    {
        $filters = false;

        if ($this->cacheSettings) {
        
            if ($this->cache) {
                $filters = $this->cache->getCache();
            }
        }

        return $filters;
    }
454802
public function _set_cache( $nav_menu, $args ) {
		if ( ! $this->_is_caching_nav_menus() ) {
			return $nav_menu;
		}

		if ( $this->_is_caching_nav_menu( $args->theme_location ) ) {
			set_transient( $this->_get_transient_id( $args->theme_location ), $nav_menu, HOUR_IN_SECONDS );
		}

		return $nav_menu;
	}
378476
public function is(string $arg): bool
    {
        return $this->short === $arg || $this->long === $arg;
    }
1234549
public function process(...$args): bool
    {
        foreach ($this->registry as $callback) {
            if (call_user_func_array($callback, $args) === false) {
                return false;
            }
        }

        return true;
    }