Completed
Push — master ( 7ca08e...5a5cfd )
by Matt
02:19
created

VerifyKeyResult   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 2 1
A __construct() 0 3 1
1
<?php
2
namespace Gothick\AkismetClient\Result;
3
4
/**
5
 * Result of calling the verify-key method on the Akismet API.
6
 * @author matt
7
 *
8
 */
9
class VerifyKeyResult extends ClientResult
10
{
11
	/**
12
	 * Create a result; throws if the result body isn't in the known list of responses.
13
	 * @param \GuzzleHttp\Psr7\Response $response
14
	 */
15 13
	public function __construct(\GuzzleHttp\Psr7\Response $response)
16
	{
17 13
		parent::__construct($response, [ 'valid', 'invalid' ]);
18 12
	}
19
20
	/**
21
	 * Is the key valid?
22
	 * @return boolean
23
	 */
24 6
	public function isValid() {
25 6
		return $this->raw_result == 'valid';
26
	}
27
}