From 8c73aa013ca06388e6a8ddc08ea0ad87526421df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurynas=20Grici=C5=ABnas?= Date: Fri, 2 Aug 2024 10:12:22 +0300 Subject: [PATCH] PR Changes --- CHANGELOG.md | 4 ++++ src/Entity/Result.php | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c61a18..7d53531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 2.6.1 +### Fixed +- Changed `\Paysera\Component\RestClientCommon\Entity\Result::getItems` to always return an array, empty one if the value is null. + ## 2.7.0 ### Changed - Minimal version of PHP is increased to `7.4`. diff --git a/src/Entity/Result.php b/src/Entity/Result.php index 7c6a44a..65a1c6f 100644 --- a/src/Entity/Result.php +++ b/src/Entity/Result.php @@ -62,7 +62,9 @@ public function count() public function getItems() { - return $this->get($this->dataKey); + $items = $this->get($this->dataKey); + + return is_array($items) ? $items : []; } public function getMetadata()