$cache_key is unconditionally called in $cache->setKey($cache_key, $data) but is only defined if the previous condition if ($is_cacheable && $is_locally_cacheable && !$dev_mode) was true.
Thus initialize the variable to avoid a theoretical exception. (No additional null check is needed as $cache gets defined in the same condition.)
Details
Details
- Reviewers
valerio.bozzolan - Group Reviewers
O1: Blessed Committers - Commits
- rPc1d86da5b209: Initialize $cache_key variable in CelerityResourceController.php
Carefully read the code.
Diff Detail
Diff Detail
- Repository
- rP Phorge
- Branch
- celerityResourceControllerLogic (branched from master)
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 1263 Build 1263: arc lint + arc unit
Event Timeline
src/applications/celerity/controller/CelerityResourceController.php | ||
---|---|---|
102 | And, maybe this line |
Comment Actions
Thanks. Moreover, looking at PhutilKeyValueCache it seems that setKey(null) has no sense. So thanks also for that extra care you already set.