Skip to content

Commit

Permalink
Update console.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jul 17, 2024
1 parent b4991b0 commit 55ffc70
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@

declare(strict_types=1);

namespace Ghostwriter\Wip\Console;

use Ghostwriter\Wip\Foo;
use Ghostwriter\Arm\Console\Application;

use const STDERR;

use function fwrite;
use function sprintf;

/** @var ?string $_composer_autoload_path */
(static function (string $composerAutoloadPath): void {
/** @psalm-suppress UnresolvableInclude */
require $composerAutoloadPath ?: fwrite(
STDERR,
sprintf('[ERROR]Cannot locate "%s"\n please run "composer install"\n', $composerAutoloadPath)
) && exit(1);

/**
* #BlackLivesMatter.
*/
echo (new Foo())->test();
})($_composer_autoload_path ?? null);
if (! \file_exists($composerAutoloadPath)) {
\fwrite(
STDERR,
\sprintf('[ERROR]Cannot locate "%s"\n please run "composer install"\n', $composerAutoloadPath)
);
exit(1);
}

require $composerAutoloadPath;

/** #BlackLivesMatter */
Application::new()->run();
})($_composer_autoload_path ?? \dirname(__DIR__) . '/vendor/autoload.php');

0 comments on commit 55ffc70

Please sign in to comment.