Code Duplication    Length = 13-13 lines in 2 locations

classes/ClassGenerator.php 2 locations

@@ 211-223 (lines=13) @@
208
     * @param string $name
209
     * @return ClassGenerator
210
     */
211
    public function generateUnset(string $name): ClassGenerator
212
    {
213
        $this->class
214
            ->addMethod(static::camelCase('unset_' . $name))
215
            ->addComment(
216
                '@return ' . $this->class->getName()
217
            )->setReturnType($this->getCanonicalClassName())
218
            ->setBody(
219
                'unset($this->__' . $name . '__[0]);' . PHP_EOL .
220
                'return $this;'
221
            );
222
        return $this;
223
    }
224
225
    /**
226
     * @param string $name
@@ 476-488 (lines=13) @@
473
     * @param string $name
474
     * @return ClassGenerator
475
     */
476
    public function generateArrayClear(string $name): ClassGenerator
477
    {
478
        $this->class
479
            ->addMethod(static::camelCase('clear_' . $name))
480
            ->addComment(
481
                '@return ' . $this->class->getName()
482
            )->setReturnType($this->getCanonicalClassName())
483
            ->setBody(
484
                'unset($this->__' . $name . '__[0]);' . PHP_EOL .
485
                'return $this;'
486
            );
487
        return $this;
488
    }
489
490
    /**
491
     * @param string $name