From 40de8f8b76ca3959b21a328fb3c8707a58ea2488 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Thu, 30 Nov 2023 09:12:28 +0200 Subject: [PATCH] Fixed sonar warnings --- src/test/php/com_github_leetcode/LinkedListUtils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/php/com_github_leetcode/LinkedListUtils.php b/src/test/php/com_github_leetcode/LinkedListUtils.php index 42a9959..1410b95 100644 --- a/src/test/php/com_github_leetcode/LinkedListUtils.php +++ b/src/test/php/com_github_leetcode/LinkedListUtils.php @@ -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); @@ -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." );