Skip to content

Commit

Permalink
Phpstan level 5
Browse files Browse the repository at this point in the history
  • Loading branch information
convenient committed Nov 7, 2022
1 parent e13b459 commit feec2af
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dev/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ parameters:
- %currentWorkingDirectory%/stub.php
paths:
- %currentWorkingDirectory%/../../src
level: 3
level: 5
11 changes: 5 additions & 6 deletions src/Ampersand/PatchHelper/Command/AnalyseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -265,7 +264,7 @@ protected function execute(InputInterface $input, Output $output)

$output->writeln("<comment>WARN count: $warnLevelCount</comment>");
$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("<comment>$infoMessage</comment>");
Expand Down
3 changes: 0 additions & 3 deletions src/Ampersand/PatchHelper/Helper/Magento2Instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

class Magento2Instance
{
/** @var \Magento\Framework\App\Http $app */
private $app;

/** @var \Magento\Framework\ObjectManagerInterface $objectManager */
private $objectManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ public function validate($vendorNamespaces = [])
break;
default:
throw new \LogicException("An unknown file path was encountered $this->vendorFilepath");
break;
}

return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/Ampersand/PatchHelper/Patchfile/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Entry
private $lines = [];

/**
* @var string[]
* @var null|string[]
*/
private $affectedPhpFunctions;

Expand Down

0 comments on commit feec2af

Please sign in to comment.