Example #1
0
 /**
  * Call the given seeder.
  *
  * @param  \Closure|string  $seeder
  * @return void
  */
 protected function call($seeder)
 {
     if ($seeder instanceof Closure) {
         return $this->container->call($seeder);
     }
     $this->container->call($seeder, [], 'seed');
 }
Example #2
0
 /**
  * Deteremine if the request passes the authorization check.
  *
  * @return bool
  */
 protected function passesAuthorization()
 {
     if (method_exists($this, 'authorize')) {
         return $this->container->call([$this, 'authorize']);
     }
     return false;
 }
Example #3
0
 /**
  * @param \Notadd\Foundation\Extension\Abstracts\ExtensionRegistrar $registrar
  *
  * @throws \Exception
  */
 public function boot(ExtensionRegistrar $registrar)
 {
     if (method_exists($registrar, 'register')) {
         $this->container->call([$registrar, 'register']);
     }
     $this->booted[get_class($registrar)] = $registrar;
 }
Example #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  *
  * @throws \InvalidArgumentException
  */
 public function __invoke()
 {
     if (!method_exists($this, 'run')) {
         throw new InvalidArgumentException('Method [run] missing from ' . get_class($this));
     }
     return isset($this->container) ? $this->container->call([$this, 'run']) : $this->run();
 }
Example #5
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @throws \Exception
  * @return mixed
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->input = $input;
     $this->output = $output;
     if (!method_exists($this, 'fire')) {
         throw new Exception('Method fire do not exits!', 404);
     }
     return $this->container->call([$this, 'fire']);
 }
 /**
  * Handle the command.
  *
  * @param Container $container
  */
 public function handle(Container $container)
 {
     $handler = array_get($this->fieldType->getConfig(), 'handler');
     if (!class_exists($handler) && !str_contains($handler, '@')) {
         $handler = array_get($this->fieldType->getHandlers(), $handler);
     }
     if (is_string($handler) && !str_contains($handler, '@')) {
         $handler .= '@handle';
     }
     $container->call($handler, ['fieldType' => $this->fieldType]);
 }
 /**
  * Handle the command.
  *
  * @param Container $container
  */
 public function handle(Container $container)
 {
     $container->call(array_get($this->fieldType->getConfig(), 'handler'), ['fieldType' => $this->fieldType]);
 }
Example #8
0
 /**
  * Execute the console command.
  *
  * @param Container $container
  * @param KyloRen $kyloRen
  * @return mixed
  */
 public function handle(Container $container, KyloRen $kyloRen)
 {
     $container->call([$kyloRen, 'talkToDad'], ['speech' => 'Im in a gang, Im cool now!']);
 }
Example #9
0
 /**
  * Boot method.
  * @return void
  */
 public function boot()
 {
     $this->app->call([$this, 'setup']);
 }
Example #10
0
 /**
  * Call the given Closure / class@method and inject its dependencies.
  *
  * Note: Uses the illuminate/container `call` method.
  *
  * @param  callable|string $callback
  * @param  array           $args
  *
  * @return mixed
  */
 public function callWithDependencyInjection($callback, array $args = [])
 {
     return static::$container->call($callback, $args);
 }
Example #11
0
 /**
  * Handle the command.
  *
  * @param Container $container
  */
 public function handle(Container $container)
 {
     $container->call($this->extension->getLoader(), ['extension' => $this->extension]);
 }
Example #12
0
 /**
  * Register the disk.
  *
  * @param DiskInterface $disk
  */
 public function register(DiskInterface $disk)
 {
     if ($adapter = $disk->getAdapter()) {
         $this->container->call(substr(get_class($adapter), 0, -9) . 'Loader@load', compact('disk', 'adapter'));
     }
 }
Example #13
0
 /**
  * Call the given Closure / class@method and inject its dependencies.
  *
  * @param callable|string $callback
  * @param array           $parameters
  * @param string|null     $defaultMethod
  *
  * @return mixed
  */
 public function call($callback, array $parameters = [], $defaultMethod = null)
 {
     return $this->delegate->call($callback, $parameters, $defaultMethod);
 }