GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ae724f...a11daa )
by Norbert
02:52 queued 01:17
created

IsNotEmpty   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 5
c 1
b 1
f 0
lcom 1
cbo 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A match() 0 9 4
A getError() 0 4 1
1
<?php
2
3
namespace Coduo\PHPMatcher\Matcher\Pattern\Expander;
4
5
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
6
use Coduo\ToString\StringConverter;
7
8
final class IsNotEmpty implements PatternExpander
9
{
10
    private $error;
11
12
    /**
13
     * @param $value
14
     * @return boolean
15
     */
16
    public function match($value)
17
    {
18
        if (false === $value || (empty($value) && '0' != $value)) {
19
            $this->error = sprintf("Value %s is not blank.", new StringConverter($value));
20
            return false;
21
        }
22
23
        return true;
24
    }
25
26
    /**
27
     * @return string|null
28
     */
29
    public function getError()
30
    {
31
        return $this->error;
32
    }
33
}
34