1 | <?php |
||
26 | class JsonWriter |
||
27 | { |
||
28 | private $filename; |
||
29 | private $handle; |
||
30 | private $count; |
||
31 | private $currentPosition = 0; |
||
32 | |||
33 | public function __construct(string $filename, int $count) |
||
38 | |||
39 | /** |
||
40 | * Destructor. Closes file handler if open. |
||
41 | */ |
||
42 | public function __destruct() |
||
46 | |||
47 | /** |
||
48 | * Performs initialization. |
||
49 | */ |
||
50 | protected function initialize() |
||
60 | |||
61 | /** |
||
62 | * Performs finalization. |
||
63 | */ |
||
64 | public function finalize() |
||
73 | |||
74 | /** |
||
75 | * Writes single document to stream. |
||
76 | * |
||
77 | * @param mixed $document Object to insert into stream. |
||
78 | * |
||
79 | * @throws \OverflowException |
||
80 | */ |
||
81 | public function push($document) |
||
99 | } |
||
100 |