function FileImageDimensionsConstraint::__construct
Same name and namespace in other branches
- main core/modules/file/src/Plugin/Validation/Constraint/FileImageDimensionsConstraint.php \Drupal\file\Plugin\Validation\Constraint\FileImageDimensionsConstraint::__construct()
Attributes
#[HasNamedArguments]
File
-
core/
modules/ file/ src/ Plugin/ Validation/ Constraint/ FileImageDimensionsConstraint.php, line 36
Class
- FileImageDimensionsConstraint
- File extension dimensions constraint.
Namespace
Drupal\file\Plugin\Validation\ConstraintCode
public function __construct(mixed $options = NULL, string|int|null $minDimensions = NULL, string|int|null $maxDimensions = NULL, public string $messageResizedImageTooSmall = 'The resized image is too small. The minimum dimensions are %dimensions pixels and after resizing, the image size will be %widthx%height pixels.', public string $messageImageTooSmall = 'The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.', public string $messageResizeFailed = 'The image exceeds the maximum allowed dimensions and an attempt to resize it failed.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
$this->minDimensions = $minDimensions ?? $this->minDimensions;
$this->maxDimensions = $maxDimensions ?? $this->maxDimensions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.