Code Duplication    Length = 10-10 lines in 2 locations

src/Charcoal/Ui/Dashboard/DashboardTrait.php 2 locations

@@ 48-57 (lines=10) @@
45
     */
46
    protected function setWidgetBuilder($builder)
47
    {
48
        if (is_object($builder)) {
49
            $this->widgetBuilder = $builder;
50
        } else {
51
            throw new InvalidArgumentException(
52
                sprintf(
53
                    'Argument must be a widget builder, %s given',
54
                    (is_object($builder) ? get_class($builder) : gettype($builder))
55
                )
56
            );
57
        }
58
59
        return $this;
60
    }
@@ 78-87 (lines=10) @@
75
            return $this;
76
        }
77
78
        if (is_callable($callable)) {
79
            $this->widgetCallback = $callable;
80
        } else {
81
            throw new InvalidArgumentException(
82
                sprintf(
83
                    'Argument must be callable or NULL, %s given',
84
                    (is_object($callable) ? get_class($callable) : gettype($callable))
85
                )
86
            );
87
        }
88
89
        return $this;
90
    }