Passed
Push — master ( 50332b...6b3eac )
by Dāvis
03:20
created

NotEmpty   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A isSatisfiedBy() 0 8 2
1
<?php
2
3
namespace Sludio\HelperBundle\Openidconnect\Specification;
4
5
use Sludio\HelperBundle\Script\Specification\CompositeSpecification;
6
7
class NotEmpty extends CompositeSpecification
8
{
9
    use SpecificationTrait;
10
11
    public function isSatisfiedBy($expectedValue, $actualValue)
12
    {
13
        $valid = !empty($actualValue);
14
        if (!$valid) {
15
            $this->message = sprintf("%s is required and cannot be empty", $this->getName());
16
        }
17
18
        return $valid;
19
    }
20
}
21