Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
19 | 2 | public function contains( |
|
20 | string $serializedData, |
||
21 | string $searchTerm |
||
22 | ): bool { |
||
23 | 2 | $tokenizer = new Tokenizer(); |
|
24 | |||
25 | 2 | $containsString = false; |
|
26 | 2 | foreach ($tokenizer->tokenize($serializedData) as $token) { |
|
27 | 2 | if (Token::STRING === $token->getType() && strstr($token->getValue(), $searchTerm)) { |
|
28 | 2 | $containsString = true; |
|
29 | } |
||
30 | } |
||
31 | |||
32 | 2 | return $containsString; |
|
33 | } |
||
34 | |||
70 | } |