diff --git a/search/includes/classes/class-health.php b/search/includes/classes/class-health.php index a02f8e3421..bf8eb5c150 100644 --- a/search/includes/classes/class-health.php +++ b/search/includes/classes/class-health.php @@ -56,9 +56,17 @@ class Health { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; + /** @var \ElasticPress\Indexables */ + public $indexables; + + /** @var \ElasticPress\Elasticsearch */ + public $elasticsearch; + public function __construct( \Automattic\VIP\Search\Search $search ) { $this->search = $search; $this->indexables = \ElasticPress\Indexables::factory(); diff --git a/search/includes/classes/class-healthjob.php b/search/includes/classes/class-healthjob.php index 0ece1bbbb5..46ea37e391 100644 --- a/search/includes/classes/class-healthjob.php +++ b/search/includes/classes/class-healthjob.php @@ -30,6 +30,8 @@ class HealthJob { * Instance of the Health class * * Useful for overriding in tests via dependency injection + * + * @var Health */ public $health; @@ -37,6 +39,8 @@ class HealthJob { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; @@ -44,6 +48,8 @@ class HealthJob { * Instance of \ElasticPress\Indexables * * Useful for overriding (dependency injection) for tests + * + * @var \ElasticPress\Indexables */ public $indexables; diff --git a/search/includes/classes/class-queue.php b/search/includes/classes/class-queue.php index a84b7af0be..66325c01aa 100644 --- a/search/includes/classes/class-queue.php +++ b/search/includes/classes/class-queue.php @@ -14,7 +14,9 @@ class Queue { /** @var Queue\Schema */ public $schema; + /** @var Indexables */ public $indexables; + /** @var \Automattic\VIP\Logstash\Logger */ public $logger; /** @var Queue\Cron */ public $cron; diff --git a/search/includes/classes/class-search.php b/search/includes/classes/class-search.php index a598d21a87..79f8bae645 100644 --- a/search/includes/classes/class-search.php +++ b/search/includes/classes/class-search.php @@ -186,6 +186,8 @@ class Search { public $concurrency_limiter; public $time; public static $stat_sampling_drop_value = 5; // Value to compare >= against rand( 1, 10 ). 5 should result in roughly half being true. + /** @var Cache */ + public $cache; /** * Maximum number of queries before rate-limiting kicks in. diff --git a/search/includes/classes/class-settingshealthjob.php b/search/includes/classes/class-settingshealthjob.php index 0a20fe1876..a998845313 100644 --- a/search/includes/classes/class-settingshealthjob.php +++ b/search/includes/classes/class-settingshealthjob.php @@ -39,6 +39,8 @@ class SettingsHealthJob { * Instance of the Health class * * Useful for overriding in tests via dependency injection + * + * @var Health */ public $health; @@ -46,6 +48,8 @@ class SettingsHealthJob { * Instance of Search class * * Useful for overriding (dependency injection) for tests + * + * @var \Automattic\VIP\Search\Search */ public $search; @@ -53,6 +57,8 @@ class SettingsHealthJob { * Instance of \ElasticPress\Indexables * * Useful for overriding (dependency injection) for tests + * + * @var \ElasticPress\Indexables */ public $indexables; diff --git a/search/includes/classes/class-versioningcleanupjob.php b/search/includes/classes/class-versioningcleanupjob.php index 835cdc4aae..a7288fb3cb 100644 --- a/search/includes/classes/class-versioningcleanupjob.php +++ b/search/includes/classes/class-versioningcleanupjob.php @@ -11,6 +11,9 @@ class VersioningCleanupJob { const SEARCH_ALERT_SLACK_CHAT = '#vip-go-es-alerts'; + public $indexables; + public $versioning; + public function __construct( $indexables, $versioning ) { $this->indexables = $indexables; $this->versioning = $versioning; diff --git a/search/includes/classes/commands/class-documentcommand.php b/search/includes/classes/commands/class-documentcommand.php index 7237624e07..29b18bebeb 100644 --- a/search/includes/classes/commands/class-documentcommand.php +++ b/search/includes/classes/commands/class-documentcommand.php @@ -35,7 +35,7 @@ public function get( $args, $assoc_args ) { $type = $args[0]; $object_id = $args[1]; - $search = \Automattic\VIP\Search\Search::instance(); + \Automattic\VIP\Search\Search::instance(); $indexable = \ElasticPress\Indexables::factory()->get( $type );