From da7675c822e236da6cd7bc06ee24e9e5e2beca65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 11 Jan 2025 17:45:29 +0100 Subject: [PATCH] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 18 ------------------ htdocs/includes/odtphp/Segment.php | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index a82935c45fc..4e98d2d655e 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -21108,12 +21108,6 @@ parameters: count: 1 path: ../../../htdocs/includes/odtphp/Segment.php - - - message: '#^Property Segment\:\:\$name has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/includes/odtphp/Segment.php - - message: '#^Property Segment\:\:\$odf has no type specified\.$#' identifier: missingType.property @@ -21126,18 +21120,6 @@ parameters: count: 1 path: ../../../htdocs/includes/odtphp/Segment.php - - - message: '#^Property Segment\:\:\$xml has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/includes/odtphp/Segment.php - - - - message: '#^Property Segment\:\:\$xmlParsed has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/includes/odtphp/Segment.php - - message: '#^Class SegmentIterator implements generic interface RecursiveIterator but does not specify its types\: TKey, TValue$#' identifier: missingType.generics diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index 3e8675c65a9..95b1c75d35c 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -16,8 +16,24 @@ class SegmentException extends Exception */ class Segment implements IteratorAggregate, Countable { + /** + * @var string + */ protected $xml; + + /** + * @var string + */ + protected $savxml; + + /** + * @var string + */ protected $xmlParsed = ''; + + /** + * @var string + */ protected $name; protected $children = array(); protected $vars = array(); @@ -30,7 +46,7 @@ class Segment implements IteratorAggregate, Countable * * @param string $name name of the segment to construct * @param string $xml XML tree of the segment - * @param string $odf odf + * @param Odf $odf odf */ public function __construct($name, $xml, $odf) {