Code Duplication    Length = 19-19 lines in 2 locations

src/PhpSpreadsheet/Worksheet/Drawing.php 1 location

@@ 103-121 (lines=19) @@
100
     *
101
     * @return Drawing
102
     */
103
    public function setPath($pValue, $pVerifyFile = true)
104
    {
105
        if ($pVerifyFile) {
106
            if (file_exists($pValue)) {
107
                $this->path = $pValue;
108
109
                if ($this->width == 0 && $this->height == 0) {
110
                    // Get width/height
111
                    list($this->width, $this->height) = getimagesize($pValue);
112
                }
113
            } else {
114
                throw new \PhpOffice\PhpSpreadsheet\Exception("File $pValue not found!");
115
            }
116
        } else {
117
            $this->path = $pValue;
118
        }
119
120
        return $this;
121
    }
122
123
    /**
124
     * Get hash code.

src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php 1 location

@@ 325-343 (lines=19) @@
322
     *
323
     * @return HeaderFooterDrawing
324
     */
325
    public function setPath($pValue, $pVerifyFile = true)
326
    {
327
        if ($pVerifyFile) {
328
            if (file_exists($pValue)) {
329
                $this->path = $pValue;
330
331
                if ($this->width == 0 && $this->height == 0) {
332
                    // Get width/height
333
                    list($this->width, $this->height) = getimagesize($pValue);
334
                }
335
            } else {
336
                throw new \PhpOffice\PhpSpreadsheet\Exception("File $pValue not found!");
337
            }
338
        } else {
339
            $this->path = $pValue;
340
        }
341
342
        return $this;
343
    }
344
345
    /**
346
     * Get hash code.