Skip to content

Fix mocking anonymous classes #455

Fix mocking anonymous classes

Fix mocking anonymous classes #455

Triggered via pull request April 26, 2024 13:43
Status Failure
Total duration 25s
Artifacts

psalm.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 10 warnings
PossiblyInvalidArgument: library/Mockery.php#L512
library/Mockery.php:512:46: PossiblyInvalidArgument: Argument 1 of Mockery\Container::mock expects Closure|array<array-key, mixed|string>, but possibly different type Mockery\Generator\MockConfigurationBuilder|(TNamedMock:fn-mockery::namedmock as mixed)|array<array-key, mixed>|(class-string<TNamedMock:fn-mockery::namedmock as object>) provided (see https://psalm.dev/092)
PossiblyInvalidArgument: library/Mockery.php#L681
library/Mockery.php:681:46: PossiblyInvalidArgument: Argument 1 of Mockery\Container::mock expects Closure|array<array-key, mixed|string>, but possibly different type Mockery\ClosureWrapper|(TSpy:fn-mockery::spy as mixed)|array<array-key, mixed>|(class-string<TSpy:fn-mockery::spy as object>) provided (see https://psalm.dev/092)
InvalidArgument: library/Mockery.php#L1014
library/Mockery.php:1014:34: InvalidArgument: Argument 1 of Mockery\Container::mock expects Closure|array<array-key, mixed|string>, but non-falsy-string provided (see https://psalm.dev/004)
DocblockTypeContradiction: library/Mockery/Container.php#L258
library/Mockery/Container.php:258:17: DocblockTypeContradiction: Docblock-defined type Closure|array<array-key, mixed|string> for $arg is never string (see https://psalm.dev/155)
NoValue: library/Mockery/Container.php#L259
library/Mockery/Container.php:259:39: NoValue: All possible types for this argument were invalidated - This may be dead code (see https://psalm.dev/179)
TypeDoesNotContainType: library/Mockery/Container.php#L260
library/Mockery/Container.php:260:25: TypeDoesNotContainType: Type never for $arg is never =string(null) (see https://psalm.dev/056)
RiskyTruthyFalsyComparison: library/Mockery/Container.php#L265
library/Mockery/Container.php:265:47: RiskyTruthyFalsyComparison: Operand of type false|int<0, max> contains type int<0, max>, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
RedundantConditionGivenDocblockType: library/Mockery/Container.php#L349
library/Mockery/Container.php:349:17: RedundantConditionGivenDocblockType: Docblock-defined type array<array-key, mixed|string> for $arg is always array<array-key, mixed> (see https://psalm.dev/156)
UnusedBaselineEntry: library/Mockery.php#L1
library/Mockery.php:0:0: UnusedBaselineEntry: Baseline for issue "MixedArgumentTypeCoercion" has 2 extra entries. (see https://psalm.dev/316)
UnusedBaselineEntry: library/Mockery/Container.php#L1
library/Mockery/Container.php:0:0: UnusedBaselineEntry: Baseline for issue "DocblockTypeContradiction" has 1 extra entry. (see https://psalm.dev/316)
PossiblyNullPropertyAssignmentValue: library/Mockery.php#L54
library/Mockery.php:54:33: PossiblyNullPropertyAssignmentValue: $this->_config with non-nullable declared type 'Mockery\Configuration' cannot be assigned nullable type 'null' (see https://psalm.dev/148)
PossiblyUnusedMethod: library/Mockery.php#L83
library/Mockery.php:83:28: PossiblyUnusedMethod: Cannot find any calls to method Mockery::andAnyOtherArgs (see https://psalm.dev/087)
PossiblyUnusedMethod: library/Mockery.php#L96
library/Mockery.php:96:28: PossiblyUnusedMethod: Cannot find any calls to method Mockery::andAnyOthers (see https://psalm.dev/087)
PossiblyUnusedMethod: library/Mockery.php#L106
library/Mockery.php:106:28: PossiblyUnusedMethod: Cannot find any calls to method Mockery::any (see https://psalm.dev/087)
PossiblyUnusedMethod: library/Mockery.php#L120
library/Mockery.php:120:28: PossiblyUnusedMethod: Cannot find any calls to method Mockery::anyOf (see https://psalm.dev/087)
PossiblyUnusedMethod: library/Mockery.php#L144
library/Mockery.php:144:28: PossiblyUnusedMethod: Cannot find any calls to method Mockery::capture (see https://psalm.dev/087)
MissingClosureReturnType: library/Mockery.php#L146
library/Mockery.php:146:20: MissingClosureReturnType: Closure does not have a return type, expecting true (see https://psalm.dev/068)
MissingClosureParamType: library/Mockery.php#L146
library/Mockery.php:146:37: MissingClosureParamType: Parameter $argument has no provided type (see https://psalm.dev/153)
MixedAssignment: library/Mockery.php#L147
library/Mockery.php:147:13: MixedAssignment: Unable to determine the type that $reference is being assigned to (see https://psalm.dev/032)
MissingThrowsDocblock: library/Mockery.php#L176
library/Mockery.php:176:21: MissingThrowsDocblock: Exception is thrown but not caught - please either catch or add a @throws annotation (see https://psalm.dev/169)