10000 Merge branch '5.3' into 5.4 · symfony/symfony@5bb0ebe · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bb0ebe

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: (24 commits) [TwigBundle] fix auto-enabling assets/expression/routing/yaml/workflow extensions [PhpUnitBridge] fix symlink to bridge in docker by making its path relative [Dotenv] Duplicate $_SERVER values in $_ENV if they don't exist Add polish translations (#43725) [String] Add PLURAL_MAP "zombies" -- fix #43789 [Validator] Update validators.bs.xlf [Messenger] Fix `TraceableMessageBus` implementation so it can compute caller even when used within a callback [Validator] Add the missing translations for Russian (ru) [Validator] Added missing translations for Latvian (lv) [Validator] Added missing translations [Validator] Add missing translations for Vietnamese (VI) Add missing translations for Lithuanian (lt) [Validator] Add missing translations for Italian (it) #43722 Add missing translations for Ukrainian Add missing translations for Bulgarian Add missing translations for Dutch (nl) Update validators.es.xlf update zh_TW translation [Validator] Added Danish translations added missing translations for Serbian Latin (sr_Latn) #43734 ...
2 parents 4a73f51 + d7b529d commit 5bb0ebe

28 files changed

+200
-13
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

Lines changed: 5 additions & 1 deletion
F438
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
}
123123

