fix and ignore logs-page typing

This commit is contained in:
Leon Stafford 2022-12-29 03:26:07 +11:00
parent 3576f4b50a
commit 7bd1e6aeb4
2 changed files with 13 additions and 2 deletions

View file

@ -35,4 +35,10 @@ parameters:
- message: "#^Cannot access property \\$name on mixed\\.$#"
path: views/options-page.php
count: 2
- message: "#^Cannot access property \\$time on string\\.$#"
path: views/logs-page.php
count: 1
- message: "#^Cannot access property \\$log on string\\.$#"
path: views/logs-page.php
count: 1
- '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/'

View file

@ -5,6 +5,11 @@
/**
* @var mixed[] $view
*/
/**
* @var string[] $logs
*/
$logs = $view['logs'];
?>
<div class="wrap">
@ -18,14 +23,14 @@
</tr>
</thead>
<tbody>
<?php if ( ! $view['logs'] ) : ?>
<?php if ( ! $logs ) : ?>
<tr>
<td colspan="2">Logs are empty.</td>
</tr>
<?php endif; ?>
<?php foreach ( $view['logs'] as $log ) : ?>
<?php foreach ( $logs as $log ) : ?>
<tr>
<td><?php echo $log->time; ?></td>
<td><?php echo $log->log; ?></td>