From 1c051cb431d839930cd0ec77213bf61eba67a832 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Sun, 4 Jun 2017 07:23:00 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/DI/Compiler.php | 3 +++ tests/IntegrationTest/CompiledContainerTest.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/DI/Compiler.php b/src/DI/Compiler.php index 4239a6bd0..26e295709 100644 --- a/src/DI/Compiler.php +++ b/src/DI/Compiler.php @@ -1,4 +1,5 @@ getName())) { return 'Decorators cannot be nested in another definition'; } + return 'A decorator definition was found but decorators cannot be compiled'; } if ($value instanceof FactoryDefinition) { @@ -234,6 +236,7 @@ private function isCompilable($value) } } }); + return $compilable; } if (is_object($value)) { diff --git a/tests/IntegrationTest/CompiledContainerTest.php b/tests/IntegrationTest/CompiledContainerTest.php index 693b36659..03c0e9890 100644 --- a/tests/IntegrationTest/CompiledContainerTest.php +++ b/tests/IntegrationTest/CompiledContainerTest.php @@ -82,7 +82,7 @@ public function factories_nested_in_other_definitions_cannot_be_compiled() \stdClass::class => create() ->property('foo', factory(function () { return 'hello'; - })) + })), ]); $builder->compile(self::generateCompilationFileName()); $builder->build(); @@ -98,7 +98,7 @@ public function object_nested_in_other_definitions_cannot_be_compiled() $builder = new ContainerBuilder; $builder->addDefinitions([ \stdClass::class => create() - ->property('foo', new \stdClass) + ->property('foo', new \stdClass), ]); $builder->compile(self::generateCompilationFileName()); $builder->build(); @@ -137,9 +137,9 @@ public function object_nested_in_array_in_other_definitions_cannot_be_compiled() \stdClass::class => create() ->property('foo', [ [ - new \stdClass + new \stdClass, ], - ]) + ]), ]); $builder->compile(self::generateCompilationFileName()); $builder->build();