| 1 | <?php |
||
| 14 | final class Json implements Formatter |
||
| 15 | { |
||
| 16 | private const DEFAULT_FLAGS = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var int |
||
| 20 | */ |
||
| 21 | private $flags; |
||
| 22 | |||
| 23 | public function __construct(int $flags = self::DEFAULT_FLAGS) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | public function format($content, array $attributes = []): string |
||
| 39 | |||
| 40 | protected function formatException(Throwable $e): string |
||
| 52 | |||
| 53 | protected function encode($data): string |
||
| 60 | } |
||
| 61 |