mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-02 09:20:52 +00:00
Remove useless type castings in ShouldNotHappenException::createDefaultMessageWithLocation()
method (#1678)
* Remove useless type castings in `ShouldNotHappenException::createDefaultMessageWithLocation()` method * Update PHPStan baseline
This commit is contained in:
parent
80882ad175
commit
303ecc342d
|
@ -627,3 +627,9 @@ parameters:
|
|||
|
||||
# impossible to validate json string is a class-string
|
||||
- '#Parameter \#1 \$rectorClass of class Rector\\ChangesReporting\\ValueObject\\RectorWithLineChange constructor expects class\-string<Rector\\Core\\Contract\\Rector\\RectorInterface\>\|Rector\\Core\\Contract\\Rector\\RectorInterface, string given#'
|
||||
|
||||
# will be solved once https://github.com/phpstan/phpstan-src/pull/914 gets released
|
||||
-
|
||||
message: '#sprintf\(\) call mask types does not match provided arguments types#'
|
||||
paths:
|
||||
- src/Exception/ShouldNotHappenException.php
|
||||
|
|
|
@ -26,9 +26,9 @@ final class ShouldNotHappenException extends Exception
|
|||
{
|
||||
$debugBacktrace = debug_backtrace();
|
||||
|
||||
$class = isset($debugBacktrace[2]['class']) ? (string) $debugBacktrace[2]['class'] : null;
|
||||
$function = isset($debugBacktrace[2]['function']) ? (string) $debugBacktrace[2]['function'] : '';
|
||||
$line = isset($debugBacktrace[1]['line']) ? (int) $debugBacktrace[1]['line'] : 0;
|
||||
$class = $debugBacktrace[2]['class'] ?? null;
|
||||
$function = $debugBacktrace[2]['function'];
|
||||
$line = $debugBacktrace[1]['line'] ?? 0;
|
||||
|
||||
$method = $class !== null ? ($class . '::' . $function) : $function;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user