Passed
Pull Request — master (#2)
by Thomas
03:05
created

MigrationSchema   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 21
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getStructure() 0 4 1
1
<?php
2
3
namespace Webfactor\Laravel\Generators\Schemas;
4
5
use Illuminate\Support\Collection;
6
7
class MigrationSchema
8
{
9
    protected $structure;
10
11
    public function __construct(string $schema)
12
    {
13
        $this->structure = collect();
14
15
        foreach (explode(',', $schema) as $field) {
16
            $this->structure->push(new MigrationField($field));
17
        }
18
    }
19
20
    /**
21
     * @return Collection
22
     */
23
    public function getStructure(): Collection
24
    {
25
        return $this->structure;
26
    }
27
}
28