Code Duplication    Length = 36-36 lines in 2 locations

src/Schemas/CrudColumn.php 1 location

@@ 5-40 (lines=36) @@
2
3
namespace Webfactor\Laravel\Generators\Schemas;
4
5
class CrudColumn
6
{
7
    private $type;
8
9
    private $field;
10
11
    public function __construct(MigrationField $migrationField)
12
    {
13
        $this->type = $migrationField->getType();
14
        $this->field = $migrationField->getName();
15
    }
16
17
    public function generateColumn(): array
18
    {
19
        return [
20
            'name' => $this->getField(),
21
            'type' => $this->getType(),
22
        ];
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getField()
29
    {
30
        return $this->field;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getType()
37
    {
38
        return $this->type;
39
    }
40
}
41

src/Schemas/CrudField.php 1 location

@@ 5-40 (lines=36) @@
2
3
namespace Webfactor\Laravel\Generators\Schemas;
4
5
class CrudField
6
{
7
    private $type;
8
9
    private $field;
10
11
    public function __construct(MigrationField $migrationField)
12
    {
13
        $this->type = $migrationField->getType();
14
        $this->field = $migrationField->getName();
15
    }
16
17
    public function generateField(): array
18
    {
19
        return [
20
            'name'  => $this->getField(),
21
            'type'  => $this->getType(),
22
        ];
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getField()
29
    {
30
        return $this->field;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getType()
37
    {
38
        return $this->type;
39
    }
40
}
41