mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix phpstan
This commit is contained in:
parent
1ba37602bc
commit
74b445ac31
|
|
@ -21396,18 +21396,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../../htdocs/includes/odtphp/Segment.php
|
||||
|
||||
-
|
||||
message: '#^Method Segment\:\:macroReplace\(\) has parameter \$text with no type specified\.$#'
|
||||
identifier: missingType.parameter
|
||||
count: 1
|
||||
path: ../../../htdocs/includes/odtphp/Segment.php
|
||||
|
||||
-
|
||||
message: '#^PHPDoc tag @param references unknown parameter\: \$value$#'
|
||||
identifier: parameter.notFound
|
||||
count: 1
|
||||
path: ../../../htdocs/includes/odtphp/Segment.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#3 \$encode of method Segment\:\:setVars\(\) expects string, false given\.$#'
|
||||
identifier: argument.type
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class Segment implements IteratorAggregate, Countable
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->children);
|
||||
|
|
@ -73,6 +74,7 @@ class Segment implements IteratorAggregate, Countable
|
|||
*
|
||||
* @return Iterator
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator()
|
||||
{
|
||||
return new RecursiveIteratorIterator(new SegmentIterator($this->children), 1);
|
||||
|
|
@ -165,7 +167,7 @@ class Segment implements IteratorAggregate, Countable
|
|||
*
|
||||
* Miguel Erill 09/04/2017
|
||||
*
|
||||
* @param string $value String to convert
|
||||
* @param string $text String to convert
|
||||
*/
|
||||
public function macroReplace($text)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,30 +19,43 @@ class SegmentIterator implements RecursiveIterator
|
|||
$this->key = 0;
|
||||
$this->keys = array_keys($this->ref);
|
||||
}
|
||||
#[\ReturnTypeWillChange]
|
||||
public function hasChildren()
|
||||
{
|
||||
return $this->valid() && $this->current() instanceof Segment;
|
||||
}
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
return $this->ref[$this->keys[$this->key]];
|
||||
}
|
||||
#[\ReturnTypeWillChange]
|
||||
function getChildren()
|
||||
{
|
||||
return new self($this->current()->children);
|
||||
}
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
return array_key_exists($this->key, $this->keys);
|
||||
}
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->key = 0;
|
||||
}
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
$this->key ++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user