Print a summary of the permission section.

@param array $options
The array of permission information from the yaml file.
180545
private function printPermissionSummary($options, $heading = '') {
    // Print permission info.
    if (!empty($options)) {
      drush_print("{$heading}");

      foreach ($options as $role => $perms) {
        foreach ($options[$role] as &$grant) {
          $grant = ($grant == 0) ? dt('revoke') : dt('grant');
        }

        drush_print($role, 1);
        drush_print_format([$options[$role]], 'key-value-list');
      }
    }
  }
474929
protected function _groupTemplate($options)
    {
        $groupTemplate = $options['options']['type'] . 'FormGroup';
        if (!$this->templater()->get($groupTemplate)) {
            $groupTemplate = 'formGroup';
        }

        return $this->templater()->format($groupTemplate, [
            'input' => isset($options['input']) ? $options['input'] : [],
            'label' => $options['label'],
            'error' => $options['error'],
            'templateVars' => isset($options['options']['templateVars']) ? $options['options']['templateVars'] : [],
            'help' => $options['options']['help'],
        ]);
    }
10441
public function render(array $options = [])
    {
        $output = '';

        if ($this->count()) {
            foreach ($this->storage as $key => $value) {
                $output = trim($output);
                switch ($key) {
                    case 'style':
                        if (count($value) == 0) {
                            continue;
                        }

                        $output .= 'style="';
                        foreach ($value as $styleKey => $styleValue) {
                            $output .= $styleKey . ':' . $styleValue . ';';
                        }
                        $output .= '"';

                        break;
                    case 'class':
                        if (count($value) == 0) {
                            continue;
                        }
                        $output .= ' ' . $key . '="' . implode(' ', $value) . '"';
                        break;
                    case 'js':
                        $output .= ' ' . $key . '="' . $value . '"';
                        break;
                    default:
                        if (is_array($value)) {
                            if (count($value) == 0) {
                                continue;
                            }
                            $value = implode(', ', $value);
                        }

                        if (is_bool($value)) {
                            $value = $value === true ? 'true' : 'false';
                        }

                        if (in_array($key, [
                            'controls',
                            'disabled',
                            'readonly',
                            'autocomplete',
                            'checked',
                            'loop',
                            'autoplay',
                            'muted',
                        ])) {
                            $output .= ' ' . $key;
                        } else {
                            $output .= ' ' . $key . '="' . $value . '"';
                        }
                        break;
                }
            }
        }

        return $output;
    }
1321312
function write($options = array())
    {
        $dir = @$options["dir"];
        $compress = @$options["compress"] ?: false;
        $includeDigest = @$options["include_digest"] ?: false;

        $filename = Path::join(array($dir, ($includeDigest ? $this->getDigestName() : $this->logicalPath)));

        if (!is_dir(dirname($filename))) {
            mkdir(dirname($filename), 0777, true);
        }

        $body = $this->getBody();

        if ($compress) {
            $body = gzencode($body, 9);
            $filename .= ".gz";
        }

        @file_put_contents($filename, $body);
    }
1251529
public function print_section_remote_management() {
		if ( empty( self::$api_key ) ) {
			$this->load_options();
		}
		$api_url = add_query_arg(
			[
				'action' => 'github-updater-update',
				'key'    => self::$api_key,
			],
			admin_url( 'admin-ajax.php' )
		);
		?>
		<p>
			<?php
			printf(
				wp_kses_post(
					/* translators: %s: Link to wiki */
					__( 'Please refer to the <a href="%s">wiki</a> for complete list of attributes. RESTful endpoints begin at:', 'github-updater' )
				),
				'https://github.com/afragen/github-updater/wiki/Remote-Management---RESTful-Endpoints'
			);
			?>
			<br>
			<span style="font-family:monospace;"><?php echo $api_url; ?></span>
		<p>
			<?php esc_html_e( 'Use of Remote Management services may result increase some page load speeds only for `admin` level users in the dashboard.', 'github-updater' ); ?>
		</p>
		<?php
	}
852508
private function _output($options = array())
    {
        if (!isset($options["type"])) $options["type"] = "png";
        if (!isset($options["page"])) $options["page"] = 1;
        $type = strtolower($options["type"]);

        if (isset($this->_imgs[$options["page"] - 1])) {
            $img = $this->_imgs[$options["page"] - 1];
        } else {
            $img = $this->_imgs[0];
        }

        // Perform any antialiasing
        if ($this->_aa_factor != 1) {
            $dst_w = $this->_actual_width / $this->_aa_factor;
            $dst_h = $this->_actual_height / $this->_aa_factor;
            $dst = imagecreatetruecolor($dst_w, $dst_h);
            imagecopyresampled($dst, $img, 0, 0, 0, 0,
                $dst_w, $dst_h,
                $this->_actual_width, $this->_actual_height);
        } else {
            $dst = $img;
        }

        switch ($type) {
            case "jpg":
            case "jpeg":
                if (!isset($options["quality"])) {
                    $options["quality"] = 75;
                }

                imagejpeg($dst, null, $options["quality"]);
                break;
            case "png":
            default:
                imagepng($dst);
                break;
        }

        if ($this->_aa_factor != 1) {
            imagedestroy($dst);
        }
    }
30544
protected function loadOptions(array $options)
    {
        $this->slowThreshold = isset($options['slowThreshold']) ? $options['slowThreshold'] : 500;
        $this->reportLength = isset($options['reportLength']) ? $options['reportLength'] : 10;
    }
