@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | $this->maxLength = $maxLength; |
| 33 | 33 | $this->min = $min; |
| 34 | 34 | $this->max = $max; |
| 35 | - $this->adjectives = explode(PHP_EOL, file_get_contents(__DIR__ . '/dictionaries/adjectives.txt')); |
|
| 36 | - $this->animals = explode(PHP_EOL, file_get_contents(__DIR__ . '/dictionaries/animals.txt')); |
|
| 35 | + $this->adjectives = explode(PHP_EOL, file_get_contents(__DIR__.'/dictionaries/adjectives.txt')); |
|
| 36 | + $this->animals = explode(PHP_EOL, file_get_contents(__DIR__.'/dictionaries/animals.txt')); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -59,17 +59,17 @@ discard block |
||
| 59 | 59 | $this->animal = $this->animals[$this->second]; |
| 60 | 60 | switch ($this->case) { |
| 61 | 61 | case 'ucfirst': |
| 62 | - $this->string = ucfirst($this->adjective . $this->animal . $this->number); |
|
| 62 | + $this->string = ucfirst($this->adjective.$this->animal.$this->number); |
|
| 63 | 63 | break; |
| 64 | 64 | case 'ucwords': |
| 65 | 65 | case 'sentence': |
| 66 | - $this->string = ucfirst($this->adjective) . ucfirst($this->animal) . ucfirst($this->number); |
|
| 66 | + $this->string = ucfirst($this->adjective).ucfirst($this->animal).ucfirst($this->number); |
|
| 67 | 67 | break; |
| 68 | 68 | case 'camel': |
| 69 | - $this->string = $this->adjective . ucfirst($this->animal) . $this->number; |
|
| 69 | + $this->string = $this->adjective.ucfirst($this->animal).$this->number; |
|
| 70 | 70 | break; |
| 71 | 71 | default: |
| 72 | - $this->string = $this->adjective . $this->animal . $this->number; |
|
| 72 | + $this->string = $this->adjective.$this->animal.$this->number; |
|
| 73 | 73 | break; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | private function generateNumbers($first = null, $second = null) |
| 82 | 82 | { |
| 83 | - $this->first = ($first) ? $first : mt_rand(0, count($this->adjectives) - 1); |
|
| 84 | - $this->second = ($second) ? $second : mt_rand(0, count($this->animals) - 1); |
|
| 83 | + $this->first = ($first) ? $first : mt_rand(0, count($this->adjectives)-1); |
|
| 84 | + $this->second = ($second) ? $second : mt_rand(0, count($this->animals)-1); |
|
| 85 | 85 | $this->number = mt_rand($this->min, $this->max); |
| 86 | - if (array_key_exists($this->first . '.' . $this->second . '.' . $this->number, $this->combinations)) { |
|
| 86 | + if (array_key_exists($this->first.'.'.$this->second.'.'.$this->number, $this->combinations)) { |
|
| 87 | 87 | $this->generateNumbers($this->first, $this->second); |
| 88 | 88 | } |
| 89 | - $this->combinations[$this->first . '.' . $this->second . '.' . $this->number] = 1; |
|
| 89 | + $this->combinations[$this->first.'.'.$this->second.'.'.$this->number] = 1; |
|
| 90 | 90 | } |
| 91 | 91 | } |