forked from laravel/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackageDiscoverCommand.php
More file actions
44 lines (37 loc) · 1.02 KB
/
PackageDiscoverCommand.php
File metadata and controls
44 lines (37 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
use Illuminate\Foundation\PackageManifest;
use Illuminate\Support\Collection;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name: 'package:discover')]
class PackageDiscoverCommand extends Command
{
/**
* The console command signature.
*
* @var string
*/
protected $signature = 'package:discover';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rebuild the cached package manifest';
/**
* Execute the console command.
*
* @param \Illuminate\Foundation\PackageManifest $manifest
* @return void
*/
public function handle(PackageManifest $manifest)
{
$this->components->info('Discovering packages');
$manifest->build();
(new Collection($manifest->manifest))
->keys()
->each($this->components->task(...))
->whenNotEmpty(fn () => $this->newLine());
}
}