diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4f781d20..62cbc75f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,4 +7,11 @@ parameters: checkMissingIterableValueType: false treatPhpDocTypesAsCertain: false paths: - - src/ \ No newline at end of file + - src/ + ignoreErrors: + - + message: '~^Access to an undefined property MailchimpMarketing\\ApiClient~' + path: src/integrations/mailchimp/class-mailchimp.php + - + message: '~^Function apply_filters invoked with [0-9] parameters~' + path: src/routes/class-buckaroo-response-handler-route.php \ No newline at end of file diff --git a/src/routes/class-mailchimp-fetch-segments-route.php b/src/routes/class-mailchimp-fetch-segments-route.php index 7868ef6f..28435c6a 100644 --- a/src/routes/class-mailchimp-fetch-segments-route.php +++ b/src/routes/class-mailchimp-fetch-segments-route.php @@ -133,6 +133,11 @@ private function extract_tags_and_segments( $response ): array { 'tags' => [], 'segments' => [], ]; + + if ( ! isset( $response->segments ) ) { + return $tags_segments; + } + foreach ( $response->segments as $segment ) { switch ( $segment->type ) { case 'static':