Completed
Pull Request — development (#2330)
by Joshua
41:37 queued 30:33
created

Cache_Method_Abstract::isMiss()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 23 and the first side effect is on line 16.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
/**
4
 * This file contains functions that deal with getting and setting cache values.
5
 *
6
 * @name      ElkArte Forum
7
 * @copyright ElkArte Forum contributors
8
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
9
 *
10
 * @version 1.1 dev
11
 *
12
 */
13
14
namespace ElkArte\sources\subs\CacheMethod;
15
16 1
if (!defined('ELK'))
17 1
	die('No access...');
18
19
/**
20
 * Abstract cache class, implementing the Cache_Method_Interface interface.
21
 * Used to provide common methods and properties to the caching classes
22
 */
23
abstract class Cache_Method_Abstract implements Cache_Method_Interface
24
{
25
	/**
26
	 * The settings of the caching engine
27
	 * @var array
28
	 */
29
	public $_options = null;
30
31
	protected $is_miss = true;
32
33
	/**
34
	 * {@inheritdoc }
35
	 */
36 1
	public function __construct($options)
37
	{
38 1
		$this->_options = $options;
0 ignored issues
show
Documentation Bug introduced by
It seems like $options of type * is incompatible with the declared type array of property $_options.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
39 1
	}
40
41
	/**
42
	 * {@inheritdoc }
43
	 */
44
	public function fixkey($key)
45
	{
46
		return $key;
47
	}
48
49
	public function isMiss()
50
	{
51
		return $this->is_miss;
52
	}
53
54
	/**
55
	 * {@inheritdoc }
56
	 */
57
	public static function settings(&$confing_vars)
58
	{
59
	}
60
}