Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../src/editors/domain/analysis...
File: analysis-feature.php
<?php
[0] Fix | Delete
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
[1] Fix | Delete
namespace Yoast\WP\SEO\Editors\Domain\Analysis_Features;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* This class describes a single Analysis feature and if it is enabled.
[5] Fix | Delete
*/
[6] Fix | Delete
class Analysis_Feature {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* If the feature is enabled.
[10] Fix | Delete
*
[11] Fix | Delete
* @var bool
[12] Fix | Delete
*/
[13] Fix | Delete
private $is_enabled;
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* What the identifier of the feature is.
[17] Fix | Delete
*
[18] Fix | Delete
* @var string
[19] Fix | Delete
*/
[20] Fix | Delete
private $name;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* What the identifier is for the old script data array.
[24] Fix | Delete
*
[25] Fix | Delete
* @var string
[26] Fix | Delete
*/
[27] Fix | Delete
private $legacy_key;
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* The constructor.
[31] Fix | Delete
*
[32] Fix | Delete
* @param bool $is_enabled If the feature is enabled.
[33] Fix | Delete
* @param string $name What the identifier of the feature is.
[34] Fix | Delete
* @param string $legacy_key What the identifier is for the old script data array.
[35] Fix | Delete
*/
[36] Fix | Delete
public function __construct( bool $is_enabled, string $name, string $legacy_key ) {
[37] Fix | Delete
$this->is_enabled = $is_enabled;
[38] Fix | Delete
$this->name = $name;
[39] Fix | Delete
$this->legacy_key = $legacy_key;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* If the feature is enabled.
[44] Fix | Delete
*
[45] Fix | Delete
* @return bool If the feature is enabled.
[46] Fix | Delete
*/
[47] Fix | Delete
public function is_enabled(): bool {
[48] Fix | Delete
return $this->is_enabled;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Gets the identifier.
[53] Fix | Delete
*
[54] Fix | Delete
* @return string The feature identifier.
[55] Fix | Delete
*/
[56] Fix | Delete
public function get_name(): string {
[57] Fix | Delete
return $this->name;
[58] Fix | Delete
}
[59] Fix | Delete
[60] Fix | Delete
/**
[61] Fix | Delete
* Return this object represented by a key value array.
[62] Fix | Delete
*
[63] Fix | Delete
* @return array<string,bool> Returns the name and if the feature is enabled.
[64] Fix | Delete
*/
[65] Fix | Delete
public function to_array(): array {
[66] Fix | Delete
return [ $this->name => $this->is_enabled ];
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* Returns this object represented by a key value structure that is compliant with the script data array.
[71] Fix | Delete
*
[72] Fix | Delete
* @return array<string,bool> Returns the legacy key and if the feature is enabled.
[73] Fix | Delete
*/
[74] Fix | Delete
public function to_legacy_array(): array {
[75] Fix | Delete
return [ $this->legacy_key => $this->is_enabled ];
[76] Fix | Delete
}
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function