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

CharacterSet   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCharacters() 0 4 1
A __toString() 0 8 2
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