Code Duplication    Length = 12-12 lines in 2 locations

src/Node/ObjectNode.php 1 location

@@ 85-96 (lines=12) @@
82
     * @param boolean $beautify
83
     * @return string
84
     */
85
    public function json(bool $beautify = false): string
86
    {
87
        if (null === $serialized = $this->serialize()) {
88
            return '';
89
        }
90
91
        if ($beautify) {
92
            return json_encode($serialized, JSON_PRETTY_PRINT);
93
        }
94
95
        return json_encode($serialized);
96
    }
97
}
98

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