Code Duplication    Length = 13-16 lines in 2 locations

src/Charcoal/Property/PropertyMetadata.php 1 location

@@ 36-51 (lines=16) @@
33
     * @throws InvalidArgumentException If identifier is not a string.
34
     * @return self
35
     */
36
    public function setIdent($ident)
37
    {
38
        if (!is_string($ident)) {
39
            throw new InvalidArgumentException(
40
                sprintf(
41
                    '[%s] Identifier must be a string; received %s',
42
                    get_called_class(),
43
                    (is_object($ident) ? get_class($ident) : gettype($ident))
44
                )
45
            );
46
        }
47
48
        $this->ident = $ident;
49
50
        return $this;
51
    }
52
53
    /**
54
     * Retrieve the metadata identifier.

src/Charcoal/Property/ImageProperty.php 1 location

@@ 89-101 (lines=13) @@
86
     * @throws InvalidArgumentException If the drive type is not a string.
87
     * @return ImageProperty Chainable
88
     */
89
    public function setDriverType($type)
90
    {
91
        if (!is_string($type)) {
92
            throw new InvalidArgumentException(sprintf(
93
                'Image driver type must be a string, received %s',
94
                (is_object($type) ? get_class($type) : gettype($type))
95
            ));
96
        }
97
98
        $this->driverType = $type;
99
100
        return $this;
101
    }
102
103
    /**
104
     * Retrieve the name of the property's image processing driver.