Example #1
0
 /**
  * Template method. Main algorithm
  *
  * {@inheritdoc}
  */
 public function build(array $options)
 {
     $this->checkOptions($options);
     $this->options = $options;
     $config = $this->buildData($this->dependenciesParser->parse($options['parse']));
     $this->reportWriter->write($options['write'], $config);
 }
Example #2
0
 public function testBuild()
 {
     $options = array('parse' => array('files_for_parse' => array(1, 2, 3)), 'write' => array('report_filename' => 'some_filename'));
     $parseResult = array('foo', 'bar', 'baz');
     $configMock = $this->getMock('\\Magento\\Tools\\Dependency\\Report\\Data\\ConfigInterface');
     $this->dependenciesParserMock->expects($this->once())->method('parse')->with($options['parse'])->will($this->returnValue($parseResult));
     $this->builder->expects($this->once())->method('buildData')->with($parseResult)->will($this->returnValue($configMock));
     $this->reportWriterMock->expects($this->once())->method('write')->with($options['write'], $configMock);
     $this->builder->build($options);
 }
Example #3
0
 /**
  * Get allowed modules
  *
  * @return array
  */
 protected function getAllowedModules()
 {
     return array_map(function ($element) {
         return $element['name'];
     }, $this->configParser->parse(array('files_for_parse' => $this->options['parse']['config_files'])));
 }
Example #4
0
 /**
  * Get allowed modules
  *
  * @return array
  */
 protected function getAllowedModules()
 {
     return $this->configParser->parse(['files_for_parse' => $this->options['parse']['config_files']]);
 }