Skip to content
Permalink
Browse files

working around vimeo/psalm#2819

  • Loading branch information
SignpostMarv committed Feb 14, 2020
1 parent c39141b commit b7dd5b54975acd94768c7a3b28ac97eeaaf33324
Showing with 3 additions and 9 deletions.
  1. +3 −9 src/SprintfExceptionFactory.php
@@ -45,17 +45,11 @@ public static function Exception(
*/
$type = $type ?? Exception::class;

if ($type !== $expected && ! is_a($type, $expected, self::IS_A_STRINGS)) {
throw static::ExpectArgumentIsException(
$type,
$expected,
1,
__METHOD__,
$code,
$previous
);
if ( ! is_a($type, $expected, self::IS_A_STRINGS)) {
throw static::ExpectArgumentIsException($type, $expected, 1, __METHOD__, $code, $previous);
}

/** @var T */
return new $type(sprintf($sprintf, ...$args), $code, $previous);
}

0 comments on commit b7dd5b5

Please sign in to comment.
You can’t perform that action at this time.