for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Basis\Job\Module;
use Basis\Dispatcher;
use Basis\Event;
use Basis\Filesystem;
use Basis\Framework;
use Basis\Runner;
use Basis\Service;
use Exception;
use ReflectionClass;
use ReflectionProperty;
class Bootstrap
{
public function run(Runner $runner, Dispatcher $dispatcher, Service $service, Event $event, Framework $framework, Filesystem $fs)
$service->register();
$runner->dispatch('tarantool.migrate');
$meta = $runner->dispatch('module.meta');
foreach ($meta['routes'] as $route) {
$service->registerRoute($route);
}
foreach ($event->getSubscription() as $event => $listeners) {
$event
integer|string
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe:
function someFunction(A $objectMaybe = null) { if ($objectMaybe instanceof A) { $objectMaybe->doSomething(); } }
$service->subscribe($event);
foreach ($framework->listFiles('resources/default') as $file) {
if (!$fs->exists($file)) {
$source = $framework->getPath("resources/default/$file");
$destination = $fs->getPath($file);
file_put_contents($destination, file_get_contents($source));
$assets = $runner->dispatch('module.assets');
($service->getName() == 'web' ? $runner : $dispatcher)
->dispatch('asset.register', [
'service' => $service->getName(),
'hash' => $assets['hash'],
]);
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: