Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
63 | 6 | public function explodeName() |
|
64 | { |
||
65 | 6 | $name = explode(' ', $this->full_name); |
|
66 | 6 | $count_name = count($name); |
|
67 | |||
68 | 6 | if ($count_name == 3) { |
|
69 | 2 | $this->first = $name[0]; |
|
70 | 2 | $this->second = $name[1]; |
|
71 | 2 | $this->middle = $name[2]; |
|
72 | 4 | } elseif ($count_name == 2) { |
|
73 | 1 | $this->first = $name[0]; |
|
74 | 1 | $this->second = $name[1]; |
|
75 | 1 | $this->middle = false; |
|
76 | } else { |
||
77 | 3 | $this->first = $this->second = $this->middle = false; |
|
78 | } |
||
79 | |||
80 | 6 | return $this; |
|
81 | } |
||
82 | |||
114 | } |