From f3f0668a7e3ebe8335aade71c45848b14f6b68d9 Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Thu, 16 Jul 2020 08:26:27 -0700 Subject: [PATCH] Simplified container initialization code a bit --- index.php | 5 ++--- tests/TestCase.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 2595609..5462578 100644 --- a/index.php +++ b/index.php @@ -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 diff --git a/tests/TestCase.php b/tests/TestCase.php index 0251786..1d1c1bf 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -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'));