@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require __DIR__.'/../../vendor/autoload.php'; |
|
2 | +require __DIR__ . '/../../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | use Tarsana\Functional as F; |
5 | 5 | use Tarsana\Functional\Stream; |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | $words = []; |
8 | 8 | foreach ($text as $word => $occ) { |
9 | - if (! isset($words[$occ])) { |
|
9 | + if (!isset($words[$occ])) { |
|
10 | 10 | $words[$occ] = []; |
11 | 11 | } |
12 | 12 | $words[$occ][] = $word; |
@@ -103,8 +103,9 @@ |
||
103 | 103 | protected function getWordsHavingOccurrences($number) { |
104 | 104 | $result = []; |
105 | 105 | foreach ($this->list as $word) { |
106 | - if ($word->occurrences() == $number) |
|
107 | - $result[] = $word; |
|
106 | + if ($word->occurrences() == $number) { |
|
107 | + $result[] = $word; |
|
108 | + } |
|
108 | 109 | } |
109 | 110 | usort($result, function(Word $w1, Word $w2) { |
110 | 111 | return strcmp($w1->value(), $w2->value()); |
@@ -8,10 +8,10 @@ |
||
8 | 8 | */ |
9 | 9 | class Placeholder { |
10 | 10 | private static $instance; |
11 | - private function __construct(){} |
|
11 | + private function __construct() {} |
|
12 | 12 | public static function get() |
13 | 13 | { |
14 | - if(static::$instance === null) |
|
14 | + if (static::$instance === null) |
|
15 | 15 | static::$instance = new Placeholder; |
16 | 16 | return static::$instance; |
17 | 17 | } |