1 | <?php |
||
15 | class RegenerateCommand extends Command |
||
16 | { |
||
17 | use ConfirmableTrait; |
||
18 | |||
19 | /** |
||
20 | * The console command name. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $signature = 'medialibrary:regenerate {modelType?} {--ids=*} |
||
25 | {-- force : Force the operation to run when in production}'; |
||
26 | |||
27 | /** |
||
28 | * The console command description. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $description = 'Regenerate the derived images of media'; |
||
33 | |||
34 | /** |
||
35 | * @var \Spatie\MediaLibrary\MediaRepository |
||
36 | */ |
||
37 | protected $mediaRepository; |
||
38 | |||
39 | /** |
||
40 | * @var \Spatie\MediaLibrary\FileManipulator |
||
41 | */ |
||
42 | protected $fileManipulator; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $erroredMediaIds = []; |
||
48 | |||
49 | /** |
||
50 | * RegenerateCommand constructor. |
||
51 | * |
||
52 | * @param MediaRepository $mediaRepository |
||
53 | * @param FileManipulator $fileManipulator |
||
54 | */ |
||
55 | public function __construct(MediaRepository $mediaRepository, FileManipulator $fileManipulator) |
||
62 | |||
63 | /** |
||
64 | * Handle regeneration. |
||
65 | */ |
||
66 | public function handle() |
||
88 | |||
89 | public function getMediaToBeRegenerated(): Collection |
||
109 | } |
||
110 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.