Passed
Branch master (c65ffc)
by Dāvis
03:08
created

NotEmpty::isValid()   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\Validator;
4
5
class NotEmpty implements Valid
6
{
7
    use ValidatorTrait;
8
9
    public function isValid($expectedValue, $actualValue)
10
    {
11
        $valid = !empty($actualValue);
12
        if (!$valid) {
13
            $this->message = sprintf("%s is required and cannot be empty", $this->getName());
14
        }
15
16
        return $valid;
17
    }
18
}
19