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

NotEmpty::isSatisfiedBy()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
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