Completed
Pull Request — master (#526)
by Michael
02:11
created

BanHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A ipIsBanned() 0 3 1
A nameIsBanned() 0 3 1
A emailIsBanned() 0 3 1
1
<?php
2
3
class BanHelper implements IBanHelper
4
{
5
	/**
6
	 * Summary of nameIsBanned
7
	 * @param string $name The name to test if is banned.
8
	 * @return Ban
9
	 */
10
	public function nameIsBanned($name)
11
	{
12
		return Ban::getBanByTarget($name, "Name");
13
	}
14
15
	/**
16
	 * Summary of emailIsBanned
17
	 * @param string $email
18
	 * @return Ban
19
	 */
20
	public function emailIsBanned($email)
21
	{
22
		return Ban::getBanByTarget($email, "EMail");
23
	}
24
25
	/**
26
	 * Summary of ipIsBanned
27
	 * @param string $ip
28
	 * @return Ban
29
	 */
30
	public function ipIsBanned($ip)
31
	{
32
		return Ban::getBanByTarget($ip, "IP");
33
	}
34
}
35