Code Duplication    Length = 5-5 lines in 2 locations

src/GsonBuilder.php 2 locations

@@ 162-166 (lines=5) @@
159
            return $this;
160
        }
161
162
        if ($handler instanceof JsonSerializer) {
163
            $this->typeAdapterFactories[] = new CustomWrappedTypeAdapterFactory(new PhpType($type), $handler);
164
165
            return $this;
166
        }
167
168
        if ($handler instanceof JsonDeserializer) {
169
            $this->typeAdapterFactories[] = new CustomWrappedTypeAdapterFactory(new PhpType($type), null, $handler);
@@ 168-172 (lines=5) @@
165
            return $this;
166
        }
167
168
        if ($handler instanceof JsonDeserializer) {
169
            $this->typeAdapterFactories[] = new CustomWrappedTypeAdapterFactory(new PhpType($type), null, $handler);
170
171
            return $this;
172
        }
173
174
        throw new BadMethodCallException(sprintf('Handler of type "%s" is not supported', get_class($handler)));
175
    }