Formats the options.

@return self
355761
public function formatOptions(bool $strict = false, bool $noBraces = false)
    {
        $this->options([
            'xAxis' => [
                'data' => json_decode($this->formatLabels()),
            ],
        ]);

        return parent::formatOptions($strict, $noBraces);
    }
555945
final public function optionHelp()
    {
        // Show Usage
        output()->write(
            (new Format())
                ->setContextualClass(Format::INFO)
                ->setString(language()->getLine('CLI_USAGE') . ':')
                ->setNewLinesBefore(1)
                ->setNewLinesAfter(1)
        );

        // Show Actions
        $this->loadActions();

        if (count($this->actionsPool)) {
            output()->write(
                (new Format())
                    ->setContextualClass(Format::INFO)
                    ->setString($this->commandName . '/action --option=value')
            );

            output()->write(
                (new Format())
                    ->setString(language()->getLine('CLI_ACTIONS') . ':')
                    ->setNewLinesBefore(2)
                    ->setNewLinesAfter(1)
            );

            $table = new Table();
            $table->isShowBorder = false;

            foreach ($this->actionsPool as $action) {

                if ($action instanceof AbstractCommander) {
                    $table
                        ->addRow()
                        ->addColumn($action->getCommandName())
                        ->addColumn(language()->getLine($action->getCommandDescription()));
                }
            }

            output()->write(
                (new Format())
                    ->setString($table->render())
            );
        } else {
            output()->write(
                (new Format())
                    ->setContextualClass(Format::INFO)
                    ->setString($this->commandName . ' --option=value')
            );
        }

        // Show Options
        output()->write(
            (new Format())
                ->setString(language()->getLine('CLI_OPTIONS') . ':')
                ->setNewLinesBefore(2)
                ->setNewLinesAfter(1)
        );

        $table = new Table();
        $table->isShowBorder = false;

        foreach ($this->commandOptions as $optionCaller => $optionProps) {
            $table
                ->addRow()
                ->addColumn('--' . $optionCaller)
                ->addColumn($optionProps[ 'shortcut' ])
                ->addColumn(language()->getLine($optionProps[ 'description' ]));
        }

        output()->write(
            (new Format())
                ->setString($table->render())
                ->setNewLinesAfter(2)
        );

        exit(EXIT_SUCCESS);
    }
244924
public function getFormat() : ?string 
    {
        if ( ! $this->hasFormat()) {
            $this->setFormat($this->getDefaultFormat());
        }
        return $this->format;
    }
445215
private function _formatLimit()
    {
        $str = ' LIMIT ';

        if ($this->_skip !== NULL) {
            $str .= $this->_skip;
        }
        if ($this->_skip !== NULL and $this->_limit !== NULL) {
            $str .= ', ';
        }
        if ($this->_limit !== NULL) {
            $str .= $this->_limit;
        }

        return $str;
    }
1077067
public function generateOptions()
    {
        $generated = [];
        array_walk($this->options, function ($value, $key) use (&$generated) {
            $result = "";
            switch ($key) {
                case "singlePage":
                    $result = $value ? "-c" : "-s";
                break;
                case "imageJpeg":
                    $result = "-fmt ".($value ? "jpg" : "png");
                break;
                case "zoom":
                    $result = "-zoom ".$value;
                break;
                case "ignoreImages":
                    $result = $value ? "-i" : "";
                break;
                case 'noFrames':
                    $result = $value ? '-noframes' : '';
                break;
            }
            $generated[] = $result;
        });

        return implode(" ", $generated);
    }
107497
public function setOptions($options)
    {
        $format = null;

        /** @noinspection UnSafeIsSetOverArrayInspection */
        if (isset($options['date_format'])) {
            $format = $options['date_format'];

            unset($options['date_format']);
        } /** @noinspection UnSafeIsSetOverArrayInspection */ elseif (isset($options['format'])) {
            $format = $options['format'];

            unset($options['format']);
        }

        if ($format) {
            $options['format'] = $format;
        }

        parent::setOptions($options);

        return $this;
    }
143034
public function toLowerCase() {
        $str = mb_strtolower($this->str, $this->encoding);

        return self::create($str, $this->encoding);
    }
463421
public function disPresentationFiles()
    {
        $properties     = $this->getProperties();
        $acceptedFiles  = $properties['acceptedFiles'];
        $pptsExt        = $this->getPresentationExtensionConstant();
        $acceptedFiles  = $this->rmAcceptedFiles($acceptedFiles, $pptsExt);
        $properties['acceptedFiles']    = $acceptedFiles;
        $this->setProperties($properties);
        return $this;
    }
