Skip to content

Commit f3ad655

Browse files
author
Jelle van Oosterbosch
committed
Merge branch '4.4' of https://github.com/symfony/symfony into set-store-in-lockable-trait
2 parents ab4c20a + dca9325 commit f3ad655

File tree

282 files changed

+1780
-698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+1780
-698
lines changed

.php_cs.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ return PhpCsFixer\Config::create()
1515
'ordered_imports' => true,
1616
'protected_to_private' => false,
1717
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
18-
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
18+
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
1919
// Part of future @Symfony ruleset in PHP-CS-Fixer To be removed from the config file once upgrading
2020
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
2121
])

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ install:
243243
tfold 'composer update' $COMPOSER_UP
244244
tfold 'phpunit install' ./phpunit install
245245
if [[ $deps = high ]]; then
246-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
246+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
247247
elif [[ $deps = low ]]; then
248248
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
249249
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
250250
php .github/rm-invalid-lowest-lock-files.php $COMPONENTS
251-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
251+
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
252252
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
253253
else
254254
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"

UPGRADE-4.4.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,27 @@ DependencyInjection
2424
my_service:
2525
factory: ['@factory_service', method]
2626
```
27+
* Deprecated `tagged` in favor of `tagged_iterator`
28+
29+
Before:
30+
```yaml
31+
services:
32+
App\Handler:
33+
tags: ['app.handler']
34+
35+
App\HandlerCollection:
36+
arguments: [!tagged app.handler]
37+
```
38+
39+
After:
40+
```yaml
41+
services:
42+
App\Handler:
43+
tags: ['app.handler']
44+
45+
App\HandlerCollection:
46+
arguments: [!tagged_iterator app.handler]
47+
```
2748

2849
HttpClient
2950
----------
@@ -64,3 +85,9 @@ TwigBridge
6485

6586
* Deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the
6687
`DebugCommand::__construct()` method, swap the variables position.
88+
89+
Validator
90+
---------
91+
92+
* Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`.
93+
Pass it as the first argument instead.

UPGRADE-5.0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,27 @@ DependencyInjection
8484
my_service:
8585
factory: ['@factory_service', method]
8686
```
87+
* Removed `tagged` in favor of `tagged_iterator`
88+
89+
Before:
90+
```yaml
91+
services:
92+
App\Handler:
93+
tags: ['app.handler']
94+
95+
App\HandlerCollection:
96+
arguments: [!tagged app.handler]
97+
```
98+
99+
After:
100+
```yaml
101+
services:
102+
App\Handler:
103+
tags: ['app.handler']
104+
105+
App\HandlerCollection:
106+
arguments: [!tagged_iterator app.handler]
107+
```
87108

88109
DoctrineBridge
89110
--------------
@@ -432,6 +453,7 @@ TwigBridge
432453
Validator
433454
--------
434455

456+
* An `ExpressionLanguage` instance or null must be passed as the first argument of `ExpressionValidator::__construct()`
435457
* The `checkMX` and `checkHost` options of the `Email` constraint were removed
436458
* The `Email::__construct()` 'strict' property has been removed. Use 'mode'=>"strict" instead.
437459
* Calling `EmailValidator::__construct()` method with a boolean parameter has been removed, use `EmailValidator("strict")` instead.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
"monolog/monolog": "~1.11",
112112
"nyholm/psr7": "^1.0",
113113
"ocramius/proxy-manager": "^2.1",
114+
"php-http/httplug": "^1.0|^2.0",
114115
"predis/predis": "~1.1",
115116
"psr/http-client": "^1.0",
116117
"psr/simple-cache": "^1.0",

src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function createTestConfiguration()
6161
$config = new Configuration();
6262
$config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']);
6363
$config->setAutoGenerateProxyClasses(true);
64-
$config->setProxyDir(\sys_get_temp_dir());
64+
$config->setProxyDir(sys_get_temp_dir());
6565
$config->setProxyNamespace('SymfonyTests\Doctrine');
6666
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader()));
6767
$config->setQueryCacheImpl(new ArrayCache());

src/Symfony/Bridge/Doctrine/Tests/Fixtures/DoctrineLoaderEmbed.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ class DoctrineLoaderEmbed
2222
* @ORM\Column(length=25)
2323
*/
2424
public $embeddedMaxLength;
25+
26+
/**
27+
* @ORM\Embedded(class=DoctrineLoaderNestedEmbed::class)
28+
*/
29+
public $nestedEmbedded;
2530
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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\Doctrine\Tests\Fixtures;
13+
14+
use Doctrine\ORM\Mapping as ORM;
15+
16+
/**
17+
* @ORM\Embeddable()
18+
*/
19+
class DoctrineLoaderNestedEmbed
20+
{
21+
/**
22+
* @ORM\Column(length=27)
23+
*/
24+
public $nestedEmbeddedMaxLength;
25+
}

src/Symfony/Bridge/Doctrine/Tests/Validator/DoctrineLoaderTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Bridge\Doctrine\Tests\Fixtures\BaseUser;
1717
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoctrineLoaderEmbed;
1818
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoctrineLoaderEntity;
19+
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoctrineLoaderNestedEmbed;
1920
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoctrineLoaderParentEntity;
2021
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
2122
use Symfony\Bridge\Doctrine\Validator\DoctrineLoader;
@@ -109,6 +110,20 @@ public function testLoadClassMetadata()
109110
$this->assertInstanceOf(Length::class, $embeddedMaxLengthConstraints[0]);
110111
$this->assertSame(25, $embeddedMaxLengthConstraints[0]->max);
111112

113+
$nestedEmbeddedMetadata = $embeddedClassMetadata->getPropertyMetadata('nestedEmbedded');
114+
$this->assertCount(1, $nestedEmbeddedMetadata);
115+
$this->assertSame(CascadingStrategy::CASCADE, $nestedEmbeddedMetadata[0]->getCascadingStrategy());
116+
$this->assertSame(TraversalStrategy::IMPLICIT, $nestedEmbeddedMetadata[0]->getTraversalStrategy());
117+
118+
$nestedEmbeddedClassMetadata = $validator->getMetadataFor(new DoctrineLoaderNestedEmbed());
119+
120+
$nestedEmbeddedMaxLengthMetadata = $nestedEmbeddedClassMetadata->getPropertyMetadata('nestedEmbeddedMaxLength');
121+
$this->assertCount(1, $nestedEmbeddedMaxLengthMetadata);
122+
$nestedEmbeddedMaxLengthConstraints = $nestedEmbeddedMaxLengthMetadata[0]->getConstraints();
123+
$this->assertCount(1, $nestedEmbeddedMaxLengthConstraints);
124+
$this->assertInstanceOf(Length::class, $nestedEmbeddedMaxLengthConstraints[0]);
125+
$this->assertSame(27, $nestedEmbeddedMaxLengthConstraints[0]->max);
126+
112127
$this->assertCount(0, $classMetadata->getPropertyMetadata('guidField'));
113128
$this->assertCount(0, $classMetadata->getPropertyMetadata('simpleArrayField'));
114129

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private function formatWithIdentifiers(ObjectManager $em, ClassMetadata $class,
186186
return $this->formatValue($value, self::PRETTY_DATE);
187187
}
188188

189-
if (\method_exists($value, '__toString')) {
189+
if (method_exists($value, '__toString')) {
190190
return (string) $value;
191191
}
192192

0 commit comments

Comments
 (0)