Conditions | 5 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
5 | public function updateEnabled(&$enabled) |
||
6 | { |
||
7 | // Disable caching for this request if a user is logged in |
||
8 | if (Member::currentUserID()) { |
||
9 | $enabled = false; |
||
10 | } |
||
11 | |||
12 | // Disable caching for this request if in dev mode |
||
13 | elseif (Director::isDev()) { |
||
14 | $enabled = false; |
||
15 | } |
||
16 | |||
17 | // Disable caching if the request is in dev mode |
||
18 | else { |
||
19 | $session = Session::get_all(); |
||
20 | if ($session && count($session)) { |
||
21 | $enabled = false; |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 | |||
36 |
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.