Code Duplication    Length = 19-19 lines in 2 locations

src/PhpSpreadsheet/Worksheet/Drawing.php 1 location

@@ 84-102 (lines=19) @@
81
     *
82
     * @return Drawing
83
     */
84
    public function setPath($pValue, $pVerifyFile = true)
85
    {
86
        if ($pVerifyFile) {
87
            if (file_exists($pValue)) {
88
                $this->path = $pValue;
89
90
                if ($this->width == 0 && $this->height == 0) {
91
                    // Get width/height
92
                    list($this->width, $this->height) = getimagesize($pValue);
93
                }
94
            } else {
95
                throw new PhpSpreadsheetException("File $pValue not found!");
96
            }
97
        } else {
98
            $this->path = $pValue;
99
        }
100
101
        return $this;
102
    }
103
104
    /**
105
     * Get hash code.

src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php 1 location

@@ 306-324 (lines=19) @@
303
     *
304
     * @return HeaderFooterDrawing
305
     */
306
    public function setPath($pValue, $pVerifyFile = true)
307
    {
308
        if ($pVerifyFile) {
309
            if (file_exists($pValue)) {
310
                $this->path = $pValue;
311
312
                if ($this->width == 0 && $this->height == 0) {
313
                    // Get width/height
314
                    list($this->width, $this->height) = getimagesize($pValue);
315
                }
316
            } else {
317
                throw new PhpSpreadsheetException("File $pValue not found!");
318
            }
319
        } else {
320
            $this->path = $pValue;
321
        }
322
323
        return $this;
324
    }
325
326
    /**
327
     * Get hash code.