From 356c692b16faf7a748febe363e270cdbeabdd5f0 Mon Sep 17 00:00:00 2001 From: Sam Sheridan Date: Wed, 11 Jul 2018 16:13:18 +0100 Subject: [PATCH] Fixed issue with empty scope being passed throwing exception --- src/Repository/Pdo/AbstractRepository.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Repository/Pdo/AbstractRepository.php b/src/Repository/Pdo/AbstractRepository.php index 7cce630..aae4434 100644 --- a/src/Repository/Pdo/AbstractRepository.php +++ b/src/Repository/Pdo/AbstractRepository.php @@ -39,6 +39,10 @@ public function __construct(PdoService $pdo) */ protected function scopesToString(array $scopes) : string { + if (empty($scopes)) { + return ''; + } + return trim(array_reduce($scopes, function ($result, $item) { return $result . ' ' . $item->getIdentifier(); }));