@@ -108,6 +108,14 @@ final class HtmlRenderer implements ThrowableRendererInterface
108108 * - maxSourceLines: int, maximum number of source code lines to be displayed. Defaults to 19.
109109 * - maxTraceLines: int, maximum number of trace source code lines to be displayed. Defaults to 13.
110110 * - traceHeaderLine: string, trace header line with placeholders to be be substituted. Defaults to null.
111+ *
112+ * @psalm-param array{
113+ * template?: string,
114+ * verboseTemplate?: string,
115+ * maxSourceLines?: int,
116+ * maxTraceLines?: int,
117+ * traceHeaderLine?: string,
118+ * } $settings
111119 */
112120 public function __construct (array $ settings = [])
113121 {
@@ -264,6 +272,9 @@ public function argumentsToString(array $args): string
264272 $ count = 0 ;
265273 $ isAssoc = $ args !== array_values ($ args );
266274
275+ /**
276+ * @var mixed $value
277+ */
267278 foreach ($ args as $ key => $ value ) {
268279 $ count ++;
269280
@@ -306,6 +317,8 @@ public function argumentsToString(array $args): string
306317 }
307318 }
308319
320+ /** @var string[] $args */
321+
309322 ksort ($ args );
310323 return implode (', ' , $ args );
311324 }
@@ -423,6 +436,7 @@ private function renderTemplate(string $path, array $parameters): string
423436 }
424437
425438 $ renderer = function (): void {
439+ /** @psalm-suppress MixedArgument */
426440 extract (func_get_arg (1 ), EXTR_OVERWRITE );
427441 require func_get_arg (0 );
428442 };
@@ -524,6 +538,8 @@ private function groupVendorCallStackItems(array $items): array
524538 $ groupedItems [$ groupIndex ][$ index ] = $ item ;
525539 }
526540
541+ /** @psalm-var array<int, array<int, string>> $groupedItems It's need for Psalm <=4.30 only. */
542+
527543 return $ groupedItems ;
528544 }
529545
@@ -571,6 +587,7 @@ private function getVendorPaths(): array
571587 $ rootPath = dirname (__DIR__ , 4 );
572588
573589 // If the error handler is installed as a vendor package.
590+ /** @psalm-suppress InvalidLiteralArgument It is Psalm bug, {@see https://github.com/vimeo/psalm/issues/9196} */
574591 if (strlen ($ rootPath ) > 6 && str_contains ($ rootPath , 'vendor ' )) {
575592 $ this ->vendorPaths = [$ rootPath ];
576593 return $ this ->vendorPaths ;
@@ -579,6 +596,7 @@ private function getVendorPaths(): array
579596 // If the error handler is installed for development in `yiisoft/yii-dev-tool`.
580597 if (is_file ("{$ rootPath }/yii-dev " ) || is_file ("{$ rootPath }/yii-dev.bat " )) {
581598 $ vendorPaths = glob ("{$ rootPath }/dev/*/vendor " );
599+ /** @var string[] */
582600 $ this ->vendorPaths = empty ($ vendorPaths ) ? [] : str_replace (['/ ' , '\\' ], DIRECTORY_SEPARATOR , $ vendorPaths );
583601 return $ this ->vendorPaths ;
584602 }
0 commit comments