for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SubPageList;
/**
* Container for the settings contained by this extension.
*
* @since 1.0
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class Settings {
* Constructs a new instance of the settings object from global state.
* @param array $globalVariables
* @return Settings
public static function newFromGlobals( array $globalVariables ) {
return new self( [
self::AUTO_REFRESH => $globalVariables['egSPLAutorefresh'],
] );
}
const AUTO_REFRESH = 'autorefresh';
* @var array
private $settings;
* Constructor.
* @param array $settings
public function __construct( array $settings ) {
$this->settings = $settings;
* Returns the setting with the provided name.
* The specified setting needs to exist.
* @param string $settingName
* @return mixed
public function get( $settingName ) {
return $this->settings[$settingName];