| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public function modifyAll(TokenCollection $tokenCollection): TokenCollection |
|
| 21 | { |
||
| 22 | 2 | $newTokenCollection = new TokenCollection($tokenCollection->getFilePath()); |
|
| 23 | 2 | foreach ($tokenCollection->getTokens() as $token) { |
|
| 24 | 2 | $originalBlock = $token->getOriginalBlock(); |
|
| 25 | 2 | $originalText = $token->getOriginalText(); |
|
| 26 | |||
| 27 | 2 | foreach ($this->falsePositivePatterns as $falsePositivePattern) { |
|
| 28 | 2 | if (preg_match($falsePositivePattern['block_pattern'], $originalBlock) && preg_match($falsePositivePattern['text_pattern'], $originalText)) { |
|
| 29 | 2 | continue; |
|
| 30 | } |
||
| 31 | 2 | $newTokenCollection->addToken($token); |
|
| 32 | } |
||
| 33 | } |
||
| 34 | 2 | return $newTokenCollection; |
|
| 35 | } |
||
| 37 |