Code Duplication    Length = 14-14 lines in 2 locations

src/Log/Json.php 1 location

@@ 109-122 (lines=14) @@
106
     * @param \phpbu\App\Result $result
107
     * @return array
108
     */
109
    protected function extractErrors(Result $result) : array
110
    {
111
        $errors = [];
112
        /** @var \Exception $e */
113
        foreach ($result->getErrors() as $e) {
114
            $errors[] = [
115
                'class' => get_class($e),
116
                'msg'   => $e->getMessage(),
117
                'file'  => $e->getFile(),
118
                'line'  => $e->getLine()
119
            ];
120
        }
121
        return $errors;
122
    }
123
124
    /**
125
     * Return backup information.

src/Log/Webhook.php 1 location

@@ 231-244 (lines=14) @@
228
     * @param \phpbu\App\Result $result
229
     * @return array
230
     */
231
    protected function extractErrors(Result $result) : array
232
    {
233
        $errors = [];
234
        /** @var \Exception $e */
235
        foreach ($result->getErrors() as $e) {
236
            $errors[] = [
237
                'class' => get_class($e),
238
                'msg' => $e->getMessage(),
239
                'file' => $e->getFile(),
240
                'line' => $e->getLine()
241
            ];
242
        }
243
        return $errors;
244
    }
245
246
    /**
247
     * Return backup information.