Skip to content

Commit 2d33987

Browse files
committed
adjust typing for Detection classes
1 parent 17fd2dc commit 2d33987

7 files changed

+34
-3
lines changed

src/DetectAuthorPaginationURLs.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public static function detect( string $wp_site_url ) : array {
1717
$urls_to_include = [];
1818
$users = get_users();
1919
$pagination_base = $wp_rewrite->pagination_base;
20+
21+
/**
22+
* @var int $default_posts_per_page
23+
*/
2024
$default_posts_per_page = get_option( 'posts_per_page' );
2125

2226
foreach ( $users as $author ) {
@@ -40,6 +44,10 @@ public static function detect( string $wp_site_url ) : array {
4044
}
4145

4246
foreach ( $authors_urls as $author => $total_posts ) {
47+
/**
48+
* @var int $total_posts
49+
*/
50+
4351
$total_pages = ceil( $total_posts / $default_posts_per_page );
4452

4553
for ( $page = 1; $page <= $total_pages; $page++ ) {

src/DetectCategoryPaginationURLs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function detect() : array {
2626
foreach ( $taxonomies as $taxonomy ) {
2727
/** @var list<\WP_Term> $terms */
2828
$terms = get_terms(
29-
$taxonomy->name,
29+
[ $taxonomy->name ],
3030
[ 'hide_empty' => true ]
3131
);
3232

src/DetectCategoryURLs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static function detect() : array {
2121
foreach ( $taxonomies as $taxonomy ) {
2222
/** @var list<\WP_Term> $terms */
2323
$terms = get_terms(
24-
$taxonomy->name,
24+
[ $taxonomy->name ],
2525
[ 'hide_empty' => true ]
2626
);
2727

src/DetectPluginAssets.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,20 @@ public static function detect() : array {
2626
)
2727
);
2828

29+
/**
30+
* @var string[] $active_plugins
31+
*/
2932
$active_plugins = get_option( 'active_plugins' );
33+
/**
34+
* @var string[] $active_sitewide_plugins
35+
*/
36+
$active_sitewide_plugins = get_option( 'active_sitewide_plugins' );
3037

3138
if ( is_multisite() ) {
3239
$active_plugins = array_unique(
3340
array_merge(
3441
$active_plugins,
35-
array_keys( get_site_option( 'active_sitewide_plugins' ) )
42+
array_keys( $active_sitewide_plugins )
3643
)
3744
);
3845
}
@@ -45,6 +52,10 @@ function ( $active_plugin ) {
4552
);
4653

4754
foreach ( $iterator as $filename => $file_object ) {
55+
/**
56+
* @var string $filename
57+
*/
58+
4859
$path_crawlable =
4960
FilesHelper::filePathLooksCrawlable( $filename );
5061

src/DetectThemeAssets.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public static function detect( string $theme_type ) : array {
3535
);
3636

3737
foreach ( $iterator as $filename => $file_object ) {
38+
/**
39+
* @var string $filename
40+
*/
41+
3842
$path_crawlable =
3943
FilesHelper::filePathLooksCrawlable( $filename );
4044

src/DetectVendorCache.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public static function detect(
3636
);
3737

3838
foreach ( $iterator as $filename => $file_object ) {
39+
/**
40+
* @var string $filename
41+
*/
42+
3943
$path_crawlable =
4044
FilesHelper::filePathLooksCrawlable( $filename );
4145

src/DetectWPIncludesAssets.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public static function detect() : array {
2929
);
3030

3131
foreach ( $iterator as $filename => $file_object ) {
32+
/**
33+
* @var string $filename
34+
*/
35+
3236
$path_crawlable =
3337
FilesHelper::filePathLooksCrawlable( $filename );
3438

0 commit comments

Comments
 (0)