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

VerifyKeyResult::isValid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}