Completed
Push — development ( 1fb984...7ea9e3 )
by Nils
08:29
created

CharacterSet::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PasswordGenerator\Model;
4
5
class CharacterSet
6
{
7
    private $characters;
8
9
    /**
10
     * CharacterSet constructor.
11
     *
12
     * @param string $characters
13
     */
14
    public function __construct($characters)
15
    {
16
        $this->characters = $characters;
17
    }
18
19
    /**
20
     * Get Character set
21
     *
22
     * @return string
23
     */
24
    public function getCharacters()
25
    {
26
        return $this->characters;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function __toString()
33
    {
34
        if (!is_string($this->characters)) {
35
            return '';
36
        }
37
38
        return $this->characters;
39
    }
40
}
41