diff --git a/dev/phpstan/phpstan.neon b/dev/phpstan/phpstan.neon index 1565ab6b..65bfe1e5 100644 --- a/dev/phpstan/phpstan.neon +++ b/dev/phpstan/phpstan.neon @@ -3,4 +3,4 @@ parameters: - %currentWorkingDirectory%/stub.php paths: - %currentWorkingDirectory%/../../src - level: 3 \ No newline at end of file + level: 5 \ No newline at end of file diff --git a/src/Ampersand/PatchHelper/Command/AnalyseCommand.php b/src/Ampersand/PatchHelper/Command/AnalyseCommand.php index d8de0314..996c16a6 100644 --- a/src/Ampersand/PatchHelper/Command/AnalyseCommand.php +++ b/src/Ampersand/PatchHelper/Command/AnalyseCommand.php @@ -96,12 +96,11 @@ protected function execute(InputInterface $input, Output $output) throw new \Exception("Please provide an integer as fuzz factor."); } - $vendorNamespaces = []; - if ( - $input->getOption('vendor-namespaces') && - $vendorNamespaces = $input->getOption('vendor-namespaces') - ) { + $vendorNamespaces = $input->getOption('vendor-namespaces'); + if (is_string($vendorNamespaces) && strlen($vendorNamespaces)) { $vendorNamespaces = explode(',', str_replace(' ', '', $vendorNamespaces)); + } else { + $vendorNamespaces = []; } $errOutput = $output; @@ -265,7 +264,7 @@ protected function execute(InputInterface $input, Output $output) $output->writeln("WARN count: $warnLevelCount"); $infoMessage = "INFO count: $infoLevelCount"; - if (!$input->getOption('show-info') && $infoLevelCount >= 0) { + if (!$input->getOption('show-info') && $infoLevelCount > 0) { $infoMessage .= " (to view re-run this tool with --show-info)"; } $output->writeln("$infoMessage"); diff --git a/src/Ampersand/PatchHelper/Helper/Magento2Instance.php b/src/Ampersand/PatchHelper/Helper/Magento2Instance.php index 046bb678..fed11e82 100644 --- a/src/Ampersand/PatchHelper/Helper/Magento2Instance.php +++ b/src/Ampersand/PatchHelper/Helper/Magento2Instance.php @@ -12,9 +12,6 @@ class Magento2Instance { - /** @var \Magento\Framework\App\Http $app */ - private $app; - /** @var \Magento\Framework\ObjectManagerInterface $objectManager */ private $objectManager; diff --git a/src/Ampersand/PatchHelper/Helper/PatchOverrideValidator.php b/src/Ampersand/PatchHelper/Helper/PatchOverrideValidator.php index 1b8ad98a..d7064390 100644 --- a/src/Ampersand/PatchHelper/Helper/PatchOverrideValidator.php +++ b/src/Ampersand/PatchHelper/Helper/PatchOverrideValidator.php @@ -195,7 +195,6 @@ public function validate($vendorNamespaces = []) break; default: throw new \LogicException("An unknown file path was encountered $this->vendorFilepath"); - break; } return $this; diff --git a/src/Ampersand/PatchHelper/Patchfile/Entry.php b/src/Ampersand/PatchHelper/Patchfile/Entry.php index 2e72905c..106a7f65 100644 --- a/src/Ampersand/PatchHelper/Patchfile/Entry.php +++ b/src/Ampersand/PatchHelper/Patchfile/Entry.php @@ -21,7 +21,7 @@ class Entry private $lines = []; /** - * @var string[] + * @var null|string[] */ private $affectedPhpFunctions;