Conditions | 10 |
Paths | 128 |
Total Lines | 31 |
Code Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
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 |
||
59 | public function siteInformation(string $sitePath, string $phpBinary): array |
||
60 | { |
||
61 | $composerJson = json_decode(file_get_contents($sitePath.'/composer.json'), true); |
||
62 | $hydeConfig = include $sitePath.'/config/hyde.php'; |
||
63 | |||
64 | return [ |
||
65 | 'HydePHP Info' => [ |
||
66 | 'Hyde Version' => InstalledVersions::isInstalled('hyde/hyde') ? InstalledVersions::getPrettyVersion('hyde/hyde') : 'Unknown', |
||
67 | 'Framework Version' => InstalledVersions::getPrettyVersion('hyde/framework') ?: 'Unknown', |
||
68 | 'Site Name' => $hydeConfig['name'] ?? 'Unknown', |
||
69 | 'Site URL' => $hydeConfig['url'] ?? 'Not set', |
||
70 | 'Site Language' => $hydeConfig['language'] ?? 'en', |
||
71 | 'Output Directory' => $hydeConfig['output_directory'] ?? '_site', |
||
72 | ], |
||
73 | 'Build Info' => [ |
||
74 | 'Pretty URLs' => $hydeConfig['pretty_urls'] ? 'Enabled' : 'Disabled', |
||
75 | 'Generate Sitemap' => $hydeConfig['generate_sitemap'] ? 'Yes' : 'No', |
||
76 | 'RSS Feed' => ($hydeConfig['rss']['enabled'] ?? false) ? 'Enabled' : 'Disabled', |
||
77 | 'Source Root' => $hydeConfig['source_root'] ?: '(Project Root)', |
||
78 | ], |
||
79 | 'Features' => [ |
||
80 | 'Enabled Features' => implode(', ', array_map(function ($feature) { |
||
81 | return $feature->name; |
||
82 | }, $hydeConfig['features'] ?? [])), |
||
83 | ], |
||
84 | 'Server Configuration' => [ |
||
85 | 'Port' => $hydeConfig['server']['port'] ?? 8080, |
||
86 | 'Host' => $hydeConfig['server']['host'] ?? 'localhost', |
||
87 | 'Save Preview' => ($hydeConfig['server']['save_preview'] ?? true) ? 'Yes' : 'No', |
||
88 | 'Live Edit' => ($hydeConfig['server']['live_edit'] ?? false) ? 'Enabled' : 'Disabled', |
||
89 | 'Dashboard' => ($hydeConfig['server']['dashboard']['enabled'] ?? true) ? 'Enabled' : 'Disabled', |
||
90 | ], |
||
94 |
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