76439
public function format()
    {
        if ($this->groupEvent) {
            // ugly fix for misunderstanding of this...
            $this->version = 2;
        }

        $result = [
            'Url' => $this->url,
            'EventType' => $this->eventType,
            'IsBackup'  => $this->isBackup,
            'Status'    => $this->status,
            'Version'   => $this->version
        ];

        if($this->apikeyId){
            $result['APIKeyID'] = $this->apikeyId;
        }

        return $result;
    }
1167009
public function format()
    {
        $result     = array();

        $result["@type"] = $this->check_type();
        $values          = array_filter( get_object_vars( $this ) );

        foreach ($values as $key => $value) {
            if ($value instanceof ICanBecomeJSONLD) {
                $formatted = $value->format();
                if ( ! empty( $formatted )) {
                    $result[$key] = $formatted;
                }
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
862675
public function write()
    {
        $strings = func_get_args();
        foreach ($strings as $string) {
            $this->addIndentation();
            $this->source .= $string;
        }

        return $this;
    }
857504
public function format()
    {
        $ret = '';

        foreach (self::$formats as $key => $format) {
            $value = $this->get($key);

            // -stable is not added to the version, it is implied
            if ($key == self::STABILITY && $value == end(self::$stabilities)) {
                break;
            }

            $ret .= sprintf($format, $value);

            // -dev has no stability increments
            if ($key == self::STABILITY && $value == self::$stabilities[0]) {
                break;
            }
        }

        return $ret;
    }
1099820
public function format()
    {
        return sprintf(
            '%s %s %s',
            $this->getCountryCode() . $this->getChecksum(),
            substr($this->getInstituteIdentification(), 0, 4),
            implode(' ', str_split($this->getBankAccountNumber(), 4))
        );
    }
230814
public function format()
	{
		foreach($this->matches as $key => $match)
		{
			$potential = str_replace(['[', ']'], '', $match);

			// Seperate by comma
			$potential = explode(',', $potential);

			// Classes can have a dot seperator Class.method
			$mask = $potential[0];
			if(strpos($potential[0], '.') !== false) {
				$parts = explode('.', $potential[0]);
				$mask = $parts[0];
			}

			// The first value will be the mask name
			if($this->collection->getMethod()->has($mask))
			{
				$this->formatted[$mask] = Array();

				// Add the raw match so we can replace this
				$this->formatted[$mask]['raw'] = $match;
				$this->formatted[$mask]['params'] = Array();
				
				// Remove the name from the array
				unset($potential[0]);

				$this->processValues($mask, $potential);
			
			} else {
				
				// This isnt a mask
				unset($this->matches[$key]);
			}
		}	
	}
1239128
protected function formatBoth()
    {
        $data = [];
        $index = 0;

        foreach ($this->getData() as $key => $value) {
            $data[$key] = $value;
            $data[$index] = $value;
            $index++;
        }

        return $data;
    }
290599
public function formatStylesJs()
    {
        $options = [];

        $options[] = $this->formatStyle('Arial,Arial,Helvetica,sans-serif', 'Arial');
        $options[] = $this->formatStyle('Arial Black,Arial Black,Gadget,sans-serif', 'Arial Black');
        $options[] = $this->formatStyle('Comic Sans MS,Comic Sans MS,cursive', 'Comic Sans MS');
        $options[] = $this->formatStyle('Courier New,Courier New,Courier,monospace', 'Courier New');
        $options[] = $this->formatStyle('Georgia,Georgia,serif', 'Georgia');
        $options[] = $this->formatStyle('Impact,Charcoal,sans-serif', 'Impact');
        $options[] = $this->formatStyle('Lucida Console,Monaco,monospace', 'Lucida Console');
        $options[] = $this->formatStyle('Lucida Sans Unicode,Lucida Grande,sans-serif', 'Lucida Sans');
        $options[] = $this->formatStyle('Palatino Linotype,Book Antiqua,Palatino,serif', 'Palatino Linotype');
        $options[] = $this->formatStyle('Tahoma,Geneva,sans-serif', 'Tahoma');
        $options[] = $this->formatStyle('Times New Roman,Times,serif', 'Times New Roman');
        $options[] = $this->formatStyle('Trebuchet MS,Helvetica,sans-serif', 'Trebuchet');
        $options[] = $this->formatStyle('Verdana,Geneva,sans-serif', 'Verdana');

        return 'aoTypes: ['.implode(', ', $options).']';
    }
794275
private function resolve_format() {
        global $CFG;
        $thisformat = $this->get_export_config('format');
        $allformats = portfolio_supported_formats();
        require_once($CFG->libdir . '/portfolio/formats.php');
        $thisobj = new $allformats[$thisformat];
        foreach ($this->supported_formats() as $f) {
            $class = $allformats[$f];
            if ($thisobj instanceof $class) {
                return $f;
            }
        }
    }