Code Duplication    Length = 9-9 lines in 2 locations

src/generator/TableVirtualCollection.php 1 location

@@ 26-34 (lines=9) @@
23
     * @param Generator $generator
24
     * @param           $metadata
25
     */
26
    public function __construct(Generator $generator, $metadata)
27
    {
28
        parent::__construct($generator, $metadata);
29
30
        $replaced = preg_replace('/Table$/i', '', $this->metadata->entity);
31
        $this->className = $replaced . 'TableCollection';
32
        $this->parentClass = $replaced . 'TableQuery';
33
        $this->entityClass = '\samsoncms\api\generated\\' . $replaced . 'TableEntity';
34
    }
35
36
    /**
37
     * Class constructor generation part.

src/generator/TableVirtualQuery.php 1 location

@@ 26-34 (lines=9) @@
23
     * @param Generator $generator
24
     * @param           $metadata
25
     */
26
    public function __construct(Generator $generator, $metadata)
27
    {
28
        parent::__construct($generator, $metadata);
29
30
        $replaced = preg_replace('/Table$/i', '', $this->metadata->entity);
31
        $this->className = $replaced . 'TableQuery';
32
        $this->parentClass = '\\' . \samsoncms\api\query\EntityTable::class;
33
        $this->entityClass = '\samsoncms\api\generated\\' . $replaced . 'TableEntity';
34
    }
35
36
    /**
37
     * Class uses generation part.