CoordinatesRuleSet::getRules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 2
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Rule;
6
7
use Yiisoft\Validator\Rule\Composite;
8
use Yiisoft\Validator\Rule\Nested;
9
use Yiisoft\Validator\Rule\Number;
10
11
final class CoordinatesRuleSet extends Composite
12
{
13
    public function getRules(): array
14
    {
15
        return [
16
            new Nested([
17
                'latitude' => new Number(min: -90, max: 90),
18
                'longitude' => new Number(min: -180, max: 180),
19
            ]),
20
        ];
21
    }
22
}
23