-
-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathScanObjectsCommand.php
More file actions
39 lines (30 loc) · 1.04 KB
/
ScanObjectsCommand.php
File metadata and controls
39 lines (30 loc) · 1.04 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
<?php
declare(strict_types=1);
namespace Safe\Commands;
use Safe\XmlDocParser\Scanner;
use Safe\XmlDocParser\DocPage;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ScanObjectsCommand extends Command
{
protected function configure(): void
{
$this
->setName('scan-objects')
->setDescription('Displays all methods of all objects not handled yet by Safe.')
;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$scanner = new Scanner(DocPage::referenceDir());
$paths = $scanner->getMethodsPaths();
$res = $scanner->getMethods($paths, [], $output);
foreach ($res->methods as $function) {
$name = $function->getFunctionName();
$output->writeln('Found method '.$name);
}
$output->writeln('These methods are overloaded: '.\implode(', ', $res->overloadedFunctions));
return 0;
}
}