CoreFiles by mySites.guru
LessThanOrEqualValidator.php31 lines, 787 bytes, from Joomla_5.4.3-Stable-Full_Package.zip
Raw History Compare with 5.4.2
md5
a75cc31aadda6e5f6ae6886fc2cb544f
sha1
2189fbd42b6738fc0d3c4bb625c6301569b39a77
sha256
fe4038f4efdb2019f569ff9a3ecd46d6d0783a163933370b6d3b7bf684d334d9
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Validator\Constraints;

/**
 * Validates values are less than or equal to the previous (<=).
 *
 * @author Daniel Holmes <[email protected]>
 * @author Bernhard Schussek <[email protected]>
 */
class LessThanOrEqualValidator extends AbstractComparisonValidator
{
    protected function compareValues(mixed $value1, mixed $value2): bool
    {
        return null === $value2 || $value1 <= $value2;
    }

    protected function getErrorCode(): ?string
    {
        return LessThanOrEqual::TOO_HIGH_ERROR;
    }
}

The same content is in 136 releases, Joomla 5.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.