Completed
Pull Request — master (#1)
by steven
07:04 queued 02:47
created

NotEmptyString   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
3
namespace VSV\GVQ_API\Question;
4
5
class NotEmptyString
6
{
7
    /**
8
     * @var string
9
     */
10
    private $text;
11
12
    /**
13
     * @param string $text
14
     */
15
    public function __construct(string $text)
16
    {
17
        if ($text === '') {
18
            throw new \InvalidArgumentException('Text argument cannot be empty.');
19
        }
20
        $this->text = $text;
21
    }
22
}
23