Code Duplication    Length = 6-6 lines in 2 locations

src/Decoder.php 1 location

@@ 172-177 (lines=6) @@
169
                1478418107
170
            );
171
        }
172
        if (!is_int($options)) {
173
            throw new InvalidArgumentException(
174
                sprintf("Integer expected for argument '%s'. Got '%s'.", 'options', gettype($options)),
175
                1478418108
176
            );
177
        }
178
179
        $fromEncoding = self::UTF8;
180
        try {

src/Encoder.php 1 location

@@ 81-86 (lines=6) @@
78
    public function encode($value, $options = 0, $depth = 512)
79
    {
80
        // Check arguments
81
        if (!is_int($options)) {
82
            throw new InvalidArgumentException(
83
                sprintf("Integer expected for argument '%s'. Got '%s'.", 'options', gettype($options)),
84
                1478418109
85
            );
86
        }
87
        if (!is_int($depth)) {
88
            throw new InvalidArgumentException(
89
                sprintf("Integer expected for argument '%s'. Got '%s'.", 'depth', gettype($depth)),