Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
68 | public function WebpackFileHash($type = 'JS') |
||
69 | { |
||
70 | $base = Director::baseFolder(); |
||
71 | if ($type === 'JS') { |
||
72 | $file = 'bundle.js'; |
||
73 | } elseif ($type === 'CSS') { |
||
74 | $file = 'style.css'; |
||
75 | } else { |
||
76 | user_error('Please specify JS or CSS, '.$type.' specified.'); |
||
77 | } |
||
78 | $fullFile = $base.'/'.$this->owner->ThemeDir().'_'.$this->WebpackDistributionFolderExtension().'/'.$file; |
||
79 | |||
80 | return filemtime($fullFile); |
||
81 | } |
||
82 | } |
||
83 |
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.