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 90326e6

Browse filesBrowse files
committed
Merge branch '4.2'
* 4.2: Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)" [Workflow] Fixed dumping when many transition with same name exist relax assertions in tests fix ConsoleFormatter - call to a member function format() on string Made `debug:container` and `debug:autowiring` ignore starting backslash in service id [Validator] Translate messages into Japanese Fix Thai translation in validators.th.xlf [FramworkBundle] mark any env vars found in the ide setting as used
2 parents 2eda6ff + ecdfa80 commit 90326e6
Copy full SHA for 90326e6

File tree

Expand file treeCollapse file tree

13 files changed

+185
-77
lines changed
Filter options
Expand file treeCollapse file tree

13 files changed

+185
-77
lines changed

‎src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ public function format(array $record)
115115
}
116116

117117
$formatted = strtr($this->options['format'], [
118-
'%datetime%' => $record['datetime']->format($this->options['date_format']),
118+
'%datetime%' => $record['datetime'] instanceof \DateTimeInterface
119+
? $record['datetime']->format($this->options['date_format'])
120+
: $record['datetime'],
119121
'%start_tag%' => sprintf('<%s>', $levelColor),
120122
'%level_name%' => sprintf($this->options['level_name_format'], $record['level_name']),
121123
'%end_tag%' => '</>',
+66Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\Monolog\Tests\Formatter;
13+
14+
use Monolog\Logger;
15+
use PHPUnit\Framework\TestCase;
16+
use Symfony\Bridge\Monolog\Formatter\ConsoleFormatter;
17+
18+
class ConsoleFormatterTest extends TestCase
19+
{
20+
/**
21+
* @dataProvider providerFormatTests
22+
*/
23+
public function testFormat(array $record, $expectedMessage)
24+
{
25+
$formatter = new ConsoleFormatter();
26+
self::assertSame($expectedMessage, $formatter->format($record));
27+
}
28+
29+
/**
30+
* @return array
31+
*/
32+
public function providerFormatTests()
33+
{
34+
$currentDateTime = new \DateTime();
35+
36+
return [
37+
'record with DateTime object in datetime field' => [
38+
'record' => [
39+
'message' => 'test',
40+
'context' => [],
41+
'level' => Logger::WARNING,
42+
'level_name' => Logger::getLevelName(Logger::WARNING),
43+
'channel' => 'test',
44+
'datetime' => $currentDateTime,
45+
'extra' => [],
46+
],
47+
'expectedMessage' => sprintf(
48+
"%s <fg=cyan>WARNING </> <comment>[test]</> test\n",
49+
$currentDateTime->format(ConsoleFormatter::SIMPLE_DATE)
50+
),
51+
],
52+
'record with string in datetime field' => [
53+
'record' => [
54+
'message' => 'test',
55+
'context' => [],
56+
'level' => Logger::WARNING,
57+
'level_name' => Logger::getLevelName(Logger::WARNING),
58+
'channel' => 'test',
59+
'datetime' => '2019-01-01T00:42:00+00:00',
60+
'extra' => [],
61+
],
62+
'expectedMessage' => "2019-01-01T00:42:00+00:00 <fg=cyan>WARNING </> <comment>[test]</> test\n",
63+
],
64+
];
65+
}
66+
}

‎src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,8 +2551,13 @@ public function testTimezone()
25512551
[@name="name"]
25522552
[@class="my&class form-control"]
25532553
[not(@required)]
2554+
<<<<<<< HEAD
25542555
[./option[@value="Europe/Vienna"][@selected="selected"][.="Europe / Vienna"]]
25552556
[count(./option)>200]
2557+
=======
2558+
[.//option[@value="Europe/Vienna"][@selected="selected"]]
2559+
[count(.//option)>200]
2560+
>>>>>>> 4.2
25562561
'
25572562
);
25582563
}
@@ -2568,7 +2573,11 @@ public function testTimezoneWithPlaceholder()
25682573
'/select
25692574
[@class="my&class form-control"]
25702575
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans]Select&Timezone[/trans]"]]
2576+
<<<<<<< HEAD
25712577
[count(./option)>201]
2578+
=======
2579+
[count(.//option)>201]
2580+
>>>>>>> 4.2
25722581
'
25732582
);
25742583
}

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ protected function getContainerBuilder()
237237

238238
private function findProperServiceName(InputInterface $input, SymfonyStyle $io, ContainerBuilder $builder, string $name, bool $showHidden)
239239
{
240+
$name = ltrim($name, '\\');
241+
240242
if ($builder->has($name) || !$input->isInteractive()) {
241243
return $name;
242244
}

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ public function load(array $configs, ContainerBuilder $container)
208208
'vscode' => 'vscode://file/%%f:%%l',
209209
];
210210
$ide = $config['ide'];
211+
// mark any env vars found in the ide setting as used
212+
$container->resolveEnvPlaceholders($ide);
211213

212214
$container->setParameter('templating.helper.code.file_link_format', str_replace('%', '%%', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) ?: (isset($links[$ide]) ? $links[$ide] : $ide));
213215
}

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<argument type="service" id="session.storage" />
1616
<argument type="service" id="session.attribute_bag" />
1717
<argument type="service" id="session.flash_bag" />
18-
<tag name="kernel.reset" method="save" />
1918
</service>
2019

2120
<service id="Symfony\Component\HttpFoundation\Session\SessionInterface" alias="session" />

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public function provideIgnoreBackslashWhenFindingService()
154154
return [
155155
[BackslashClass::class],
156156
['FixturesBackslashClass'],
157+
['\\'.BackslashClass::class],
157158
];
158159
}
159160
}

