Code Duplication    Length = 22-22 lines in 2 locations

src/PhpSpreadsheet/Chart/Axis.php 1 location

@@ 373-394 (lines=22) @@
370
     *
371
     * @return Axis
372
     */
373
    private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
374
    {
375
        $base_reference = $reference;
376
        foreach ($properties_map as $property_key => $property_val) {
377
            if (is_array($property_val)) {
378
                if ($reference === null) {
379
                    $reference = &$this->shadowProperties[$property_key];
380
                } else {
381
                    $reference = &$reference[$property_key];
382
                }
383
                $this->setShadowProperiesMapValues($property_val, $reference);
384
            } else {
385
                if ($base_reference === null) {
386
                    $this->shadowProperties[$property_key] = $property_val;
387
                } else {
388
                    $reference[$property_key] = $property_val;
389
                }
390
            }
391
        }
392
393
        return $this;
394
    }
395
396
    /**
397
     * Set Shadow Color

src/PhpSpreadsheet/Chart/GridLines.php 1 location

@@ 326-347 (lines=22) @@
323
     *
324
     * @return GridLines
325
     */
326
    private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
327
    {
328
        $base_reference = $reference;
329
        foreach ($properties_map as $property_key => $property_val) {
330
            if (is_array($property_val)) {
331
                if ($reference === null) {
332
                    $reference = &$this->shadowProperties[$property_key];
333
                } else {
334
                    $reference = &$reference[$property_key];
335
                }
336
                $this->setShadowProperiesMapValues($property_val, $reference);
337
            } else {
338
                if ($base_reference === null) {
339
                    $this->shadowProperties[$property_key] = $property_val;
340
                } else {
341
                    $reference[$property_key] = $property_val;
342
                }
343
            }
344
        }
345
346
        return $this;
347
    }
348
349
    /**
350
     * Set Shadow Color