private function middleware(array $map = []) { if (empty($map)) { $map = ['test' => [Command::class], 'foobar' => [QueueableCommand::class]]; } $middleware = new QueueMiddleware($this->queue->get(), $map); return Liberator::liberate($middleware); }
/** * Validate Composer configuration data. * * @param mixed $data The configuration data. * * @throws Exception\ConfigurationExceptionInterface If the data is invalid. */ public function validate($data) { Liberator::liberate($this->validator)->errors = array(); $this->validator->check($data, $this->schema()); if (!$this->validator->isValid()) { throw new Exception\InvalidConfigurationException($this->validator->getErrors()); } }
private function worker() { $worker = Phony::partialMock(Worker::class, [$this->driver->get(), $this->queue->get(), $this->event->get(), $this->command_bus->get()]); return Liberator::liberate($worker->get()); }