Skip to content

Commit 3905038

Browse files
andrewbessAndrii Beziazychnyi
authored andcommitted
#25669: health_check.php fails if any database cache engine configured
- fixed PHPDocs according to requirements static tests for CE
1 parent 5c121e2 commit 3905038

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

lib/internal/Magento/Framework/Cache/Backend/Database.php

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Database extends \Zend_Cache_Backend implements \Zend_Cache_Backend_Extend
5959
* Constructor
6060
*
6161
* @param array $options associative array of options
62+
* @throws \Zend_Cache_Exception
6263
*/
6364
public function __construct($options = [])
6465
{
@@ -82,6 +83,7 @@ public function __construct($options = [])
8283
* Get DB adapter
8384
*
8485
* @return \Magento\Framework\DB\Adapter\AdapterInterface
86+
* @throws \Zend_Cache_Exception
8587
*/
8688
protected function _getConnection()
8789
{
@@ -106,6 +108,7 @@ protected function _getConnection()
106108
* Get table name where data is stored
107109
*
108110
* @return string
111+
* @throws \Zend_Cache_Exception
109112
*/
110113
protected function _getDataTable()
111114
{
@@ -122,6 +125,7 @@ protected function _getDataTable()
122125
* Get table name where tags are stored
123126
*
124127
* @return string
128+
* @throws \Zend_Cache_Exception
125129
*/
126130
protected function _getTagsTable()
127131
{
@@ -139,9 +143,10 @@ protected function _getTagsTable()
139143
*
140144
* Note : return value is always "string" (unserialization is done by the core not by the backend)
141145
*
142-
* @param string $id Cache id
143-
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
146+
* @param string $id Cache id
147+
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
144148
* @return string|false cached datas
149+
* @throws \Zend_Cache_Exception
145150
*/
146151
public function load($id, $doNotTestCacheValidity = false)
147152
{
@@ -166,8 +171,9 @@ public function load($id, $doNotTestCacheValidity = false)
166171
/**
167172
* Test if a cache is available or not (for the given id)
168173
*
169-
* @param string $id cache id
174+
* @param string $id cache id
170175
* @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
176+
* @throws \Zend_Cache_Exception
171177
*/
172178
public function test($id)
173179
{
@@ -196,11 +202,13 @@ public function test($id)
196202
* Note : $data is always "string" (serialization is done by the
197203
* core not by the backend)
198204
*
199-
* @param string $data Datas to cache
200-
* @param string $id Cache id
201-
* @param string[] $tags Array of strings, the cache record will be tagged by each string entry
202-
* @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime
205+
* @param string $data Datas to cache
206+
* @param string $id Cache id
207+
* @param string[] $tags Array of strings, the cache record will be tagged by each string entry
208+
* @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime
203209
* @return bool true if no problem
210+
* @throws \Zend_Db_Statement_Exception
211+
* @throws \Zend_Cache_Exception
204212
*/
205213
public function save($data, $id, $tags = [], $specificLifetime = false)
206214
{
@@ -239,8 +247,9 @@ public function save($data, $id, $tags = [], $specificLifetime = false)
239247
/**
240248
* Remove a cache record
241249
*
242-
* @param string $id Cache id
250+
* @param string $id Cache id
243251
* @return int|boolean Number of affected rows or false on failure
252+
* @throws \Zend_Cache_Exception
244253
*/
245254
public function remove($id)
246255
{
@@ -266,9 +275,10 @@ public function remove($id)
266275
* \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
267276
* ($tags can be an array of strings or a single string)
268277
*
269-
* @param string $mode Clean mode
270-
* @param string[] $tags Array of tags
278+
* @param string $mode Clean mode
279+
* @param string[] $tags Array of tags
271280
* @return boolean true if no problem
281+
* @throws \Zend_Cache_Exception
272282
*/
273283
public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = [])
274284
{
@@ -301,6 +311,7 @@ public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = [])
301311
* Return an array of stored cache ids
302312
*
303313
* @return string[] array of stored cache ids (string)
314+
* @throws \Zend_Cache_Exception
304315
*/
305316
public function getIds()
306317
{
@@ -316,6 +327,7 @@ public function getIds()
316327
* Return an array of stored tags
317328
*
318329
* @return string[] array of stored tags (string)
330+
* @throws \Zend_Cache_Exception
319331
*/
320332
public function getTags()
321333
{
@@ -330,6 +342,7 @@ public function getTags()
330342
*
331343
* @param string[] $tags array of tags
332344
* @return string[] array of matching cache ids (string)
345+
* @throws \Zend_Cache_Exception
333346
*/
334347
public function getIdsMatchingTags($tags = [])
335348
{
@@ -356,6 +369,7 @@ public function getIdsMatchingTags($tags = [])
356369
*
357370
* @param string[] $tags array of tags
358371
* @return string[] array of not matching cache ids (string)
372+
* @throws \Zend_Cache_Exception
359373
*/
360374
public function getIdsNotMatchingTags($tags = [])
361375
{
@@ -369,6 +383,7 @@ public function getIdsNotMatchingTags($tags = [])
369383
*
370384
* @param string[] $tags array of tags
371385
* @return string[] array of any matching cache ids (string)
386+
* @throws \Zend_Cache_Exception
372387
*/
373388
public function getIdsMatchingAnyTags($tags = [])
374389
{
@@ -404,6 +419,7 @@ public function getFillingPercentage()
404419
*
405420
* @param string $id cache id
406421
* @return array|false array of metadatas (false if the cache id is not found)
422+
* @throws \Zend_Cache_Exception
407423
*/
408424
public function getMetadatas($id)
409425
{
@@ -425,6 +441,7 @@ public function getMetadatas($id)
425441
* @param string $id cache id
426442
* @param int $extraLifetime
427443
* @return boolean true if ok
444+
* @throws \Zend_Cache_Exception
428445
*/
429446
public function touch($id, $extraLifetime)
430447
{
@@ -471,6 +488,7 @@ public function getCapabilities()
471488
* @param string $id
472489
* @param string[] $tags
473490
* @return bool
491+
* @throws \Zend_Cache_Exception
474492
*/
475493
protected function _saveTags($id, $tags)
476494
{
@@ -509,6 +527,8 @@ protected function _saveTags($id, $tags)
509527
* @param string $mode
510528
* @param string[] $tags
511529
* @return bool
530+
* @throws \Zend_Cache_Exception
531+
* @throws \Zend_Db_Statement_Exception
512532
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
513533
*/
514534
protected function _cleanByTags($mode, $tags)
@@ -558,6 +578,7 @@ protected function _cleanByTags($mode, $tags)
558578
*
559579
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
560580
* @return bool
581+
* @throws \Zend_Cache_Exception
561582
*/
562583
private function cleanAll(\Magento\Framework\DB\Adapter\AdapterInterface $connection)
563584
{
@@ -575,6 +596,7 @@ private function cleanAll(\Magento\Framework\DB\Adapter\AdapterInterface $connec
575596
*
576597
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
577598
* @return bool
599+
* @throws \Zend_Cache_Exception
578600
*/
579601
private function cleanOld(\Magento\Framework\DB\Adapter\AdapterInterface $connection)
580602
{

0 commit comments

Comments
 (0)