Completed
Push — dev ( 6500dc...8bb13e )
by Zach
02:12
created

Seeder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 22
rs 10
wmc 2
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
run() 0 1 ?
A call() 0 4 1
A setRunner() 0 4 1
1
<?php
2
3
namespace Yarak\DB\Seeders;
4
5
abstract class Seeder
6
{
7
    /**
8
     * Run the database seed logic.
9
     */
10
    abstract public function run();
11
12
    /**
13
     * Call the run method on the given seeder class.
14
     *
15
     * @param  string $class
16
     */
17
    protected function call($class)
18
    {
19
        $this->runner->run($class);
0 ignored issues
show
Bug introduced by
The property runner does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
20
    }
21
22
    public function setRunner(SeedRunner $runner)
23
    {
24
        $this->runner = $runner;
25
    }
26
}
27