Implement minor shortcut for PhpStorm DI resolution.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-12-07 05:29:35 -06:00
parent 0edb34358f
commit cd3ce3dad0
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
3 changed files with 45 additions and 17 deletions

21
.phpstorm.meta.php Normal file
View File

@ -0,0 +1,21 @@
<?php
namespace PHPSTORM_META {
override(
\Psr\Container\ContainerInterface::get(0),
map(
[
'' => '@',
]
)
);
override(
\DI\Container::get(0),
map(
[
'' => '@',
]
)
);
}

View File

@ -177,7 +177,6 @@ class AppFactory
$di = $app->getContainer();
$routeCollector = $app->getRouteCollector();
/** @var Environment $environment */
$environment = $di->get(Environment::class);
// Use the PHP-DI Bridge's action invocation helper.
@ -207,7 +206,6 @@ class AppFactory
{
$di = $app->getContainer();
/** @var EventDispatcher $dispatcher */
$dispatcher = $di->get(EventDispatcher::class);
$dispatcher->dispatch(new Event\BuildRoutes($app));
}

View File

@ -26,10 +26,12 @@ class SetupCommand extends CommandAbstract
$io->title(__('AzuraCast Setup'));
$io->writeln(__('Welcome to AzuraCast. Please wait while some key dependencies of AzuraCast are set up...'));
$io->listing([
__('Environment: %s', ucfirst($environment->getAppEnvironment())),
__('Installation Method: %s', $environment->isDocker() ? 'Docker' : 'Ansible'),
]);
$io->listing(
[
__('Environment: %s', ucfirst($environment->getAppEnvironment())),
__('Installation Method: %s', $environment->isDocker() ? 'Docker' : 'Ansible'),
]
);
if ($update) {
$io->note(__('Running in update mode.'));
@ -41,7 +43,6 @@ class SetupCommand extends CommandAbstract
}
}
/** @var EntityManagerInterface $em */
$em = $di->get(EntityManagerInterface::class);
$conn = $em->getConnection();
@ -49,9 +50,13 @@ class SetupCommand extends CommandAbstract
$io->section(__('Running Database Migrations'));
$conn->ping();
$this->runCommand($output, 'migrations:migrate', [
'--allow-no-migration' => true,
]);
$this->runCommand(
$output,
'migrations:migrate',
[
'--allow-no-migration' => true,
]
);
$io->newLine();
$io->section(__('Generating Database Proxy Classes'));
@ -97,16 +102,20 @@ class SetupCommand extends CommandAbstract
$io->newLine();
if ($update) {
$io->success([
__('AzuraCast is now updated to the latest version!'),
]);
$io->success(
[
__('AzuraCast is now updated to the latest version!'),
]
);
} else {
$public_ip = $acCentral->getIp(false);
$io->success([
__('AzuraCast installation complete!'),
__('Visit %s to complete setup.', 'http://' . $public_ip),
]);
$io->success(
[
__('AzuraCast installation complete!'),
__('Visit %s to complete setup.', 'http://' . $public_ip),
]
);
}
return 0;