Cache_Driver
last analyzed

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 3
Bugs 2 Features 0
Metric Value
c 3
b 2
f 0
dl 0
loc 30

5 Methods

Rating   Name   Duplication   Size   Complexity  
set() 0 1 ?
find() 0 1 ?
get() 0 1 ?
delete() 0 1 ?
delete_expired() 0 1 ?
1
<?php defined('SYSPATH') or die('No direct access allowed.');
2
/**
3
 * Cache driver interface.
4
 *
5
 * $Id: Cache.php 4046 2009-03-05 19:23:29Z Shadowhand $
6
 *
7
 * @package    Cache
8
 * @author     Kohana Team
9
 * @copyright  (c) 2007-2008 Kohana Team
10
 * @license    http://kohanaphp.com/license.html
11
 */
12
interface Cache_Driver
13
{
14
15
    /**
16
     * Set a cache item.
17
     */
18
    public function set($id, $data, array $tags = null, $lifetime);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
19
20
    /**
21
     * Find all of the cache ids for a given tag.
22
     */
23
    public function find($tag);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
24
25
    /**
26
     * Get a cache item.
27
     * Return NULL if the cache item is not found.
28
     */
29
    public function get($id);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
30
31
    /**
32
     * Delete cache items by id or tag.
33
     */
34
    public function delete($id, $tag = false);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
35
36
    /**
37
     * Deletes all expired cache items.
38
     * @return boolean|null
39
     */
40
    public function delete_expired();
41
} // End Cache Driver
42