From 9967f74069dca3c60942df808369ecf60c023ade Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Mon, 14 Nov 2022 14:16:30 -0300 Subject: [PATCH] Fix PHPStan definition for "path_append_id" option at `TreeListener` --- src/Tree/Mapping/Driver/Xml.php | 2 +- src/Tree/TreeListener.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tree/Mapping/Driver/Xml.php b/src/Tree/Mapping/Driver/Xml.php index 1c1b80e527..611e8b38ac 100644 --- a/src/Tree/Mapping/Driver/Xml.php +++ b/src/Tree/Mapping/Driver/Xml.php @@ -108,7 +108,7 @@ public function readExtendedMetadata($meta, array &$config) throw new InvalidMappingException("Tree Path field - [{$field}] Separator {$separator} is invalid. It must be only one character long."); } - $appendId = !$this->_isAttributeSet($mapping->{'tree-path'}, 'append_id') || $this->_getBooleanAttribute($mapping->{'tree-path'}, 'append_id'); + $appendId = $this->_isAttributeSet($mapping->{'tree-path'}, 'append_id') ? $this->_getBooleanAttribute($mapping->{'tree-path'}, 'append_id') : null; $startsWithSeparator = $this->_isAttributeSet($mapping->{'tree-path'}, 'starts_with_separator') && $this->_getBooleanAttribute($mapping->{'tree-path'}, 'starts_with_separator'); $endsWithSeparator = !$this->_isAttributeSet($mapping->{'tree-path'}, 'ends_with_separator') || $this->_getBooleanAttribute($mapping->{'tree-path'}, 'ends_with_separator'); diff --git a/src/Tree/TreeListener.php b/src/Tree/TreeListener.php index d411387a06..6c73515b5c 100644 --- a/src/Tree/TreeListener.php +++ b/src/Tree/TreeListener.php @@ -33,7 +33,7 @@ * path?: string, * path_source?: string, * path_separator?: string, - * path_append_id?: bool, + * path_append_id?: ?bool, * path_starts_with_separator?: bool, * path_ends_with_separator?: bool, * path_hash?: string,