File tree Expand file tree Collapse file tree
system/Debug/Toolbar/Collectors Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,12 +45,14 @@ class Logs extends BaseCollector
4545 /**
4646 * Our collected data.
4747 *
48- * @var array
48+ * @var list< array{level: string, msg: string}>
4949 */
5050 protected $ data ;
5151
5252 /**
53- * Returns the data of this collector to be formatted in the toolbar
53+ * Returns the data of this collector to be formatted in the toolbar.
54+ *
55+ * @return array{logs: list<array{level: string, msg: string}>}
5456 */
5557 public function display (): array
5658 {
@@ -66,7 +68,7 @@ public function isEmpty(): bool
6668 {
6769 $ this ->collectLogs ();
6870
69- return empty ( $ this ->data ) ;
71+ return $ this ->data !== [] ;
7072 }
7173
7274 /**
@@ -82,14 +84,14 @@ public function icon(): string
8284 /**
8385 * Ensures the data has been collected.
8486 *
85- * @return array
87+ * @return list< array{level: string, msg: string}>
8688 */
8789 protected function collectLogs ()
8890 {
89- if (! empty ( $ this ->data ) ) {
91+ if ($ this ->data !== [] ) {
9092 return $ this ->data ;
9193 }
9294
93- return $ this ->data = service ('logger ' , true )->logCache ?? [] ;
95+ return $ this ->data = service ('logger ' , true )->logCache ;
9496 }
9597}
You can’t perform that action at this time.
0 commit comments