Code Duplication    Length = 10-11 lines in 4 locations

src/PhpSpreadsheet/Style/Protection.php 2 locations

@@ 152-161 (lines=10) @@
149
     *
150
     * @return Protection
151
     */
152
    public function setLocked($pValue = self::PROTECTION_INHERIT)
153
    {
154
        if ($this->isSupervisor) {
155
            $styleArray = $this->getStyleArray(['locked' => $pValue]);
156
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
157
        } else {
158
            $this->locked = $pValue;
159
        }
160
161
        return $this;
162
    }
163
164
    /**
@@ 185-194 (lines=10) @@
182
     *
183
     * @return Protection
184
     */
185
    public function setHidden($pValue = self::PROTECTION_INHERIT)
186
    {
187
        if ($this->isSupervisor) {
188
            $styleArray = $this->getStyleArray(['hidden' => $pValue]);
189
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
190
        } else {
191
            $this->hidden = $pValue;
192
        }
193
194
        return $this;
195
    }
196
197
    /**

src/PhpSpreadsheet/Style/Fill.php 2 locations

@@ 207-217 (lines=11) @@
204
     *
205
     * @return Fill
206
     */
207
    public function setFillType($pValue = self::FILL_NONE)
208
    {
209
        if ($this->isSupervisor) {
210
            $styleArray = $this->getStyleArray(['type' => $pValue]);
211
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
212
        } else {
213
            $this->fillType = $pValue;
214
        }
215
216
        return $this;
217
    }
218
219
    /**
220
     * Get Rotation.
@@ 240-249 (lines=10) @@
237
     *
238
     * @return Fill
239
     */
240
    public function setRotation($pValue = 0)
241
    {
242
        if ($this->isSupervisor) {
243
            $styleArray = $this->getStyleArray(['rotation' => $pValue]);
244
            $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
245
        } else {
246
            $this->rotation = $pValue;
247
        }
248
249
        return $this;
250
    }
251
252
    /**