Make tokens stringable

This commit is contained in:
Andrea Marco Sartori 2022-10-29 18:33:28 +10:00
parent 2ec4bbe58b
commit 94667ba3e3

View File

@ -3,12 +3,13 @@
namespace Cerbero\JsonParser\Tokens;
use Cerbero\JsonParser\State;
use Stringable;
/**
* The abstract implementation of a token.
*
*/
abstract class Token
abstract class Token implements Stringable
{
/**
* The token value.
@ -77,4 +78,14 @@ abstract class Token
{
return false;
}
/**
* Retrieve the underlying token value
*
* @return string
*/
public function __toString(): string
{
return $this->value;
}
}