AnyEmailMatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A matches() 0 4 1
A __toString() 0 4 1
1
<?php
2
/**
3
 * Defines Ingenerator\Mailhook\Matcher\AnyEmailMatcher
4
 *
5
 * @copyright  2014 inGenerator Ltd
6
 * @licence    BSD
7
 */
8
9
namespace Ingenerator\Mailhook\Matcher;
10
use Ingenerator\Mailhook\Email;
11
use Ingenerator\Mailhook\EmailMatcher;
12
13
/**
14
 * Matches any email
15
 *
16
 * @package Ingenerator\Mailhook\Matcher
17
 * @see     spec\Ingenerator\Mailhook\Matcher\AnyEmailMatcherSpec
18
 */
19
class AnyEmailMatcher implements EmailMatcher {
20
21
	/**
22
	 * Test if an email matches the conditions
23
	 *
24
	 * @param Email $email
25
	 *
26
	 * @return bool
27
	 */
28
	public function matches(Email $email)
29
	{
30
		return TRUE;
31
	}
32
33
	/**
34
	 * Describe the matcher for use in exceptions etc
35
	 *
36
	 * @return string
37
	 */
38
	public function __toString()
39
	{
40
		return 'Any Email';
41
	}
42
43
}
44