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

Commit

Permalink
Updated configuration for phpstan and apply fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvargiu committed Mar 19, 2019
1 parent d710254 commit 202a304
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
14 changes: 12 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ parameters:
- %currentWorkingDirectory%/vendor/*

ignoreErrors:
- "#Casting to [a-z]+ something that's already [a-z]+#"
- '#PHPDoc tag @throws with type Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
# AbstractPluginManager::__construct() accepts more types:
- '#Result of && is always false#'
-
message: '#Result of && is always false#'
path: %currentWorkingDirectory%/src/AbstractPluginManager.php
-
message: '#Else branch is unreachable because ternary operator condition is always true#'
path: %currentWorkingDirectory%/src/AbstractPluginManager.php
-
message: '#Default value of the parameter \#1 \$resource \(mixed\) of method Zend\\ServiceManager\\Tool\\FactoryCreatorCommand::help\(\) is incompatible with type resource#'
path: %currentWorkingDirectory%/src/Tool/FactoryCreatorCommand.php
-
message: '#Default value of the parameter \#1 \$resource \(mixed\) of method Zend\\ServiceManager\\Tool\\ConfigDumperCommand::help\(\) is incompatible with type resource#'
path: %currentWorkingDirectory%/src/Tool/ConfigDumperCommand.php
3 changes: 2 additions & 1 deletion src/Exception/CyclicAliasException.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public static function fromCyclicAlias($alias, array $aliases)
*/
public static function fromAliasesMap(array $aliases)
{
/** @var bool[][] $detectedCycles */
$detectedCycles = array_filter(array_map(
function ($alias) use ($aliases) {
return self::getCycleFor($aliases, $alias);
Expand Down Expand Up @@ -73,7 +74,7 @@ function ($alias) use ($aliases) {
*
* @param string[] $aliases
* @param string $alias
* @return array|null
* @return bool[]|null
*/
private static function getCycleFor(array $aliases, $alias)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PluginManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface PluginManagerInterface extends ServiceLocatorInterface
/**
* Validate an instance
*
* @param object $instance
* @param object|array $instance
* @return void
* @throws InvalidServiceException If created instance does not respect the
* constraint on type imposed by the plugin manager
Expand Down
2 changes: 1 addition & 1 deletion src/Tool/ConfigDumperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function parseArgs(array $args)
$arg1 = array_shift($args);
}

if (! $args) {
if (empty($args)) {
return $this->createErrorArgument('Missing class name');
}

Expand Down

0 comments on commit 202a304

Please sign in to comment.