From 0a0392a3d1888bc1efedf4aa40fabd035f7d9e83 Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 29 Sep 2023 13:01:48 -0300 Subject: [PATCH 1/2] Remove unnecessary class aliases --- elasticpress.php | 2 +- includes/classes/DeprecatedCommand.php | 2 +- includes/classes/Elasticsearch.php | 4 ++-- includes/classes/Feature.php | 4 ++-- includes/classes/Feature/Autosuggest/Autosuggest.php | 10 +++++----- includes/classes/Feature/Comments/Comments.php | 10 +++++----- includes/classes/Feature/Comments/Widget.php | 6 +----- includes/classes/Feature/Documents/Documents.php | 10 +++++----- includes/classes/Feature/Facets/Facets.php | 8 ++++---- .../classes/Feature/Facets/Types/Meta/Renderer.php | 2 +- .../Feature/Facets/Types/MetaRange/Renderer.php | 2 +- .../Feature/Facets/Types/PostType/Renderer.php | 2 +- .../Feature/Facets/Types/Taxonomy/Renderer.php | 4 ++-- .../classes/Feature/Facets/Types/Taxonomy/Widget.php | 5 ++--- .../Feature/InstantResults/InstantResults.php | 10 +++++----- .../Feature/ProtectedContent/ProtectedContent.php | 8 ++++---- .../classes/Feature/RelatedPosts/RelatedPosts.php | 7 +++---- includes/classes/Feature/RelatedPosts/Widget.php | 5 ++--- includes/classes/Feature/Search/Synonyms.php | 7 +++---- .../Feature/SearchOrdering/SearchOrdering.php | 3 +-- includes/classes/Feature/Terms/Terms.php | 8 ++++---- includes/classes/Feature/Users/Users.php | 10 +++++----- includes/classes/Features.php | 2 +- .../classes/HealthCheck/HealthCheckElasticsearch.php | 6 +++--- includes/classes/IndexHelper.php | 2 +- includes/classes/Indexable.php | 4 ++-- includes/classes/Indexable/Comment/Comment.php | 12 ++++++------ .../classes/Indexable/Comment/QueryIntegration.php | 6 +++--- includes/classes/Indexable/Comment/SyncManager.php | 4 ++-- includes/classes/Indexable/Post/DateQuery.php | 2 +- includes/classes/Indexable/Post/Post.php | 8 ++++---- includes/classes/Indexable/Post/QueryIntegration.php | 6 +++--- includes/classes/Indexable/Post/SyncManager.php | 6 +++--- includes/classes/Indexable/Term/QueryIntegration.php | 2 +- includes/classes/Indexable/Term/SyncManager.php | 4 ++-- includes/classes/Indexable/Term/Term.php | 6 +++--- includes/classes/Indexable/User/QueryIntegration.php | 5 ++--- includes/classes/Indexable/User/SyncManager.php | 4 ++-- includes/classes/Indexable/User/User.php | 8 ++++---- includes/classes/Stats.php | 2 +- includes/partials/dashboard-page.php | 6 +++--- includes/partials/stats-page.php | 5 ++--- tests/php/features/TestFacet.php | 2 +- tests/php/features/TestFacetTypeMeta.php | 2 +- tests/php/features/TestFacetTypeMetaRange.php | 2 +- tests/php/features/TestFacetTypeTaxonomy.php | 2 +- tests/php/indexables/TestPost.php | 2 +- 47 files changed, 114 insertions(+), 125 deletions(-) diff --git a/elasticpress.php b/elasticpress.php index a7ad998d32..619d80fd77 100644 --- a/elasticpress.php +++ b/elasticpress.php @@ -23,7 +23,7 @@ namespace ElasticPress; -use \WP_CLI as WP_CLI; +use \WP_CLI; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/DeprecatedCommand.php b/includes/classes/DeprecatedCommand.php index 773f1eeb61..9df5970eea 100644 --- a/includes/classes/DeprecatedCommand.php +++ b/includes/classes/DeprecatedCommand.php @@ -8,7 +8,7 @@ namespace ElasticPress; -use \WP_CLI as WP_CLI; +use \WP_CLI; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Elasticsearch.php b/includes/classes/Elasticsearch.php index 8a8836d65f..1ecedcc8f5 100644 --- a/includes/classes/Elasticsearch.php +++ b/includes/classes/Elasticsearch.php @@ -8,9 +8,9 @@ namespace ElasticPress; -use ElasticPress\Utils as Utils; +use \WP_Error; use ElasticPress\Indexables; -use \WP_Error as WP_Error; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature.php b/includes/classes/Feature.php index 952b20a87a..2d1d874d11 100644 --- a/includes/classes/Feature.php +++ b/includes/classes/Feature.php @@ -10,8 +10,8 @@ namespace ElasticPress; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Utils as Utils; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Autosuggest/Autosuggest.php b/includes/classes/Feature/Autosuggest/Autosuggest.php index 4d53f8df2e..03424550cb 100644 --- a/includes/classes/Feature/Autosuggest/Autosuggest.php +++ b/includes/classes/Feature/Autosuggest/Autosuggest.php @@ -9,12 +9,12 @@ namespace ElasticPress\Feature\Autosuggest; -use ElasticPress\Feature as Feature; -use ElasticPress\Features as Features; -use ElasticPress\Utils as Utils; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Indexables as Indexables; use ElasticPress\Elasticsearch; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Features; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Comments/Comments.php b/includes/classes/Feature/Comments/Comments.php index 66feb2e782..aa341adca2 100644 --- a/includes/classes/Feature/Comments/Comments.php +++ b/includes/classes/Feature/Comments/Comments.php @@ -8,11 +8,11 @@ namespace ElasticPress\Feature\Comments; -use ElasticPress\Feature as Feature; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Indexable as Indexable; -use ElasticPress\Features as Features; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Features; +use ElasticPress\Indexable; +use ElasticPress\Indexables; use ElasticPress\Utils; /** diff --git a/includes/classes/Feature/Comments/Widget.php b/includes/classes/Feature/Comments/Widget.php index 1d2190dca0..045669cd3b 100644 --- a/includes/classes/Feature/Comments/Widget.php +++ b/includes/classes/Feature/Comments/Widget.php @@ -8,10 +8,6 @@ namespace ElasticPress\Feature\Comments; -use \WP_Widget as WP_Widget; -use ElasticPress\Features as Features; -use ElasticPress\Utils; - if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } @@ -19,7 +15,7 @@ /** * Search comment widget class */ -class Widget extends WP_Widget { +class Widget extends \WP_Widget { /** * Initialize the widget diff --git a/includes/classes/Feature/Documents/Documents.php b/includes/classes/Feature/Documents/Documents.php index 259021b992..b00ffe422c 100644 --- a/includes/classes/Feature/Documents/Documents.php +++ b/includes/classes/Feature/Documents/Documents.php @@ -7,11 +7,11 @@ namespace ElasticPress\Feature\Documents; -use ElasticPress\Feature as Feature; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Utils as Utils; +use ElasticPress\Elasticsearch; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Indexables; +use ElasticPress\Utils; /** * Documents feature class. diff --git a/includes/classes/Feature/Facets/Facets.php b/includes/classes/Feature/Facets/Facets.php index 159d365df3..d49652a6a5 100644 --- a/includes/classes/Feature/Facets/Facets.php +++ b/includes/classes/Feature/Facets/Facets.php @@ -8,10 +8,10 @@ namespace ElasticPress\Feature\Facets; -use ElasticPress\Feature as Feature; -use ElasticPress\Features as Features; -use ElasticPress\Utils as Utils; -use ElasticPress\Indexables as Indexables; +use ElasticPress\Feature; +use ElasticPress\Features; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Facets/Types/Meta/Renderer.php b/includes/classes/Feature/Facets/Types/Meta/Renderer.php index 2d4768b9e2..bf078fe541 100644 --- a/includes/classes/Feature/Facets/Types/Meta/Renderer.php +++ b/includes/classes/Feature/Facets/Types/Meta/Renderer.php @@ -8,7 +8,7 @@ namespace ElasticPress\Feature\Facets\Types\Meta; -use ElasticPress\Features as Features; +use ElasticPress\Features; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php b/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php index fd5d1d8599..3fcc1e8197 100644 --- a/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php +++ b/includes/classes/Feature/Facets/Types/MetaRange/Renderer.php @@ -8,7 +8,7 @@ namespace ElasticPress\Feature\Facets\Types\MetaRange; -use ElasticPress\Features as Features; +use ElasticPress\Features; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Facets/Types/PostType/Renderer.php b/includes/classes/Feature/Facets/Types/PostType/Renderer.php index ea93a4169b..6a371b178a 100644 --- a/includes/classes/Feature/Facets/Types/PostType/Renderer.php +++ b/includes/classes/Feature/Facets/Types/PostType/Renderer.php @@ -8,7 +8,7 @@ namespace ElasticPress\Feature\Facets\Types\PostType; -use ElasticPress\Features as Features; +use ElasticPress\Features; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php b/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php index ac854cfa14..44fb7a7dc0 100644 --- a/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php +++ b/includes/classes/Feature/Facets/Types/Taxonomy/Renderer.php @@ -8,8 +8,8 @@ namespace ElasticPress\Feature\Facets\Types\Taxonomy; -use ElasticPress\Features as Features; -use ElasticPress\Utils as Utils; +use ElasticPress\Features; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php b/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php index 189b0e37f6..42f0de7def 100644 --- a/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php +++ b/includes/classes/Feature/Facets/Types/Taxonomy/Widget.php @@ -7,8 +7,7 @@ namespace ElasticPress\Feature\Facets\Types\Taxonomy; -use \WP_Widget as WP_Widget; -use ElasticPress\Features as Features; +use ElasticPress\Features; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -17,7 +16,7 @@ /** * Facets widget class */ -class Widget extends WP_Widget { +class Widget extends \WP_Widget { /** * The renderer instance. * diff --git a/includes/classes/Feature/InstantResults/InstantResults.php b/includes/classes/Feature/InstantResults/InstantResults.php index ebe2bdbb72..e7c348a2ac 100644 --- a/includes/classes/Feature/InstantResults/InstantResults.php +++ b/includes/classes/Feature/InstantResults/InstantResults.php @@ -7,12 +7,12 @@ namespace ElasticPress\Feature\InstantResults; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Feature as Feature; +use ElasticPress\Elasticsearch; +use ElasticPress\Feature; use ElasticPress\FeatureRequirementsStatus; -use ElasticPress\Features as Features; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Utils as Utils; +use ElasticPress\Features; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/ProtectedContent/ProtectedContent.php b/includes/classes/Feature/ProtectedContent/ProtectedContent.php index 9a766e1d97..144c26227c 100644 --- a/includes/classes/Feature/ProtectedContent/ProtectedContent.php +++ b/includes/classes/Feature/ProtectedContent/ProtectedContent.php @@ -8,10 +8,10 @@ namespace ElasticPress\Feature\ProtectedContent; -use ElasticPress\Utils as Utils; -use ElasticPress\Feature as Feature; -use ElasticPress\Features as Features; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Features; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/RelatedPosts/RelatedPosts.php b/includes/classes/Feature/RelatedPosts/RelatedPosts.php index c1f1a75ceb..ebf6deae12 100644 --- a/includes/classes/Feature/RelatedPosts/RelatedPosts.php +++ b/includes/classes/Feature/RelatedPosts/RelatedPosts.php @@ -8,11 +8,10 @@ namespace ElasticPress\Feature\RelatedPosts; -use ElasticPress\Feature as Feature; -use ElasticPress\Elasticsearch as Elasticsearch; +use \WP_Query; +use ElasticPress\Elasticsearch; +use ElasticPress\Feature; use ElasticPress\Utils; -use ElasticPress\Post\Post as Post; -use \WP_Query as WP_Query; /** * Related posts feature class diff --git a/includes/classes/Feature/RelatedPosts/Widget.php b/includes/classes/Feature/RelatedPosts/Widget.php index 74c1b1823d..7252a311cf 100644 --- a/includes/classes/Feature/RelatedPosts/Widget.php +++ b/includes/classes/Feature/RelatedPosts/Widget.php @@ -8,8 +8,7 @@ namespace ElasticPress\Feature\RelatedPosts; -use \WP_Widget as WP_Widget; -use ElasticPress\Features as Features; +use ElasticPress\Features; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -18,7 +17,7 @@ /** * Related posts widget class */ -class Widget extends WP_Widget { +class Widget extends \WP_Widget { /** * Initialize the widget diff --git a/includes/classes/Feature/Search/Synonyms.php b/includes/classes/Feature/Search/Synonyms.php index 0c3ce00c76..cf3fccec97 100644 --- a/includes/classes/Feature/Search/Synonyms.php +++ b/includes/classes/Feature/Search/Synonyms.php @@ -7,12 +7,11 @@ namespace ElasticPress\Feature\Search; -use ElasticPress\Feature; -use ElasticPress\Features; -use ElasticPress\Indexables; use ElasticPress\Elasticsearch; use ElasticPress\FeatureRequirementsStatus; -use ElasticPress\Utils as Utils; +use ElasticPress\Features; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Feature/SearchOrdering/SearchOrdering.php b/includes/classes/Feature/SearchOrdering/SearchOrdering.php index 33529ed924..4550371b8d 100644 --- a/includes/classes/Feature/SearchOrdering/SearchOrdering.php +++ b/includes/classes/Feature/SearchOrdering/SearchOrdering.php @@ -8,9 +8,8 @@ namespace ElasticPress\Feature\SearchOrdering; use ElasticPress\Feature; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; +use ElasticPress\FeatureRequirementsStatus; use ElasticPress\Features; -use ElasticPress\Indexable\Post\Post; use ElasticPress\Indexables; use ElasticPress\Utils; diff --git a/includes/classes/Feature/Terms/Terms.php b/includes/classes/Feature/Terms/Terms.php index 46cda3ed79..c0d406557d 100644 --- a/includes/classes/Feature/Terms/Terms.php +++ b/includes/classes/Feature/Terms/Terms.php @@ -8,10 +8,10 @@ namespace ElasticPress\Feature\Terms; -use ElasticPress\Feature as Feature; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Indexable as Indexable; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Indexable; +use ElasticPress\Indexables; /** * Terms feature class diff --git a/includes/classes/Feature/Users/Users.php b/includes/classes/Feature/Users/Users.php index 34868d2ac8..794e8d62ce 100644 --- a/includes/classes/Feature/Users/Users.php +++ b/includes/classes/Feature/Users/Users.php @@ -8,11 +8,11 @@ namespace ElasticPress\Feature\Users; -use ElasticPress\Feature as Feature; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Indexable as Indexable; -use ElasticPress\FeatureRequirementsStatus as FeatureRequirementsStatus; -use ElasticPress\Utils as Utils; +use ElasticPress\Feature; +use ElasticPress\FeatureRequirementsStatus; +use ElasticPress\Indexable; +use ElasticPress\Indexables; +use ElasticPress\Utils; /** * Users feature class diff --git a/includes/classes/Features.php b/includes/classes/Features.php index 20349440c7..51a4c9f5e4 100644 --- a/includes/classes/Features.php +++ b/includes/classes/Features.php @@ -8,7 +8,7 @@ namespace ElasticPress; -use ElasticPress\Utils as Utils; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/HealthCheck/HealthCheckElasticsearch.php b/includes/classes/HealthCheck/HealthCheckElasticsearch.php index 74aab0f6b5..537fc8abab 100644 --- a/includes/classes/HealthCheck/HealthCheckElasticsearch.php +++ b/includes/classes/HealthCheck/HealthCheckElasticsearch.php @@ -8,9 +8,9 @@ namespace ElasticPress\HealthCheck; -use ElasticPress\HealthCheck as HealthCheck; -use ElasticPress\Utils as Utils; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\HealthCheck; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/IndexHelper.php b/includes/classes/IndexHelper.php index 3b7db2950f..6f759d1a1d 100644 --- a/includes/classes/IndexHelper.php +++ b/includes/classes/IndexHelper.php @@ -13,7 +13,7 @@ namespace ElasticPress; -use ElasticPress\Utils as Utils; +use ElasticPress\Utils; /** * Index Helper Class. diff --git a/includes/classes/Indexable.php b/includes/classes/Indexable.php index 5cbb9ebc93..e66bb18f63 100644 --- a/includes/classes/Indexable.php +++ b/includes/classes/Indexable.php @@ -10,8 +10,8 @@ namespace ElasticPress; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\SyncManager as SyncManager; +use ElasticPress\Elasticsearch; +use ElasticPress\SyncManager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Indexable/Comment/Comment.php b/includes/classes/Indexable/Comment/Comment.php index 73392ab2a5..cfa5eb5c4a 100644 --- a/includes/classes/Indexable/Comment/Comment.php +++ b/includes/classes/Indexable/Comment/Comment.php @@ -8,12 +8,12 @@ namespace ElasticPress\Indexable\Comment; -use ElasticPress\Indexable as Indexable; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Indexable\Post\DateQuery as DateQuery; -use \WP_Comment_Query as WP_Comment_Query; -use ElasticPress\Features as Features; +use \WP_Comment_Query; +use ElasticPress\Elasticsearch; +use ElasticPress\Features; +use ElasticPress\Indexable; +use ElasticPress\Indexable\Post\DateQuery; +use ElasticPress\Indexables; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Indexable/Comment/QueryIntegration.php b/includes/classes/Indexable/Comment/QueryIntegration.php index cb94d3bbae..c1f8043f45 100644 --- a/includes/classes/Indexable/Comment/QueryIntegration.php +++ b/includes/classes/Indexable/Comment/QueryIntegration.php @@ -8,9 +8,9 @@ namespace ElasticPress\Indexable\Comment; -use ElasticPress\Indexables as Indexables; -use \WP_Comment_Query as WP_Comment_Query; -use ElasticPress\Utils as Utils; +use \WP_Comment_Query; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Indexable/Comment/SyncManager.php b/includes/classes/Indexable/Comment/SyncManager.php index 719bac237f..8705952356 100644 --- a/includes/classes/Indexable/Comment/SyncManager.php +++ b/includes/classes/Indexable/Comment/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\Comment; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { diff --git a/includes/classes/Indexable/Post/DateQuery.php b/includes/classes/Indexable/Post/DateQuery.php index 84f76004ab..06e38f2deb 100644 --- a/includes/classes/Indexable/Post/DateQuery.php +++ b/includes/classes/Indexable/Post/DateQuery.php @@ -8,7 +8,7 @@ namespace ElasticPress\Indexable\Post; -use \WP_Date_Query as WP_Date_Query; +use \WP_Date_Query; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Indexable/Post/Post.php b/includes/classes/Indexable/Post/Post.php index d98c4c7b85..717b26598f 100644 --- a/includes/classes/Indexable/Post/Post.php +++ b/includes/classes/Indexable/Post/Post.php @@ -8,10 +8,10 @@ namespace ElasticPress\Indexable\Post; -use ElasticPress\Indexable as Indexable; -use ElasticPress\Elasticsearch as Elasticsearch; -use \WP_Query as WP_Query; -use \WP_User as WP_User; +use \WP_Query; +use \WP_User; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexable; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Indexable/Post/QueryIntegration.php b/includes/classes/Indexable/Post/QueryIntegration.php index 100a778759..e383fa17df 100644 --- a/includes/classes/Indexable/Post/QueryIntegration.php +++ b/includes/classes/Indexable/Post/QueryIntegration.php @@ -8,9 +8,9 @@ namespace ElasticPress\Indexable\Post; -use ElasticPress\Indexables as Indexables; -use \WP_Query as WP_Query; -use ElasticPress\Utils as Utils; +use \WP_Query; +use ElasticPress\Indexables; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Indexable/Post/SyncManager.php b/includes/classes/Indexable/Post/SyncManager.php index 8c82cfa96d..2e938f8439 100644 --- a/includes/classes/Indexable/Post/SyncManager.php +++ b/includes/classes/Indexable/Post/SyncManager.php @@ -8,11 +8,11 @@ namespace ElasticPress\Indexable\Post; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Indexables as Indexables; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; +use ElasticPress\IndexHelper; use ElasticPress\SyncManager as SyncManagerAbstract; use ElasticPress\Utils; -use ElasticPress\IndexHelper; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Indexable/Term/QueryIntegration.php b/includes/classes/Indexable/Term/QueryIntegration.php index e3d894602f..9977c1bb22 100644 --- a/includes/classes/Indexable/Term/QueryIntegration.php +++ b/includes/classes/Indexable/Term/QueryIntegration.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\Term; +use \WP_Term_Query; use ElasticPress\Indexables; -use \WP_Term_Query as WP_Term_Query; use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { diff --git a/includes/classes/Indexable/Term/SyncManager.php b/includes/classes/Indexable/Term/SyncManager.php index 9896fa92b4..ed8c5ac8ee 100644 --- a/includes/classes/Indexable/Term/SyncManager.php +++ b/includes/classes/Indexable/Term/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\Term; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { diff --git a/includes/classes/Indexable/Term/Term.php b/includes/classes/Indexable/Term/Term.php index 817139028c..14c370be71 100644 --- a/includes/classes/Indexable/Term/Term.php +++ b/includes/classes/Indexable/Term/Term.php @@ -8,9 +8,9 @@ namespace ElasticPress\Indexable\Term; -use ElasticPress\Indexable as Indexable; -use ElasticPress\Elasticsearch as Elasticsearch; -use \WP_Term_Query as WP_Term_Query; +use \WP_Term_Query; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexable; if ( ! defined( 'ABSPATH' ) ) { // @codeCoverageIgnoreStart diff --git a/includes/classes/Indexable/User/QueryIntegration.php b/includes/classes/Indexable/User/QueryIntegration.php index 66809f9a4f..abefedf100 100644 --- a/includes/classes/Indexable/User/QueryIntegration.php +++ b/includes/classes/Indexable/User/QueryIntegration.php @@ -8,9 +8,8 @@ namespace ElasticPress\Indexable\User; -use ElasticPress\Indexables as Indexables; -use \WP_User_Query as WP_User_Query; -use ElasticPress\Utils as Utils; +use \WP_User_Query; +use ElasticPress\Indexables; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Indexable/User/SyncManager.php b/includes/classes/Indexable/User/SyncManager.php index 2e2aa53baf..7b7b1a9af1 100644 --- a/includes/classes/Indexable/User/SyncManager.php +++ b/includes/classes/Indexable/User/SyncManager.php @@ -8,8 +8,8 @@ namespace ElasticPress\Indexable\User; -use ElasticPress\Indexables as Indexables; -use ElasticPress\Elasticsearch as Elasticsearch; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexables; use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { diff --git a/includes/classes/Indexable/User/User.php b/includes/classes/Indexable/User/User.php index 8b6ab429f3..fa5dea3f83 100644 --- a/includes/classes/Indexable/User/User.php +++ b/includes/classes/Indexable/User/User.php @@ -8,10 +8,10 @@ namespace ElasticPress\Indexable\User; -use ElasticPress\Indexable as Indexable; -use ElasticPress\Elasticsearch as Elasticsearch; -use \WP_User_Query as WP_User_Query; -use ElasticPress\Utils as Utils; +use \WP_User_Query; +use ElasticPress\Elasticsearch; +use ElasticPress\Indexable; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/classes/Stats.php b/includes/classes/Stats.php index a823fe55c4..a5dae9885e 100644 --- a/includes/classes/Stats.php +++ b/includes/classes/Stats.php @@ -8,7 +8,7 @@ namespace ElasticPress; -use ElasticPress\Utils as Utils; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/partials/dashboard-page.php b/includes/partials/dashboard-page.php index 394c3ef7a9..9ee27b4bf8 100644 --- a/includes/partials/dashboard-page.php +++ b/includes/partials/dashboard-page.php @@ -6,9 +6,9 @@ * @package elasticpress */ -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Features as Features; -use ElasticPress\Utils as Utils; +use ElasticPress\Elasticsearch; +use ElasticPress\Features; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/includes/partials/stats-page.php b/includes/partials/stats-page.php index b180bf2fcb..d86653d723 100644 --- a/includes/partials/stats-page.php +++ b/includes/partials/stats-page.php @@ -6,9 +6,8 @@ * @package elasticpress */ -use ElasticPress\Stats as Stats; -use ElasticPress\Elasticsearch as Elasticsearch; -use ElasticPress\Utils as Utils; +use ElasticPress\Stats; +use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. diff --git a/tests/php/features/TestFacet.php b/tests/php/features/TestFacet.php index 381ca387a7..09c2e6170d 100644 --- a/tests/php/features/TestFacet.php +++ b/tests/php/features/TestFacet.php @@ -7,7 +7,7 @@ namespace ElasticPressTest; -use ElasticPress\Features as Features; +use ElasticPress\Features; /** * Facet test class diff --git a/tests/php/features/TestFacetTypeMeta.php b/tests/php/features/TestFacetTypeMeta.php index caf3de0eeb..b49c5ea2c6 100644 --- a/tests/php/features/TestFacetTypeMeta.php +++ b/tests/php/features/TestFacetTypeMeta.php @@ -7,7 +7,7 @@ namespace ElasticPressTest; -use ElasticPress\Features as Features; +use ElasticPress\Features; /** * Facets\Types\Taxonomy\FacetType test class diff --git a/tests/php/features/TestFacetTypeMetaRange.php b/tests/php/features/TestFacetTypeMetaRange.php index d10c9402b2..340effbb96 100644 --- a/tests/php/features/TestFacetTypeMetaRange.php +++ b/tests/php/features/TestFacetTypeMetaRange.php @@ -8,7 +8,7 @@ namespace ElasticPressTest; -use ElasticPress\Features as Features; +use ElasticPress\Features; /** * Facets\Types\Taxonomy\FacetType test class diff --git a/tests/php/features/TestFacetTypeTaxonomy.php b/tests/php/features/TestFacetTypeTaxonomy.php index a62e8a92a8..352c3044fc 100644 --- a/tests/php/features/TestFacetTypeTaxonomy.php +++ b/tests/php/features/TestFacetTypeTaxonomy.php @@ -7,7 +7,7 @@ namespace ElasticPressTest; -use ElasticPress\Features as Features; +use ElasticPress\Features; /** * Facets\Types\Taxonomy\FacetType test class diff --git a/tests/php/indexables/TestPost.php b/tests/php/indexables/TestPost.php index 44d02aa0c8..bae444ba71 100644 --- a/tests/php/indexables/TestPost.php +++ b/tests/php/indexables/TestPost.php @@ -8,7 +8,7 @@ namespace ElasticPressTest; use ElasticPress; -use ElasticPress\Indexables as Indexables; +use ElasticPress\Indexables; /** * Test post indexable class From fc084b5124bd2e838eabc644d9cf99f244a307df Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Fri, 29 Sep 2023 13:29:29 -0300 Subject: [PATCH 2/2] Remove SyncManagerAbstract references --- includes/classes/Indexable/Comment/SyncManager.php | 3 +-- includes/classes/Indexable/Post/SyncManager.php | 3 +-- includes/classes/Indexable/Term/SyncManager.php | 3 +-- includes/classes/Indexable/User/SyncManager.php | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/includes/classes/Indexable/Comment/SyncManager.php b/includes/classes/Indexable/Comment/SyncManager.php index 8705952356..0291a85310 100644 --- a/includes/classes/Indexable/Comment/SyncManager.php +++ b/includes/classes/Indexable/Comment/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -19,7 +18,7 @@ /** * Sync manager class */ -class SyncManager extends SyncManagerAbstract { +class SyncManager extends \ElasticPress\SyncManager { /** * Indexable slug * diff --git a/includes/classes/Indexable/Post/SyncManager.php b/includes/classes/Indexable/Post/SyncManager.php index 2e938f8439..3da74ef0f6 100644 --- a/includes/classes/Indexable/Post/SyncManager.php +++ b/includes/classes/Indexable/Post/SyncManager.php @@ -11,7 +11,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; use ElasticPress\IndexHelper; -use ElasticPress\SyncManager as SyncManagerAbstract; use ElasticPress\Utils; if ( ! defined( 'ABSPATH' ) ) { @@ -23,7 +22,7 @@ /** * Sync manager class */ -class SyncManager extends SyncManagerAbstract { +class SyncManager extends \ElasticPress\SyncManager { /** * Indexable slug diff --git a/includes/classes/Indexable/Term/SyncManager.php b/includes/classes/Indexable/Term/SyncManager.php index ed8c5ac8ee..29912a7849 100644 --- a/includes/classes/Indexable/Term/SyncManager.php +++ b/includes/classes/Indexable/Term/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -19,7 +18,7 @@ /** * Sync manager class */ -class SyncManager extends SyncManagerAbstract { +class SyncManager extends \ElasticPress\SyncManager { /** * Indexable slug * diff --git a/includes/classes/Indexable/User/SyncManager.php b/includes/classes/Indexable/User/SyncManager.php index 7b7b1a9af1..a7734cea0f 100644 --- a/includes/classes/Indexable/User/SyncManager.php +++ b/includes/classes/Indexable/User/SyncManager.php @@ -10,7 +10,6 @@ use ElasticPress\Elasticsearch; use ElasticPress\Indexables; -use ElasticPress\SyncManager as SyncManagerAbstract; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -19,7 +18,7 @@ /** * Sync manager class */ -class SyncManager extends SyncManagerAbstract { +class SyncManager extends \ElasticPress\SyncManager { /** * Indexable slug *