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

Empties   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A notEmptyBoth() 0 4 2
A notEmpty() 0 4 1
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