@@ -30,8 +30,8 @@ |
||
30 | 30 | ): CoreInterface { |
31 | 31 | $pipeline = (new InterceptorPipeline($dispatcher))->withCore($core); |
32 | 32 | |
33 | - foreach (static::defineInterceptors() as $interceptor) { |
|
34 | - if (!$interceptor instanceof CoreInterceptorInterface && !$interceptor instanceof InterceptorInterface) { |
|
33 | + foreach (static::defineInterceptors() as $interceptor){ |
|
34 | + if (!$interceptor instanceof CoreInterceptorInterface && !$interceptor instanceof InterceptorInterface){ |
|
35 | 35 | $interceptor = $container->get($interceptor); |
36 | 36 | } |
37 | 37 |
@@ -30,8 +30,10 @@ |
||
30 | 30 | ): CoreInterface { |
31 | 31 | $pipeline = (new InterceptorPipeline($dispatcher))->withCore($core); |
32 | 32 | |
33 | - foreach (static::defineInterceptors() as $interceptor) { |
|
34 | - if (!$interceptor instanceof CoreInterceptorInterface && !$interceptor instanceof InterceptorInterface) { |
|
33 | + foreach (static::defineInterceptors() as $interceptor) |
|
34 | + { |
|
35 | + if (!$interceptor instanceof CoreInterceptorInterface && !$interceptor instanceof InterceptorInterface) |
|
36 | + { |
|
35 | 37 | $interceptor = $container->get($interceptor); |
36 | 38 | } |
37 | 39 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | private readonly ContainerInterface $container, |
46 | 46 | private readonly BinderInterface $binder, |
47 | 47 | private readonly ConfiguratorInterface $config |
48 | - ) { |
|
48 | + ){ |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ): FilterProvider { |
97 | 97 | $pipeline = (new InterceptorPipeline($dispatcher))->withHandler(new Core()); |
98 | 98 | |
99 | - foreach ($config->getInterceptors() as $interceptor) { |
|
99 | + foreach ($config->getInterceptors() as $interceptor){ |
|
100 | 100 | $pipeline->addInterceptor($container->get($interceptor)); |
101 | 101 | } |
102 | 102 |
@@ -96,7 +96,8 @@ |
||
96 | 96 | ): FilterProvider { |
97 | 97 | $pipeline = (new InterceptorPipeline($dispatcher))->withHandler(new Core()); |
98 | 98 | |
99 | - foreach ($config->getInterceptors() as $interceptor) { |
|
99 | + foreach ($config->getInterceptors() as $interceptor) |
|
100 | + { |
|
100 | 101 | $pipeline->addInterceptor($container->get($interceptor)); |
101 | 102 | } |
102 | 103 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | public function __construct( |
24 | 24 | private readonly ContainerInterface $container, |
25 | 25 | private readonly ResolverInterface $resolver, |
26 | - private readonly CoreInterface|HandlerInterface $core |
|
27 | - ) { |
|
26 | + private readonly CoreInterface | HandlerInterface $core |
|
27 | + ){ |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function createFilter(string $name, InputInterface $input): FilterInterface |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $filter = $this->createFilterInstance($name); |
36 | 36 | [$mappingSchema, $errors, $setters, $optionalFilters] = $attributeMapper->map($filter, $input); |
37 | 37 | |
38 | - if ($filter instanceof HasFilterDefinition) { |
|
38 | + if ($filter instanceof HasFilterDefinition){ |
|
39 | 39 | $mappingSchema = \array_merge( |
40 | 40 | $mappingSchema, |
41 | 41 | $filter->filterDefinition()->mappingSchema() |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | \assert($schemaBuilder instanceof Builder); |
50 | 50 | |
51 | 51 | $schema = $schemaBuilder->makeSchema($name, $mappingSchema); |
52 | - foreach ($optionalFilters as $optionalFilter) { |
|
52 | + foreach ($optionalFilters as $optionalFilter){ |
|
53 | 53 | $schema[$optionalFilter][Builder::SCHEMA_OPTIONAL] = true; |
54 | 54 | } |
55 | 55 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $class = new \ReflectionClass($name); |
68 | 68 | |
69 | 69 | $args = []; |
70 | - if ($constructor = $class->getConstructor()) { |
|
70 | + if ($constructor = $class->getConstructor()){ |
|
71 | 71 | $args = $this->resolver->resolveArguments($constructor); |
72 | 72 | } |
73 | 73 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public function __construct( |
50 | 50 | private readonly ConfiguratorInterface $configs |
51 | - ) { |
|
51 | + ){ |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function init(): void |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | FinalizerInterface $finalizer, |
73 | 73 | ?EventDispatcherInterface $eventDispatcher = null |
74 | 74 | ): void { |
75 | - if ($eventDispatcher !== null) { |
|
75 | + if ($eventDispatcher !== null){ |
|
76 | 76 | $this->initEventDispatcher(new Core($eventDispatcher), $config, $container, $factory); |
77 | 77 | } |
78 | 78 | |
79 | - foreach ($config->getProcessors() as $processor) { |
|
79 | + foreach ($config->getProcessors() as $processor){ |
|
80 | 80 | $processor = $this->autowire($processor, $container, $factory); |
81 | 81 | |
82 | 82 | \assert($processor instanceof ProcessorInterface); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $registry->process(); |
88 | 88 | }); |
89 | 89 | |
90 | - if ($finalizer instanceof EventDispatcherAwareInterface && $eventDispatcher !== null) { |
|
90 | + if ($finalizer instanceof EventDispatcherAwareInterface && $eventDispatcher !== null){ |
|
91 | 91 | $finalizer->setEventDispatcher($eventDispatcher); |
92 | 92 | } |
93 | 93 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * @param TInterceptor $interceptor |
97 | 97 | */ |
98 | - public function addInterceptor(string|CoreInterceptorInterface|Container\Autowire $interceptor): void |
|
98 | + public function addInterceptor(string | CoreInterceptorInterface | Container\Autowire $interceptor): void |
|
99 | 99 | { |
100 | 100 | $this->configs->modify(EventsConfig::CONFIG, new Append('interceptors', null, $interceptor)); |
101 | 101 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ): void { |
109 | 109 | $pipeline = (new InterceptorPipeline())->withCore($core); |
110 | 110 | |
111 | - foreach ($config->getInterceptors() as $interceptor) { |
|
111 | + foreach ($config->getInterceptors() as $interceptor){ |
|
112 | 112 | $interceptor = $this->autowire($interceptor, $container, $factory); |
113 | 113 | |
114 | 114 | \assert($interceptor instanceof CoreInterceptorInterface || $interceptor instanceof InterceptorInterface); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * |
129 | 129 | * @throws ContainerExceptionInterface |
130 | 130 | */ |
131 | - private function autowire(string|object $id, ContainerInterface $container, FactoryInterface $factory): object |
|
131 | + private function autowire(string | object $id, ContainerInterface $container, FactoryInterface $factory): object |
|
132 | 132 | { |
133 | 133 | return match (true) { |
134 | 134 | \is_string($id) => $container->get($id), |
@@ -72,11 +72,13 @@ discard block |
||
72 | 72 | FinalizerInterface $finalizer, |
73 | 73 | ?EventDispatcherInterface $eventDispatcher = null |
74 | 74 | ): void { |
75 | - if ($eventDispatcher !== null) { |
|
75 | + if ($eventDispatcher !== null) |
|
76 | + { |
|
76 | 77 | $this->initEventDispatcher(new Core($eventDispatcher), $config, $container, $factory); |
77 | 78 | } |
78 | 79 | |
79 | - foreach ($config->getProcessors() as $processor) { |
|
80 | + foreach ($config->getProcessors() as $processor) |
|
81 | + { |
|
80 | 82 | $processor = $this->autowire($processor, $container, $factory); |
81 | 83 | |
82 | 84 | \assert($processor instanceof ProcessorInterface); |
@@ -87,7 +89,8 @@ discard block |
||
87 | 89 | $registry->process(); |
88 | 90 | }); |
89 | 91 | |
90 | - if ($finalizer instanceof EventDispatcherAwareInterface && $eventDispatcher !== null) { |
|
92 | + if ($finalizer instanceof EventDispatcherAwareInterface && $eventDispatcher !== null) |
|
93 | + { |
|
91 | 94 | $finalizer->setEventDispatcher($eventDispatcher); |
92 | 95 | } |
93 | 96 | } |
@@ -108,7 +111,8 @@ discard block |
||
108 | 111 | ): void { |
109 | 112 | $pipeline = (new InterceptorPipeline())->withCore($core); |
110 | 113 | |
111 | - foreach ($config->getInterceptors() as $interceptor) { |
|
114 | + foreach ($config->getInterceptors() as $interceptor) |
|
115 | + { |
|
112 | 116 | $interceptor = $this->autowire($interceptor, $container, $factory); |
113 | 117 | |
114 | 118 | \assert($interceptor instanceof CoreInterceptorInterface || $interceptor instanceof InterceptorInterface); |