Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | public static function find_or_make(string $site_key, string $host = ''): Store |
||
37 | { |
||
38 | // Perform whatever logic is necessary to find the object in your DB |
||
39 | $find = self::get()->find('SiteKey', $site_key); |
||
40 | if (!$find) { |
||
41 | $find = new self(); |
||
42 | $find->SiteKey = $site_key; |
||
43 | } |
||
44 | |||
45 | // Always check if the host has changed. |
||
46 | // Users may change their master domain and thus changing the host |
||
47 | if ($host && $host !== $find->SiteHost) { |
||
48 | $find->SiteHost = $host; |
||
49 | } |
||
50 | |||
51 | // Write any changes to the database |
||
52 | $find->save(); |
||
53 | |||
54 | // Return this object |
||
55 | return $find; |
||
56 | } |
||
58 |
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