Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit dc3f77a

Browse files
committed
Base module class can create config containers
1 parent 8a9ace6 commit dc3f77a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/Module/AbstractBaseModule.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,24 @@ protected function _createContainer($definitions = [], ContainerInterface $paren
341341
return $containerFactory->make(['definitions' => $definitions, 'parent' => $parent]);
342342
}
343343

344+
/**
345+
* Creates a config container instance with the given data.
346+
*
347+
* @since [*next-version*]
348+
*
349+
* @param callable[]|ArrayAccess|stdClass|ContainerInterface $data The config data.
350+
*
351+
* @return ContainerInterface The created config container instance.
352+
*
353+
* @throws CouldNotMakeExceptionInterface If the factory failed to create the exception.
354+
* @throws FactoryExceptionInterface If the factory encountered an error.
355+
* @throws RuntimeException If the container factory associated with this instance is null.
356+
*/
357+
protected function _createConfig($data = [])
358+
{
359+
return $this->_getConfigFactory()->make(['definitions' => $data]);
360+
}
361+
344362
/**
345363
* Creates a composite container with the given children container instances.
346364
*

0 commit comments

Comments
 (0)