,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'validToString' => [ ' [ ' [ ' [ ' [ ' [ ' $_) {} echo (string) $i; }', ], 'allowToStringAfterMethodExistsCheck' => [ ' [ '__toString(); } class A { /** @psalm-return non-empty-string */ function __toString(): string { return "ha"; } }' ], 'intersectionCanBeString' => [ ' [ ' [ ' */ public function providerInvalidCodeParse(): iterable { return [ 'echoClass' => [ ' 'InvalidArgument', ], 'echoCastClass' => [ ' 'InvalidCast', ], 'invalidToStringReturnType' => [ ' 'InvalidToString', ], 'invalidInferredToStringReturnType' => [ ' 'InvalidToString', ], 'invalidInferredToStringReturnTypeWithTruePhp8' => [ ' 'InvalidToString', [], false, '8.0' ], 'implicitCastWithStrictTypes' => [ ' 'InvalidArgument', ], 'implicitCastWithStrictTypesToEchoOrSprintf' => [ ' 'ImplicitToStringCast', ], 'implicitCast' => [ ' 'ImplicitToStringCast', ], 'implicitCastToUnion' => [ ' 'ImplicitToStringCast', ], 'implicitCastFromInterface' => [ ' 'ImplicitToStringCast', ], 'implicitConcatenation' => [ ' 'ImplicitToStringCast', [], true, ], 'resourceCannotBeCoercedToString' => [ ' 'InvalidArgument', ], 'resourceOrFalseToString' => [ ' 'PossiblyInvalidCast', ], 'cannotCastInsideString' => [ ' 'InvalidCast', ], 'warnAboutNullableCast' => [ ' 'ImplicitToStringCast', ], 'possiblyInvalidCastOnIsSubclassOf' => [ ' 'PossiblyInvalidOperand', ], 'allowToStringAfterMethodExistsCheckWithTypo' => [ ' 'InvalidCast', ], 'alwaysEvaluateToStringVar' => [ ' 'UndefinedGlobalVariable', ], 'implicitStringableDisallowed' => [ ' 'InvalidArgument', [], false, '7.4', ], ]; } }