Skip to content

Commit 8cb614d

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: [CS] Apply phpdoc_annotation_without_dot bumped Symfony version to 3.3.10 updated VERSION for 3.3.9 updated CHANGELOG for 3.3.9 [DomCrawler] Fix conversion to int on GetPhpFiles Remove `protected_to_private` rule. Filtering empty uuids in ORMQueryBuilderLoader.
2 parents 8c303de + e844b64 commit 8cb614d

File tree

82 files changed

+347
-214
lines changed

Some content is hidden

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

82 files changed

+347
-214
lines changed

.php_cs.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ return PhpCsFixer\Config::create()
1212
'no_unreachable_default_argument_value' => false,
1313
'braces' => array('allow_single_line_closure' => true),
1414
'heredoc_to_nowdoc' => false,
15-
'phpdoc_annotation_without_dot' => false,
15+
'protected_to_private' => false,
1616
))
1717
->setRiskyAllowed(true)
1818
->setFinder(

CHANGELOG-3.3.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ in 3.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.3.0...v3.3.1
99

10+
* 3.3.9 (2017-09-11)
11+
12+
* bug #24141 [DomCrawler] Fix conversion to int on GetPhpFiles (MaraBlaga)
13+
* bug #23853 Filtering empty uuids in ORMQueryBuilderLoader. (mlazovla)
14+
* bug #24101 [Security] Fix exception when use_referer option is true and referer is not set or empty (linniksa)
15+
* bug #24105 [Filesystem] check permissions if dump target dir is missing (xabbuh)
16+
* bug #24126 [HttpKernel] "controller.service_arguments" services should be public (nicolas-grekas)
17+
* bug #24113 [FrameworkBundle] Get KERNEL_CLASS through $_ENV too for KernelTestCase (yceruto)
18+
* bug #24115 [FrameworkBundle] Get KERNEL_DIR through $_ENV too for KernelTestCase (yceruto)
19+
* bug #24041 [ExpressionLanguage] throws an exception on calling uncallable method (fmata)
20+
* bug #24096 Fix ArrayInput::toString() for VALUE_IS_ARRAY options/args (chalasr)
21+
* bug #24082 [DI] Minor fix in dumped code (nicolas-grekas)
22+
* bug #23969 [Cache] Use namespace versioning for backends that dont support clearing by keys (nicolas-grekas)
23+
* bug #24021 [DI] Don't track merged configs when the extension doesn't expose it (nicolas-grekas)
24+
* bug #24011 [Cache] Always require symfony/polyfill-apcu to provide APCuIterator everywhere (guillaumelecerf)
25+
* bug #23730 Fixed the escaping of back slashes and << in console output (javiereguiluz)
26+
1027
* 3.3.8 (2017-08-28)
1128

1229
* bug #24016 [DI] Fix tracking env var placeholders nested in object graphs (nicolas-grekas)

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
298298
* @param ContainerBuilder $container A ContainerBuilder instance
299299
* @param string $cacheName
300300
*
301-
* @throws \InvalidArgumentException In case of unknown driver type.
301+
* @throws \InvalidArgumentException in case of unknown driver type
302302
*/
303303
protected function loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, $cacheName)
304304
{

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
108108
*
109109
* @param Definition|Reference $driver Driver DI definition or reference
110110
* @param string[] $namespaces List of namespaces handled by $driver
111-
* @param string[] $managerParameters List of container parameters that could
112-
* hold the manager name.
111+
* @param string[] $managerParameters list of container parameters that could
112+
* hold the manager name
113113
* @param string $driverPattern Pattern for the metadata driver service name
114114
* @param string|false $enabledParameter Service container parameter that must be
115115
* present to enable the mapping. Set to false
116116
* to not do any check, optional.
117117
* @param string $configurationPattern Pattern for the Configuration service name
118-
* @param string $registerAliasMethodName Name of Configuration class method to
119-
* register alias.
118+
* @param string $registerAliasMethodName name of Configuration class method to
119+
* register alias
120120
* @param string[] $aliasMap Map of alias to namespace
121121
*/
122122
public function __construct($driver, array $namespaces, array $managerParameters, $driverPattern, $enabledParameter = false, $configurationPattern = '', $registerAliasMethodName = '', array $aliasMap = array())
@@ -174,7 +174,7 @@ public function process(ContainerBuilder $container)
174174
* @return string The name of the chain driver service
175175
*
176176
* @throws InvalidArgumentException if non of the managerParameters has a
177-
* non-empty value.
177+
* non-empty value
178178
*/
179179
protected function getChainDriverServiceName(ContainerBuilder $container)
180180
{
@@ -185,7 +185,7 @@ protected function getChainDriverServiceName(ContainerBuilder $container)
185185
* Create the service definition for the metadata driver.
186186
*
187187
* @param ContainerBuilder $container passed on in case an extending class
188-
* needs access to the container.
188+
* needs access to the container
189189
*
190190
* @return Definition|Reference the metadata driver to add to all chain drivers
191191
*/
@@ -202,7 +202,7 @@ protected function getDriver(ContainerBuilder $container)
202202
* @return string a service definition name
203203
*
204204
* @throws InvalidArgumentException if none of the managerParameters has a
205-
* non-empty value.
205+
* non-empty value
206206
*/
207207
private function getConfigurationServiceName(ContainerBuilder $container)
208208
{
@@ -219,7 +219,7 @@ private function getConfigurationServiceName(ContainerBuilder $container)
219219
*
220220
* @return string The name of the active manager
221221
*
222-
* @throws InvalidArgumentException If none of the managerParameters is found in the container.
222+
* @throws InvalidArgumentException if none of the managerParameters is found in the container
223223
*/
224224
private function getManagerName(ContainerBuilder $container)
225225
{

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface
5959
* @param ObjectManager $manager The object manager
6060
* @param string $class The class name of the
6161
* loaded objects
62-
* @param IdReader $idReader The reader for the object
63-
* IDs.
62+
* @param IdReader $idReader the reader for the object
63+
* IDs
6464
* @param null|EntityLoaderInterface $objectLoader The objects loader
6565
* @param ChoiceListFactoryInterface $factory The factory for creating
6666
* the loaded choice list

src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function __construct(ObjectManager $om, ClassMetadata $classMetadata)
7979
/**
8080
* Returns whether the class has a single-column ID.
8181
*
82-
* @return bool Returns `true` if the class has a single-column ID and
83-
* `false` otherwise.
82+
* @return bool returns `true` if the class has a single-column ID and
83+
* `false` otherwise
8484
*/
8585
public function isSingleId()
8686
{
@@ -90,8 +90,8 @@ public function isSingleId()
9090
/**
9191
* Returns whether the class has a single-column integer ID.
9292
*
93-
* @return bool Returns `true` if the class has a single-column integer ID
94-
* and `false` otherwise.
93+
* @return bool returns `true` if the class has a single-column integer ID
94+
* and `false` otherwise
9595
*/
9696
public function isIntId()
9797
{

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getEntitiesByIds($identifier, array $values)
7272
$values = array_values(array_filter($values, function ($v) {
7373
return (string) $v === (string) (int) $v || ctype_digit($v);
7474
}));
75-
} elseif ('guid' === $metadata->getTypeOfField($identifier)) {
75+
} elseif (in_array($metadata->getTypeOfField($identifier), array('uuid', 'guid'))) {
7676
$parameterType = Connection::PARAM_STR_ARRAY;
7777

7878
// Like above, but we just filter out empty strings.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
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\Id;
15+
use Doctrine\ORM\Mapping\Column;
16+
use Doctrine\ORM\Mapping\Entity;
17+
18+
/** @Entity */
19+
class GuidIdEntity
20+
{
21+
/** @Id @Column(type="guid") */
22+
protected $id;
23+
24+
public function __construct($id)
25+
{
26+
$this->id = $id;
27+
}
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
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\Id;
15+
use Doctrine\ORM\Mapping\Column;
16+
use Doctrine\ORM\Mapping\Entity;
17+
18+
/** @Entity */
19+
class UuidIdEntity
20+
{
21+
/** @Id @Column(type="uuid") */
22+
protected $id;
23+
24+
public function __construct($id)
25+
{
26+
$this->id = $id;
27+
}
28+
}

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,38 @@ public function testFilterNonIntegerValues()
8787
$loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo', '9223372036854775808'));
8888
}
8989

90+
/**
91+
* @dataProvider provideGuidEntityClasses
92+
*/
93+
public function testFilterEmptyUuids($entityClass)
94+
{
95+
$em = DoctrineTestHelper::createTestEntityManager();
96+
97+
$query = $this->getMockBuilder('QueryMock')
98+
->setMethods(array('setParameter', 'getResult', 'getSql', '_doExecute'))
99+
->getMock();
100+
101+
$query->expects($this->once())
102+
->method('setParameter')
103+
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array('71c5fd46-3f16-4abb-bad7-90ac1e654a2d', 'b98e8e11-2897-44df-ad24-d2627eb7f499'), Connection::PARAM_STR_ARRAY)
104+
->willReturn($query);
105+
106+
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
107+
->setConstructorArgs(array($em))
108+
->setMethods(array('getQuery'))
109+
->getMock();
110+
111+
$qb->expects($this->once())
112+
->method('getQuery')
113+
->willReturn($query);
114+
115+
$qb->select('e')
116+
->from($entityClass, 'e');
117+
118+
$loader = new ORMQueryBuilderLoader($qb);
119+
$loader->getEntitiesByIds('id', array('71c5fd46-3f16-4abb-bad7-90ac1e654a2d', '', 'b98e8e11-2897-44df-ad24-d2627eb7f499'));
120+
}
121+
90122
public function testEmbeddedIdentifierName()
91123
{
92124
if (Version::compare('2.5.0') > 0) {
@@ -120,4 +152,12 @@ public function testEmbeddedIdentifierName()
120152
$loader = new ORMQueryBuilderLoader($qb);
121153
$loader->getEntitiesByIds('id.value', array(1, '', 2, 3, 'foo'));
122154
}
155+
156+
public function provideGuidEntityClasses()
157+
{
158+
return array(
159+
array('Symfony\Bridge\Doctrine\Tests\Fixtures\GuidIdEntity'),
160+
array('Symfony\Bridge\Doctrine\Tests\Fixtures\UuidIdEntity'),
161+
);
162+
}
123163
}

0 commit comments

Comments
 (0)