@@ -41,8 +41,7 @@ |
||
41 | 41 | if($hoursAgo >= 24 || $hoursAgo == null) { |
42 | 42 | try { |
43 | 43 | Cooldown::expired()->delete(); |
44 | - } |
|
45 | - catch(Exception $e) { } |
|
44 | + } catch(Exception $e) { } |
|
46 | 45 | |
47 | 46 | Cache::forever('kurozora_cooldown_last_cleaned_up_at', now()); |
48 | 47 | } |
@@ -59,12 +59,13 @@ discard block |
||
59 | 59 | { |
60 | 60 | $cooldown = $this->findCooldownWithName($this->name); |
61 | 61 | |
62 | - if(!$cooldown) return; |
|
62 | + if(!$cooldown) { |
|
63 | + return; |
|
64 | + } |
|
63 | 65 | |
64 | 66 | try { |
65 | 67 | $cooldown->delete(); |
66 | - } |
|
67 | - catch(Exception $e) { } |
|
68 | + } catch(Exception $e) { } |
|
68 | 69 | } |
69 | 70 | |
70 | 71 | /** |
@@ -76,16 +77,17 @@ discard block |
||
76 | 77 | { |
77 | 78 | $cooldown = $this->findCooldownWithName($this->name); |
78 | 79 | |
79 | - if(!$cooldown) |
|
80 | - return true; |
|
80 | + if(!$cooldown) { |
|
81 | + return true; |
|
82 | + } |
|
81 | 83 | |
82 | - if(now() < $cooldown->expires_at) |
|
83 | - return false; |
|
84 | + if(now() < $cooldown->expires_at) { |
|
85 | + return false; |
|
86 | + } |
|
84 | 87 | |
85 | 88 | try { |
86 | 89 | $cooldown->delete(); |
87 | - } |
|
88 | - catch(Exception $e) { } |
|
90 | + } catch(Exception $e) { } |
|
89 | 91 | |
90 | 92 | return true; |
91 | 93 | } |
@@ -99,16 +101,17 @@ discard block |
||
99 | 101 | { |
100 | 102 | $cooldown = $this->findCooldownWithName($this->name); |
101 | 103 | |
102 | - if(!$cooldown) |
|
103 | - return false; |
|
104 | + if(!$cooldown) { |
|
105 | + return false; |
|
106 | + } |
|
104 | 107 | |
105 | - if(now() < $cooldown->expires_at) |
|
106 | - return true; |
|
108 | + if(now() < $cooldown->expires_at) { |
|
109 | + return true; |
|
110 | + } |
|
107 | 111 | |
108 | 112 | try { |
109 | 113 | $cooldown->delete(); |
110 | - } |
|
111 | - catch(Exception $e) { } |
|
114 | + } catch(Exception $e) { } |
|
112 | 115 | |
113 | 116 | return false; |
114 | 117 | } |
@@ -120,7 +123,9 @@ discard block |
||
120 | 123 | */ |
121 | 124 | public function expiresAt() |
122 | 125 | { |
123 | - if($this->passed()) return null; |
|
126 | + if($this->passed()) { |
|
127 | + return null; |
|
128 | + } |
|
124 | 129 | |
125 | 130 | $cooldown = $this->findCooldownWithName($this->name); |
126 | 131 | |
@@ -184,7 +189,9 @@ discard block |
||
184 | 189 | */ |
185 | 190 | private function modelType() |
186 | 191 | { |
187 | - if($this->model === null) return null; |
|
192 | + if($this->model === null) { |
|
193 | + return null; |
|
194 | + } |
|
188 | 195 | |
189 | 196 | return get_class($this->model); |
190 | 197 | } |
@@ -196,7 +203,9 @@ discard block |
||
196 | 203 | */ |
197 | 204 | private function modelId() |
198 | 205 | { |
199 | - if($this->model === null) return null; |
|
206 | + if($this->model === null) { |
|
207 | + return null; |
|
208 | + } |
|
200 | 209 | |
201 | 210 | return (int) $this->model->id; |
202 | 211 | } |