| Server IP : 145.239.37.162 / Your IP : 216.73.216.72 Web Server : Apache System : Linux webm003.cluster130.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaa ( 38250) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaa/www1/wp-content/plugins/wordpress-seo/vendor/yoast/whip/src/ |
Upload File : |
<?php
/**
* WHIP libary file.
*
* @package Yoast\WHIP
*/
/**
* Class Whip_Configuration.
*/
class Whip_Configuration {
/**
* The configuration to use.
*
* @var array
*/
private $configuration;
/**
* Whip_Configuration constructor.
*
* @param array $configuration The configuration to use.
*
* @throws Whip_InvalidType When the $configuration parameter is not of the expected type.
*/
public function __construct( $configuration = array() ) {
if ( ! is_array( $configuration ) ) {
throw new Whip_InvalidType( 'Configuration', $configuration, 'array' );
}
$this->configuration = $configuration;
}
/**
* Retrieves the configured version of a particular requirement.
*
* @param Whip_Requirement $requirement The requirement to check.
*
* @return string|int The version of the passed requirement that was detected as a string.
* If the requirement does not exist, this returns int -1.
*/
public function configuredVersion( Whip_Requirement $requirement ) {
if ( ! $this->hasRequirementConfigured( $requirement ) ) {
return -1;
}
return $this->configuration[ $requirement->component() ];
}
/**
* Determines whether the passed requirement is present in the configuration.
*
* @param Whip_Requirement $requirement The requirement to check.
*
* @return bool Whether or not the requirement is present in the configuration.
*/
public function hasRequirementConfigured( Whip_Requirement $requirement ) {
return array_key_exists( $requirement->component(), $this->configuration );
}
}