SeedingProgressBar   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 17 3
1
<?php
2
3
namespace App\Traits\Seeds;
4
5
trait SeedingProgressBar
6
{
7
    public function run()
8
    {
9
        $seeders = $this->seeders;
10
11
        $this->command->info('Seeding ' . __CLASS__ . '...');
12
        $this->command->getOutput()->progressStart(count($seeders));
13
14
        foreach ($seeders as $class => $is_class) {
15
            if ($is_class) {
16
                $this->call($class, true);
0 ignored issues
show
Bug introduced by
It seems like call() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
                $this->/** @scrutinizer ignore-call */ 
17
                       call($class, true);
Loading history...
17
            } else {
18
                $method = $class;
19
                $this->$method();
20
            }
21
            $this->command->getOutput()->progressAdvance();
22
        }
23
        $this->command->getOutput()->progressFinish();
24
    }
25
}
26