本文整理汇总了PHP中Illuminate\Container\Container::call方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::call方法的具体用法?PHP Container::call怎么用?PHP Container::call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Container\Container
的用法示例。
在下文中一共展示了Container::call方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: call
/**
* 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');
}
示例2: passesAuthorization
/**
* 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;
}
示例3: boot
/**
* @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;
}
示例4: __invoke
/**
* 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();
}
示例5: execute
/**
* @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']);
}
示例6: handle
/**
* 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]);
}
示例7: handle
/**
* Handle the command.
*
* @param Container $container
*/
public function handle(Container $container)
{
$container->call(array_get($this->fieldType->getConfig(), 'handler'), ['fieldType' => $this->fieldType]);
}
示例8: handle
/**
* 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!']);
}
示例9: boot
/**
* Boot method.
* @return void
*/
public function boot()
{
$this->app->call([$this, 'setup']);
}
示例10: callWithDependencyInjection
/**
* 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);
}
示例11: handle
/**
* Handle the command.
*
* @param Container $container
*/
public function handle(Container $container)
{
$container->call($this->extension->getLoader(), ['extension' => $this->extension]);
}
示例12: register
/**
* 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'));
}
}
示例13: call
/**
* 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);
}