diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-12-16 06:29:28 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-12-16 06:29:28 +0000 |
| commit | e990a3c00fb630465996a29d60d9acc7687c8979 (patch) | |
| tree | 6a1071eeb3e1a618ac3fe94bcf8363c6fbbc0bb5 /include | |
| parent | d1c0ba5944e225165a5761e3d9a6620d27aca263 (diff) | |
| parent | 6f8f1b30d508dc3d2c3a067ca7fe2d161963ef5f (diff) | |
Merge branch 'feature/php-misc' into 'master'
More native typing, use some new PHP stuff
See merge request tt-rss/tt-rss!88
Diffstat (limited to 'include')
| -rwxr-xr-x | include/controls.php | 6 | ||||
| -rw-r--r-- | include/controls_compat.php | 30 |
2 files changed, 16 insertions, 20 deletions
diff --git a/include/controls.php b/include/controls.php index 5c6174e3d..8932dd048 100755 --- a/include/controls.php +++ b/include/controls.php @@ -56,21 +56,21 @@ * @param array<string, mixed> $attributes */ function number_spinner_tag(string $name, string $value, array $attributes = [], string $id = ""): string { - return input_tag($name, $value, "text", array_merge(["dojoType" => "dijit.form.NumberSpinner"], $attributes), $id); + return input_tag($name, $value, 'text', ['dojoType' => 'dijit.form.NumberSpinner', ...$attributes], $id); } /** * @param array<string, mixed> $attributes */ function submit_tag(string $value, array $attributes = []): string { - return button_tag($value, "submit", array_merge(["class" => "alt-primary"], $attributes)); + return button_tag($value, 'submit', ['class' => 'alt-primary', ...$attributes]); } /** * @param array<string, mixed> $attributes */ function cancel_dialog_tag(string $value, array $attributes = []): string { - return button_tag($value, "", array_merge(["onclick" => "App.dialogOf(this).hide()"], $attributes)); + return button_tag($value, '', ['onclick' => 'App.dialogOf(this).hide()', ...$attributes]); } /** diff --git a/include/controls_compat.php b/include/controls_compat.php index 5a2a9f2ba..d22f7fc3c 100644 --- a/include/controls_compat.php +++ b/include/controls_compat.php @@ -5,15 +5,13 @@ */ function stylesheet_tag(string $filename, array $attributes = []): string { - $attributes_str = \Controls\attributes_to_string( - array_merge( - [ - "href" => "$filename?" . filemtime($filename), - "rel" => "stylesheet", - "type" => "text/css", - "data-orig-href" => $filename - ], - $attributes)); + $attributes_str = \Controls\attributes_to_string([ + 'href' => "$filename?" . filemtime($filename), + 'rel' => 'stylesheet', + 'type' => 'text/css', + 'data-orig-href' => $filename, + ...$attributes, + ]); return "<link $attributes_str/>\n"; } @@ -22,14 +20,12 @@ function stylesheet_tag(string $filename, array $attributes = []): string { * @param array<string, mixed> $attributes */ function javascript_tag(string $filename, array $attributes = []): string { - $attributes_str = \Controls\attributes_to_string( - array_merge( - [ - "src" => "$filename?" . filemtime($filename), - "type" => "text/javascript", - "charset" => "utf-8" - ], - $attributes)); + $attributes_str = \Controls\attributes_to_string([ + 'src' => "$filename?" . filemtime($filename), + 'type' => 'text/javascript', + 'charset' => 'utf-8', + ...$attributes, + ]); return "<script $attributes_str></script>\n"; } |