Code Duplication    Length = 13-13 lines in 2 locations

classes/ClassGenerator.php 2 locations

@@ 174-186 (lines=13) @@
171
     * @param string $name
172
     * @return ClassGenerator
173
     */
174
    public function generateUnset(string $name): ClassGenerator
175
    {
176
        $this->class
177
            ->addMethod(static::camelCase('unset_' . $name))
178
            ->addComment(
179
                '@return ' . $this->class->getName()
180
            )->setReturnType($this->getCanonicalClassName())
181
            ->setBody(
182
                'unset($this->__' . $name . '__[0]);' . PHP_EOL .
183
                'return $this;'
184
            );
185
        return $this;
186
    }
187
188
    /**
189
     * @param string $name
@@ 294-306 (lines=13) @@
291
     * @param string $name
292
     * @return ClassGenerator
293
     */
294
    public function generateArrayClear(string $name): ClassGenerator
295
    {
296
        $this->class
297
            ->addMethod(static::camelCase('clear_' . $name))
298
            ->addComment(
299
                '@return ' . $this->class->getName()
300
            )->setReturnType($this->getCanonicalClassName())
301
            ->setBody(
302
                'unset($this->__' . $name . '__[0]);' . PHP_EOL .
303
                'return $this;'
304
            );
305
        return $this;
306
    }
307
308
    /**
309
     * @param string $name