Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DependenciesShowFrameworkCommand.php
Go to the documentation of this file.
1 <?php
7 
13 
18 {
22  private $registrar;
23 
30  public function __construct(ComponentRegistrarInterface $registrar, ObjectManagerProvider $objectManagerProvider)
31  {
32  $this->registrar = $registrar;
33  parent::__construct($objectManagerProvider);
34  }
35 
39  protected function configure()
40  {
41  $this->setDescription('Shows number of dependencies on Magento framework')
42  ->setName('info:dependencies:show-framework');
43  parent::configure();
44  }
45 
51  protected function getDefaultOutputFilename()
52  {
53  return 'framework-dependencies.csv';
54  }
55 
62  protected function buildReport($outputPath)
63  {
64  $filePaths = $this->registrar->getPaths(ComponentRegistrar::MODULE);
65 
66  $filesForParse = Files::init()->getFiles($filePaths, '*');
67  $configFiles = Files::init()->getConfigFiles('module.xml', [], false);
68 
70  [
71  'parse' => [
72  'files_for_parse' => $filesForParse,
73  'config_files' => $configFiles,
74  'declared_namespaces' => Files::init()->getNamespaces(),
75  ],
76  'write' => ['report_filename' => $outputPath],
77  ]
78  );
79  }
80 }
$registrar
Definition: registration.php:9
__construct(ComponentRegistrarInterface $registrar, ObjectManagerProvider $objectManagerProvider)