IsNotEmpty   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\File\Action;
13
14
use SebastianFeldmann\Git\Repository;
15
16
/**
17
 * Class IsNotEmpty
18
 *
19
 * @package CaptainHook
20
 * @author  Sebastian Feldmann <[email protected]>
21
 * @link    https://github.com/captainhook-git/captainhook
22
 * @since   Class available since Release 5.4.1
23
 */
24
class IsNotEmpty extends Emptiness
25
{
26
    /**
27
     * Actual action name for better error messages
28
     *
29
     * @var string
30
     */
31
    protected string $actionName = 'IsNotEmpty';
32
33
    /**
34
     * Checks if the file is valid or not
35
     *
36
     * @param  \SebastianFeldmann\Git\Repository $repository
37
     * @param  string                            $file
38
     * @return bool
39
     */
40 3
    protected function isValid(Repository $repository, string $file): bool
41
    {
42 3
        return !$this->isEmpty($file);
43
    }
44
}
45