Nelmio\Alice\Symfony\KernelIsolatedServiceCall::call PHP Method

call() public static method

public static call ( string $serviceId, callable $getResult )
$serviceId string
$getResult callable
    public static function call(string $serviceId, callable $getResult)
    {
        $kernel = KernelFactory::createKernel();
        $kernel->boot();
        $container = $kernel->getContainer();
        $service = $container->get($serviceId);
        $result = $getResult($service);
        $kernel->shutdown();
        return $result;
    }

Usage Example

コード例 #1
0
 /**
  * @inheritdoc
  */
 public function parse(string $value)
 {
     return KernelIsolatedServiceCall::call('nelmio_alice.fixture_builder.expression_language.parser', function (ParserInterface $parser) use($value) {
         return $parser->parse($value);
     });
 }
All Usage Examples Of Nelmio\Alice\Symfony\KernelIsolatedServiceCall::call
KernelIsolatedServiceCall