Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd64f5a

Browse filesBrowse files
Merge branch '6.0' into 6.1
* 6.0: [Workflow] Fix deprecated syntax for interpolated strings [DependencyInjection] Fix lazyness of AutowiringFailedException
2 parents b0be802 + 06b4706 commit fd64f5a
Copy full SHA for fd64f5a

File tree

3 files changed

+25
-4
lines changed
Filter options

3 files changed

+25
-4
lines changed

‎src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Exception/AutowiringFailedException.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(string $serviceId, string|\Closure $message = '', in
3939
parent::__construct('', $code, $previous);
4040

4141
$this->message = new class($this->message, $this->messageCallback) {
42-
private string $message;
42+
private string|self $message;
4343
private ?\Closure $messageCallback;
4444

4545
public function __construct(&$message, &$messageCallback)

‎src/Symfony/Component/DependencyInjection/Tests/Exception/AutowiringFailedExceptionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Exception/AutowiringFailedExceptionTest.php
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,25 @@ public function testGetMessageCallbackWhenMessageIsNotANotClosure()
2525

2626
self::assertNull($exception->getMessageCallback());
2727
}
28+
29+
public function testLazyness()
30+
{
31+
$counter = 0;
32+
$exception = new AutowiringFailedException(
33+
'App\DummyService',
34+
function () use (&$counter) {
35+
++$counter;
36+
37+
throw new \Exception('boo');
38+
}
39+
);
40+
41+
$this->assertSame(0, $counter);
42+
43+
$this->assertSame('boo', $exception->getMessage());
44+
$this->assertSame(1, $counter);
45+
46+
$this->assertSame('boo', $exception->getMessage());
47+
$this->assertSame(1, $counter);
48+
}
2849
}

‎src/Symfony/Component/Workflow/Dumper/PlantUmlDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Dumper/PlantUmlDumper.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ public function dump(Definition $definition, Marking $marking = null, array $opt
103103
}
104104

105105
$lines = [
106-
"$fromEscaped -${transitionColor}-> ${transitionEscaped}${transitionLabel}",
107-
"$transitionEscaped -${transitionColor}-> ${toEscaped}${transitionLabel}",
106+
"{$fromEscaped} -{$transitionColor}-> {$transitionEscaped}{$transitionLabel}",
107+
"{$transitionEscaped} -{$transitionColor}-> {$toEscaped}{$transitionLabel}",
108108
];
109109
foreach ($lines as $line) {
110110
if (!\in_array($line, $code)) {
111111
$code[] = $line;
112112
}
113113
}
114114
} else {
115-
$code[] = "$fromEscaped -${transitionColor}-> $toEscaped: $transitionEscapedWithStyle";
115+
$code[] = "{$fromEscaped} -{$transitionColor}-> {$toEscaped}: {$transitionEscapedWithStyle}";
116116
}
117117
}
118118
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.