Skip to content

Commit 39b5b8f

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: [FrameworkBundle] Add missing `not-compromised-password` entry in XSD [AssetMapper] Fix CssCompiler matches url in comments Add support for doctrine/persistence 4 Ensure TransportExceptionInterface populates stream debug data Fix typo in validators.sk.xlf [Mime] Fix body validity check in `Email` when using `Message::setBody()` Review Arabic translations for the validator Fixed mistakes in proper hebrew writing in the previous translation and confirmed the rest to be correct and in the same style. Review translation [Cache] Don't clear system caches on cache:clear [FrameworkBundle] Fix patching refs to the tmp warmup dir in files generated by optional cache warmers Mark Czech Validator translation as reviewed [PropertyInfo] Fix `TypeTest` duplicated assert [HtmlSanitizer] Avoid accessing non existent array key when checking for hosts validity Update validators.ar.xlf [DomCrawler] Make `ChoiceFormField::isDisabled` return `true` for unchecked disabled checkboxes
2 parents 29e1ee8 + c5704e9 commit 39b5b8f

File tree

26 files changed

+230
-88
lines changed

26 files changed

+230
-88
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"composer/semver": "^3.0",
3939
"ext-xml": "*",
4040
"doctrine/event-manager": "^2",
41-
"doctrine/persistence": "^3.1",
41+
"doctrine/persistence": "^3.1|^4",
4242
"twig/twig": "^3.10",
4343
"psr/cache": "^2.0|^3.0",
4444
"psr/clock": "^1.0",

src/Symfony/Bridge/Doctrine/Tests/ArgumentResolver/EntityValueResolverTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,13 @@ private function createRegistry(?ObjectManager $manager = null): ManagerRegistry
487487
->method('getManagerForClass')
488488
->willReturn($manager);
489489

490-
$registry->expects($this->any())
491-
->method('getManager')
492-
->willReturn($manager);
490+
if (null === $manager) {
491+
$registry->method('getManager')
492+
->willThrowException(new \InvalidArgumentException());
493+
} else {
494+
$registry->method('getManager')->willReturn($manager);
495+
}
496+
493497

494498
return $registry;
495499
}

src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,16 @@ protected function setUp(): void
8484
protected function createRegistryMock($em = null)
8585
{
8686
$registry = $this->createMock(ManagerRegistry::class);
87-
$registry->expects($this->any())
88-
->method('getManager')
89-
->with($this->equalTo(self::EM_NAME))
90-
->willReturn($em);
87+
88+
if (null === $em) {
89+
$registry->method('getManager')
90+
->with($this->equalTo(self::EM_NAME))
91+
->willThrowException(new \InvalidArgumentException());
92+
} else {
93+
$registry->method('getManager')
94+
->with($this->equalTo(self::EM_NAME))
95+
->willReturn($em);
96+
}
9197

9298
return $registry;
9399
}

src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function validate(mixed $value, Constraint $constraint): void
6969
$entityClass = $constraint->entityClass ?? $value::class;
7070

7171
if ($constraint->em) {
72-
$em = $this->registry->getManager($constraint->em);
73-
74-
if (!$em) {
75-
throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em));
72+
try {
73+
$em = $this->registry->getManager($constraint->em);
74+
} catch (\InvalidArgumentException $e) {
75+
throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em), 0, $e);
7676
}
7777
} else {
7878
$em = $this->registry->getManagerForClass($entityClass);

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=8.2",
2020
"doctrine/event-manager": "^2",
21-
"doctrine/persistence": "^3.1",
21+
"doctrine/persistence": "^3.1|^4",
2222
"symfony/deprecation-contracts": "^2.5|^3",
2323
"symfony/polyfill-ctype": "~1.8",
2424
"symfony/polyfill-mbstring": "~1.0",

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
146146
}
147147
$this->warmupOptionals($useBuildDir ? $realCacheDir : $warmupDir, $warmupDir, $io);
148148
}
149+
150+
// fix references to cached files with the real cache directory name
151+
$search = [$warmupDir, str_replace('/', '\\/', $warmupDir), str_replace('\\', '\\\\', $warmupDir)];
152+
$replace = str_replace('\\', '/', $realBuildDir);
153+
foreach (Finder::create()->files()->in($warmupDir) as $file) {
154+
$content = str_replace($search, $replace, $this->filesystem->readFile($file), $count);
155+
if ($count) {
156+
file_put_contents($file, $content);
157+
}
158+
}
149159
}
150160

