Code Duplication    Length = 17-21 lines in 2 locations

src/Request/JsonProcessor.php 1 location

@@ 157-173 (lines=17) @@
154
     * @return mixed
155
     * @throws Exception
156
     */
157
    public static function process($payload, Parameters $parameters, \Psr\Log\LoggerInterface $logger) {
158
159
        try {
160
161
            $processor = new JsonProcessor($payload, $parameters, $logger);
162
163
            $return = $processor->run();
164
165
        } catch (Exception $e) {
166
167
            throw $e;
168
169
        }
170
171
        return $return;
172
173
    }
174
175
    /**
176
     * Preprocess json payload

src/Request/XmlProcessor.php 1 location

@@ 178-198 (lines=21) @@
175
     * @throws \Comodojo\Exception\RpcException
176
     * @throws Exception
177
     */
178
    public static function process($payload, Parameters $parameters, \Psr\Log\LoggerInterface $logger) {
179
180
        try {
181
182
            $processor = new self($payload, $parameters, $logger);
183
184
            $return = $processor->run();
185
186
        } catch (RpcException $re) {
187
188
            throw $re;
189
190
        } catch (Exception $e) {
191
192
            throw $e;
193
194
        }
195
196
        return $return;
197
198
    }
199
200
    /**
201
     * Check if a request is sustainable (i.e. if method is registered)