Code Duplication    Length = 10-10 lines in 2 locations

src/Formatter/Coordinate/DecimalMinutes.php 1 location

@@ 104-113 (lines=10) @@
101
     * @return DecimalMinutes
102
     * @throws \InvalidArgumentException
103
     */
104
    public function setUnits(string $type): DecimalMinutes
105
    {
106
        if (! array_key_exists($type, $this->units)) {
107
            throw new \InvalidArgumentException('Invalid unit type');
108
        }
109
110
        $this->unitType = $type;
111
112
        return $this;
113
    }
114
115
    /**
116
     * @param int $digits

src/Formatter/Coordinate/DMS.php 1 location

@@ 97-106 (lines=10) @@
94
     * @return DMS
95
     * @throws \InvalidArgumentException
96
     */
97
    public function setUnits(string $type): DMS
98
    {
99
        if (! array_key_exists($type, $this->units)) {
100
            throw new \InvalidArgumentException('Invalid unit type');
101
        }
102
103
        $this->unitType = $type;
104
105
        return $this;
106
    }
107
108
    /**
109
     * @param Coordinate $coordinate