| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 4 | public function lolify(array $record) |
|
| 23 | { |
||
| 24 | 4 | $messageArray = explode(' ', $record['message']); |
|
| 25 | 4 | $badWords = $this->swearWordsProvider->getSwearWords(); |
|
| 26 | |||
| 27 | 4 | $iterations = rand(1, 3); |
|
| 28 | 4 | for($i = 0; $i < $iterations; $i++) |
|
| 29 | { |
||
| 30 | 4 | $badWord = $this->chooseBadWordRandomly($badWords); |
|
| 31 | 4 | $this->insertSwearWordIntoMessage($messageArray, $badWord); |
|
| 32 | 4 | } |
|
| 33 | |||
| 34 | 4 | $record['message'] = implode(' ', $messageArray); |
|
| 35 | |||
| 36 | 4 | return $record; |
|
| 37 | } |
||
| 38 | |||
| 51 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.