Skip to content

Commit

Permalink
qa: normalize psalm config to get rid of warnings when running psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Oct 10, 2023
1 parent 1aeb087 commit eb09e53
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
43 changes: 35 additions & 8 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<code>DispatchableInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/AbstractFactoryInterface.php">
<PossiblyUnusedMethod>
<code>canCreateServiceWithName</code>
<code>createServiceWithName</code>
</PossiblyUnusedMethod>
</file>
<file src="src/AbstractPluginManager.php">
<ArgumentTypeCoercion>
<code>$config</code>
Expand All @@ -77,9 +83,6 @@
<RedundantConditionGivenDocblockType>
<code>is_object($configInstanceOrParentLocator)</code>
</RedundantConditionGivenDocblockType>
<UnusedPsalmSuppress>
<code>MixedAssignment</code>
</UnusedPsalmSuppress>
</file>
<file src="src/Config.php">
<DeprecatedInterface>
Expand All @@ -94,10 +97,14 @@
<MoreSpecificReturnType>
<code>ServiceManagerConfigurationType</code>
</MoreSpecificReturnType>
<UnusedPsalmSuppress>
<code>MixedReturnTypeCoercion</code>
<code>MixedReturnTypeCoercion</code>
</UnusedPsalmSuppress>
<UnusedProperty>
<code>$allowedKeys</code>
</UnusedProperty>
</file>
<file src="src/DelegatorFactoryInterface.php">
<PossiblyUnusedMethod>
<code>createDelegatorWithName</code>
</PossiblyUnusedMethod>
</file>
<file src="src/Exception/CyclicAliasException.php">
<InvalidArgument>
Expand All @@ -117,6 +124,16 @@
<code>new $requestedName()</code>
</InvalidStringClass>
</file>
<file src="src/FactoryInterface.php">
<UnusedClass>
<code>FactoryInterface</code>
</UnusedClass>
</file>
<file src="src/InitializerInterface.php">
<UnusedClass>
<code>InitializerInterface</code>
</UnusedClass>
</file>
<file src="src/Proxy/LazyServiceFactory.php">
<MissingClosureParamType>
<code>$wrappedInstance</code>
Expand Down Expand Up @@ -218,6 +235,9 @@
<code>$service</code>
<code>$target</code>
</UnusedForeachValue>
<UnusedReturnValue>
<code>DelegatorsConfiguration</code>
</UnusedReturnValue>
<UnusedVariable>
<code>$key</code>
</UnusedVariable>
Expand Down Expand Up @@ -484,7 +504,6 @@
<code><![CDATA[$object[$shared ? $method : 'build'][]]]></code>
<code>$second</code>
<code>$shared</code>
<code>$shared</code>
</MixedAssignment>
<MixedFunctionCall>
<code>$callback()</code>
Expand Down Expand Up @@ -606,6 +625,9 @@
<code><![CDATA[$instance->foo]]></code>
<code><![CDATA[$instance->option]]></code>
</MixedPropertyFetch>
<PossiblyUnusedMethod>
<code>sampleFactory</code>
</PossiblyUnusedMethod>
<UnusedClosureParam>
<code>$container</code>
<code>$container</code>
Expand All @@ -615,6 +637,11 @@
<code>$name</code>
</UnusedClosureParam>
</file>
<file src="test/StaticAnalysis/ServiceManagerConfiguration.php">
<UnusedClass>
<code>ServiceManagerConfiguration</code>
</UnusedClass>
</file>
<file src="test/Tool/ConfigDumperCommandTest.php">
<MixedArgument>
<code>$factoryConfig[ObjectWithObjectScalarDependency::class]</code>
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedPsalmSuppress="true"
findUnusedCode="true"
findUnusedBaselineEntry="true"
>
<projectFiles>
<directory name="bin"/>
Expand Down
1 change: 0 additions & 1 deletion src/AbstractPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public function __construct($configInstanceOrParentLocator = null, array $config
public function configure(array $config)
{
if (isset($config['services'])) {
/** @psalm-suppress MixedAssignment */
foreach ($config['services'] as $service) {
$this->validate($service);
}
Expand Down
2 changes: 0 additions & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ public function toArray()
* @psalm-param ServiceManagerConfigurationType $a
* @psalm-param ServiceManagerConfigurationType $b
* @psalm-return ServiceManagerConfigurationType
* @psalm-suppress MixedReturnTypeCoercion
*/
private function merge(array $a, array $b)
{
/** @psalm-suppress MixedReturnTypeCoercion */
return ArrayUtils::merge($a, $b);
}
}

0 comments on commit eb09e53

Please sign in to comment.