lib/Core/Validator/Validator.php
public function validatePosition(?int $position, ?string $propertyPath = null, bool $isRequired = false): void
    {
        if (!$isRequired && $position === null) {
            return;
        }

        $constraints = [
            new Constraints\NotBlank(),
            new Constraints\GreaterThanOrEqual(0),
        ];

        $this->validate($position, $constraints, $propertyPath);
    }
public function validatePosition(?int $position, ?string $propertyPath = null, bool $isRequired = false): void
    {
        if (!$isRequired && $position === null) {
            return;
        }

        $constraints = [
            new Constraints\NotBlank(),
            new Constraints\GreaterThanOrEqual(0),
        ];

        $this->validate($position, $constraints, $propertyPath);
    }
public function validatePosition ( ? int $ position , ? string $ propertyPath = null , bool $ isRequired = false ) : void { if ( ! $ isRequired && $ position === null ) { return ; } $ constraints = [ new Constraints \ NotBlank ( ) , new Constraints \ GreaterThanOrEqual ( 0 ) , ] ; $ this -> validate ( $ position , $ constraints , $ propertyPath ) ; }
Validates the provided position to be an integer greater than or equal to 0.

If $isRequired is set to false, null value is also allowed.

Use the $propertyPath to change the name of the validated property in the error message.

@throws \Netgen\BlockManager\Exception\Validation\ValidationException If the validation failed
Validates the provided position to be an integer greater than or equal to 0 .