TaskNameIsNotEmptySpecification::isSatisfiedBy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Todo\Domain\Specification;
4
5
/**
6
 * Class TaskNameIsNotEmptySpecification
7
 *
8
 * A specification describes that Task's name should not be empty
9
 *
10
 * @category None
11
 * @package  Todo\Domain\Specification
12
 * @author   Martin Pham <[email protected]>
13
 * @license  None http://
14
 * @link     None
15
 */
16
class TaskNameIsNotEmptySpecification
17
{
18
    /**
19
     * Check given name is empty or not, we want it not empty
20
     *
21
     * @param string $name Name
22
     *
23
     * @return bool
24
     */
25
    public function isSatisfiedBy(string $name)
26
    {
27
        return $name !== '';
28
    }
29
}
30