setup(); }, $modules ); $provider = new CompositeCachingServiceProvider( $providers ); $proxy_container = new ProxyContainer(); // TODO: caching does not work currently, // may want to consider fixing it later (pass proxy as parent to DelegatingContainer) // for now not fixed since we were using this behavior for long time and fixing it now may break things. $container = new DelegatingContainer( $provider ); /** * Skip iterable vs array check. * * @psalm-suppress PossiblyInvalidArgument */ $app_container = new CachingContainer( new CompositeContainer( array_merge( $additional_containers, array( $container ) ) ) ); $proxy_container->setInnerContainer( $app_container ); foreach ( $modules as $module ) { /* @var $module ModuleInterface module */ $module->run( $app_container ); } return $app_container; };