| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class ProgressHelper |
||
| 8 | { |
||
| 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 | } |
||
| 24 | |||
| 25 | /** @return Progress */ |
||
| 26 | public static function progressFor($uid) |
||
| 33 | } |
||
| 34 | } |
||
| 35 |