Code Duplication    Length = 14-14 lines in 2 locations

src/PropertiesHandler.php 2 locations

@@ 102-115 (lines=14) @@
99
     * @throws BadMethodCallException If unable to get the property value.
100
     * @see PropertiesHandler::getPropertyGetter()
101
     * */
102
    public function __get($name)
103
    {
104
        try {
105
            $getter = static::getPropertyGetter($name);
106
        } catch (InvalidArgumentException $error) {
107
            $msg = msg('Unable to get the property value in "{0}" class.', get_class($this));
108
            throw new BadMethodCallException($msg, 31, $error);
109
        } catch (BadMethodCallException $error) {
110
            $msg = msg('Unable to get the property value in "{0}" class.', get_class($this));
111
            throw new BadMethodCallException($msg, 32, $error);
112
        }
113
114
        return $this->$getter();
115
    }
116
117
118
    /**
@@ 129-142 (lines=14) @@
126
     * @throws BadMethodCallException If unable to set property value.
127
     * @see PropertiesHandler::getPropertySetter()
128
     * */
129
    public function __set($name, $value)
130
    {
131
        try {
132
            $setter = static::getPropertySetter($name);
133
        } catch (InvalidArgumentException $error) {
134
            $msg = msg('Unable to set the property value in "{0}" class.', get_class($this));
135
            throw new BadMethodCallException($msg, 41, $error);
136
        } catch (BadMethodCallException $error) {
137
            $msg = msg('Unable to set the property value in "{0}" class.', get_class($this));
138
            throw new BadMethodCallException($msg, 42, $error);
139
        }
140
141
        $this->$setter($value);
142
    }
143
144
145
    /**