[VarDumper] Add types to private methods.
This commit is contained in:
parent
3fa8ad0859
commit
065acc816f
@ -191,7 +191,7 @@ class AmqpCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function extractFlags($flags)
|
||||
private static function extractFlags(int $flags): ConstStub
|
||||
{
|
||||
$flagsArray = [];
|
||||
|
||||
|
@ -49,7 +49,7 @@ class ArgsStub extends EnumStub
|
||||
}
|
||||
}
|
||||
|
||||
private static function getParameters($function, $class)
|
||||
private static function getParameters(string $function, ?string $class): array
|
||||
{
|
||||
if (isset(self::$parameters[$k = $class.'::'.$function])) {
|
||||
return self::$parameters[$k];
|
||||
|
@ -110,12 +110,12 @@ class DateCaster
|
||||
return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a;
|
||||
}
|
||||
|
||||
private static function formatDateTime(\DateTimeInterface $d, $extra = '')
|
||||
private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string
|
||||
{
|
||||
return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra);
|
||||
}
|
||||
|
||||
private static function formatSeconds($s, $us)
|
||||
private static function formatSeconds(string $s, string $us): string
|
||||
{
|
||||
return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ class ExceptionCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function filterExceptionArray($xClass, array $a, $xPrefix, $filter)
|
||||
private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array
|
||||
{
|
||||
if (isset($a[$xPrefix.'trace'])) {
|
||||
$trace = $a[$xPrefix.'trace'];
|
||||
@ -294,7 +294,7 @@ class ExceptionCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function traceUnshift(&$trace, $class, $file, $line)
|
||||
private static function traceUnshift(array &$trace, ?string $class, string $file, int $line): void
|
||||
{
|
||||
if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) {
|
||||
return;
|
||||
@ -306,7 +306,7 @@ class ExceptionCaster
|
||||
]);
|
||||
}
|
||||
|
||||
private static function extractSource($srcLines, $line, $srcContext, $title, $lang, $file = null)
|
||||
private static function extractSource(string $srcLines, int $line, int $srcContext, ?string $title, string $lang, string $file = null): EnumStub
|
||||
{
|
||||
$srcLines = explode("\n", $srcLines);
|
||||
$src = [];
|
||||
|
Reference in New Issue
Block a user