From 0993ffb195eac8c05969d70671522fc28d7c9456 Mon Sep 17 00:00:00 2001 From: Sebastian Brix Date: Mon, 22 Sep 2025 09:07:26 +0200 Subject: [PATCH] Calling get_class() without arguments is deprecated --- src/ConcatParser.php | 2 +- src/EmptyParser.php | 2 +- src/GrammerParser.php | 2 +- src/GreedyMultiParser.php | 2 +- src/LazyAltParser.php | 2 +- src/RegexParser.php | 2 +- src/StringParser.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ConcatParser.php b/src/ConcatParser.php index 92d6e4f..0caa202 100644 --- a/src/ConcatParser.php +++ b/src/ConcatParser.php @@ -10,7 +10,7 @@ class ConcatParser extends BaseParser */ public function __construct(array $internals, $generator = null) { - $this->description = 'new '.get_class().'('.$this->serializeInternals($internals).')'; + $this->description = 'new '.self::class.'('.$this->serializeInternals($internals).')'; parent::__construct($internals, $generator); } diff --git a/src/EmptyParser.php b/src/EmptyParser.php index ffdd253..32051a1 100644 --- a/src/EmptyParser.php +++ b/src/EmptyParser.php @@ -9,7 +9,7 @@ class EmptyParser extends BaseParser */ public function __construct($generator = null) { - $this->description = 'new '.get_class().'()'; + $this->description = 'new '.self::class.'()'; parent::__construct(array(), $generator); } diff --git a/src/GrammerParser.php b/src/GrammerParser.php index 640a9c2..df90749 100644 --- a/src/GrammerParser.php +++ b/src/GrammerParser.php @@ -14,7 +14,7 @@ class GrammerParser extends BaseParser */ public function __construct($s, array $internals, $generator = null) { - $this->description = 'new '.get_class().'('.$this->serializeInternals($internals).')'; + $this->description = 'new '.self::class.'('.$this->serializeInternals($internals).')'; parent::__construct($internals, $generator); $this->s = (string)$s; diff --git a/src/GreedyMultiParser.php b/src/GreedyMultiParser.php index b117663..a2f8897 100644 --- a/src/GreedyMultiParser.php +++ b/src/GreedyMultiParser.php @@ -21,7 +21,7 @@ class GreedyMultiParser extends BaseParser $this->lower = $lower; $this->optional = $optional; - $this->description = 'new '.get_class()."({$internal}, {$lower}, {$optional})"; + $this->description = 'new '.self::class."({$internal}, {$lower}, {$optional})"; parent::__construct(array($internal), $generator); } diff --git a/src/LazyAltParser.php b/src/LazyAltParser.php index 7e8fd50..14d8cbf 100644 --- a/src/LazyAltParser.php +++ b/src/LazyAltParser.php @@ -14,7 +14,7 @@ class LazyAltParser extends BaseParser throw new GrammerException('At least one internal parser is needed!'); } - $this->description = 'new '.get_class().'('.$this->serializeInternals($internals).')'; + $this->description = 'new '.self::class.'('.$this->serializeInternals($internals).')'; parent::__construct($internals, $generator); } diff --git a/src/RegexParser.php b/src/RegexParser.php index ac36e94..c022925 100644 --- a/src/RegexParser.php +++ b/src/RegexParser.php @@ -18,7 +18,7 @@ class RegexParser extends BaseParser throw new GrammerException('Pattern {$this->pattern} must anchor at the beginning of the string!'); } - $this->description = 'new '.get_class().'('.var_export($this->pattern, true).')'; + $this->description = 'new '.self::class.'('.var_export($this->pattern, true).')'; parent::__construct(array(), $generator); } diff --git a/src/StringParser.php b/src/StringParser.php index d07eead..affd3a8 100644 --- a/src/StringParser.php +++ b/src/StringParser.php @@ -15,7 +15,7 @@ class StringParser extends BaseParser { $this->needle = (string)$needle; - $this->description = 'new '.get_class().'('.var_export($this->needle, true).')'; + $this->description = 'new '.self::class.'('.var_export($this->needle, true).')'; parent::__construct(array(), $generator); } -- 2.34.1