110447
private function printHelp()
    {
        $this->writeLn("Usage: pho [options] [files]\n");
        $this->writeLn("Options\n");

        // Loop over availableOptions, building the necessary input for
        // ConsoleFormatter::alignText()
        $options = [];
        foreach ($this->availableOptions as $name => $optionInfo) {
            $row = [$optionInfo[1], $optionInfo[0]];
            $row[] = (isset($optionInfo[3])) ? "<{$optionInfo[3]}>" : '';
            $row[] = $optionInfo[2];

            $options[] = $row;
        }

        $pad = str_repeat(' ', 3);
        foreach ($this->formatter->alignText($options, $pad) as $line) {
            $this->writeLn($pad . $line);
        }
    }
1225860
public function render($options = array()) {
		
		$result = $this->instance->render($options["pattern"], $options["data"]);
		// This error handler catches files that didn't render using any of the loaders.
		// The most common scenario is when a file's contents get passed to and through `Twig_Loader_String` and
		// outputs the raw Twig file contents like `@atoms/buttons/button.twig`.
		// @todo Remove this once `Twig_Loader_String` is removed.
		if (strpos($result, "@") === 0) {
			echo "Twig file not found: " . $result . "\n";
			exit(1);
		} else {
			return $result;
		}
		
	}
675797
public function getInputOptionSynopsis(input\Option $definition, array $options = null)
    {
        $shortcut = $definition->getShortcut() ? sprintf('-%s|', $definition->getShortcut()) : '';

        if ($value = $definition->getValue()) {
            $format = $value->is(input\Value::REQUIRED) ? '%s--%s="..."' : '%s--%s[="..."]';
        } else {
            $format = '%s--%s';
        }

        return sprintf('['.$format.']', $shortcut, $definition->getName());
    }
399288
protected function main(Options $options)
    {
        if ($options->getOpt('longflag')) {
            $this->info("longflag was set");
        } else {
            $this->info("longflag was not set");
        }

        if ($options->getOpt('file')) {
            $this->info("file was given as " . $options->getOpt('file'));
        }

        $this->info("Number of arguments: " . count($options->getArgs()));

        $this->success("main finished");
    }
1018386
public function render(array $options = []): string
    {
        $html = $this->format['menuStart'];
        $html .= !empty($options['title']) ? $options['title'] : '';

        /**
         * @var MenuItemInterface $menuItem
         */
        foreach ($this->menu->getMenuItems() as $menuItem) {
            if ($menuItem->isEnabled()) {
                $html .= $this->renderMenuItem($menuItem);
            }
        }
        $html .= $this->format['menuEnd'];

        return $html;
    }
474382
public static function showAll($options = [])
    {
        // Stop started items
        if (count(self::$runningItems)) {
            foreach (self::$runningItems as $key => $value) {
                self::stop($key);
            }
        }

        // Output items
        $output    = '';
        $itemCount = 1;
        foreach (self::$collection as $key => $item) {
            $stats = self::getStats($key, $options);

            if (php_sapi_name() == 'cli') {
                $output .= (!empty($output) ? "\n" : '') . $stats;
            } else {
                $output .= '<div class="xicrow-php-debug-timer">';
                $output .= $stats;
                $output .= '</div>';
            }

            $itemCount++;

            unset($stats);
        }
        unset($itemCount);

        self::output($output);
    }
983175
private function assertPdffillerOptions(array $options)
    {
        $missing = array_diff_key(array_flip($this->getPdffillerOptions()), $options);

        if (!empty($missing)) {
            throw new OptionsMissingException(array_keys($missing));
        }
    }
780967
protected function _groupTemplate($options)
    {
        $groupTemplate = $options['options']['type'] . 'FormGroup';
        if (!$this->templater()->get($groupTemplate)) {
            $groupTemplate = 'formGroup';
        }

        return $this->formatTemplate($groupTemplate, [
            'input' => $options['input'],
            'label' => $options['label'],
            'error' => $options['error'],
            'templateVars' => $this->_processTemplateVars($options)
        ]);
    }
366697
protected function _buildPermissionsArgument()
    {
        $permissions = $this->_Pdf->permissions();

        if ($permissions === false) {
            return false;
        }

        $allowed = [];

        if ($permissions === true) {
            $allowed[] = 'AllFeatures';
        }

        if (is_array($permissions)) {
            foreach ($permissions as $permission) {
                $allowed[] = $this->_permissionsMap[$permission];
            }
        }

        return implode(' ', $allowed);
    }
395032
public function outputHelp($short = false)
    {
        echo "Usage: " . $this->getName() . " ";
        if (!empty($this->params)) {
            foreach ($this->params as $param) {
                if ($param['required'] == true) {
                    echo '<' . $param['name'] . '> ';
                } else {
                    echo '[' . $param['name'] . '] ';
                }
            }
        }
        echo "[options]";

        if (!$short) {
            echo PHP_EOL . PHP_EOL;

            if (!empty($this->params)) {
                echo "Parameters:" . PHP_EOL;
                foreach ($this->params as $param) {
                    echo "\t" . $param['help'] . PHP_EOL;
                }
                echo PHP_EOL;
            }

            echo "Options:" . PHP_EOL;
            foreach ($this->options as $option) {
                $output = "\t" . $option['help'];
                if (array_key_exists('required', $option) && $option['required'] == true) {
                    $output .= " [required]";
                }
                $output .= PHP_EOL;
                echo $output;
            }
            echo "\t" . $this->helpOption . PHP_EOL;
        } else {
            echo PHP_EOL;
        }
    }