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

MockBanHelper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setResult() 0 3 1
A nameIsBanned() 0 3 1
A emailIsBanned() 0 3 1
A ipIsBanned() 0 3 1
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