Skip to content

Commit aef0966

Browse files
committed
Add more specific types and fix a return type
1 parent a5ec617 commit aef0966

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/wp-content/themes/twentyeleven/inc/theme-options.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function twentyeleven_theme_options_help() {
152152
*
153153
* @since Twenty Eleven 1.0
154154
*
155-
* @return array An associative array of color scheme options.
155+
* @return array<string, array<string, string>> An associative array of color scheme options.
156156
*/
157157
function twentyeleven_color_schemes() {
158158
$color_scheme_options = array(
@@ -175,7 +175,7 @@ function twentyeleven_color_schemes() {
175175
*
176176
* @since Twenty Eleven 1.0
177177
*
178-
* @param array $color_scheme_options An associative array of color scheme options.
178+
* @param array<string, array<string, string>> $color_scheme_options An associative array of color scheme options.
179179
*/
180180
return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
181181
}
@@ -185,7 +185,7 @@ function twentyeleven_color_schemes() {
185185
*
186186
* @since Twenty Eleven 1.0
187187
*
188-
* @return array An associative array of layout options.
188+
* @return array<string, array<string, string>> An associative array of layout options.
189189
*/
190190
function twentyeleven_layouts() {
191191
$layout_options = array(
@@ -211,7 +211,7 @@ function twentyeleven_layouts() {
211211
*
212212
* @since Twenty Eleven 1.0
213213
*
214-
* @param array $layout_options An associative array of layout options.
214+
* @param array<string, array<string, string>> $layout_options An associative array of layout options.
215215
*/
216216
return apply_filters( 'twentyeleven_layouts', $layout_options );
217217
}
@@ -221,7 +221,7 @@ function twentyeleven_layouts() {
221221
*
222222
* @since Twenty Eleven 1.0
223223
*
224-
* @return array An array of default theme options.
224+
* @return array<string, string> An array of default theme options.
225225
*/
226226
function twentyeleven_get_default_theme_options() {
227227
$default_theme_options = array(
@@ -239,7 +239,7 @@ function twentyeleven_get_default_theme_options() {
239239
*
240240
* @since Twenty Eleven 1.0
241241
*
242-
* @param array $default_theme_options An array of default theme options.
242+
* @param array<string, string> $default_theme_options An array of default theme options.
243243
*/
244244
return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
245245
}
@@ -251,7 +251,7 @@ function twentyeleven_get_default_theme_options() {
251251
*
252252
* @param string $color_scheme Optional. Color scheme.
253253
* Default null (or the active color scheme).
254-
* @return string The default link color.
254+
* @return string|false The default link color, or false if not set.
255255
*/
256256
function twentyeleven_get_default_link_color( $color_scheme = null ) {
257257
if ( null === $color_scheme ) {
@@ -272,7 +272,7 @@ function twentyeleven_get_default_link_color( $color_scheme = null ) {
272272
*
273273
* @since Twenty Eleven 1.0
274274
*
275-
* @return array The theme options array.
275+
* @return array<string, string> The theme options array.
276276
*/
277277
function twentyeleven_get_theme_options() {
278278
return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() );
@@ -385,7 +385,7 @@ function twentyeleven_theme_options_render_page() {
385385
* @since Twenty Eleven 1.0
386386
*
387387
* @param array $input An array of form input.
388-
* @return array An array of sanitized and validated form output.
388+
* @return array<string, string> An array of sanitized and validated form output.
389389
*/
390390
function twentyeleven_theme_options_validate( $input ) {
391391
$defaults = twentyeleven_get_default_theme_options();
@@ -415,9 +415,9 @@ function twentyeleven_theme_options_validate( $input ) {
415415
*
416416
* @since Twenty Eleven 1.0
417417
*
418-
* @param array $output An array of sanitized form output.
419-
* @param array $input An array of un-sanitized form input.
420-
* @param array $defaults An array of default theme options.
418+
* @param array<string, string> $output An array of sanitized form output.
419+
* @param array $input An array of un-sanitized form input.
420+
* @param array<string, string> $defaults An array of default theme options.
421421
*/
422422
return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
423423
}
@@ -500,8 +500,8 @@ function twentyeleven_print_link_color_style() {
500500
*
501501
* @since Twenty Eleven 1.0
502502
*
503-
* @param array $existing_classes An array of existing body classes.
504-
* @return array The filtered array of body classes.
503+
* @param string[] $existing_classes An array of existing body classes.
504+
* @return string[] The filtered array of body classes.
505505
*/
506506
function twentyeleven_layout_classes( $existing_classes ) {
507507
$options = twentyeleven_get_theme_options();
@@ -526,8 +526,8 @@ function twentyeleven_layout_classes( $existing_classes ) {
526526
*
527527
* @since Twenty Eleven 1.0
528528
*
529-
* @param array $classes An array of body classes.
530-
* @param string $current_layout The current theme layout.
529+
* @param string[] $classes An array of body classes.
530+
* @param string $current_layout The current theme layout.
531531
*/
532532
$classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
533533

src/wp-content/themes/twentyeleven/inc/widgets.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function Twenty_Eleven_Ephemera_Widget() {
4949
*
5050
* @since Twenty Eleven 1.0
5151
*
52-
* @param array $args An array of standard parameters for widgets in this theme.
53-
* @param array $instance An array of settings for this widget instance.
52+
* @param array $args An array of standard parameters for widgets in this theme.
53+
* @param array<string, string|int> $instance An array of settings for this widget instance.
5454
*/
5555
public function widget( $args, $instance ) {
5656
$cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
@@ -159,7 +159,7 @@ public function widget( $args, $instance ) {
159159
*
160160
* @param array $new_instance New widget instance.
161161
* @param array $old_instance Original widget instance.
162-
* @return array Updated widget instance.
162+
* @return array<string, string|int> Updated widget instance.
163163
*/
164164
public function update( $new_instance, $old_instance ) {
165165
$instance = $old_instance;

0 commit comments

Comments
 (0)