Commit d9459b2
[5.4] Makes cache() throw exceoption when incorrect first argument
The cache() function will return nothing when the first argument is something else than a string or array.
This PR fixes that by throwing an exception when that is the case.
It also improves code styling by removing the nested ifs (so less indentation) and follows the 'golden path' guideline.1 parent 0d667f8 commit d9459b2
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
240 | 239 | | |
241 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
| 245 | + | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
| |||
0 commit comments