A few minor fixes

This commit is contained in:
Timothy Warren 2021-02-18 12:48:59 -05:00
parent 97df64bf7a
commit a338a43e43
4 changed files with 15 additions and 8 deletions

2
Jenkinsfile vendored
View File

@ -37,7 +37,7 @@ pipeline {
stage('Code Cleanliness') { stage('Code Cleanliness') {
agent any agent any
steps { steps {
sh "php8 ./vendor/bin/phpstan analyse -c phpstan.neon -n --no-progress --no-ansi --error-format=checkstyle | awk '{\$1=\$1;print}' > build/logs/phpstan.log" sh "php ./vendor/bin/phpstan analyse -c phpstan.neon -n --no-progress --no-ansi --error-format=checkstyle | awk '{\$1=\$1;print}' > build/logs/phpstan.log"
recordIssues( recordIssues(
failOnError: false, failOnError: false,
tools: [phpStan(reportEncoding: 'UTF-8', pattern: 'build/logs/phpstan.log')] tools: [phpStan(reportEncoding: 'UTF-8', pattern: 'build/logs/phpstan.log')]

View File

@ -26,7 +26,7 @@ try
'sync:lists' => Command\SyncLists::class 'sync:lists' => Command\SyncLists::class
]))->run(); ]))->run();
} }
catch (\Exception $e) catch (\Throwable)
{ {
} }

View File

@ -17,9 +17,9 @@
namespace Aviat\AnimeClient; namespace Aviat\AnimeClient;
use Aviat\AnimeClient\Types\Config as ConfigType; use Aviat\AnimeClient\Types\Config as ConfigType;
use Whoops\Handler\PrettyPageHandler; use Whoops\Handler;
use Whoops\Run; use Whoops\Run;
use Whoops\Util;
use function Aviat\Ion\_dir; use function Aviat\Ion\_dir;
setlocale(LC_CTYPE, 'en_US'); setlocale(LC_CTYPE, 'en_US');
@ -30,7 +30,12 @@ require_once __DIR__ . '/vendor/autoload.php';
if (file_exists('.is-dev')) if (file_exists('.is-dev'))
{ {
$whoops = new Run; $whoops = new Run;
$whoops->pushHandler(new PrettyPageHandler); $whoops->pushHandler(new Handler\PrettyPageHandler);
if (Util\Misc::isAjaxRequest()) {
$whoops->pushHandler(new Handler\JsonResponseHandler);
}
$whoops->register(); $whoops->register();
} }

View File

@ -61,14 +61,16 @@ abstract class BaseCommand extends Command {
if ($fgColor !== NULL) if ($fgColor !== NULL)
{ {
$fgColor = (string)$fgColor; $fgColor = (int)$fgColor;
} }
if ($bgColor !== NULL) if ($bgColor !== NULL)
{ {
$bgColor = (string)$bgColor; $bgColor = (int)$bgColor;
} }
// color message // Colorize the CLI output
// the documented type for the function is wrong
// @phpstan-ignore-next-line
$message = Colors::colorize($message, $fgColor, $bgColor); $message = Colors::colorize($message, $fgColor, $bgColor);
// create the box // create the box