Code Duplication    Length = 12-12 lines in 2 locations

src/QueryBuilder.php 1 location

@@ 189-200 (lines=12) @@
186
     * @param boolean $beautify
187
     * @return string
188
     */
189
    public function json(bool $beautify = false): string
190
    {
191
        if (null === $serialized = $this->serialize()) {
192
            return '';
193
        }
194
195
        if ($beautify) {
196
            return json_encode($serialized, JSON_PRETTY_PRINT);
197
        }
198
199
        return json_encode($serialized);
200
    }
201
}
202

src/Node/ObjectNode.php 1 location

@@ 98-109 (lines=12) @@
95
     * @param boolean $beautify
96
     * @return string
97
     */
98
    public function json(bool $beautify = false): string
99
    {
100
        if (null === $serialized = $this->serialize()) {
101
            return '';
102
        }
103
104
        if ($beautify) {
105
            return json_encode($serialized, JSON_PRETTY_PRINT);
106
        }
107
108
        return json_encode($serialized);
109
    }
110
}
111