Skip to content

Commit

Permalink
chore: fix PHPStan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed May 17, 2024
1 parent a2c49ac commit b2db84c
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 1 deletion.
86 changes: 86 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\$apply of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$applyUnsafe of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$changed of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$formatterEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$linterEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$organizeImportsEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$path of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$since of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$staged of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:check\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCheckCommand.php

-
message: "#^Parameter \\$changed of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Parameter \\$formatterEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Parameter \\$linterEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Parameter \\$organizeImportsEnabled of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects bool, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Parameter \\$path of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Parameter \\$since of method Kocal\\\\BiomeJsBundle\\\\BiomeJs\\:\\:ci\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
path: src/Command/BiomeJsCiCommand.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:end\\(\\)\\.$#"
count: 1
path: src/DependencyInjection/BiomeJsExtension.php

-
message: "#^Method Kocal\\\\BiomeJsBundle\\\\DependencyInjection\\\\BiomeJsExtension\\:\\:getConfiguration\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
count: 1
path: src/DependencyInjection/BiomeJsExtension.php
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
includes:
- phpstan-baseline.neon

parameters:
level: max

Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/BiomeJsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('services.php');

$configuration = $this->getConfiguration($configs, $container);
/** @var array<string> $config */
$config = $this->processConfiguration($configuration, $configs);

$container->getDefinition('biomejs.binary')
->setArgument(2, $config['binary_version']);
}

public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface
public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
{
return $this;
}
Expand Down

0 comments on commit b2db84c

Please sign in to comment.