mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-25 06:51:18 +02:00
Simplified container initialization code a bit
This commit is contained in:
@@ -14,9 +14,8 @@ ini_set('open_basedir', __DIR__);
|
||||
Dotenv::createUnsafeImmutable(__DIR__)->safeLoad();
|
||||
|
||||
// Initialize the container
|
||||
$container = call_user_func_array(
|
||||
[new ContainerBuilder, 'addDefinitions'],
|
||||
glob(__DIR__ . '/app/config/*.php')
|
||||
$container = (new ContainerBuilder)->addDefinitions(
|
||||
...glob(__DIR__ . '/app/config/*.php')
|
||||
);
|
||||
|
||||
// Compile the container
|
||||
|
@@ -29,9 +29,8 @@ class TestCase extends PHPUnitTestCase
|
||||
{
|
||||
Dotenv::createUnsafeImmutable(__DIR__)->safeLoad();
|
||||
|
||||
$this->container = call_user_func_array(
|
||||
[new ContainerBuilder, 'addDefinitions'],
|
||||
glob(dirname(__DIR__) . '/app/config/*.php')
|
||||
$this->container = (new ContainerBuilder)->addDefinitions(
|
||||
...glob(dirname(__DIR__) . '/app/config/*.php')
|
||||
)->build();
|
||||
|
||||
$this->cache = new ArrayAdapter($this->container->get('cache_lifetime'));
|
||||
|
Reference in New Issue
Block a user