8000 Merge branch '7.1' into 7.2 · nicolas-grekas/symfony@e2f2a96 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2f2a96

Browse files
Merge branch '7.1' into 7.2
* 7.1: fix: ignore missing directory in isVendor() [OptionsResolver] Allow Union/Intersection Types in Resolved Closures Issue symfony#58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass(). Dynamically fix compatibility with doctrine/data-fixtures v2 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception don't call EntityManager::initializeObject() with scalar values make RelayProxyTrait compatible with relay extension 0.9.0 [Validator] review italian translations Update PR template
2 parents a8621e8 + 597e48c commit e2f2a96

File tree

19 files changed

+393
-83
lines changed

19 files changed

+393
-83
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 7.2 for features / 5.4, 6.4, and 7.1 for bug fixes <!-- see below -->
3+
| Branch? | 7.3 for features / 5.4, 6.4, 7.1, and 7.2 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
66
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function validate(mixed $value, Constraint $constraint): void
105105

106106
$criteria[$fieldName] = $fieldValue;
107107

108-
if (null !== $criteria[$fieldName] && $class->hasAssociation($fieldName)) {
108+
if (\is_object($criteria[$fieldName]) && $class->hasAssociation($fieldName)) {
109109
/* Ensure the Proxy is initialized before using reflection to
110110
* read its identifiers. This is necessary because the wrapped
111111
* getter methods in the Proxy are being bypassed.

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"symfony/validator": "^6.4|^7.0",
4545
"symfony/var-dumper": "^6.4|^7.0",
4646
"doctrine/collections": "^1.8|^2.0",
47-
"doctrine/data-fixtures": "^1.1",
47+
"doctrine/data-fixtures": "^1.1|^2",
4848
"doctrine/dbal": "^3.6|^4",
4949
"doctrine/orm": "^2.15|^3",
5050
"psr/log": "^1|^2|^3"

src/Symfony/Component/AssetMapper/Factory/MappedAssetFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@ private function isVendor(string $sourcePath): bool
129129
$sourcePath = realpath($sourcePath);
130130
$vendorDir = realpath($this->vendorDir);
131131

132-
return $sourcePath && str_starts_with($sourcePath, $vendorDir);
132+
return $sourcePath && $vendorDir && str_starts_with($sourcePath, $vendorDir);
133133
}
134134
}

src/Symfony/Component/AssetMapper/Tests/Factory/MappedAssetFactoryTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
class MappedAssetFactoryTest extends TestCase
2828
{
29+
private const DEFAULT_FIXTURES = __DIR__.'/../Fixtures/assets/vendor';
30+
2931
private AssetMapperInterface&MockObject $assetMapper;
3032

3133
public function testCreateMappedAsset()
@@ -137,7 +139,15 @@ public function testCreateMappedAssetInVendor()
137139
$this->assertTrue($asset->isVendor);
138140
}
139141

140-
private function createFactory(?AssetCompilerInterface $extraCompiler = null): MappedAssetFactory
142+
public function testCreateMappedAssetInMissingVendor()
143+
{
144+
$assetMapper = $this->createFactory(null, '/this-path-does-not-exist/');
145+
$asset = $assetMapper->createMappedAsset('lodash.js', __DIR__.'/../Fixtures/assets/vendor/lodash/lodash.index.js');
146+
$this->assertSame('lodash.js', $asset->logicalPath);
147+
$this->assertFalse($asset->isVendor);
148+
}
149+
150+
private function createFactory(?AssetCompilerInterface $extraCompiler = null, ?string $vendorDir = self::DEFAULT_FIXTURES): MappedAssetFactory
141151
{
142152
$compilers = [
143153
new JavaScriptImportPathCompiler($this->createMock(ImportMapConfigReader::class)),
@@ -162,7 +172,7 @@ private function createFactory(?AssetCompilerInterface $extraCompiler = null): M
162172
$factory = new MappedAssetFactory(
163173
$pathResolver,
164174
$compiler,
165-
__DIR__.'/../Fixtures/assets/vendor',
175+
$vendorDir,
166176
);
167177

168178
// mock the AssetMapper to behave like normal: by calling back to the factory
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.8.1', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait CopyTrait
19+
{
20+
public function copy($src, $dst, $options = null): \Relay\Relay|bool
21+
{
22+
return $this->initializeLazyObject()->copy(...\func_get_args());
23+
}
24+
}
25+
} else {
26+
/**
27+
* @internal
28+
*/
29+
trait CopyTrait
30+
{
31+
public function copy($src, $dst, $options = null): \Relay\Relay|false|int
32+
{
33+
return $this->initializeLazyObject()->copy(...\func_get_args());
34+
}
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.9.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait GeosearchTrait
19+
{
20+
public function geosearch($key, $position, $shape, $unit, $options = []): \Relay\Relay|array|false
21+
{
22+
return $this->initializeLazyObject()->geosearch(...\func_get_args());
23+
}
24+
}
25+
} else {
26+
/**
27+
* @internal
28+
*/
29+
trait GeosearchTrait
30+
{
31+
public function geosearch($key, $position, $shape, $unit, $options = []): \Relay\Relay|array
32+
{
33+
return $this->initializeLazyObject()->geosearch(...\func_get_args());
34+
}
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.9.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait GetrangeTrait
19+
{
20+
public function getrange($key, $start, $end): mixed
21+
{
22+
return $this->initializeLazyObject()->getrange(...\func_get_args());
23+
}
24+
}
25+
} else {
26+
/**
27+
* @internal
28+
*/
29+
trait GetrangeTrait
30+
{
31+
public function getrange($key, $start, $end): \Relay\Relay|false|string
32+
{
33+
return $this->initializeLazyObject()->getrange(...\func_get_args());
34+
}
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.9.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait HsetTrait
19+
{
20+
public function hset($key, ...$keys_and_vals): \Relay\Relay|false|int
21+
{
22+
return $this->initializeLazyObject()->hset(...\func_get_args());
23+
}
24+
}
25+
} else {
26+
/**
27+
* @internal
28+
*/
29+
trait HsetTrait
30+
{
31+
public function hset($key, $mem, $val, ...$kvals): \Relay\Relay|false|int
32+
{
33+
return $this->initializeLazyObject()->hset(...\func_get_args());
34+
}
35+
}
36+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.9.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait MoveTrait
19+
{
20+
public function blmove($srckey, $dstkey, $srcpos, $dstpos, $timeout): mixed
21+
{
22+
return $this->initializeLazyObject()->blmove(...\func_get_args());
23+
}
24+
25+
public function lmove($srckey, $dstkey, $srcpos, $dstpos): mixed
26+
{
27+
return $this->initializeLazyObject()->lmove(...\func_get_args());
28+
}
29+
}
30+
} else {
31+
/**
32+
* @internal
33+
*/
34+
trait MoveTrait
35+
{
36+
public function blmove($srckey, $dstkey, $srcpos, $dstpos, $timeout): \Relay\Relay|false|null|string
37+
{
38+
return $this->initializeLazyObject()->blmove(...\func_get_args());
39+
}
40+
41+
public function lmove($srckey, $dstkey, $srcpos, $dstpos): \Relay\Relay|false|null|string
42+
{
43+
return $this->initializeLazyObject()->lmove(...\func_get_args());
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)
0