Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RangeValidator.php

function RangeValidator::getLimit

1 call to RangeValidator::getLimit()
RangeValidator::validate in vendor/symfony/validator/Constraints/RangeValidator.php
Checks if the passed value is valid.

File

vendor/symfony/validator/Constraints/RangeValidator.php, line 146

Class

RangeValidator
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Constraints

Code

private function getLimit(?string $propertyPath, mixed $default, Constraint $constraint) : mixed {
    if (null === $propertyPath) {
        return $default;
    }
    if (null === ($object = $this->context
        ->getObject())) {
        return $default;
    }
    try {
        return $this->getPropertyAccessor()
            ->getValue($object, $propertyPath);
    } catch (NoSuchPropertyException $e) {
        throw new ConstraintDefinitionException(\sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)) . $e->getMessage(), 0, $e);
    } catch (UninitializedPropertyException) {
        return null;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal