Seeder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 59
rs 10
wmc 3
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
run() 0 1 ?
A call() 0 4 1
A setRunner() 0 6 1
A setOutput() 0 6 1
1
<?php
2
3
namespace Yarak\DB\Seeders;
4
5
use Artisanize\Output\Output;
6
7
abstract class Seeder
8
{
9
    /**
10
     * SeedRunner instance.
11
     *
12
     * @var SeedRunner
13
     */
14
    protected $runner;
15
16
    /**
17
     * Output strategy.
18
     *
19
     * @var Output
20
     */
21
    protected $output;
22
23
    /**
24
     * Run the database seed logic.
25
     */
26
    abstract public function run();
27
28
    /**
29
     * Call the run method on the given seeder class.
30
     *
31
     * @param string $class
32
     */
33
    protected function call($class)
34
    {
35
        $this->runner->run($class);
36
    }
37
38
    /**
39
     * Set SeedRunner instance on object.
40
     *
41
     * @param SeedRunner $runner
42
     *
43
     * @return $this
44
     */
45
    public function setRunner(SeedRunner $runner)
46
    {
47
        $this->runner = $runner;
48
49
        return $this;
50
    }
51
52
    /**
53
     * Set output strategy on object.
54
     *
55
     * @param Output $output
56
     *
57
     * @return $this
58
     */
59
    public function setOutput(Output $output)
60
    {
61
        $this->output = $output;
62
63
        return $this;
64
    }
65
}
66