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