| Total Complexity | 10 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class Template |
||
| 9 | { |
||
| 10 | private $template; |
||
| 11 | private $templateSettings; |
||
| 12 | |||
| 13 | public function __construct($template = null) |
||
| 14 | { |
||
| 15 | $this->template = $this->getCurrentTemplate($template); |
||
| 16 | $this->templateSettings = $this->getCurrentSettings($this->template); |
||
| 17 | } |
||
| 18 | |||
| 19 | public static function forTemplate(string $template) |
||
| 20 | { |
||
| 21 | return new static($template); |
||
| 22 | } |
||
| 23 | |||
| 24 | private function getCurrentSettings(TemplateModel $template_model) |
||
| 25 | { |
||
| 26 | return $template_model->json; |
||
| 27 | } |
||
| 28 | |||
| 29 | private function getCurrentTemplate($template_slug) |
||
| 30 | { |
||
| 31 | if (is_null($template_slug)) { |
||
| 32 | $template = TemplateModel::where('active', true)->where('type', 'default')->first(); |
||
| 33 | } else { |
||
| 34 | $template = TemplateModel::where('slug', $template_slug)->first(); |
||
| 35 | } |
||
| 36 | |||
| 37 | if (is_null($template)) { |
||
| 38 | throw new Exception('Whoops! No Template Defined...'); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $template; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getSetting($var) |
||
| 48 | } |
||
| 49 | |||
| 50 | private function resolveSetting($var, $settings) |
||
| 59 | } |
||
| 60 | |||
| 61 | } |
||
| 62 |
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