88namespace Ibexa \Bundle \IO \DependencyInjection \Compiler ;
99
1010use ArrayObject ;
11+ use Ibexa \Bundle \IO \DependencyInjection \ConfigurationFactory ;
1112use Symfony \Component \Config \Definition \Exception \InvalidConfigurationException ;
1213use Symfony \Component \DependencyInjection \ChildDefinition ;
1314use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
1617use Symfony \Component \DependencyInjection \Reference ;
1718
1819/**
19- * This compiler pass will create the metadata and binarydata IO handlers depending on container configuration.
20- *
2120 * @todo Refactor into two passes, since they're very very close.
2221 */
2322class IOConfigurationPass implements CompilerPassInterface
@@ -36,12 +35,7 @@ public function __construct(
3635 $ this ->binarydataHandlerFactories = $ binarydataHandlerFactories ;
3736 }
3837
39- /**
40- * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
41- *
42- * @throws \LogicException
43- */
44- public function process (ContainerBuilder $ container )
38+ public function process (ContainerBuilder $ container ): void
4539 {
4640 $ ioMetadataHandlers = $ container ->hasParameter ('ibexa.io.metadata_handlers ' ) ?
4741 $ container ->getParameter ('ibexa.io.metadata_handlers ' ) :
@@ -80,8 +74,8 @@ protected function processHandlers(
8074 Definition $ factory ,
8175 array $ configuredHandlers ,
8276 ArrayObject $ factories ,
83- $ defaultHandler
84- ) {
77+ string $ defaultHandler
78+ ): void {
8579 $ handlers = ['default ' => new Reference ($ defaultHandler )];
8680
8781 foreach ($ configuredHandlers as $ name => $ config ) {
@@ -105,10 +99,8 @@ protected function processHandlers(
10599 *
106100 * @param \Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory[]|\ArrayObject $factories
107101 * @param string $type
108- *
109- * @return \Ibexa\Bundle\IO\DependencyInjection\ConfigurationFactory
110102 */
111- protected function getFactory (ArrayObject $ factories , $ type )
103+ protected function getFactory (ArrayObject $ factories , string $ type ): ConfigurationFactory
112104 {
113105 if (!isset ($ factories [$ type ])) {
114106 throw new InvalidConfigurationException ("Unknown handler type $ type " );
0 commit comments