GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

matchesSafelyWithDiagnosticDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace WMDE\HamcrestHtml;
4
5
use Hamcrest\Description;
6
use Hamcrest\Matcher;
7
use Hamcrest\Util;
8
9
class TextContentsMatcher extends TagMatcher {
10
11
	/**
12
	 * @var Matcher
13
	 */
14
	private $matcher;
15
16
	/**
17
	 * @param Matcher|string $text
18
	 *
19
	 * @return self
20
	 */
21
	public static function havingTextContents( $text ) {
22
		return new static( Util::wrapValueWithIsEqual( $text ) );
23
	}
24
25
	public function __construct( Matcher $matcher ) {
26
		parent::__construct();
27
		$this->matcher = $matcher;
28
	}
29
30 2
	public function describeTo( Description $description ) {
31 2
		$description->appendText( 'having text contents ' )->appendDescriptionOf( $this->matcher );
32 2
	}
33
34
	/**
35
	 * @param \DOMElement $item
36
	 * @param Description $mismatchDescription
37
	 *
38
	 * @return bool
39
	 */
40 4
	protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) {
41 4
		return $this->matcher->matches( $item->textContent );
42
	}
43
44
}
45