SerializedConstraint.php
Same filename and directory in other branches
Namespace
Drupal\Core\Validation\Plugin\Validation\ConstraintFile
-
core/
lib/ Drupal/ Core/ Validation/ Plugin/ Validation/ Constraint/ SerializedConstraint.php
View source
<?php
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;
/**
* Checks for valid serialized data.
*/
class SerializedConstraint extends SymfonyConstraint {
public function __construct(mixed $options = NULL, public string $message = 'This value should be a serialized object.', public string $wrongTypeMessage = 'This value should be a string, "{type}" given.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| SerializedConstraint | Checks for valid serialized data. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.