| Conditions | 10 |
| Paths | 15 |
| Total Lines | 34 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 27 | private function runMultiLanguage(): void |
||
| 28 | { |
||
| 29 | // check if multi-language is enabled |
||
| 30 | if (!App::$Properties->get('multiLanguage')) { |
||
| 31 | $this->language = App::$Properties->get('singleLanguage'); |
||
| 32 | return; |
||
| 33 | } |
||
| 34 | |||
| 35 | // check if domain-lang binding is enabled |
||
| 36 | if (Any::isArray(App::$Properties->get('languageDomainAlias'))) { |
||
| 37 | /** @var array $domainAlias */ |
||
| 38 | $domainAlias = App::$Properties->get('languageDomainAlias'); |
||
| 39 | if (Any::isArray($domainAlias) && !Str::likeEmpty($domainAlias[$this->getHost()])) { |
||
| 40 | $this->language = $domainAlias[$this->getHost()]; |
||
| 41 | } |
||
| 42 | return; |
||
| 43 | } |
||
| 44 | |||
| 45 | // try to find language in pathway |
||
| 46 | foreach (App::$Properties->get('languages') as $lang) { |
||
| 47 | if (Str::startsWith('/' . $lang, $this->getPathInfo())) { |
||
| 48 | $this->language = $lang; |
||
| 49 | $this->languageInPath = true; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | // try to find in ?lang get |
||
| 54 | if (!$this->language && Arr::in($this->query->get('lang'), App::$Properties->get('languages'))) { |
||
| 55 | $this->language = $this->query->get('lang'); |
||
| 56 | } |
||
| 57 | |||
| 58 | // language still not defined?! |
||
| 59 | if (!$this->language) { |
||
| 60 | $this->setLanguageFromBrowser(); |
||
| 61 | } |
||
| 127 |
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