124124
$oldPwd = getcwd();
125-
$PHPUNIT_DIR = $getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit');
125+
$PHPUNIT_DIR = rtrim($getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit'), '/'.\DIRECTORY_SEPARATOR);
126126
$PHP = defined('PHP_BINARY') ? \PHP_BINARY : 'php';
127127
$PHP = escapeshellarg($PHP);
128128
if ('phpdbg' === \PHP_SAPI) {
@@ -239,6 +239,10 @@
239239
$passthruOrFail("$COMPOSER config --unset platform.php");
240240
}
241241
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
242+
$p = str_repeat('../', substr_count("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR", '/', strlen($root))).'vendor/symfony/phpunit-bridge';
243+
if (realpath($p) === realpath($path)) {
244+
$path = $p;
245+
}
242246
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
243247
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', \DIRECTORY_SEPARATOR, $path)));
244248
if ('\\' === \DIRECTORY_SEPARATOR) {

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ class ExtensionPass implements CompilerPassInterface
2727
{
2828
public function process(ContainerBuilder $container)
2929
{
30-
if (!$container::willBeAvailable('symfony/asset', Packages::class, ['symfony/twig-bundle'], true)) {
30+
if (!class_exists(Packages::class)) {
3131
$container->removeDefinition('twig.extension.assets');
3232
}
3333

34-
if (!$container::willBeAvailable('symfony/expression-language', Expression::class, ['symfony/twig-bundle'], true)) {
34+
if (!class_exists(Expression::class)) {
3535
$container->removeDefinition('twig.extension.expression');
3636
}
3737

38-
if (!$container::willBeAvailable('symfony/routing', UrlGeneratorInterface::class, ['symfony/twig-bundle'], true)) {
38+
if (!interface_exists(UrlGeneratorInterface::class)) {
3939
$container->removeDefinition('twig.extension.routing');
4040
}
4141

42-
if (!$container::willBeAvailable('symfony/yaml', Yaml::class, ['symfony/twig-bundle'], true)) {
42+
if (!class_exists(Yaml::class)) {
4343
$container->removeDefinition('twig.extension.yaml');
4444
}
4545

@@ -115,7 +115,7 @@ public function process(ContainerBuilder $container)
115115
$container->getDefinition('twig.extension.expression')->addTag('twig.extension');
116116
}
117117

118-
if (!$container::willBeAvailable('symfony/workflow', Workflow::class, ['symfony/twig-bundle'], true) || !$container->has('workflow.registry')) {
118+
if (!class_exists(Workflow::class) || !$container->has('workflow.registry')) {
119119
$container->removeDefinition('workflow.twig_extension');
120120
} else {
121121
$container->getDefinition('workflow.twig_extension')->addTag('twig.extension');

src/Symfony/Component/Dotenv/Dotenv.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,12 @@ public function populate(array $values, bool $overrideExistingVars = false): voi
191191

192192
foreach ($values as $name => $value) {
193193
$notHttpName = 0 !== strpos($name, 'HTTP_');
194+
if (isset($_SERVER[$name]) && $notHttpName && !isset($_ENV[$name])) {
195+
$_ENV[$name] = $_SERVER[$name];
196+
}
197+
194198
// don't check existence with getenv() because of thread safety issues
195-
if (!isset($loadedVars[$name]) && (!$overrideExistingVars && (isset($_ENV[$name]) || (isset($_SERVER[$name]) && $notHttpName)))) {
199+
if (!isset($loadedVars[$name]) && !$overrideExistingVars && isset($_ENV[$name])) {
196200
continue;
197201
}
198202

src/Symfony/Component/Dotenv/Tests/DotenvTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,16 @@ public function testDoNotUsePutenv()
539539
$this->assertFalse(getenv('TEST_USE_PUTENV'));
540540
}
541541

542+
public function testSERVERVarsDuplicationInENV()
543+
{
544+
unset($_ENV['SYMFONY_DOTENV_VARS'], $_SERVER['SYMFONY_DOTENV_VARS'], $_ENV['FOO']);
545+
$_SERVER['FOO'] = 'CCC';
546+
547+
(new Dotenv(false))->populate(['FOO' => 'BAR']);
548+
549+
$this->assertSame('CCC', $_ENV['FOO']);
550+
}
551+
542552
public function testBootEnv()
543553
{
544554
$resetContext = static function (): void {

src/Symfony/Component/Form/Resources/translations/validators.bs.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</trans-unit>
1717
<trans-unit id="99">
1818
<source>This value is not a valid HTML5 color.</source>
19-
<target>Ova vrijednost nije ispravna HTML5 boja.</target>
19+
<target>Ova vrijednost nije važeća HTML5 boja.</target>
2020
</trans-unit>
2121
<trans-unit id="100">
2222
<source>Please enter a valid birthdate.</source>

src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,22 @@ public function testItTracesExceptions()
156156
],
157157
], $actualTracedMessage);
158158
}
159+
160+
public function testItTracesExceptionsWhenMessageBusIsFiredFromArrayCallback()
161+
{
162+
$message = new DummyMessage('Hello');
163+
$exception = new \RuntimeException();
164+
165+
$bus = $this->createMock(MessageBusInterface::class);
166+
$bus->expects($this->once())
167+
->method('dispatch')
168+
->with($message)
169+
->willThrowException($exception);
170+
171+
$traceableBus = new TraceableMessageBus($bus);
172+
173+
$this->expectExceptionObject($exception);
174+
175+
array_map([$traceableBus, 'dispatch'], [$message]);
176+
}
159177
}

src/Symfony/Component/Messenger/TraceableMessageBus.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ private function getCaller(): array
6262
{
6363
$trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 8);
6464

65-
$file = $trace[1]['file'];
66-
$line = $trace[1]['line'];
65+
$file = $trace[1]['file'] ?? null;
66+
$line = $trace[1]['line'] ?? null;
6767

6868
$handleTraitFile = (new \ReflectionClass(HandleTrait::class))->getFileName();
6969
$found = false;
@@ -97,9 +97,12 @@ private function getCaller(): array
9797
}
9898
}
9999

100-
$name = str_replace('\\', '/', $file);
101-
$name = substr($name, strrpos($name, '/') + 1);
100+
$name = str_replace('\\', '/', (string) $file);
102101

103-
return compact('name', 'file', 'line');
102+
return [
103+
'name' => substr($name, strrpos($name, '/') + 1),
104+
'file' => $file,
105+
'line' => $line,
106+
];
104107
}
105108
}

src/Symfony/Component/String/Inflector/EnglishInflector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ final class EnglishInflector implements InflectorInterface
5858
// selfies (selfie)
5959
['seifles', 7, true, true, 'selfie'],
6060

61+
// zombies (zombie)
62+
['seibmoz', 7, true, true, 'zombie'],
63+
6164
// movies (movie)
6265
['seivom', 6, true, true, 'movie'],
6366

src/Symfony/Component/String/Tests/Inflector/EnglishInflectorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function singularizeProvider()
152152
['trees', 'tree'],
153153
['waltzes', ['waltz', 'waltze']],
154154
['wives', 'wife'],
155+
['zombies', 'zombie'],
155156

156157
// test casing: if the first letter was uppercase, it should remain so
157158
['Men', 'Man'],

src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@
394394
<source>This value is not a valid CSS color.</source>
395395
<target>هذه القيمة ليست لون CSS صالحًا.</target>
396396
</trans-unit>
397+
<trans-unit id="102">
398+
<source>This value is not a valid CIDR notation.</source>
399+
<target>هذه القيمة ليست تدوين CIDR صالحًا.</target>
400+
</trans-unit>
401+
<trans-unit id="103">
402+
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403+
<target>يجب أن تكون قيمة netmask بين {{ min }} و {{ max }}.</target>
404+
</trans-unit>
397405
</body>
398406
</file>
399407
</xliff>

0 commit comments

Comments
 (0)
0