Issues (3641)

Form/Constraint/IntegerMoneyConstraint.php (1 issue)

1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace Spryker\Zed\Gui\Communication\Form\Constraint;
9
10
use Symfony\Component\Validator\Constraints\LessThan;
11
12
class IntegerMoneyConstraint extends LessThan
13
{
14
    /**
15
     * @var int
16
     */
17
    protected const MAX_INT_VALUE = 214748364;
18
19
    /**
20
     * @var string
21
     */
22
    protected const OPTION_VALUE = 'value';
23
24
    /**
25
     * @var string
26
     */
27
    protected const MESSAGE_PATTERN = 'This value should be less than %.2f';
28
29
    /**
30
     * @param array<string, mixed>|null $options
31
     */
32
    public function __construct($options = null)
33
    {
34
        $this->message = sprintf(static::MESSAGE_PATTERN, static::MAX_INT_VALUE / 100);
0 ignored issues
show
Bug Best Practice introduced by
The property message does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
35
        if ($options === null) {
36
            $options = [];
37
        }
38
39
        $options[static::OPTION_VALUE] = static::MAX_INT_VALUE;
40
41
        parent::__construct($options);
42
    }
43
}
44