Conditions | 3 |
Paths | 5 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
36 | 7 | private function scopeStringValue(String_ $node): void |
|
37 | { |
||
38 | try { |
||
39 | 7 | $lastChar = substr($node->value, -1); |
|
40 | |||
41 | 7 | $newValue = $this->scoper->scopePhp($node->value, $this->prefix, $this->whitelist); |
|
42 | |||
43 | 7 | if ("\n" !== $lastChar) { |
|
44 | 4 | $newValue = substr($newValue, 0, -1); |
|
45 | } |
||
46 | |||
47 | 7 | $node->value = $newValue; |
|
48 | } catch (PhpParserError $error) { |
||
49 | // Continue without scoping the heredoc which for some reasons contains invalid PHP code |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 |