Passed
Push — main ( ff180e...a01d42 )
by Andrey
12:49 queued 11:21
created

Empties::notEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Helldar\Support\Callbacks;
4
5
final class Empties
6
{
7 4
    public function notEmpty(): callable
8
    {
9 4
        return static function ($value) {
10 4
            return ! empty($value);
11 4
        };
12
    }
13
14 2
    public function notEmptyBoth(): callable
15
    {
16 2
        return static function ($value, $key) {
17 2
            return ! empty($value) && ! empty($key);
18 2
        };
19
    }
20
}
21