Code Duplication    Length = 7-7 lines in 2 locations

src/JsonDecoder.php 1 location

@@ 115-121 (lines=7) @@
112
            $schema = $data->{'$schema'};
113
        }
114
115
        if (null !== $schema) {
116
            $errors = $this->validator->validate($data, $schema);
117
118
            if (count($errors) > 0) {
119
                throw ValidationFailedException::fromErrors($errors);
120
            }
121
        }
122
123
        return $data;
124
    }

src/JsonEncoder.php 1 location

@@ 137-143 (lines=7) @@
134
            $schema = $data->{'$schema'};
135
        }
136
137
        if (null !== $schema) {
138
            $errors = $this->validator->validate($data, $schema);
139
140
            if (count($errors) > 0) {
141
                throw ValidationFailedException::fromErrors($errors);
142
            }
143
        }
144
145
        $options = 0;
146