Empties   A
last analyzed

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
 * This file is part of the "andrey-helldar/support" project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author Andrey Helldar <[email protected]>
9
 *
10
 * @copyright 2021 Andrey Helldar
11
 *
12
 * @license MIT
13
 *
14
 * @see https://github.com/andrey-helldar/support
15
 */
16
17
namespace Helldar\Support\Callbacks;
18
19
class Empties
20
{
21 25
    public function notEmpty(): callable
22
    {
23 25
        return static function ($value) {
24 25
            return ! empty($value);
25 25
        };
26
    }
27
28 2
    public function notEmptyBoth(): callable
29
    {
30 2
        return static function ($value, $key) {
31 2
            return ! empty($value) && ! empty($key);
32 2
        };
33
    }
34
}
35