mirror of
https://github.com/pestphp/pest.git
synced 2026-03-13 03:07:22 +01:00
refacto: early returns
This commit is contained in:
@ -39,15 +39,13 @@ final class Result
|
|||||||
*/
|
*/
|
||||||
public static function exitCode(Configuration $configuration, TestResult $result): int
|
public static function exitCode(Configuration $configuration, TestResult $result): int
|
||||||
{
|
{
|
||||||
$returnCode = self::FAILURE_EXIT;
|
|
||||||
|
|
||||||
if ($result->wasSuccessfulIgnoringPhpunitWarnings()
|
if ($result->wasSuccessfulIgnoringPhpunitWarnings()
|
||||||
&& ! $result->hasTestTriggeredPhpunitWarningEvents()) {
|
&& ! $result->hasTestTriggeredPhpunitWarningEvents()) {
|
||||||
$returnCode = self::SUCCESS_EXIT;
|
return self::SUCCESS_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($configuration->failOnEmptyTestSuite() && $result->numberOfTests() === 0) {
|
if ($configuration->failOnEmptyTestSuite() && $result->numberOfTests() === 0) {
|
||||||
$returnCode = self::FAILURE_EXIT;
|
return self::FAILURE_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result->wasSuccessfulIgnoringPhpunitWarnings()) {
|
if ($result->wasSuccessfulIgnoringPhpunitWarnings()) {
|
||||||
@ -76,6 +74,6 @@ final class Result
|
|||||||
return self::EXCEPTION_EXIT;
|
return self::EXCEPTION_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnCode;
|
return self::FAILURE_EXIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user