151161
if (!$fs->exists($warmupDir.'/'.$containerDir)) {
@@ -227,16 +237,6 @@ private function warmup(string $warmupDir, string $realBuildDir): void
227237
throw new \LogicException('Calling "cache:clear" with a kernel that does not implement "Symfony\Component\HttpKernel\RebootableInterface" is not supported.');
228238
}
229239
$kernel->reboot($warmupDir);
230-
231-
// fix references to cached files with the real cache directory name
232-
$search = [$warmupDir, str_replace('\\', '\\\\', $warmupDir)];
233-
$replace = str_replace('\\', '/', $realBuildDir);
234-
foreach (Finder::create()->files()->in($warmupDir) as $file) {
235-
$content = str_replace($search, $replace, $this->filesystem->readFile($file), $count);
236-
if ($count) {
237-
file_put_contents($file, $content);
238-
}
239-
}
240240
}
241241

242242
private function warmupOptionals(string $cacheDir, string $warmupDir, SymfonyStyle $io): void

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@
265265
<xsd:element name="static-method" type="xsd:string" />
266266
<xsd:element name="mapping" type="file_mapping" />
267267
<xsd:element name="auto-mapping" type="auto_mapping" />
268+
<xsd:element name="not-compromised-password" type="not-compromised-password" />
268269
</xsd:choice>
269270

270271
<xsd:attribute name="enabled" type="xsd:boolean" />
@@ -297,6 +298,11 @@
297298
</xsd:restriction>
298299
</xsd:simpleType>
299300

301+
<xsd:complexType name="not-compromised-password">
302+
<xsd:attribute name="enabled" type="xsd:boolean" />
303+
<xsd:attribute name="endpoint" type="xsd:string" />
304+
</xsd:complexType>
305+
300306
<xsd:complexType name="annotations">
301307
<xsd:attribute name="cache" type="xsd:string" />
302308
<xsd:attribute name="debug" type="xsd:string" />

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolsTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ private function doTestCachePools($options, $adapterClass)
8888
$pool2 = $container->get('cache.pool2');
8989
$pool2->save($item);
9090

91-
$container->get('cache_clearer.alias')->clear($container->getParameter('kernel.cache_dir'));
92-
$item = $pool1->getItem($key);
93-
$this->assertFalse($item->isHit());
94-
9591
$item = $pool2->getItem($key);
9692
$this->assertTrue($item->isHit());
9793

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,18 @@ public function testTagsPartialSearch()
139139
$tester->setInputs(['0']);
140140
$tester->run(['command' => 'debug:container', '--tag' => 'kernel.'], ['decorated' => false]);
141141

142-
$this->assertStringContainsString('Select one of the following tags to display its information', $tester->getDisplay());
143-
$this->assertStringContainsString('[0] kernel.cache_clearer', $tester->getDisplay());
144-
$this->assertStringContainsString('[1] kernel.cache_warmer', $tester->getDisplay());
145-
$this->assertStringContainsString('[2] kernel.event_subscriber', $tester->getDisplay());
146-
$this->assertStringContainsString('[3] kernel.fragment_renderer', $tester->getDisplay());
147-
$this->assertStringContainsString('[4] kernel.locale_aware', $tester->getDisplay());
148-
$this->assertStringContainsString('[5] kernel.reset', $tester->getDisplay());
149-
$this->assertStringContainsString('Symfony Container Services Tagged with "kernel.cache_clearer" Tag', $tester->getDisplay());
142+
$this->assertStringMatchesFormat(<<<EOTXT
143+
144+
Select one of the following tags to display its information:
145+
%A
146+
[%d] kernel.reset
147+
%A
148+
149+
Symfony Container Services Tagged with "kernel.%a" Tag
150+
%A
151+
EOTXT,
152+
$tester->getDisplay()
153+
);
150154
}
151155

152156
public function testDescribeEnvVars()
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
imports:
22
- { resource: ../config/default.yml }
3-
4-
services:
5-
cache_clearer.alias:
6-
alias: cache_clearer
7-
public: true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy