From ef79a72a3b66a07b9b79d9b0ded309482b897435 Mon Sep 17 00:00:00 2001 From: Marcel Frankruijter Date: Sun, 22 Nov 2020 18:05:02 +0100 Subject: [PATCH] Fixed issue with defaults not being set and causing errors on the return type --- CHANGELOG.md | 7 ++++++- src/Component/Criteria/FilterGroup.php | 2 +- src/Component/Criteria/Limiter.php | 2 +- src/Component/Criteria/SearchCriteria.php | 8 ++++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4486458..6f4cbe4 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](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.0.1 - 2020-11-22 +### Fixed +- Issue with unset defaults, which caused errors on the return type. + ## 2.0.0 - 2020-11-14 ### Added - IS_NULL, NOT_NULL and NOT_LIKE comparators to enum. @@ -18,5 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial implementation of the package. -- [2.0.0 > Unreleased](https://github.com/grizz-it/search/compare/2.0.0...HEAD) +- [2.0.1 > Unreleased](https://github.com/grizz-it/search/compare/2.0.1...HEAD) +- [2.0.0 > 2.0.1](https://github.com/grizz-it/search/compare/2.0.0...2.0.1) - [1.0.0 > 2.0.0](https://github.com/grizz-it/search/compare/1.0.0...2.0.0) diff --git a/src/Component/Criteria/FilterGroup.php b/src/Component/Criteria/FilterGroup.php index f283946..4f1d88f 100644 --- a/src/Component/Criteria/FilterGroup.php +++ b/src/Component/Criteria/FilterGroup.php @@ -14,7 +14,7 @@ class FilterGroup implements FilterGroupInterface { /** @var FilterInterface[]|FilterGroupInterface[] */ - private $filters; + private $filters = []; /** @var OperatorEnum */ private $operator; diff --git a/src/Component/Criteria/Limiter.php b/src/Component/Criteria/Limiter.php index 8b74d7f..e639a89 100644 --- a/src/Component/Criteria/Limiter.php +++ b/src/Component/Criteria/Limiter.php @@ -12,7 +12,7 @@ class Limiter implements LimiterInterface { /** @var array */ - private $fields; + private $fields = []; /** * Constructor diff --git a/src/Component/Criteria/SearchCriteria.php b/src/Component/Criteria/SearchCriteria.php index 014e204..885c220 100644 --- a/src/Component/Criteria/SearchCriteria.php +++ b/src/Component/Criteria/SearchCriteria.php @@ -16,16 +16,16 @@ class SearchCriteria implements SearchCriteriaInterface { /** @var FilterGroupInterface[] */ - private $filterGroups; + private $filterGroups = []; /** @var LimiterInterface[] */ - private $limiters; + private $limiters = []; /** @var PagerInterface[] */ - private $pagers; + private $pagers = []; /** @var SorterInterface[] */ - private $sorters; + private $sorters = []; /** * Adds a filter group to the criteria.