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
@@ 309-321 (lines=13) @@
306
     * @param string $name
307
     * @return ClassGenerator
308
     */
309
    public function generateArrayClear(string $name): ClassGenerator
310
    {
311
        $this->class
312
            ->addMethod(static::camelCase('clear_' . $name))
313
            ->addComment(
314
                '@return ' . $this->class->getName()
315
            )->setReturnType($this->getCanonicalClassName())
316
            ->setBody(
317
                'unset($this->__' . $name . '__[0]);' . PHP_EOL .
318
                'return $this;'
319
            );
320
        return $this;
321
    }
322
323
    /**
324
     * @param string $name