Conditions | 4 |
Paths | 4 |
Total Lines | 27 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
57 | $files = (array) glob( THEME_PATH . '/' . self::$folder . '/*/*.blade.php' ); |
||
58 | |||
59 | foreach ( $files as $filename ) { |
||
60 | |||
61 | if ( !empty($filename) ) { |
||
62 | |||
63 | if ( ! preg_match( '/\{\{\-\-\s*Template Name:(.*)\s*\-\-\}\}/mi', file_get_contents( $filename ), $header ) ) continue; |
||
64 | |||
65 | $template_name = trim($header[1]); |
||
66 | |||
67 | preg_match('/\/([^\/]*)\.blade.php$/is', $filename, $filename_match); |
||
68 | |||
69 | $template_file = 'classy-' . $filename_match[1]; |
||
70 | |||
71 | $templates[$template_file] = $template_name; |
||
72 | |||
73 | } |
||
74 | |||
75 | } |
||
76 | |||
77 | return $templates; |
||
78 | |||
79 | } |
||
80 | |||
81 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.