Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

UserPasswordValidationException.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace eZ\Publish\Core\Base\Exceptions;
10
11 use Exception;
12 use eZ\Publish\Core\FieldType\ValidationError;
13
14 class UserPasswordValidationException extends InvalidArgumentException
15 {
23 public function __construct(string $argumentName, array $errors, Exception $previous = null)
24 {
25 $rules = array_map(function (ValidationError $error) {
26 return (string) $error->getTranslatableMessage();
27 }, $errors);
28
29 parent::__construct($argumentName, "Password doesn't match the following rules: " . implode(', ', $rules), $previous);
30 }
31 }
eZ\Publish\Core\Base\Exceptions\InvalidArgumentException
Invalid Argument Type Exception implementation.
Definition: Core/Base/Exceptions/InvalidArgumentException.php:20
eZ\Publish\Core\Base\Exceptions\UserPasswordValidationException
Definition: UserPasswordValidationException.php:15
eZ\Publish\Core\Base\Exceptions\UserPasswordValidationException\__construct
__construct(string $argumentName, array $errors, Exception $previous=null)
Generates: "Argument '{$argumentName}' is invalid: Password doesn't match the following rules: {X},...
Definition: UserPasswordValidationException.php:23
eZ\Publish\Core\FieldType\ValidationError
Class for validation errors.
Definition: Core/FieldType/ValidationError.php:17
eZ\Publish\Core\FieldType\ValidationError\getTranslatableMessage
getTranslatableMessage()
Returns a translatable Message.
Definition: Core/FieldType/ValidationError.php:55
eZ\Publish\Core\Base\Exceptions
Definition: Core/Base/Exceptions/BadStateException.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.