| 1 | <?php |
||
| 27 | class JsonConverter implements Converter |
||
| 28 | { |
||
| 29 | use ConverterTrait; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * json_encode options |
||
| 33 | * |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | protected $options = 0; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * json_encode depth |
||
| 40 | * |
||
| 41 | * @var int |
||
| 42 | */ |
||
| 43 | protected $depth = 512; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Json encode Options |
||
| 47 | * |
||
| 48 | * @param int $options |
||
| 49 | * @param int $depth |
||
| 50 | * |
||
| 51 | * @return self |
||
| 52 | */ |
||
| 53 | 2 | public function options(int $options = 0, int $depth = 512): self |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Convert an Record collection into a Json string |
||
| 64 | * |
||
| 65 | * @param array|Traversable $records the CSV records collection |
||
| 66 | * |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | 4 | public function convert($records) |
|
| 83 | } |
||
| 84 |