| 1 | <?php |
||
| 10 | class ClearCommand extends Command |
||
| 11 | { |
||
| 12 | use ConfirmableTrait; |
||
| 13 | |||
| 14 | protected $signature = 'medialibrary:clear {modelType?} {collectionName?} |
||
| 15 | {-- force : Force the operation to run when in production}'; |
||
| 16 | |||
| 17 | protected $description = 'Delete all items in a media collection.'; |
||
| 18 | |||
| 19 | /** @var \Spatie\MediaLibrary\MediaRepository */ |
||
| 20 | protected $mediaRepository; |
||
| 21 | |||
| 22 | public function __construct(MediaRepository $mediaRepository) |
||
| 27 | |||
| 28 | public function handle() |
||
| 38 | |||
| 39 | public function getMediaItems(): Collection |
||
| 61 | } |
||
| 62 |
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.