[ 'count' => $files_to_scan->count(), 'plugins' => self::filterFilesByType( $files_to_scan, 'plugin' ), 'themes' => self::filterFilesByType( $files_to_scan, 'theme' ), 'other' => self::filterFilesByType( $files_to_scan, 'other' ), ], 'domains_to_pre_generate_count' => $domains_to_pre_generate_count, 'file_path' => WP_LANG_DIR . '/wpml', 'is_st_page' => $is_st_page, 'admin_texts_url' => 'admin.php?page=' . WPML_ST_FOLDER . '/menu/string-translation.php&trop=1', 'is_search' => isset( $_GET['search'] ), 'run_ror_all_sites' => ( new Condition() )->shouldRunWithAllSites(), ]; }; } /** * @param Collection $files_to_scan * @param string $type * * @return array */ private static function filterFilesByType( Collection $files_to_scan, $type ) { return $files_to_scan->filter( EntryQueries::isType( $type ) ) ->map( EntryQueries::getResourceName() ) ->unique() ->values() ->toArray(); } }