Skip to content

Commit 40de8f8

Browse files
authored
Fixed sonar warnings
1 parent d2029f2 commit 40de8f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/php/com_github_leetcode/LinkedListUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class LinkedListUtils {
88
public static function constructLinkedList($nums) {
9-
if ($nums === null || count($nums) === 0) {
9+
if ($nums === null || empty($nums)) {
1010
return null;
1111
}
1212
$pre = new ListNode(-1);
@@ -20,7 +20,7 @@ public static function constructLinkedList($nums) {
2020
}
2121

2222
public static function createSinglyLinkedList($listValues) {
23-
if ($listValues === null || count($listValues) === 0) {
23+
if ($listValues === null || empty($listValues)) {
2424
throw new InvalidArgumentException(
2525
"Please pass in a valid listValues to create a singly linked list."
2626
);

0 commit comments

Comments
 (0)