ValidIntegerValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 14
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValidInteger() 0 6 2
1
<?php
2
3
namespace Andegna\Validator;
4
5
/**
6
 * Class ValidIntegerValidator.
7
 */
8
trait ValidIntegerValidator
9
{
10
    /**
11
     * @param array $integers a list of integers
12
     *
13
     * @return bool returns true if all the elements in the array are integer
14
     */
15
    public function isValidInteger(...$integers): bool
16
    {
17 187
        return array_reduce($integers, function ($carry, $integer) {
18 187
            return $carry && is_int($integer);
19 187
        }, true);
20
    }
21
}
22