Skip to content

Commit 10feffa

Browse files
Merge branch '2.7' into 2.8
* 2.7: [HttpFoundation] fixed return type of method HeaderBag::get [HttpFoundation] Added "resource" type on Request::create docblock Revert "bug #25789 Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)" Revert "bug #25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)" [Validator] add missing parent isset and add test
2 parents 6cf97b4 + 5822afa commit 10feffa

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

Constraint.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ public function __get($option)
214214
throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, get_class($this)), array($option));
215215
}
216216

217+
/**
218+
* @param string $option The option name
219+
*
220+
* @return bool
221+
*/
222+
public function __isset($option)
223+
{
224+
return 'groups' === $option;
225+
}
226+
217227
/**
218228
* Adds the given group if this constraint is in the Default group.
219229
*

Tests/Constraints/FileTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public function testMaxSize($maxSize, $bytes, $binaryFormat)
2626

2727
$this->assertSame($bytes, $file->maxSize);
2828
$this->assertSame($binaryFormat, $file->binaryFormat);
29+
$this->assertTrue($file->__isset('maxSize'));
30+
}
31+
32+
public function testMagicIsset()
33+
{
34+
$file = new File(array('maxSize' => 1));
35+
36+
$this->assertTrue($file->__isset('maxSize'));
37+
$this->assertTrue($file->__isset('groups'));
38+
$this->assertFalse($file->__isset('toto'));
2939
}
3040

3141
/**

composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
"symfony/property-access": "For using the 2.4 Validator API",
4343
"symfony/expression-language": "For using the 2.4 Expression validator"
4444
},
45-
"conflict": {
46-
"egulias/email-validator": ">=2.0"
47-
},
4845
"autoload": {
4946
"psr-4": { "Symfony\\Component\\Validator\\": "" },
5047
"exclude-from-classmap": [

0 commit comments

Comments
 (0)