Displays a SyntaxHighlighter content.

@param array $args The arguments.
@return string Returns the SyntaxHighlighter content.
@throws FileNotFoundException Throws a file not found exception if the file does not exists.
9807
public function syntaxHighlighterContentFunction(array $args = []) {

        $tag      = ArrayHelper::get($args, "tag", "pre");
        $language = ArrayHelper::get($args, "language", "php");
        $filename = ArrayHelper::get($args, "filename");
        $content  = ArrayHelper::get($args, "content");

        if (null !== $filename) {
            $content = FileHelper::getContents($filename);
        }

        return $this->syntaxHighlighterContent($tag, $language, $content);
    }
453465
protected function composeCommand($args): string
    {
        $command = $this->getBinary();

        if (\is_array($args)) {
            $args = implode(' ', $args);
        }

        // Only append args if we have some
        $command .= $args !== '' ? ' ' . $args : '';

        return $command;
    }
41852
public function url( array $args = []) {
        $url = get_comments_link( $this->post_ID );
        if ( $args ) {
            $url = add_query_arg( $args, $url );
        }

        return $url;
    }
979815
private function _renderArgs($args = [])
    {
        return '('.
            implode(',', array_map(function ($arg) {
                if ($arg instanceof jsExpressionable) {
                    return $arg->jsRender();
                }

                return $this->_json_encode($arg);
            }, $args)).
            ')';
    }
