Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
kmadejski committed May 24, 2019
2 parents 5ed5c97 + 1711f2f commit 42f8d8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function transform($value)
public function reverseTransform($value)
{
if (!$value) {
return null;
return [$this->languageCode => []];
}

return array_merge($this->data->fieldSettings['multilingualOptions'], [$this->languageCode => $value]);
Expand Down
7 changes: 5 additions & 2 deletions lib/Validator/Constraints/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Symfony\Component\Validator\Constraint;

/**
* @Annotation
*/
class Password extends Constraint
{
/** @var string */
Expand All @@ -17,8 +20,8 @@ class Password extends Constraint
/**
* {@inheritdoc}
*/
public function getTargets(): string
public function getTargets(): array
{
return self::CLASS_CONSTRAINT;
return [self::CLASS_CONSTRAINT, self::PROPERTY_CONSTRAINT];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function testValidatedBy()

public function testGetTargets()
{
$this->assertSame(Password::CLASS_CONSTRAINT, $this->constraint->getTargets());
$this->assertSame([Password::CLASS_CONSTRAINT, Password::PROPERTY_CONSTRAINT], $this->constraint->getTargets());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public function testValidatedBy()

public function testGetTargets()
{
$this->assertSame(UserAccountPassword::CLASS_CONSTRAINT, $this->constraint->getTargets());
$this->assertSame([UserAccountPassword::CLASS_CONSTRAINT, UserAccountPassword::PROPERTY_CONSTRAINT], $this->constraint->getTargets());
}
}

0 comments on commit 42f8d8e

Please # to comment.