mirror of
https://github.com/cerbero90/json-parser.git
synced 2025-01-17 21:18:41 +01:00
Make tokens stringable
This commit is contained in:
parent
2ec4bbe58b
commit
94667ba3e3
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user