8000 Merge branch '4.4' into 5.1 · symfony/symfony@aae9211 · GitHub
[go: up one dir, main page]

Skip to content

Commit aae9211

Browse files
Merge branch '4.4' into 5.1
* 4.4: [Process] Dont test TTY if there is no TTY support Fixing some Mongolian translating the validators for european portuguese language Fix CI Update validators.he.xlf Update security.he.xlf Update validators.he.xlf Improve performances in CircualReference detection [PHPUnitBridge] Fixed crash on Windows with PHP 8 Fix session called initized several time
2 parents 8d964bd + 5831ab2 commit aae9211

File tree

13 files changed

+405
-90
lines changed

13 files changed

+405
-90
lines changed

.appveyor.yml

+1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ install:
4848
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex
4949
- git config --global user.email ""
5050
- git config --global user.name "Symfony"
51-
- FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep branch-version composer.json | grep -o '[0-9.]*'"`) DO (SET SYMFONY_VERSION=%%F)
51+
- FOR /F "tokens=* USEBACKQ" %%F IN (`bash -c "grep branch-version composer.json | grep -o '[0-9.x]*'"`) DO (SET SYMFONY_VERSION=%%F)
5252
- php .github/build-packages.php "HEAD^" %SYMFONY_VERSION% src\Symfony\Bridge\PhpUnit src\Symfony\Contracts
5353
- SET "SYMFONY_REQUIRE=>=%SYMFONY_VERSION%"
5454
- SET COMPOSER_ROOT_VERSION=%SYMFONY_VERSION%.x-dev

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
run: |
109109
COMPOSER_HOME="$(composer config home)"
110110
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
111-
echo "COMPOSER_ROOT_VERSION=$(grep branch-version composer.json | grep -o '[0-9.]*').x-dev" >> $GITHUB_ENV
111+
echo "COMPOSER_ROOT_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
112112
113113
- name: Determine composer cache directory
114114
id: composer-cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ install:
199199
git config --global user.email ""
200200
git config --global user.name "Symfony"
201201
202-
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.]*')
202+
export SYMFONY_VERSION=$(grep branch-version composer.json | grep -o '[0-9.x]*')
203203
204204
if [[ ! $deps ]]; then
205205
php .github/build-packages.php HEAD^ $SYMFONY_VERSION src/Symfony/Bridge/PhpUnit src/Symfony/Contracts

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
}
233233
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
234234
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
235-
$q = '\\' === \DIRECTORY_SEPARATOR ? '"' : '';
235+
$q = '\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 80000 ? '"' : '';
236236
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
237237
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
238238
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 71 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,7 @@ public function dump(array $options = [])
185185
}
186186
}
187187

