Skip to content

Commit

Permalink
Application: Update for new package versions, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
okdana committed Apr 22, 2020
1 parent c76ce18 commit c7f9eb7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Twigc/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Output\{ConsoleOutputInterface,OutputInterface};
use Twig\Environment;
use Twig\Extension\EscaperExtension;
use Twig\Loader\{ArrayLoader,FilesystemLoader};

use Dana\Twigc\ComposerHelper;
Expand Down Expand Up @@ -122,7 +123,7 @@ public function doRun(OutputInterface $output, array $argv = null): int {
$temp = false;

// If we're receiving data on standard input, and we didn't get a template,
// assume `-` — we'll make sure this doesn't conflict with `-j` below
// assume `-` — we'll make sure this doesn't conflict with `-j` below
if ( ! posix_isatty(\STDIN) ) {
$template = $template ?? '-';
}
Expand Down Expand Up @@ -249,18 +250,18 @@ public function doRun(OutputInterface $output, array $argv = null): int {
),
]);

$twig->getExtension('Twig_Extension_Core')->setEscaper(
$twig->getExtension(EscaperExtension::class)->setEscaper(
'json',
function($twigEnv, $string, $charset) {
function ($twigEnv, $string, $charset) {
return json_encode(
$string,
\JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE
);
}
);
$twig->getExtension('Twig_Extension_Core')->setEscaper(
$twig->getExtension(EscaperExtension::class)->setEscaper(
'sh',
function($twigEnv, $string, $charset) {
function ($twigEnv, $string, $charset) {
return '"' . addcslashes($string, '$`\\"') . '"';
}
);
Expand Down Expand Up @@ -337,9 +338,9 @@ public function doCredits(OutputInterface $output): int {

$table = new Table($output);
$table->setStyle('compact');
$table->getStyle()->setVerticalBorderChar('');
$table->getStyle()->setVerticalBorderChars('');
$table->getStyle()->setCellRowContentFormat('%s ');
$table->setHeaders(['name', 'version', 'licence']);
$table->setHeaders(['#name', 'version', 'licence']);

foreach ( $packages as $package ) {
$table->addRow([
Expand Down

0 comments on commit c7f9eb7

Please sign in to comment.