‎src/Symfony/Component/HttpFoundation/Session/Session.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Session.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ public function migrate($destroy = false, $lifetime = null)
193193
*/
194194
public function save()
195195
{
196-
if ($this->isStarted()) {
197-
$this->storage->save();
198-
}
196+
$this->storage->save();
199197
}
200198

201199
/**

‎src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/SessionTest.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,4 @@ public function testIsEmpty()
260260
$flash->get('hello');
261261
$this->assertTrue($this->session->isEmpty());
262262
}
263-
264-
public function testSaveIfNotStarted()
265-
{
266-
$storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface')->getMock();
267-
$session = new Session($storage);
268-
269-
$storage->expects($this->once())->method('isStarted')->willReturn(false);
270-
$storage->expects($this->never())->method('save');
271-
$session->save();
272-
}
273263
}

‎src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,38 @@
330330
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
331331
<target>このSWIFTコードはIBANコード({{ iban }})に関連付けられていません。</target>
332332
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>JSONでなければなりません。</target>
336+
</trans-unit>
337+
<trans-unit id="87">
338+
<source>This collection should contain only unique elements.</source>
339+
<target>要素は重複してはなりません。</target>
340+
</trans-unit>
341+
<trans-unit id="88">
342+
<source>This value should be positive.</source>
343+
<target>正の数でなければなりません。</target>
344+
</trans-unit>
345+
<trans-unit id="89">
346+
<source>This value should be either positive or zero.</source>
347+
<target>正の数、または0でなければなりません。</target>
348+
</trans-unit>
349+
<trans-unit id="90">
350+
<source>This value should be negative.</source>
351+
<target>負の数でなければなりません。</target>
352+
</trans-unit>
353+
<trans-unit id="91">
354+
<source>This value should be either negative or zero.</source>
355+
<target>負の数、または0でなければなりません。</target>
356+
</trans-unit>
357+
<trans-unit id="92">
358+
<source>This value is not a valid timezone.</source>
359+
<target>有効なタイムゾーンではありません。</target>
360+
</trans-unit>
361+
<trans-unit id="93">
362+
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
363+
<target>このパスワードは漏洩している為使用できません。</target>
364+
</trans-unit>
333365
</body>
334366
</file>
335367
</xliff>

‎src/Symfony/Component/Validator/Resources/translations/validators.th.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.th.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
</trans-unit>
153153
<trans-unit id="41">
154154
<source>This value is already used.</source>
155-
<target>Tค่านี้ถูกใช้งานไปแล้ว</target>
155+
<target>ค่านี้ถูกใช้งานไปแล้ว</target>
156156
</trans-unit>
157157
<trans-unit id="42">
158158
<source>The size of the image could not be detected.</source>

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Workflow/Dumper/GraphvizDumper.php
+16-9Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ protected function addTransitions(array $transitions)
149149
{
150150
$code = '';
151151

152-
foreach ($transitions as $place) {
153-
$code .= sprintf(" transition_%s [label=\"%s\",%s];\n", $this->dotize($place['name']), $this->escape($place['name']), $this->addAttributes($place['attributes']));
152+
foreach ($transitions as $i => $place) {
153+
$code .= sprintf(" transition_%s [label=\"%s\",%s];\n", $this->dotize($i), $this->escape($place['name']), $this->addAttributes($place['attributes']));
154154
}
155155

156156
return $code;
@@ -165,21 +165,23 @@ protected function findEdges(Definition $definition)
165165

166166
$dotEdges = [];
167167

168-
foreach ($definition->getTransitions() as $transition) {
168+
foreach ($definition->getTransitions() as $i => $transition) {
169169
$transitionName = $workflowMetadata->getMetadata('label', $transition) ?? $transition->getName();
170170

171171
foreach ($transition->getFroms() as $from) {
172172
$dotEdges[] = [
173173
'from' => $from,
174174
'to' => $transitionName,
175175
'direction' => 'from',
176+
'transition_number' => $i,
176177
];
177178
}
178179
foreach ($transition->getTos() as $to) {
179180
$dotEdges[] = [
180181
'from' => $transitionName,
181182
'to' => $to,
182183
'direction' => 'to',
184+
'transition_number' => $i,
183185
];
184186
}
185187
}
@@ -195,12 +197,17 @@ protected function addEdges(array $edges)
195197
$code = '';
196198

197199
foreach ($edges as $edge) {
198-
$code .= sprintf(" %s_%s -> %s_%s [style=\"solid\"];\n",
199-
'from' === $edge['direction'] ? 'place' : 'transition',
200-
$this->dotize($edge['from']),
201-
'from' === $edge['direction'] ? 'transition' : 'place',
202-
$this->dotize($edge['to'])
203-
);
200+
if ('from' === $edge['direction']) {
201+
$code .= sprintf(" place_%s -> transition_%s [style=\"solid\"];\n",
202+
$this->dotize($edge['from']),
203+
$this->dotize($edge['transition_number'])
204+
);
205+
} else {
206+
$code .= sprintf(" transition_%s -> place_%s [style=\"solid\"];\n",
207+
$this->dotize($edge['transition_number']),
208+
$this->dotize($edge['to'])
209+
);
210+
}
204211
}
205212

206213
return $code;

0 commit comments

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