Loading src/Commands/UpgradeStatusCommands.php +7 −4 Original line number Diff line number Diff line Loading @@ -80,12 +80,13 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan. * @aliases us-cs * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function checkstyle(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function checkstyle(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { $extensions = $this->doAnalyze($projects, $options); $xml = new \SimpleXMLElement("<?xml version='1.0'?><checkstyle/>"); Loading Loading @@ -136,12 +137,13 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan. * @aliases us-a * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function analyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function analyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { $extensions = $this->doAnalyze($projects, $options); foreach ($extensions as $type => $list) { Loading Loading @@ -177,11 +179,12 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan (default: 1500M). * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function doAnalyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function doAnalyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { // Group by type here so we can tell loader what is type of each one of // these. $extensions = []; Loading Loading @@ -258,7 +261,7 @@ class UpgradeStatusCommands extends DrushCommands { } } $this->logger()->info(dt('Processing @name.', ['@name' => $name])); $this->deprecationAnalyzer->analyze($extension); $this->deprecationAnalyzer->analyze($extension, $options); } } Loading src/DeprecationAnalyzer.php +6 −3 Original line number Diff line number Diff line Loading @@ -334,11 +334,13 @@ final class DeprecationAnalyzer { * * @param \Drupal\Core\Extension\Extension $extension * The extension to analyze. * @param array $options * Options for the analysis. * * @return null * Errors are logged to the logger, data is stored to keyvalue storage. */ public function analyze(Extension $extension) { public function analyze(Extension $extension, array $options = []) { try { $this->initEnvironment(); } Loading @@ -354,14 +356,15 @@ final class DeprecationAnalyzer { $project_dir = DRUPAL_ROOT . '/' . $extension->getPath(); $this->logger->notice('Processing %path.', ['%path' => $project_dir]); $memory_limit = $options['phpstan-memory-limit'] ?? '1500M'; $command = [ $this->phpPath, $this->binPath . '/phpstan', 'analyse', '--memory-limit=-1', '--memory-limit=' . $memory_limit, '--error-format=json', '--configuration=' . $this->phpstanNeonPath, $project_dir, $project_dir ]; $process = new Process($command, DRUPAL_ROOT, NULL, NULL, NULL); Loading Loading
src/Commands/UpgradeStatusCommands.php +7 −4 Original line number Diff line number Diff line Loading @@ -80,12 +80,13 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan. * @aliases us-cs * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function checkstyle(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function checkstyle(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { $extensions = $this->doAnalyze($projects, $options); $xml = new \SimpleXMLElement("<?xml version='1.0'?><checkstyle/>"); Loading Loading @@ -136,12 +137,13 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan. * @aliases us-a * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function analyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function analyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { $extensions = $this->doAnalyze($projects, $options); foreach ($extensions as $type => $list) { Loading Loading @@ -177,11 +179,12 @@ class UpgradeStatusCommands extends DrushCommands { * @option ignore-uninstalled Ignore uninstalled projects. * @option ignore-contrib Ignore contributed projects. * @option ignore-custom Ignore custom projects. * @option phpstan-memory-limit Set memory limit for PHPStan (default: 1500M). * * @throws \InvalidArgumentException * Thrown when one of the passed arguments is invalid or no arguments were provided. */ public function doAnalyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE]) { public function doAnalyze(array $projects, array $options = ['all' => FALSE, 'skip-existing' => FALSE, 'ignore-uninstalled' => FALSE, 'ignore-contrib' => FALSE, 'ignore-custom' => FALSE, 'phpstan-memory-limit' => '1500M']) { // Group by type here so we can tell loader what is type of each one of // these. $extensions = []; Loading Loading @@ -258,7 +261,7 @@ class UpgradeStatusCommands extends DrushCommands { } } $this->logger()->info(dt('Processing @name.', ['@name' => $name])); $this->deprecationAnalyzer->analyze($extension); $this->deprecationAnalyzer->analyze($extension, $options); } } Loading
src/DeprecationAnalyzer.php +6 −3 Original line number Diff line number Diff line Loading @@ -334,11 +334,13 @@ final class DeprecationAnalyzer { * * @param \Drupal\Core\Extension\Extension $extension * The extension to analyze. * @param array $options * Options for the analysis. * * @return null * Errors are logged to the logger, data is stored to keyvalue storage. */ public function analyze(Extension $extension) { public function analyze(Extension $extension, array $options = []) { try { $this->initEnvironment(); } Loading @@ -354,14 +356,15 @@ final class DeprecationAnalyzer { $project_dir = DRUPAL_ROOT . '/' . $extension->getPath(); $this->logger->notice('Processing %path.', ['%path' => $project_dir]); $memory_limit = $options['phpstan-memory-limit'] ?? '1500M'; $command = [ $this->phpPath, $this->binPath . '/phpstan', 'analyse', '--memory-limit=-1', '--memory-limit=' . $memory_limit, '--error-format=json', '--configuration=' . $this->phpstanNeonPath, $project_dir, $project_dir ]; $process = new Process($command, DRUPAL_ROOT, NULL, NULL, NULL); Loading