MockPhpStorage.php

Same filename in other branches
  1. 9 core/modules/system/src/PhpStorage/MockPhpStorage.php
  2. 10 core/modules/system/src/PhpStorage/MockPhpStorage.php
  3. 11.x core/modules/system/src/PhpStorage/MockPhpStorage.php

Namespace

Drupal\system\PhpStorage

File

core/modules/system/src/PhpStorage/MockPhpStorage.php

View source
<?php

namespace Drupal\system\PhpStorage;


/**
 * Mock PHP storage class used for testing.
 */
class MockPhpStorage {
    
    /**
     * The storage configuration.
     *
     * @var array
     */
    protected $configuration;
    
    /**
     * Constructs a MockPhpStorage object.
     *
     * @param array $configuration
     */
    public function __construct(array $configuration) {
        $this->configuration = $configuration;
    }
    
    /**
     * Gets the configuration data.
     */
    public function getConfiguration() {
        return $this->configuration;
    }
    
    /**
     * Gets a single configuration key.
     */
    public function getConfigurationValue($key) {
        return isset($this->configuration[$key]) ? $this->configuration[$key] : NULL;
    }

}

Classes

Title Deprecated Summary
MockPhpStorage Mock PHP storage class used for testing.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.