Skip to content

Commit

Permalink
fix(vip-search): PHP 8.2 deprecation notices for dynamic properties
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks authored and rebeccahum committed Sep 27, 2023
1 parent 56ec94e commit 74b1916
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions search/includes/classes/class-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions search/includes/classes/class-healthjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,26 @@ class HealthJob {
* Instance of the Health class
*
* Useful for overriding in tests via dependency injection
*
* @var Health
*/
public $health;

/**
* Instance of Search class
*
* Useful for overriding (dependency injection) for tests
*
* @var \Automattic\VIP\Search\Search
*/
public $search;

/**
* Instance of \ElasticPress\Indexables
*
* Useful for overriding (dependency injection) for tests
*
* @var \ElasticPress\Indexables
*/
public $indexables;

Expand Down
2 changes: 2 additions & 0 deletions search/includes/classes/class-queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions search/includes/classes/class-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions search/includes/classes/class-settingshealthjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,26 @@ class SettingsHealthJob {
* Instance of the Health class
*
* Useful for overriding in tests via dependency injection
*
* @var Health
*/
public $health;

/**
* Instance of Search class
*
* Useful for overriding (dependency injection) for tests
*
* @var \Automattic\VIP\Search\Search
*/
public $search;

/**
* Instance of \ElasticPress\Indexables
*
* Useful for overriding (dependency injection) for tests
*
* @var \ElasticPress\Indexables
*/
public $indexables;

Expand Down
3 changes: 3 additions & 0 deletions search/includes/classes/class-versioningcleanupjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion search/includes/classes/commands/class-documentcommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 74b1916

Please sign in to comment.