Code Duplication    Length = 16-16 lines in 2 locations

transports/slack/message/Attachment.php 1 location

@@ 693-708 (lines=16) @@
690
     * @return  $this
691
     * @throws  \InvalidArgumentException
692
     */
693
    public function addAction($action) : Attachment
694
    {
695
        if (is_array($action)) {
696
            $this->actions[] = new attachment\Action($action);
697
698
            return $this;
699
        }
700
701
        if ($action instanceof attachment\Action) {
702
            $this->actions[] = $action;
703
704
            return $this;
705
        }
706
707
        throw new \InvalidArgumentException("Expected an array or an instance of ".attachment\Action::class.", got [".diagnostics\Debug::getTypeName($action)."] instead.");
708
   }
709
710
    /**
711
     * {@inheritDoc}

transports/slack/message/attachment/Action.php 1 location

@@ 251-266 (lines=16) @@
248
     * @return  $this
249
     * @throws  \InvalidArgumentException
250
     */
251
    public function setConfirm($confirm) : Action
252
    {
253
        if (is_array($confirm)) {
254
            $this->confirm = new actions\Confirmation($confirm);
255
256
            return $this;
257
        }
258
259
        if ($confirm instanceof actions\Confirmation) {
260
            $this->confirm = $confirm;
261
262
            return $this;
263
        }
264
265
        throw new \InvalidArgumentException("Expected an array or an instance of ".actions\Confirmation::class.", got [".diagnostics\Debug::getTypeName($confirm)."] instead.");
266
    }
267
268
    /**
269
     * {@inheritDoc}