Skip to content
Snippets Groups Projects
Select Git revision
  • db998a72ee2fccb6262b5ae2b367fc42fe79705b
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

NullStorage.php

Blame
  • Alex Pott's avatar
    Issue #2665992 by alexpott, klausi, heykarthikwithu, xjm, tstoeckler: @file is...
    Alex Pott authored
    Issue #2665992 by alexpott, klausi, heykarthikwithu, xjm, tstoeckler: @file is not required for classes, interfaces and traits
    bfde6d34
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    NullStorage.php 1.90 KiB
    <?php
    
    namespace Drupal\Core\Config;
    
    /**
     * Defines a stub storage.
     *
     * This storage is always empty; the controller reads and writes nothing.
     *
     * The stub implementation is needed for synchronizing configuration during
     * installation of a module, in which case all configuration being shipped with
     * the module is known to be new. Therefore, the module installation process is
     * able to short-circuit the full diff against the active configuration; the
     * diff would yield all currently available configuration as items to remove,
     * since they do not exist in the module's default configuration directory.
     *
     * This also can be used for testing purposes.
     */
    class NullStorage implements StorageInterface {
    
      /**
       * {@inheritdoc}
       */
      public function exists($name) {
        return FALSE;
      }
    
      /**
       * {@inheritdoc}
       */
      public function read($name) {
        return array();
      }
    
      /**
       * {@inheritdoc}
       */
      public function readMultiple(array $names) {
        return array();
      }
    
      /**
       * {@inheritdoc}
       */
      public function write($name, array $data) {
        return FALSE;
      }
    
      /**
       * {@inheritdoc}
       */
      public function delete($name) {
        return FALSE;
      }
    
      /**
       * {@inheritdoc}
       */
      public function rename($name, $new_name) {
        return FALSE;
      }
    
      /**
       * {@inheritdoc}
       */
      public function encode($data) {
        return $data;
      }
    
      /**
       * {@inheritdoc}
       */
      public function decode($raw) {
        return $raw;
      }
    
      /**
       * {@inheritdoc}
       */
      public function listAll($prefix = '') {
        return array();
      }
    
      /**
       * {@inheritdoc}
       */
      public function deleteAll($prefix = '') {
        return FALSE;
      }
    
      /**
       * {@inheritdoc}
       */
      public function createCollection($collection) {
        // No op.
      }
    
      /**
       * {@inheritdoc}
       */
      public function getAllCollectionNames() {
        return array();
      }
    
      /**
       * {@inheritdoc}
       */
      public function getCollectionName() {
        return '';
      }
    
    }