8000 [FrameworkBundle] use service() in route condition · symfony/symfony@19682cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 19682cb

Browse files
committed
[FrameworkBundle] use service() in route condition
1 parent 78ad4b9 commit 19682cb

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" ?>
22

33
<container xmlns="http://symfony.com/schema/dic/services"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<parameters>
88
<parameter key="router.request_context.host">localhost</parameter>
@@ -79,6 +79,15 @@
7979
</argument>
8080
</service>
8181
</argument>
82+
<argument type="service" key="service">
83+
<service class="Closure">
84+
<factory class="Closure" method="fromCallable" />
85+
<argument type="collection">
86+
<argument type="service" id="service_container" />
87+
<argument>get</argument>
88+
</argument>
89+
</service>
90+
</argument>
8291
</argument>
8392
</argument>
8493
<call method="setConfigCacheFactory">
@@ -132,6 +141,7 @@
132141
<service id="Symfony\Component\Routing\Matcher\ExpressionLanguageProvider">
133142
<argument type="collection">
134143
<argument>env</argument>
144+
<argument>service</argument>
135145
</argument>
136146
<tag name="routing.expression_language_provider" />
137147
</service>

src/Symfony/Component/Routing/Tests/Matcher/ExpressionLanguageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ExpressionLanguageTest extends TestCase
2121
private $context;
2222
private $expressionLanguage;
2323

24-
public function setUp(): void
< 94B9 div aria-hidden="true" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__comment-indicator--eI0hb">
24+
protected function setUp(): void
2525
{
2626
$this->context = new RequestContext();
2727
$this->context->setParameter('_functions', [
@@ -71,7 +71,7 @@ public function testEvaluate(string $expression, $expected)
7171
$this->assertSame($expected, $this->expressionLanguage->evaluate($expression, ['context' => $this->context]));
7272
}
7373

74-
public function evaluateProvider(): array
74+
public function evaluateProvider(): iterable
7575
{
7676
return [
7777
['env("APP_ENV")', 'test'],

0 commit comments

Comments
 (0)
0