Skip to content

Commit b4f953f

Browse files
[Contracts][EventDispatcher] add EventDispatcherInterface to symfony/contracts and use it where possible
1 parent e440baa commit b4f953f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Compiler/AutowirePass.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,7 @@ private function autowireMethod(\ReflectionFunctionAbstract $reflectionMethod, a
226226
if ($parameter->isDefaultValueAvailable()) {
227227
$value = $parameter->getDefaultValue();
228228
} elseif (!$parameter->allowsNull()) {
229-
if (\function_exists('xdebug_disable')) {
230-
xdebug_disable();
231-
}
232-
try {
233-
throw new AutowiringFailedException($this->currentId, $failureMessage);
234-
} finally {
235-
if (\function_exists('xdebug_enable')) {
236-
xdebug_enable();
237-
}
238-
}
229+
throw new AutowiringFailedException($this->currentId, $failureMessage);
239230
}
240231
}
241232

Exception/AutowiringFailedException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public function __construct(string $serviceId, $message = '', int $code = 0, \Ex
2323
{
2424
$this->serviceId = $serviceId;
2525

26+
if ($message instanceof \Closure && \function_exists('xdebug_is_enabled') && xdebug_is_enabled()) {
27+
$message = $message();
28+
}
29+
2630
if (!$message instanceof \Closure) {
2731
parent::__construct($message, $code, $previous);
2832

0 commit comments

Comments
 (0)