Skip to content

Commit 5a95940

Browse files
committed
ContainerBuilder: fixed type of service
401dca5
1 parent 0f9dc5d commit 5a95940

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/DI/ContainerBuilder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,10 @@ public function complete(): void
545545
$def->setSetup($setups);
546546

547547
} catch (\Exception $e) {
548-
throw new ServiceCreationException("Service '$name' (type of $entity): " . $e->getMessage(), 0, $e);
548+
throw new ServiceCreationException(
549+
"Service '$name'"
550+
. (is_string($entity) ? " (type of $entity)" : '')
551+
. ': ' . $e->getMessage(), 0, $e);
549552

550553
} finally {
551554
$this->currentService = null;

0 commit comments

Comments
 (0)