Passed
Pull Request — main (#131)
by Andrey
11:31
created

Empties   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 13
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
    public function notEmpty(): callable
8
    {
9
        return static function ($value) {
10
            return ! empty($value);
11
        };
12
    }
13
14
    public function notEmptyBoth(): callable
15
    {
16
        return static function ($value, $key) {
17
            return ! empty($value) && ! empty($key);
18
        };
19
    }
20
}
21