| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public static function translate(string $text, string $pattern = '/[^{\}]+(?=})/'): string |
||
| 31 | { |
||
| 32 | preg_match_all($pattern, $text, $matches); |
||
| 33 | |||
| 34 | if (0 === \count($matches[0])) { |
||
| 35 | return $text; |
||
| 36 | } |
||
| 37 | |||
| 38 | $replace_vars = []; |
||
| 39 | |||
| 40 | foreach ($matches[0] as $match) { |
||
| 41 | $var = Str::slug($match, '_'); |
||
|
|
|||
| 42 | $replace_vars["{{$match}}"] = $this->cache->get("{$this->prefix}_{$var}", "{{$var}}"); |
||
| 43 | } |
||
| 44 | |||
| 45 | return strtr($text, $replace_vars); |
||
| 46 | } |
||
| 48 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths