From 051439c447787396e4a3a36e61d3538e9fd29433 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sun, 18 Apr 2021 18:39:18 +0200 Subject: [PATCH] Token::toJson() - remove parameter --- src/Tokenizer/Token.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/Tokenizer/Token.php b/src/Tokenizer/Token.php index 5a088f511a5..7e80d864171 100644 --- a/src/Tokenizer/Token.php +++ b/src/Tokenizer/Token.php @@ -462,26 +462,9 @@ public function toArray(): array ]; } - /** - * @param null|string[] $options JSON encode option - */ - public function toJson(?array $options = null): string + public function toJson(): string { - if (null !== $options) { - Utils::triggerDeprecation(sprintf('Arguments of "%s()" is deprecated since 2.19 and will be removed in 3.0.', __METHOD__)); - } - - static $defaultOptions = null; - - if (null === $options) { - if (null === $defaultOptions) { - $defaultOptions = Utils::calculateBitmask(['JSON_PRETTY_PRINT', 'JSON_NUMERIC_CHECK']); - } - - $options = $defaultOptions; - } else { - $options = Utils::calculateBitmask($options); - } + $options = Utils::calculateBitmask(['JSON_PRETTY_PRINT', 'JSON_NUMERIC_CHECK']); $jsonResult = json_encode($this->toArray(), $options);