From 2ba05a3ba5b769224036c91beee118b6a91bed1e Mon Sep 17 00:00:00 2001 From: indeed-a-genius Date: Tue, 17 Sep 2019 14:29:22 +0200 Subject: [PATCH] Incorrect listPageRules() conditions for optional parameters --- src/Endpoints/PageRules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Endpoints/PageRules.php b/src/Endpoints/PageRules.php index df0290f..c8480f4 100644 --- a/src/Endpoints/PageRules.php +++ b/src/Endpoints/PageRules.php @@ -73,19 +73,19 @@ class PageRules implements API string $direction = null, string $match = null ): array { - if ($status === null && !in_array($status, ['active', 'disabled'])) { + if ($status != null && !in_array($status, ['active', 'disabled'])) { throw new EndpointException('Page Rules can only be listed by status of active or disabled.'); } - if ($order === null && !in_array($order, ['status', 'priority'])) { + if ($order != null && !in_array($order, ['status', 'priority'])) { throw new EndpointException('Page Rules can only be ordered by status or priority.'); } - if ($direction === null && !in_array($direction, ['asc', 'desc'])) { + if ($direction != null && !in_array($direction, ['asc', 'desc'])) { throw new EndpointException('Direction of Page Rule ordering can only be asc or desc.'); } - if ($match === null && !in_array($match, ['all', 'any'])) { + if ($match != null && !in_array($match, ['all', 'any'])) { throw new EndpointException('Match can only be any or all.'); }