@@ -81,6 +81,9 @@ abstract protected function get_item_list();
8181 */
8282 abstract protected function filter_item_list ( $ items , $ args );
8383
84+ /**
85+ * @return array<string, array{slug: string, name: string, update: string, recently_active?: bool, status: string, version: string}>
86+ */
8487 abstract protected function get_all_items ();
8588
8689 /**
@@ -237,6 +240,11 @@ public function install( $args, $assoc_args ) {
237240 && ! preg_match ( '#github\.com/[^/]+/[^/]+/(?:releases/download|raw)/# ' , $ slug ) ) {
238241
239242 $ filter = function ( $ source ) use ( $ slug ) {
243+ /**
244+ * @var \WP_Filesystem_Base $wp_filesystem
245+ */
246+ global $ wp_filesystem ;
247+
240248 /**
241249 * @var string $path
242250 */
@@ -255,7 +263,7 @@ public function install( $args, $assoc_args ) {
255263 }
256264 $ new_path = substr_replace ( $ source , $ slug_dir , (int ) strrpos ( $ source , $ source_dir ), strlen ( $ source_dir ) );
257265
258- if ( $ GLOBALS [ ' wp_filesystem ' ] ->move ( $ source , $ new_path ) ) {
266+ if ( $ wp_filesystem ->move ( $ source , $ new_path ) ) {
259267 WP_CLI ::log ( sprintf ( "Renamed Github-based project from '%s' to '%s'. " , $ source_dir , $ slug_dir ) );
260268 return $ new_path ;
261269 }
@@ -874,6 +882,9 @@ protected function _search( $args, $assoc_args ) {
874882 // In older WP versions these used to be objects.
875883 foreach ( $ items as $ index => $ item_object ) {
876884 if ( is_array ( $ item_object ) ) {
885+ /**
886+ * @var array{slug: string} $item_object
887+ */
877888 $ items [ $ index ]['url ' ] = "https://wordpress.org/ {$ plural }/ {$ item_object ['slug ' ]}/ " ;
878889 } elseif ( $ item_object instanceof \stdClass ) {
879890 $ item_object ->url = "https://wordpress.org/ {$ plural }/ {$ item_object ->slug }/ " ;
0 commit comments