AllTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 8 1
1
<?php
2
3
namespace Prelude\Tests;
4
5
use const Prelude\isScalar;
6
use function Prelude\all;
7
8
class AllTest extends \PHPUnit\Framework\TestCase
9
{
10
    public function test()
11
    {
12
        $even = function ($n) { return $n % 2 === 0; };
13
14
        $this->assertTrue(all($even)([2, 4, 6, 8, 10, 12]));
15
        $this->assertTrue(all(isScalar)([1, 2, 3, 4]));
16
        $this->assertFalse(all(isScalar)([1, 2, [], 4]));
17
    }
18
}
19