Conditions | 6 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function entries(): array |
||
10 | { |
||
11 | if (!empty($this->entries)) { |
||
12 | return $this->entries; |
||
13 | } |
||
14 | if (class_exists('\GeminiLabs\Castor\Facades\Development') |
||
15 | && class_exists('\GeminiLabs\Castor\Helpers\Development') |
||
16 | && method_exists('\GeminiLabs\Castor\Helpers\Development', 'templatePaths')) { // @phpstan-ignore-line |
||
17 | $this->entries = \GeminiLabs\Castor\Facades\Development::templatePaths(); |
||
18 | } else { |
||
19 | $files = array_values(array_filter(get_included_files(), function ($file) { |
||
20 | $bool = false !== strpos($file, '/themes/') && false === strpos($file, '/functions.php'); |
||
21 | return (bool) apply_filters('blackbar/templates/file', $bool, $file); |
||
22 | })); |
||
23 | $this->entries = array_map(function ($file) { |
||
24 | return str_replace(trailingslashit(WP_CONTENT_DIR), '', $file); |
||
25 | }, $files); |
||
26 | } |
||
27 | return $this->entries; |
||
28 | } |
||
45 |