From aace47d913724b252b750010a7c86a8e52aa3bf7 Mon Sep 17 00:00:00 2001
From: Eddie Lau <kahlau@ebay.com>
Date: Mon, 4 May 2015 11:11:20 -0500
Subject: [PATCH] MAGETWO-36071: Move
 dev/tools/Magento/Tools/Dependency/generate/*.dependencies.php tools

- changed according to CR feedback
---
 .../Command/DependenciesShowFrameworkCommandTest.php   |  6 +++---
 .../DependenciesShowModulesCircularCommandTest.php     |  6 +++---
 .../Command/DependenciesShowModulesCommandTest.php     |  6 +++---
 .../_files/root/app/code/Magento/A/Model/Foo.php       |  3 +++
 .../_files/root/app/code/Magento/B/Model/Foo.php       |  3 +++
 .../Console/Command/AbstractDependenciesCommand.php    | 10 +++++-----
 .../Command/DependenciesShowFrameworkCommand.php       |  4 ++--
 .../Command/DependenciesShowModulesCircularCommand.php |  4 ++--
 .../Console/Command/DependenciesShowModulesCommand.php |  4 ++--
 9 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowFrameworkCommandTest.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowFrameworkCommandTest.php
index 9e73b16468a..76db3df10eb 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowFrameworkCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowFrameworkCommandTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\Test\Tool\Console\Command;
+namespace Magento\Test\Tools\Console\Command;
 
 use Magento\Tools\Console\Command\DependenciesShowFrameworkCommand;
 use Symfony\Component\Console\Tester\CommandTester;
@@ -38,7 +38,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase
         $this->commandTester->execute(
             ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/framework.csv']
         );
-        $this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay());
+        $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
         $this->assertFileEquals(
             __DIR__ . '/_files/expected/framework.csv',
             __DIR__ . '/_files/output/framework.csv'
@@ -49,7 +49,7 @@ class DependenciesShowFrameworkCommandTest extends \PHPUnit_Framework_TestCase
     {
         $this->commandTester->execute(['--directory' => '/invalid/path']);
         $this->assertContains(
-            'Please, check passed path. Dependencies report generator failed:',
+            'Please check the path you provided. Dependencies report generator failed with error:',
             $this->commandTester->getDisplay()
         );
     }
diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCircularCommandTest.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCircularCommandTest.php
index 914faeeaef9..c47489a361d 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCircularCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCircularCommandTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\Test\Tool\Console\Command;
+namespace Magento\Test\Tools\Console\Command;
 
 use Magento\Tools\Console\Command\DependenciesShowModulesCircularCommand;
 use Symfony\Component\Console\Tester\CommandTester;
@@ -38,7 +38,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test
         $this->commandTester->execute(
             ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/circular.csv']
         );
-        $this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay());
+        $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
         $this->assertFileEquals(
             __DIR__ . '/_files/expected/circular.csv',
             __DIR__ . '/_files/output/circular.csv'
@@ -49,7 +49,7 @@ class DependenciesShowModulesCircularCommandTest extends \PHPUnit_Framework_Test
     {
         $this->commandTester->execute(['--directory' => '/invalid/path']);
         $this->assertContains(
-            'Please, check passed path. Dependencies report generator failed:',
+            'Please check the path you provided. Dependencies report generator failed with error:',
             $this->commandTester->getDisplay()
         );
     }
diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCommandTest.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCommandTest.php
index 4b9f0fcca27..348d82f098a 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCommandTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/DependenciesShowModulesCommandTest.php
@@ -3,7 +3,7 @@
  * Copyright © 2015 Magento. All rights reserved.
  * See COPYING.txt for license details.
  */
-namespace Magento\Test\Tool\Console\Command;
+namespace Magento\Test\Tools\Console\Command;
 
 use Magento\Tools\Console\Command\DependenciesShowModulesCommand;
 use Symfony\Component\Console\Tester\CommandTester;
@@ -38,7 +38,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase
         $this->commandTester->execute(
             ['--directory' => __DIR__ . '/_files/root', '--output' => __DIR__ . '/_files/output/modules.csv']
         );
