Skip to content

Commit

Permalink
Fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta committed Aug 29, 2024
1 parent 7008ddf commit 696be85
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions projects/packages/protect-models/src/class-status-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class Status_Model {
public $status;

/**
* Fixable threats.
* List of fixable threat IDs.
*
* @var array
* @var number[]
*/
public $fixable_threats = array();
public $fixable_threat_ids = array();

Check failure on line 61 in projects/packages/protect-models/src/class-status-model.php

View workflow job for this annotation

GitHub Actions / Static analysis

UndefError PhanUndeclaredTypeProperty Property \Automattic\Jetpack\Protect_Models\Status_Model->fixable_threat_ids has undeclared type \Automattic\Jetpack\Protect_Models\number[]

/**
* WordPress core status.
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/protect-status/src/class-scan-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private static function normalize_api_data( $scan_data ) {
if ( isset( $scan_data->threats ) && is_array( $scan_data->threats ) ) {
foreach ( $scan_data->threats as $threat ) {
if ( isset( $threat->fixable ) && $threat->fixable ) {
$status->fixable_threats[] = $threat->id;
$status->fixable_threat_ids[] = $threat->id;
}

if ( isset( $threat->extension->type ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function get_sample_status() {
'num_plugins_threats' => 1,
'num_themes_threats' => 0,
'status' => 'idle',
'fixable_threats' => array( '69353714' ),
'fixable_threat_ids' => array( '69353714' ),
'plugins' => array(
new Extension_Model(
array(
Expand Down
2 changes: 1 addition & 1 deletion projects/plugins/protect/src/class-threats.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static function fix_threats( $threat_ids ) {
* @return bool|array
*/
public static function fix_threats_status( $threat_ids ) {
if ( ! $threat_ids ) {
if ( empty( $threat_ids ) ) {
return false;
}

Expand Down

0 comments on commit 696be85

Please sign in to comment.