fix PHP 8.1 limit

This commit is contained in:
Jean-Christian Paul Denis 2023-07-01 10:41:14 +02:00
parent aa4af2e63a
commit a8e840eca7
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
6 changed files with 41 additions and 11 deletions

View File

@ -32,7 +32,10 @@ class ActionsCleanersStack implements Countable, Iterator
return isset($this->stack[$offset]); return isset($this->stack[$offset]);
} }
public function get(int $offset): ?ActionDescriptor /**
* @return null|ActionDescriptor
*/
public function get(int $offset)
{ {
return $this->stack[$offset] ?? null; return $this->stack[$offset] ?? null;
} }
@ -52,12 +55,20 @@ class ActionsCleanersStack implements Countable, Iterator
reset($this->stack); reset($this->stack);
} }
public function current(): false|ActionDescriptor /**
* @return false|ActionDescriptor
*/
#[\ReturnTypeWillChange]
public function current()
{ {
return current($this->stack); return current($this->stack);
} }
public function key(): ?int /**
* @return null|int
*/
#[\ReturnTypeWillChange]
public function key()
{ {
return key($this->stack); return key($this->stack);
} }

View File

@ -56,12 +56,20 @@ class ActionsStack implements Countable, Iterator
reset($this->stack); reset($this->stack);
} }
public function current(): false|ActionsCleanersStack /**
* @return false|ActionsCleanersStack
*/
#[\ReturnTypeWillChange]
public function current()
{ {
return current($this->stack); return current($this->stack);
} }
public function key(): ?string /**
* return null|string
*/
#[\ReturnTypeWillChange]
public function key()
{ {
return key($this->stack); return key($this->stack);
} }

View File

@ -50,7 +50,7 @@ abstract class CleanerParent
* *
* @return null|ActionDescriptor The action descriptor * @return null|ActionDescriptor The action descriptor
*/ */
final public function get(string $id): ?ActionDescriptor final public function get(string $id)
{ {
return $this->actions[$id] ?? null; return $this->actions[$id] ?? null;
} }

View File

@ -43,7 +43,10 @@ class CleanersStack implements Countable, Iterator
return isset($this->stack[$offset]); return isset($this->stack[$offset]);
} }
public function get(string $offset): ?CleanerParent /**
* @return null|CleanerParent
*/
public function get(string $offset)
{ {
return $this->stack[$offset] ?? null; return $this->stack[$offset] ?? null;
} }
@ -67,12 +70,20 @@ class CleanersStack implements Countable, Iterator
reset($this->stack); reset($this->stack);
} }
public function current(): false|CleanerParent /**
* @return false|CleanerParent
*/
#[\ReturnTypeWillChange]
public function current()
{ {
return current($this->stack); return current($this->stack);
} }
public function key(): ?string /**
* @return null|string
*/
#[\ReturnTypeWillChange]
public function key()
{ {
return key($this->stack); return key($this->stack);
} }

View File

@ -25,7 +25,7 @@ trait DirTrait
/** /**
* Get excuded files. * Get excuded files.
* *
* @param array<int,string> The excluded files * @return array<int,string> The excluded files
*/ */
public static function getExcluded(): array public static function getExcluded(): array
{ {

View File

@ -264,7 +264,7 @@ class Uninstaller
* *
* @return null|ActionDescriptor The action description * @return null|ActionDescriptor The action description
*/ */
private function addAction(string $cleaner, string $action, string $ns, ?bool $default): ?ActionDescriptor private function addAction(string $cleaner, string $action, string $ns, ?bool $default)
{ {
// no current module or no cleaner id or no ns or unknown cleaner action // no current module or no cleaner id or no ns or unknown cleaner action
if (null === $this->module if (null === $this->module