1212037
public function getSyntaxHighlighterStrings() {

        $strings = new SyntaxHighlighterStrings();
        $strings->setAlert($this->getTranslator()->trans("strings.alert", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setBrushNotHtmlScript($this->getTranslator()->trans("strings.brush_no_html_script", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setCopyToClipboard($this->getTranslator()->trans("strings.copy_to_clipboard", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setCopyToClipboardConfirmation($this->getTranslator()->trans("strings.copy_to_clipboard_confirmation", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setExpandSource($this->getTranslator()->trans("strings.expand_source", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setHelp($this->getTranslator()->trans("strings.help", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setNoBrush($this->getTranslator()->trans("strings.no_brush", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setPrint($this->getTranslator()->trans("strings.print", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));
        $strings->setViewSource($this->getTranslator()->trans("strings.view_source", [], "WBWSyntaxHighlighterBundle", $this->getTranslator()->getLocale()));

        return $strings;
    }
1091000
public static function serialize(array $args)
    {
        return array_reduce(
            $args,
            function ($msg, $arg) {
                return $msg.'$'.strlen($arg)."\r\n".$arg."\r\n";
            },
            '*'.count($args)."\r\n"
        );
    }
464588
public function find($args = null)
    {
        $this->areArgumentsValid($args, ['getProgress', 'showTaskLists', 'showTasks']);

        return $this->client->get("$this->endpoint/$this->id", $args)->response();
    }
64937
public function messagePrintf(array $args = array())
    {
        $this->raw_msg = vsprintf($this->raw_msg, $args);
        $this->message = vsprintf($this->message, $args);
    }
967866
protected function libCounter($args)
    {
        $list = array_map([$this, 'compileValue'], $args);

        return [Type::T_STRING, '', ['counter(' . implode(',', $list) . ')']];
    }
64772
public static function findCommandLong($arg) {
		foreach (self::$commands as $command => $commandOptions) {
			if (($commandOptions["commandLong"] == $arg) || ($commandOptions["commandShort"] == $arg)) {
				return $command;
			}
		}
		return false;
	}
407479
public function shortcodeDisplay($args)
    {
        $args = shortcode_atts(array(
            'id' => false,
            'inline' => true
        ), $args);

        if (!is_numeric($args['id'])) {
            return;
        }

        //Get module details
        $module = \Modularity\Editor::getModule($args['id']);

        //If not valid details, abort.
        if (!is_object($module) || empty($module->post_type)) {
            return "";
        }

        //Create instance
        $class = \Modularity\ModuleManager::$classes[$module->post_type];
        $module = new $class($module, $args);

        $moduleMarkup = $this->getModuleMarkup($module, $args);
        if (empty($moduleMarkup)) {
            return;
        }

        $moduleMarkup = apply_filters('Modularity/Display/Markup', $moduleMarkup, $module);
        $moduleMarkup = apply_filters('Modularity/Display/' . $module->post_type . '/Markup', $moduleMarkup, $module);

        return '<div class="' . $module->post_type . '">' . $moduleMarkup . '</div>';
    }
25801
public function _parse($args)
    {
        $this->_values = [];
        $this->_options = [];

        if (in_array(end($args), ['', '-', '--'], true)) {
            array_pop($args);
        }

        while ($args) {
            $o = array_shift($args);
            if ($o[0] !== '-') {
                $this->_values[] = $o;
                continue;
            }

            if (preg_match('#^-((\w)|-([\w-_]+))=(.*)$#', $o, $match)) {
                $this->_options[$match[2]] = $match[4];
                continue;
            }

            if ($o[1] === '-') {
                if (strlen($o) < 3) {
                    throw new ArgumentsException(['long `:option` option is too short', 'option' => $o]);
                }

                $this->_options[substr($o, 2)] = !$args || $args[0] === '-' ? 1 : array_shift($args);
            } elseif (strlen($o) > 2) {
                if (!$args || $args[0][0] === '-') {
                    /** @noinspection PhpParamsInspection */
                    foreach (str_split(substr($o, 1), 1) as $c) {
                        $this->_options[$c] = 1;
                    }
                } else {
                    $this->_options[substr($o, 1)] = array_shift($args);
                }
            } else {
                $this->_options[substr($o, 1)] = !$args || $args[0] === '-' ? 1 : array_shift($args);
            }
        }

        return $this;
    }
1253930
public function output($args = null) {
        // calculate diff
        $diff = $this->end->diff($this->begin);

        // decide stuff
        $msg = [];
        if($diff->d > 0) $msg[] = $this->plural($diff->d, 'd');
        if($diff->h > 0) $msg[] = $this->plural($diff->h, 'h');
        if($diff->i > 0) $msg[] = $this->plural($diff->i, 'i');
        $msg[] = $this->plural($diff->s);

        // return stuff
        return $this->str_lreplace(',', ' ' . __d('Unimatrix/cake', 'and'), implode(', ', $msg));
    }
914549
private function cmdHelp($args)
    {
        $help = isset($args[1]) ? $args[1] : 'help';
        $file = __DIR__.'/../help/'.$help.'.txt';

        if (!file_exists($file)) {
            return $this->error('&help-not-found');
        }

        echo file_get_contents(__DIR__.'/../help/'.$help.'.txt');
    }
1136753
private static function prepareCommand($args)
    {
        return sprintf('*%d%s%s%s', count($args), self::CRLF, implode(array_map(array('self', 'map'), $args), self::CRLF), self::CRLF);
    }
1360689
public function find_subcommand( &$args ) {
		$command = array_shift( $args );

		Utils\load_command( $command );

		if ( ! isset( $this->subcommands[ $command ] ) ) {
			return false;
		}

		return $this->subcommands[ $command ];
	}
1126795
public function selectOptions(array $args = []): string
    {
        // Establish args.

        $default_args = [
            // Unique.
            'allow_empty'      => true,
            'allow_arbitrary'  => true,
            'option_formatter' => null,
            'current_caps'     => null,

            // Used by {@link all()}.
            'max'         => 1000,
            'fail_on_max' => true,

            // Used by {@link total()}.
            // Used by {@link all()}.
            'include'                   => [],
            'exclude'                   => [],
            'exclude_deprecated_levels' => true,
            'no_cache'                  => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        // Unique.
        $args['allow_empty']      = (bool) $args['allow_empty'];
        $args['allow_arbitrary']  = (bool) $args['allow_arbitrary'];
        $args['option_formatter'] = is_callable($args['option_formatter']) ? $args['option_formatter'] : null;
        $args['current_caps']     = isset($args['current_caps']) ? (array) $args['current_caps'] : null;
        $args['current_caps']     = $this->c::removeEmptys(array_map('strval', $args['current_caps']));

        // Used by {@link all()}.
        $args['max']         = max(1, (int) $args['max']);
        $args['fail_on_max'] = (bool) $args['fail_on_max'];

        // Used by {@link total()}.
        // Used by {@link all()}.
        $args['include']                   = (array) $args['include'];
        $args['exclude']                   = (array) $args['exclude'];
        $args['exclude_deprecated_levels'] = (bool) $args['exclude_deprecated_levels'];
        $args['no_cache']                  = (bool) $args['no_cache'];

        // Check for nothing being available (or too many).

        if (!($caps = $this->all($args))) {
            return ''; // None available.
        }
        // Initialize several working variables.

        $options        = ''; // Initialize.
        $available_caps = []; // Initialize.
        $selected_caps  = []; // Initialize.

        // Build & return all `<option>` tags.

        if ($args['allow_empty']) { // Allow ``?
            $options = '<option value=""></option>';
        }
        foreach ($caps as $_cap) { // Key/value the same at this time.
            $available_caps[] = $_cap; // Record all available.

            if (isset($args['current_caps']) && in_array($_cap, $args['current_caps'], true)) {
                $selected_caps[$_cap] = $_cap; // Flag selected cap.
            }
            $_cap_selected_attr = isset($selected_caps[$_cap]) ? ' selected' : '';

            // Format `<option>` tag w/ a custom formatter?

            if ($args['option_formatter']) {
                $options .= $args['option_formatter']($_cap, [
                        'cap_selected_attr' => $_cap_selected_attr,
                    ], $args); // ↑ This allows for a custom option formatter.
                    // The formatter must always return an `<option></option>` tag.

            // Else format the `<option>` tag using a default behavior.
            } else { // Both front & back-end displays are the same for caps.
                $options .= '<option value="'.esc_attr($_cap).'"'.$_cap_selected_attr.'>'.
                                esc_html($_cap).
                            '</option>';
            }
        } // unset($_cap, $_cap_selected_attr); // Housekeeping.

        if ($args['allow_arbitrary'] && $args['current_caps']) { // Allow arbitrary select `<option>`s?
            foreach (array_diff($args['current_caps'], $available_caps) as $_arbitrary_cap) {
                $options .= '<option value="'.esc_attr($_arbitrary_cap).'" selected>'.
                                esc_html($_arbitrary_cap).
                            '</option>';
            } // unset($_arbitrary_cap); // Housekeeping.
        }
        return $options; // HTML markup.
    }