-        $this->assertEquals('Report successfully processed.' . PHP_EOL , $this->commandTester->getDisplay());
+        $this->assertEquals('Report successfully processed.' . PHP_EOL, $this->commandTester->getDisplay());
         $this->assertFileEquals(
             __DIR__ . '/_files/expected/modules.csv',
             __DIR__ . '/_files/output/modules.csv'
@@ -49,7 +49,7 @@ class DependenciesShowModulesCommandTest extends \PHPUnit_Framework_TestCase
     {
         $this->commandTester->execute(['--directory' => '/invalid/path']);
         $this->assertContains(
-            'Please, check passed path. Dependencies report generator failed:',
+            'Please check the path you provided. Dependencies report generator failed with error:',
             $this->commandTester->getDisplay()
         );
     }
diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/A/Model/Foo.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/A/Model/Foo.php
index 6300096a6eb..25f20265a9c 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/A/Model/Foo.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/A/Model/Foo.php
@@ -7,6 +7,9 @@ namespace Magento\A\Model;
 
 class Foo
 {
+    /**
+     * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+     */
     public function foo()
     {
         $frameworkDependencies = new \Magento\Framework\A();
diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/B/Model/Foo.php b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/B/Model/Foo.php
index 5868020636a..843ade228dd 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/B/Model/Foo.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Console/Command/_files/root/app/code/Magento/B/Model/Foo.php
@@ -7,6 +7,9 @@ namespace Magento\B\Model;
 
 class Foo
 {
+    /**
+     * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+     */
     public function foo()
     {
         $frameworkDependencies = new \Magento\Framework\B();
diff --git a/dev/tools/Magento/Tools/Console/Command/AbstractDependenciesCommand.php b/dev/tools/Magento/Tools/Console/Command/AbstractDependenciesCommand.php
index 51649929b7a..19c94e8dfe1 100644
--- a/dev/tools/Magento/Tools/Console/Command/AbstractDependenciesCommand.php
+++ b/dev/tools/Magento/Tools/Console/Command/AbstractDependenciesCommand.php
@@ -40,8 +40,8 @@ abstract class AbstractDependenciesCommand extends Command
                     self::INPUT_KEY_OUTPUT,
                     'o',
                     InputOption::VALUE_REQUIRED,
-                    'Path to report file',
-                    $this->getDefaultOutputPath()
+                    'Report filename',
+                    $this->getDefaultOutputFilename()
                 )
             ]
         );
@@ -57,11 +57,11 @@ abstract class AbstractDependenciesCommand extends Command
     abstract protected function buildReport($outputPath);
 
     /**
-     * Get path to the default output report file
+     * Get the default output report filename
      *
      * @return string
      */
-    abstract protected function getDefaultOutputPath();
+    abstract protected function getDefaultOutputFilename();
 
     /**
      * {@inheritdoc}
@@ -74,7 +74,7 @@ abstract class AbstractDependenciesCommand extends Command
             $output->writeln('<info>Report successfully processed.</info>');
         } catch (\Exception $e) {
             $output->writeln(
-                '<error>Please, check passed path. Dependencies report generator failed: ' .
+                '<error>Please check the path you provided. Dependencies report generator failed with error: ' .
                 $e->getMessage() . '</error>'
             );
         }
diff --git a/dev/tools/Magento/Tools/Console/Command/DependenciesShowFrameworkCommand.php b/dev/tools/Magento/Tools/Console/Command/DependenciesShowFrameworkCommand.php
index 87306ba0f99..03499b681ba 100644
--- a/dev/tools/Magento/Tools/Console/Command/DependenciesShowFrameworkCommand.php
+++ b/dev/tools/Magento/Tools/Console/Command/DependenciesShowFrameworkCommand.php
@@ -24,11 +24,11 @@ class DependenciesShowFrameworkCommand extends AbstractDependenciesCommand
     }
 
     /**
-     * Return default output file for framework dependencies report
+     * Return default output filename for framework dependencies report
      *
      * @return string
      */
-    protected function getDefaultOutputPath()
+    protected function getDefaultOutputFilename()
     {
         return 'framework-dependencies.csv';
     }
diff --git a/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCircularCommand.php b/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCircularCommand.php
index 11916895c0e..96a4dfeb25f 100644
--- a/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCircularCommand.php
+++ b/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCircularCommand.php
@@ -24,11 +24,11 @@ class DependenciesShowModulesCircularCommand extends AbstractDependenciesCommand
     }
 
     /**
-     * Return default output file for modules circular dependencies report
+     * Return default output filename for modules circular dependencies report
      *
      * @return string
      */
-    protected function getDefaultOutputPath()
+    protected function getDefaultOutputFilename()
     {
         return 'modules-circular-dependencies.csv';
     }
diff --git a/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCommand.php b/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCommand.php
index 31aacdb259f..1c7ced7c37c 100644
--- a/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCommand.php
+++ b/dev/tools/Magento/Tools/Console/Command/DependenciesShowModulesCommand.php
@@ -24,11 +24,11 @@ class DependenciesShowModulesCommand extends AbstractDependenciesCommand
     }
 
     /**
-     * Return default output file for modules dependencies report
+     * Return default output filename for modules dependencies report
      *
      * @return string
      */
-    protected function getDefaultOutputPath()
+    protected function getDefaultOutputFilename()
     {
         return 'modules-dependencies.csv';
     }
-- 
GitLab