summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-11 20:40:30 +0000
committerwn_ <[email protected]>2021-11-11 20:47:20 +0000
commite4b8e2d0631825ff0d3fa7bd5eb6e88414facd92 (patch)
treeaf9e330190f069511cb5318b1770c2516455fc8d /include
parentd2ccbecea68c0804c7b5b3650a92aa47c90cf29c (diff)
Address PHPStan warnings in 'include/controls_compat.php'.
Diffstat (limited to 'include')
-rw-r--r--include/controls_compat.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/controls_compat.php b/include/controls_compat.php
index d1c2c12b5..5a2a9f2ba 100644
--- a/include/controls_compat.php
+++ b/include/controls_compat.php
@@ -1,7 +1,9 @@
<?php
-
-function stylesheet_tag($filename, $attributes = []) {
+/**
+ * @param array<string, mixed> $attributes
+ */
+function stylesheet_tag(string $filename, array $attributes = []): string {
$attributes_str = \Controls\attributes_to_string(
array_merge(
@@ -16,7 +18,10 @@ function stylesheet_tag($filename, $attributes = []) {
return "<link $attributes_str/>\n";
}
-function javascript_tag($filename, $attributes = []) {
+/**
+ * @param array<string, mixed> $attributes
+ */
+function javascript_tag(string $filename, array $attributes = []): string {
$attributes_str = \Controls\attributes_to_string(
array_merge(
[
@@ -29,26 +34,26 @@ function javascript_tag($filename, $attributes = []) {
return "<script $attributes_str></script>\n";
}
-function format_warning($msg, $id = "") {
+function format_warning(string $msg, string $id = ""): string {
return "<div class=\"alert\" id=\"$id\">$msg</div>";
}
-function format_notice($msg, $id = "") {
+function format_notice(string $msg, string $id = ""): string {
return "<div class=\"alert alert-info\" id=\"$id\">$msg</div>";
}
-function format_error($msg, $id = "") {
+function format_error(string $msg, string $id = ""): string {
return "<div class=\"alert alert-danger\" id=\"$id\">$msg</div>";
}
-function print_notice($msg) {
+function print_notice(string $msg): string {
return print format_notice($msg);
}
-function print_warning($msg) {
+function print_warning(string $msg): string {
return print format_warning($msg);
}
-function print_error($msg) {
+function print_error(string $msg): string {
return print format_error($msg);
}