Completed
Pull Request — master (#526)
by Michael
11:09 queued 01:05
created

MockBanHelper::emailIsBanned()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
class MockBanHelper implements IBanHelper
4
{
5
	/**
6
	 * Summary of $result
7
	 * @var Ban|boolean
8
	 */
9
	private $result = false;
10
11
	/**
12
	 * Summary of setResult
13
	 * @param Ban|boolean $result 
14
	 */
15
	public function setResult($result)
16
	{
17
		$this->result = $result;
18
	}
19
20
	/**
21
	 * Summary of nameIsBanned
22
	 * @param string $name The name to test if is banned.
23
	 * @return Ban|boolean
24
	 */
25 1
	public function nameIsBanned($name)
26
	{
27 1
		return $this->result;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->result also could return the type boolean which is incompatible with the return type mandated by IBanHelper::nameIsBanned() of Ban.
Loading history...
28
	}
29
30
	/**
31
	 * Summary of emailIsBanned
32
	 * @param string $email
33
	 * @return Ban|boolean
34
	 */
35
	public function emailIsBanned($email)
36
	{
37
		return $this->result;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->result also could return the type boolean which is incompatible with the return type mandated by IBanHelper::emailIsBanned() of Ban.
Loading history...
38
	}
39
40
	/**
41
	 * Summary of ipIsBanned
42
	 * @param string $ip
43
	 * @return Ban|boolean
44
	 */
45
	public function ipIsBanned($ip)
46
	{
47
		return $this->result;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->result also could return the type boolean which is incompatible with the return type mandated by IBanHelper::ipIsBanned() of Ban.
Loading history...
48
	}
49
}
50