188-
(new AnalyzeServiceReferencesPass(false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container);
189-
$checkedNodes = [];
190-
$this->circularReferences = [];
191-
$this->singleUsePrivateIds = [];
192-
foreach ($this->container->getCompiler()->getServiceReferenceGraph()->getNodes() as $id => $node) {
193-
if (!$node->getValue() instanceof Definition) {
194-
continue;
195-
}
196-
if (!isset($checkedNodes[$id])) {
197-
$this->analyzeCircularReferences($id, $node->getOutEdges(), $checkedNodes);
198-
}
199-
if ($this->isSingleUsePrivateNode($node)) {
200-
$this->singleUsePrivateIds[$id] = $id;
201-
}
202-
}
203-
$this->container->getCompiler()->getServiceReferenceGraph()->clear();
204-
$checkedNodes = [];
205-
$this->singleUsePrivateIds = array_diff_key($this->singleUsePrivateIds, $this->circularReferences);
206-
188+
$this->analyzeReferences();
207189
$this->docStar = $options['debug'] ? '*' : '';
208190

209191
if (!empty($options['file']) && is_dir($dir = \dirname($options['file']))) {
@@ -429,61 +411,92 @@ private function getProxyDumper(): ProxyDumper
429411
return $this->proxyDumper;
430412
}
431413

432-
/**
433-
* @param ServiceReferenceGraphEdge[] $edges
434-
*/
435-
private function analyzeCircularReferences(string $sourceId, array $edges, array &$checkedNodes, array &$currentPath = [], bool $byConstructor = true)
414+
private function analyzeReferences()
436415
{
437-
$checkedNodes[$sourceId] = true;
438-
$currentPath[$sourceId] = $byConstructor;
416+
(new AnalyzeServiceReferencesPass(false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container);
417+
$checkedNodes = [];
418+
$this->circularReferences = [];
419+
$this->singleUsePrivateIds = [];
420+
foreach ($this->container->getCompiler()->getServiceReferenceGraph()->getNodes() as $id => $node) {
421+
if (!$node->getValue() instanceof Definition) {
422+
continue;
423+
}
439424

440-
foreach ($edges as $edge) {
441-
$node = $edge->getDestNode();
442-
$id = $node->getId();
425+
if ($this->isSingleUsePrivateNode($node)) {
426+
$this->singleUsePrivateIds[$id] = $id;
427+
}
443428

444-
if (!$node->getValue() instanceof Definition || $sourceId === $id || $edge->isLazy() || $edge->isWeak()) {
445-
// no-op
446-
} elseif (isset($currentPath[$id])) {
447-
$this->addCircularReferences($id, $currentPath, $edge->isReferencedByConstructor());
448-
} elseif (!isset($checkedNodes[$id])) {
449-
$this->analyzeCircularReferences($id, $node->getOutEdges(), $checkedNodes, $currentPath, $edge->isReferencedByConstructor());
450-
} elseif (isset($this->circularReferences[$id])) {
451-
$this->connectCircularReferences($id, $currentPath, $edge->isReferencedByConstructor());
429+
$newNodes = [];
430+
if (!$this->collectCircularReferences($id, $node->getOutEdges(), $checkedNodes, $newNodes)) {
431+
foreach ($newNodes as $newNodeId => $_) {
432+
$checkedNodes[$newNodeId] = [];
433+
}
434+
continue;
452435
}
453-
}
454-
unset($currentPath[$sourceId]);
455-
}
456436

457-
private function connectCircularReferences(string $sourceId, array &$currentPath, bool $byConstructor, array &$subPath = [])
458-
{
459-
$currentPath[$sourceId] = $subPath[$sourceId] = $byConstructor;
437+
$nodesToFlatten = $newNodes;
438+
do {
439+
$changedNodes = [];
440+
foreach ($nodesToFlatten as $newNodeId => $_) {
441+
$deps = &$checkedNodes[$newNodeId];
442+
foreach ($deps as $id => [$path, $depsByConstructor]) {
443+
foreach ($checkedNodes[$id] as $depsId => [$subPath, $subDepsByConstructor]) {
444+
if (!isset($deps[$depsId]) || ($depsByConstructor && $subDepsByConstructor && !$deps[$depsId][1])) {
445+
array_unshift($subPath, $id);
446+
$deps[$depsId] = [$subPath, $depsByConstructor && $subDepsByConstructor];
447+
$changedNodes += $newNodes[$newNodeId] ?? [];
448+
}
449+
}
450+
}
451+
}
452+
} while ($nodesToFlatten = $changedNodes);
460453

461-
foreach ($this->circularReferences[$sourceId] as $id => $byConstructor) {
462-
if (isset($currentPath[$id])) {
463-
$this->addCircularReferences($id, $currentPath, $byConstructor);
464-
} elseif (!isset($subPath[$id]) && isset($this->circularReferences[$id])) {
465-
$this->connectCircularReferences($id, $currentPath, $byConstructor, $subPath);
454+
foreach ($newNodes as $newNodeId => $_) {
455+
if (null !== $n = $checkedNodes[$newNodeId][$newNodeId] ?? null) {
456+
$this->addCircularReferences($newNodeId, $n[0], $n[1]);
457+
}
466458
}
467459
}
468-
unset($currentPath[$sourceId], $subPath[$sourceId]);
460+
461+
$this->container->getCompiler()->getServiceReferenceGraph()->clear();
462+
$this->singleUsePrivateIds = array_diff_key($this->singleUsePrivateIds, $this->circularReferences);
469463
}
470464

471-
private function addCircularReferences(string $id, array $curr 179B entPath, bool $byConstructor)
465+
private function collectCircularReferences(string $sourceId, array $edges, array &$checkedNodes, array &$newNodes, array $path = []): bool
472466
{
473-
$currentPath[$id] = $byConstructor;
474-
$circularRefs = [];
467+
$path[$sourceId] = true;
468+
$checkedNodes[$sourceId] = [];
469+
$newNodes[$sourceId] = [];
470+
$circular = false;
471+
foreach ($edges as $edge) {
472+
$node = $edge->getDestNode();
473+
$id = $node->getId();
474+
if (!$node->getValue() instanceof Definition || $sourceId === $id || $edge->isLazy() || $edge->isWeak()) {
475+
continue;
476+
}
475477

476-
foreach (array_reverse($currentPath) as $parentId => $v) {
477-
$byConstructor = $byConstructor && $v;
478-
$circularRefs[] = $parentId;
478+
if (isset($path[$id])) {
479+
$circular = true;
480+
} elseif (!isset($checkedNodes[$id])) {
481+
$circular = $this->collectCircularReferences($id, $node->getOutEdges(), $checkedNodes, $newNodes, $path) || $circular;
482+
}
479483

480-
if ($parentId === $id) {
481-
break;
484+
$checkedNodes[$sourceId][$id] = [[], $edge->isReferencedByConstructor()];
485+
if (isset($newNodes[$id])) {
486+
$newNodes[$id][$sourceId] = true;
482487
}
483488
}
489+
unset($path[$sourceId]);
484490

485-
$currentId = $id;
486-
foreach ($circularRefs as $parentId) {
491+
return $circular;
492+
}
493+
494+
private function addCircularReferences(string $sourceId, array $currentPath, bool $byConstructor)
495+
{
496+
$currentId = $sourceId;
497+
$currentPath = array_reverse($currentPath);
498+
$currentPath[] = $currentId;
499+
foreach ($currentPath as $parentId) {
487500
if (empty($this->circularReferences[$parentId][$currentId])) {
488501
$this->circularReferences[$parentId][$currentId] = $byConstructor;
489502
}

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

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,126 @@
1414
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
1515
<target>אסימון CSRF אינו חוקי. אנא נסה לשלוח שוב את הטופס.</target>
1616
</trans-unit>
17+
<trans-unit id="99">
18+
<source>This value is not a valid HTML5 color.</source>
19+
<target>ערך זה אינו צבע HTML5 חוקי.</target>
20+
</trans-unit>
21+
<trans-unit id="100">
22+
<source>Please enter a valid birthdate.</source>
23+
<target>נא להזין את תאריך לידה תקני.</target>
24+
</trans-unit>
25+
<trans-unit id="101">
26+
<source>The selected choice is invalid.</source>
27+
<target>הבחירה שנבחרה אינה חוקית.</target>
28+
</trans-unit>
29+
<trans-unit id="102">
30+
<source>The collection is invalid.</source>
31+
<target>האוסף אינו חוקי.</target>
32+
</trans-unit>
33+
<trans-unit id="103">
34+
<source>Please select a valid color.</source>
35+
<target>אנא בחר צבע חוקי.</target>
36+
</trans-unit>
37+
<trans-unit id="104">
38+
<source>Please select a valid country.</source>
39+
<target>אנא בחר מדינה חוקית.</target>
40+
</trans-unit>
41+
<trans-unit id="105">
42+
<source>Please select a valid currency.</source>
43+
<target>אנא בחר מטבע חוקי.</target>
44+
</trans-unit>
45+
<trans-unit id="106">
46+
<source>Please choose a valid date interval.</source>
47+
<target>אנא בחר מרווח תאריכים חוקי.</target>
48+
</trans-unit>
49+
<trans-unit id="107">
50+
<source>Please enter a valid date and time.</source>
51+
<target>אנא הזן תאריך ושעה תקנים.</target>
52+
</trans-unit>
53+
<trans-unit id="108">
54+
<source>Please enter a valid date.</source>
55+
<target>נא להזין תאריך חוקי.</target>
56+
</trans-unit>
57+
<trans-unit id="109">
58+
<source>Please select a valid file.</source>
59+
<target>אנא בחר קובץ חוקי.</target>
60+
</trans-unit>
61+
<trans-unit id="110">
62+
<source>The hidden field is invalid.</source>
63+
<target>השדה הנסתר אינו חוקי.</target>
64+
</trans-unit>
65+
<trans-unit id="111">
66+
<source>Please enter an integer.</source>
67+
<target>אנא הזן מספר שלם.</target>
68+
</trans-unit>
69+
<trans-unit id="112">
70+
<source>Please select a valid language.</source>
71+
<target>אנא בחר שפה חוקי.</target>
72+
</trans-unit>
73+
<trans-unit id="113">
74+
<source>Please select a valid locale.</source>
75+
<target>אנא בחר שפה מקומית.</target>
76+
</trans-unit>
77+
<trans-unit id="114">
78+
<source>Please enter a valid money amount.</source>
79+
<target>אנא הזן סכום כסף חוקי.</target>
80+
</trans-unit>
81+
<trans-unit id="115">
82+
<source>Please enter a number.</source>
83+
<target>אנא הזן מספר.</target>
84+
</trans-unit>
85+
<trans-unit id="116">
86+
<source>The password is invalid.</source>
87+
<target>הסיסמה אינה חוקית.</target>
88+
</trans-unit>
89+
<trans-unit id="117">
90+
<source>Please enter a percentage value.</source>
91+
<target>אנא הזן ערך באחוזים.</target>
92+
</trans-unit>
93+
<trans-unit id="118">
94+
<source>The values do not match.</source>
95+
<target>הערכים אינם תואמים.</target>
96+
</trans-unit>
97+
<trans-unit id="119">
98+
<source>Please enter a valid time.</source>
99+
<target>אנא הזן שעה חוקי.</target>
100+
</trans-unit>
101+
<trans-unit id="120">
102+
<source>Please select a valid timezone.</source>
103+
<target>אנא בחר אזור זמן חוקי.</target>
104+
</trans-unit>
105+
<trans-unit id="121">
106+
<source>Please enter a valid URL.</source>
107+
<target>נא להזין את כתובת אתר חוקית.</target>
108+
</trans-unit>
109+
<trans-unit id="122">
110+
<source>Please enter a valid search term.</source>
111+
<target>אנא הזן מונח חיפוש חוקי.</target>
112+
</trans-unit>
113+
<trans-unit id="123">
114+
<source>Please provide a valid phone number.</source>
115+
<target>אנא ספק מספר טלפון חוקי.</target>
116+
</trans-unit>
117+
<trans-unit id="124">
118+
<source>The checkbox has an invalid value.</source>
119+
<target>לתיבת הסימון יש ערך לא חוקי.</target>
120+
</trans-unit>
121+
<trans-unit id="125">
122+
<source>Please enter a valid email address.</source>
123+
<target>אנא הזן כתובת דוא"ל תקנית.</target>
124+
</trans-unit>
125+
<trans-unit id="126">
126+
<source>Please select a valid option.</source>
127+
<target>אנא בחר אפשרות חוקית.</target>
128+
</trans-unit>
129+
<trans-unit id="127">
130+
<source>Please select a valid range.</source>
131+
<target>אנא בחר טווח חוקי.</target>
132+
</trans-unit>
133+
<trans-unit id="128">
134+
<source>Please enter a valid week.</source>
135+
<target>אנא הזן שבוע תקף.</target>
136+
</trans-unit>
17137
</body>
18138
</file>
19139
</xliff>

0 commit comments

Comments
 (0)
0