Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 202a304

Browse files
committed
Updated configuration for phpstan and apply fixes
1 parent d710254 commit 202a304

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

phpstan.neon.dist

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ parameters:
1212
- %currentWorkingDirectory%/vendor/*
1313

1414
ignoreErrors:
15-
- "#Casting to [a-z]+ something that's already [a-z]+#"
1615
- '#PHPDoc tag @throws with type Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
1716
# AbstractPluginManager::__construct() accepts more types:
18-
- '#Result of && is always false#'
17+
-
18+
message: '#Result of && is always false#'
19+
path: %currentWorkingDirectory%/src/AbstractPluginManager.php
20+
-
21+
message: '#Else branch is unreachable because ternary operator condition is always true#'
22+
path: %currentWorkingDirectory%/src/AbstractPluginManager.php
23+
-
24+
message: '#Default value of the parameter \#1 \$resource \(mixed\) of method Zend\\ServiceManager\\Tool\\FactoryCreatorCommand::help\(\) is incompatible with type resource#'
25+
path: %currentWorkingDirectory%/src/Tool/FactoryCreatorCommand.php
26+
-
27+
message: '#Default value of the parameter \#1 \$resource \(mixed\) of method Zend\\ServiceManager\\Tool\\ConfigDumperCommand::help\(\) is incompatible with type resource#'
28+
path: %currentWorkingDirectory%/src/Tool/ConfigDumperCommand.php

src/Exception/CyclicAliasException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static function fromCyclicAlias($alias, array $aliases)
4646
*/
4747
public static function fromAliasesMap(array $aliases)
4848
{
49+
/** @var bool[][] $detectedCycles */
4950
$detectedCycles = array_filter(array_map(
5051
function ($alias) use ($aliases) {
5152
return self::getCycleFor($aliases, $alias);
@@ -73,7 +74,7 @@ function ($alias) use ($aliases) {
7374
*
7475
* @param string[] $aliases
7576
* @param string $alias
76-
* @return array|null
77+
* @return bool[]|null
7778
*/
7879
private static function getCycleFor(array $aliases, $alias)
7980
{

src/PluginManagerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface PluginManagerInterface extends ServiceLocatorInterface
1919
/**
2020
* Validate an instance
2121
*
22-
* @param object $instance
22+
* @param object|array $instance
2323
* @return void
2424
* @throws InvalidServiceException If created instance does not respect the
2525
* constraint on type imposed by the plugin manager

src/Tool/ConfigDumperCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private function parseArgs(array $args)
139139
$arg1 = array_shift($args);
140140
}
141141

142-
if (! $args) {
142+
if (empty($args)) {
143143
return $this->createErrorArgument('Missing class name');
144144
}
145145

0 commit comments

Comments
 (0)