PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | controllers/template-tag-functions.php +12 -10 2.1.7 → 3.4 View file →
@@ -7,23 +7,25 @@
7 7 * @author Tobias Bäthge
8 8 * @since 1.0.0
9 9 */
10 10
11 +declare(strict_types=1);
12 +
11 13 /**
12 14 * Provides template tag functionality for the "table" Shortcode, to be used anywhere in the template, returns the table HTML.
13 15 *
14 16 * @since 1.0.0
15 17 *
16 - * @param string|array $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
18 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
17 19 * @return string HTML of the rendered table.
18 20 */
19 -function tablepress_get_table( $table_query ) {
21 +function tablepress_get_table( /* string|array */ $table_query ): string {
20 22 if ( is_array( $table_query ) ) {
21 23 $atts = $table_query;
22 24 } else {
23 25 parse_str( (string) $table_query, $atts );
24 26 }
25 - return TablePress::$controller->shortcode_table( $atts );
27 + return TablePress::$controller->shortcode_table( $atts ); // @phpstan-ignore argument.type
26 28 }
27 29
28 30 /**
29 31 * Provides template tag functionality for the "table" Shortcode, to be used anywhere in the template, echoes the table HTML.
@@ -31,11 +33,11 @@
31 33 * @since 1.0.0
32 34 *
33 35 * @see tablepress_get_table()
34 36 *
35 - * @param string|array $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
37 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table" rendering.
36 38 */
37 -function tablepress_print_table( $table_query ) {
39 +function tablepress_print_table( /* string|array */ $table_query ): void {
38 40 echo tablepress_get_table( $table_query );
39 41 }
40 42
41 43 /**
@@ -42,18 +44,18 @@
42 44 * Provides template tag functionality for the "table-info" Shortcode, to be used anywhere in the template, returns the info.
43 45 *
44 46 * @since 1.0.0
45 47 *
46 - * @param string|array $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
48 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
47 49 * @return string Desired table information.
48 50 */
49 -function tablepress_get_table_info( $table_query ) {
51 +function tablepress_get_table_info( /* string|array */ $table_query ): string {
50 52 if ( is_array( $table_query ) ) {
51 53 $atts = $table_query;
52 54 } else {
53 55 parse_str( (string) $table_query, $atts );
54 56 }
55 - return TablePress::$controller->shortcode_table_info( $atts );
57 + return TablePress::$controller->shortcode_table_info( $atts ); // @phpstan-ignore argument.type
56 58 }
57 59
58 60 /**
59 61 * Provides template tag functionality for the "table-info" Shortcode, to be used anywhere in the template, echoes the info.
@@ -61,9 +63,9 @@
61 63 * @since 1.0.0
62 64 *
63 65 * @see tablepress_get_table_info()
64 66 *
65 - * @param string|array $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
67 + * @param string|array<string, mixed> $table_query Query-string-like list or array of parameters for Shortcode "table-info" rendering.
66 68 */
67 -function tablepress_print_table_info( $table_query ) {
69 +function tablepress_print_table_info( /* string|array */ $table_query ): void {
68 70 echo tablepress_get_table_info( $table_query );
69 71 }