Skip to content

Commit 9c6be7e

Browse files
Do not use empty()
1 parent b550a96 commit 9c6be7e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/TextUI/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ private function exitWithCrashMessage(Throwable $t): never
745745
{
746746
$message = $t->getMessage();
747747

748-
if (empty(trim($message))) {
748+
if (trim($message) === '') {
749749
$message = '(no message)';
750750
}
751751

src/TextUI/Configuration/Cli/Builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,15 @@ public function fromParameters(array $parameters): Configuration
958958
}
959959
}
960960

961-
if (empty($iniSettings)) {
961+
if ($iniSettings === []) {
962962
$iniSettings = null;
963963
}
964964

965-
if (empty($coverageFilter)) {
965+
if ($coverageFilter === []) {
966966
$coverageFilter = null;
967967
}
968968

969-
if (empty($extensions)) {
969+
if ($extensions === []) {
970970
$extensions = null;
971971
}
972972

src/TextUI/Configuration/Xml/Loader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti
979979

980980
$directory = $directoryNode->textContent;
981981

982-
if (empty($directory)) {
982+
if ($directory === '') {
983983
continue;
984984
}
985985

@@ -1013,7 +1013,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti
10131013
foreach (explode(',', $directoryNode->getAttribute('groups')) as $group) {
10141014
$group = trim($group);
10151015

1016-
if (empty($group)) {
1016+
if ($group === '') {
10171017
continue;
10181018
}
10191019

@@ -1038,7 +1038,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti
10381038

10391039
$file = $fileNode->textContent;
10401040

1041-
if (empty($file)) {
1041+
if ($file === '') {
10421042
continue;
10431043
}
10441044

@@ -1060,7 +1060,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti
10601060
foreach (explode(',', $fileNode->getAttribute('groups')) as $group) {
10611061
$group = trim($group);
10621062

1063-
if (empty($group)) {
1063+
if ($group === '') {
10641064
continue;
10651065
}
10661066

0 commit comments

Comments
 (0)