Issues (6)

src/Rules/PersianNumber.php (1 issue)

1
<?php
2
3
/*
4
 * This file is part of persian validation package
5
 *
6
 * (c) Farhad Zand <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Iamfarhad\Validation\Rules;
13
14
use Iamfarhad\Validation\Contracts\AbstractValidationRule;
15
16
class PersianNumber extends AbstractValidationRule
17
{
18
    /**
19
     * @var string
20
     */
21
    public $validationRule = 'persian_number';
22
23
    /**
24
     * @param $attribute
25
     * @param $value
26
     * @param $parameters
27
     * @param $validator
28
     * @return bool
29
     */
30
    public function rule($attribute, $value, $parameters, $validator): bool
31
    {
32
        return preg_match('/^[\x{6F0}-\x{6F9}]+$/u', $value);
0 ignored issues
show
Bug Best Practice introduced by
The expression return preg_match('/^[\x...-\x{6F9}]+$/u', $value) returns the type integer which is incompatible with the type-hinted return boolean.
Loading history...
33
    }
34
}
35