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

Seeder::setRunner()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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