Skip to content

Commit 864ba68

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [VarDumper] Enhance docblock to tell about AbstractDumper::dumpLine(-1) [Debug] Remove false-positive check in DebugClassLoader [Validator] Fix use of GroupSequenceProvider in child classes Change number PHPDoc type to int|float [VarDumper] Strengthen dumped JS [travis] Add timing info [Validator] Fix Greek translation [Console] Initialize lazily to render exceptions properly [Validator] Add a property tag for File::$maxSize
2 parents 83fb5d9 + 9931c89 commit 864ba68

File tree

5 files changed

+38
-14
lines changed

5 files changed

+38
-14
lines changed

Constraints/File.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* @Annotation
1919
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
2020
*
21+
* @property int $maxSize
22+
*
2123
* @author Bernhard Schussek <[email protected]>
2224
*/
2325
class File extends Constraint

Mapping/ClassMetadata.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ public function addGetterMethodConstraints($property, $method, array $constraint
381381
*/
382382
public function mergeConstraints(ClassMetadata $source)
383383
{
384+
if ($source->isGroupSequenceProvider()) {
385+
$this->setGroupSequenceProvider(true);
386+
}
387+
384388
foreach ($source->getConstraints() as $constraint) {
385389
$this->addConstraint(clone $constraint);
386390
}

Resources/translations/validators.el.xlf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</trans-unit>
101101
<trans-unit id="25">
102102
<source>This value is not valid.</source>
103-
<target>Αυτή η τιμή δεν είναι έκγυρη.</target>
103+
<target>Αυτή η τιμή δεν είναι έγκυρη.</target>
104104
</trans-unit>
105105
<trans-unit id="26">
106106
<source>This value is not a valid time.</source>
@@ -136,19 +136,19 @@
136136
</trans-unit>
137137
<trans-unit id="37">
138138
<source>This is not a valid IP address.</source>
139-
<target>Αυτό δεν είναι μια έκγυρη διεύθυνση IP.</target>
139+
<target>Αυτό δεν είναι μια έγκυρη διεύθυνση IP.</target>
140140
</trans-unit>
141141
<trans-unit id="38">
142142
<source>This value is not a valid language.</source>
143-
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έκγυρη γλώσσα.</target>
143+
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έγκυρη γλώσσα.</target>
144144
</trans-unit>
145145
<trans-unit id="39">
146146
<source>This value is not a valid locale.</source>
147147
<target>Αυτή η τιμή δεν αντιστοιχεί σε έκγυρο κωδικό τοποθεσίας.</target>
148148
</trans-unit>
149149
<trans-unit id="40">
150150
<source>This value is not a valid country.</source>
151-
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έκγυρη χώρα.</target>
151+
<target>Αυτή η τιμή δεν αντιστοιχεί σε μια έγκυρη χώρα.</target>
152152
</trans-unit>
153153
<trans-unit id="41">
154154
<source>This value is already used.</source>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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\Component\Validator\Tests\Fixtures;
13+
14+
class GroupSequenceProviderChildEntity extends GroupSequenceProviderEntity
15+
{
16+
}

Tests/Mapping/ClassMetadataTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ClassMetadataTest extends TestCase
2424
const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity';
2525
const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent';
2626
const PROVIDERCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderEntity';
27+
const PROVIDERCHILDCLASS = 'Symfony\Component\Validator\Tests\Fixtures\GroupSequenceProviderChildEntity';
2728

2829
protected $metadata;
2930

@@ -301,6 +302,17 @@ public function testGroupSequenceProvider()
301302
$this->assertTrue($metadata->isGroupSequenceProvider());
302303
}
303304

305+
public function testMergeConstraintsMergesGroupSequenceProvider()
306+
{
307+
$parent = new ClassMetadata(self::PROVIDERCLASS);
308+
$parent->setGroupSequenceProvider(true);
309+
310+
$metadata = new ClassMetadata(self::PROVIDERCHILDCLASS);
311+
$metadata->mergeConstraints($parent);
312+
313+
$this->assertTrue($metadata->isGroupSequenceProvider());
314+
}
315+
304316
/**
305317
* https://github.com/symfony/symfony/issues/11604.
306318
*/
@@ -309,13 +321,3 @@ public function testGetPropertyMetadataReturnsEmptyArrayWithoutConfiguredMetadat
309321
$this->assertCount(0, $this->metadata->getPropertyMetadata('foo'), '->getPropertyMetadata() returns an empty collection if no metadata is configured for the given property');
310322
}
311323
}
312-
313-
class ParentClass
314-
{
315-
public $example = 0;
316-
}
317-
318-
class ChildClass extends ParentClass
319-
{
320-
public $example = 1; // overrides parent property of same name
321-
}

0 commit comments

Comments
 (0)