function matches() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).
This check examines a number of code elements and verifies that they conform
to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties,
methods, parameters, interfaces, classes, exceptions and special methods.
Loading history...
18
{
19
$cursor = 0;
20
21
foreach ($this->expected as $substring) {
22
$next = strpos($other, $substring, $cursor);
23
24
if ($next === false) {
25
return false;
26
}
27
28
$cursor = $next + strlen($substring) + 1;
29
}
30
31
return true;
32
}
33
34
public function toString()
35
{
36
return 'matches array of '.count($this->expected).' strings';
37
}
38
39
protected function failureDescription($other)
40
{
41
if (is_string($other)) {
42
return 'string '.strlen($other).' bytes long '.$this->toString();
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.