function TestCase::hasError
*
Parameters
list<list<array{source: string, message: string}>> $errorsOnLine:
2 calls to TestCase::hasError()
- TestCase::assertSniffError in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ TestCase.php - TestCase::assertSniffWarning in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ TestCase.php
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ TestCase.php, line 197
Class
- TestCase
- @codeCoverageIgnore
Namespace
SlevomatCodingStandard\SniffsCode
private static function hasError(array $errorsOnLine, string $sniffCode, ?string $message) : bool {
$hasError = false;
foreach ($errorsOnLine as $errorsOnPosition) {
foreach ($errorsOnPosition as $error) {
/** @var string $errorSource */
$errorSource = $error['source'];
/** @var string $errorMessage */
$errorMessage = $error['message'];
if ($errorSource === $sniffCode && ($message === null || strpos($errorMessage, $message) !== false)) {
$hasError = true;
break;
}
}
}
return $hasError;
}