Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli authored and StyleCIBot committed Jun 4, 2017
1 parent bdf8af9 commit 1c051cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/DI/Compiler.php
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);

namespace DI;
Expand Down Expand Up @@ -214,6 +215,7 @@ private function isCompilable($value)
if (empty($value->getName())) {
return 'Decorators cannot be nested in another definition';
}

return 'A decorator definition was found but decorators cannot be compiled';
}
if ($value instanceof FactoryDefinition) {
Expand All @@ -234,6 +236,7 @@ private function isCompilable($value)
}
}
});

return $compilable;
}
if (is_object($value)) {
Expand Down
8 changes: 4 additions & 4 deletions tests/IntegrationTest/CompiledContainerTest.php
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1c051cb

Please sign in to comment.