From d9d81412db9b991f442336fd5b68ee037e6d9a16 Mon Sep 17 00:00:00 2001 From: Cristiano Cinotti Date: Mon, 22 Feb 2021 08:11:41 +0100 Subject: [PATCH] Union types Add a temporary workaround to avoid spaces between union types, when PHP 8+. --- src/Config.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Config.php b/src/Config.php index 329a99d..68a36d9 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1,4 +1,4 @@ - [ 'comment_type' => 'phpdocs_only' ], @@ -86,5 +86,12 @@ public function getRules(): array { 'visibility_required' => true, 'whitespace_after_comma_in_array' => true ]; + + if (phpversion() >= '8.0') { + //temporary workaround to avoid spaces between PHP 8 union types + $rules['binary_operator_spaces']['operators'] = ['|' => null]; + } + + return $rules; } }