Passed
Branch master (c65ffc)
by Dāvis
03:08
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 isValid() 0 8 2
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