Skip to content

Commit

Permalink
Fixed sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev authored Nov 30, 2023
1 parent d2029f2 commit 40de8f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/php/com_github_leetcode/LinkedListUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class LinkedListUtils {
public static function constructLinkedList($nums) {
if ($nums === null || count($nums) === 0) {
if ($nums === null || empty($nums)) {
return null;
}
$pre = new ListNode(-1);
Expand All @@ -20,7 +20,7 @@ public static function constructLinkedList($nums) {
}

public static function createSinglyLinkedList($listValues) {
if ($listValues === null || count($listValues) === 0) {
if ($listValues === null || empty($listValues)) {
throw new InvalidArgumentException(
"Please pass in a valid listValues to create a singly linked list."
);
Expand Down

0 comments on commit 40de8f8

Please sign in to comment.