Code Duplication    Length = 9-11 lines in 2 locations

src/ObjectFacade.php 2 locations

@@ 135-145 (lines=11) @@
132
     *
133
     * @return bool
134
     */
135
    final public function setValueByMethod(string $name, $value): bool
136
    {
137
        $method = $this->getSetterMethod($name);
138
        if ($method !== null && Validator::new($this)->isValidSetterMethod($method, $value)) {
139
            $method->invoke($this->object, $value);
140
141
            return true;
142
        }
143
144
        return false;
145
    }
146
147
    /**
148
     * @param string $name
@@ 152-160 (lines=9) @@
149
     *
150
     * @return mixed|null
151
     */
152
    final public function getValueByMethod(string $name)
153
    {
154
        $method = $this->getGetterMethod($name);
155
        if ($method !== null && Validator::new($this)->isValidGetterMethod($method)) {
156
            return $method->invoke($this->object);
157
        }
158
159
        return null;
160
    }
161
162
    /**
163
     * @param string $name