@@ -17,7 +17,7 @@ |
||
| 17 | 17 | protected function configure() |
| 18 | 18 | { |
| 19 | 19 | $this->setName('show-unused-mysql-tables') |
| 20 | - ->setDescription('Show a list of potentially unused MySQL tables.'); |
|
| 20 | + ->setDescription('Show a list of potentially unused MySQL tables.'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -417,13 +417,13 @@ discard block |
||
| 417 | 417 | ); |
| 418 | 418 | |
| 419 | 419 | $this->addRequirement( |
| 420 | - is_dir(__DIR__.'/../vendor/composer'), |
|
| 420 | + is_dir(__DIR__ . '/../vendor/composer'), |
|
| 421 | 421 | 'Vendor libraries must be installed', |
| 422 | - 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '. |
|
| 422 | + 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' . |
|
| 423 | 423 | 'Then run "<strong>php composer.phar install</strong>" to install them.' |
| 424 | 424 | ); |
| 425 | 425 | |
| 426 | - $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; |
|
| 426 | + $cacheDir = is_dir(__DIR__ . '/../var/cache') ? __DIR__ . '/../var/cache' : __DIR__ . '/cache'; |
|
| 427 | 427 | |
| 428 | 428 | $this->addRequirement( |
| 429 | 429 | is_writable($cacheDir), |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | 'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.' |
| 432 | 432 | ); |
| 433 | 433 | |
| 434 | - $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; |
|
| 434 | + $logsDir = is_dir(__DIR__ . '/../var/logs') ? __DIR__ . '/../var/logs' : __DIR__ . '/logs'; |
|
| 435 | 435 | |
| 436 | 436 | $this->addRequirement( |
| 437 | 437 | is_writable($logsDir), |
@@ -564,13 +564,13 @@ discard block |
||
| 564 | 564 | |
| 565 | 565 | /* optional recommendations follow */ |
| 566 | 566 | |
| 567 | - if (file_exists(__DIR__.'/../vendor/composer')) { |
|
| 568 | - require_once __DIR__.'/../vendor/autoload.php'; |
|
| 567 | + if (file_exists(__DIR__ . '/../vendor/composer')) { |
|
| 568 | + require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 569 | 569 | |
| 570 | 570 | try { |
| 571 | 571 | $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); |
| 572 | 572 | |
| 573 | - $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); |
|
| 573 | + $contents = file_get_contents(dirname($r->getFileName()) . '/Resources/skeleton/app/SymfonyRequirements.php'); |
|
| 574 | 574 | } catch (ReflectionException $e) { |
| 575 | 575 | $contents = ''; |
| 576 | 576 | } |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | */ |
| 799 | 799 | protected function getPhpRequiredVersion() |
| 800 | 800 | { |
| 801 | - if (!file_exists($path = __DIR__.'/../composer.lock')) { |
|
| 801 | + if (!file_exists($path = __DIR__ . '/../composer.lock')) { |
|
| 802 | 802 | return false; |
| 803 | 803 | } |
| 804 | 804 | |
@@ -34,8 +34,8 @@ |
||
| 34 | 34 | protected function configure() |
| 35 | 35 | { |
| 36 | 36 | $this->setName('consolidate-used-files') |
| 37 | - ->setDescription('Consolidate the list of unused PHP files to improve performance of later commands and readability for human readers.') |
|
| 38 | - ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.'); |
|
| 37 | + ->setDescription('Consolidate the list of unused PHP files to improve performance of later commands and readability for human readers.') |
|
| 38 | + ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -39,11 +39,11 @@ |
||
| 39 | 39 | protected function configure() |
| 40 | 40 | { |
| 41 | 41 | $this->setName('show-unused-php-files') |
| 42 | - ->setDescription('Show a list of potentially unused PHP files.') |
|
| 43 | - ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.') |
|
| 44 | - ->addOption(self::OPTION_PATH_TO_INSPECT, 'p', InputOption::VALUE_REQUIRED, 'Path to search for PHP files. If not set, it will be determined as the common parent path of the used files.') |
|
| 45 | - ->addOption(self::OPTION_PATH_TO_OUTPUT, 'o', InputOption::VALUE_REQUIRED, 'Path to the output file. If not set, it will be "potentially-unused-files.txt" next to the file named in the usedFiles argument.') |
|
| 46 | - ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 42 | + ->setDescription('Show a list of potentially unused PHP files.') |
|
| 43 | + ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.') |
|
| 44 | + ->addOption(self::OPTION_PATH_TO_INSPECT, 'p', InputOption::VALUE_REQUIRED, 'Path to search for PHP files. If not set, it will be determined as the common parent path of the used files.') |
|
| 45 | + ->addOption(self::OPTION_PATH_TO_OUTPUT, 'o', InputOption::VALUE_REQUIRED, 'Path to the output file. If not set, it will be "potentially-unused-files.txt" next to the file named in the usedFiles argument.') |
|
| 46 | + ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -40,12 +40,12 @@ |
||
| 40 | 40 | protected function configure() |
| 41 | 41 | { |
| 42 | 42 | $this->setName('show-unused-public-assets') |
| 43 | - ->setDescription('Show a list of potentially unused public assets.') |
|
| 44 | - ->addArgument(self::ARGUMENT_PATH_TO_PUBLIC, InputArgument::REQUIRED, 'Path to the public web root of your project.') |
|
| 45 | - ->addArgument(self::ARGUMENT_PATH_TO_LOG_FILE, InputArgument::REQUIRED, 'Path to the web server\'s access log file.') |
|
| 46 | - ->addOption(self::OPTION_REG_EXP_TO_FIND_FILE, 'r', InputOption::VALUE_REQUIRED, 'Regular expression for the log file capturing the path of the accessed file as it\'s first capture group.', '#"(?:get|post) ([a-z0-9\_\-\.\/]*)#i') |
|
| 47 | - ->addOption(self::OPTION_PATH_TO_OUTPUT, 'o', InputOption::VALUE_REQUIRED, 'Path to the output file. If not set, it will be "potentially-unused-public-assets.txt" in the folder above the public web root.') |
|
| 48 | - ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 43 | + ->setDescription('Show a list of potentially unused public assets.') |
|
| 44 | + ->addArgument(self::ARGUMENT_PATH_TO_PUBLIC, InputArgument::REQUIRED, 'Path to the public web root of your project.') |
|
| 45 | + ->addArgument(self::ARGUMENT_PATH_TO_LOG_FILE, InputArgument::REQUIRED, 'Path to the web server\'s access log file.') |
|
| 46 | + ->addOption(self::OPTION_REG_EXP_TO_FIND_FILE, 'r', InputOption::VALUE_REQUIRED, 'Regular expression for the log file capturing the path of the accessed file as it\'s first capture group.', '#"(?:get|post) ([a-z0-9\_\-\.\/]*)#i') |
|
| 47 | + ->addOption(self::OPTION_PATH_TO_OUTPUT, 'o', InputOption::VALUE_REQUIRED, 'Path to the output file. If not set, it will be "potentially-unused-public-assets.txt" in the folder above the public web root.') |
|
| 48 | + ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | private function getRelevantUsedFiles(array $usedFiles) |
| 72 | 72 | { |
| 73 | - $filteredFiles = array_filter($usedFiles, function ($usedFile) { return strpos($usedFile, 'Bundle.php') === false; }); |
|
| 73 | + $filteredFiles = array_filter($usedFiles, function($usedFile) { return strpos($usedFile, 'Bundle.php') === false; }); |
|
| 74 | 74 | $difference = count($usedFiles) - count($filteredFiles); |
| 75 | 75 | if ($difference > 0) { |
| 76 | 76 | $this->ioStyle->text('Removed ' . $difference . ' *Bundle.php files from used files as they are likely irrelevant.'); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $tables = $this->connection->getSchemaManager()->listTables(); |
| 72 | 72 | $tableNames = array_map( |
| 73 | - function (Table $table) { |
|
| 73 | + function(Table $table) { |
|
| 74 | 74 | return $table->getName(); |
| 75 | 75 | }, |
| 76 | 76 | $tables |
@@ -39,11 +39,11 @@ |
||
| 39 | 39 | protected function configure() |
| 40 | 40 | { |
| 41 | 41 | $this->setName('show-unused-composer-packages') |
| 42 | - ->setDescription('Show a list of potentially unused composer packages.') |
|
| 43 | - ->addArgument(self::ARGUMENT_COMPOSER_JSON, InputArgument::REQUIRED, 'Path to the project\'s composer.json.') |
|
| 44 | - ->addOption(self::OPTION_VENDOR_DIRECTORY, 'l', InputOption::VALUE_REQUIRED, 'Path to the project\'s vendor directory.') |
|
| 45 | - ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.') |
|
| 46 | - ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 42 | + ->setDescription('Show a list of potentially unused composer packages.') |
|
| 43 | + ->addArgument(self::ARGUMENT_COMPOSER_JSON, InputArgument::REQUIRED, 'Path to the project\'s composer.json.') |
|
| 44 | + ->addOption(self::OPTION_VENDOR_DIRECTORY, 'l', InputOption::VALUE_REQUIRED, 'Path to the project\'s vendor directory.') |
|
| 45 | + ->addArgument(self::ARGUMENT_USED_FILES, InputArgument::REQUIRED, 'Path to the list of used files.') |
|
| 46 | + ->addOption(self::OPTION_PATH_TO_BLACKLIST, 'b', InputOption::VALUE_REQUIRED, 'Path to a file containing a blacklist of regular expressions to exclude from the output. One regular expression per line, don\'t forget the delimiters. E.g.: ' . PHP_EOL . '#^/project/keepme.php#' . PHP_EOL . '#^/project/tmp/#' . PHP_EOL . '#.*Test.php#'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |