| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public static function newProgressInstance($max, $uid, OutputInterface $output) |
||
| 10 | { |
||
| 11 | if (! class_exists($progressClass = config('consolify.progress.concrete_class'))) { |
||
| 12 | throw new \LogicException("Cannot find progress class [$progressClass]"); |
||
| 13 | } |
||
| 14 | |||
| 15 | $progress = (new $progressClass()) |
||
| 16 | ->setProgressBar($output->createProgressBar($max)) |
||
|
|
|||
| 17 | ->setUid($uid); |
||
| 18 | |||
| 19 | // Reset progress |
||
| 20 | $progress->deletePersisted(); |
||
| 21 | |||
| 22 | return $progress; |
||
| 23 | } |
||
| 35 |