_usedProperties['defaultMiddleware'] = true; $this->defaultMiddleware = $value; return $this; } /** * @return \Symfony\Config\Framework\Messenger\BusConfig\MiddlewareConfig|$this */ public function middleware(mixed $value = []): \Symfony\Config\Framework\Messenger\BusConfig\MiddlewareConfig|static { $this->_usedProperties['middleware'] = true; if (!\is_array($value)) { $this->middleware[] = $value; return $this; } return $this->middleware[] = new \Symfony\Config\Framework\Messenger\BusConfig\MiddlewareConfig($value); } public function __construct(array $value = []) { if (array_key_exists('default_middleware', $value)) { $this->_usedProperties['defaultMiddleware'] = true; $this->defaultMiddleware = $value['default_middleware']; unset($value['default_middleware']); } if (array_key_exists('middleware', $value)) { $this->_usedProperties['middleware'] = true; $this->middleware = array_map(function ($v) { return \is_array($v) ? new \Symfony\Config\Framework\Messenger\BusConfig\MiddlewareConfig($v) : $v; }, $value['middleware']); unset($value['middleware']); } if ([] !== $value) { throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); } } public function toArray(): array { $output = []; if (isset($this->_usedProperties['defaultMiddleware'])) { $output['default_middleware'] = $this->defaultMiddleware; } if (isset($this->_usedProperties['middleware'])) { $output['middleware'] = array_map(function ($v) { return $v instanceof \Symfony\Config\Framework\Messenger\BusConfig\MiddlewareConfig ? $v->toArray() : $v; }, $this->middleware); } return $output; } }