Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/vendors/Textpattern/Container/ContainerInterface.php - 67 lines - 1726 bytes - Summary - Text - Print

Description: Container.

   1  <?php
   2  
   3  /*
   4   * Textpattern Content Management System
   5   * http://textpattern.com
   6   *
   7   * Copyright (C) 2016 The Textpattern Development Team
   8   *
   9   * This file is part of Textpattern.
  10   *
  11   * Textpattern is free software; you can redistribute it and/or
  12   * modify it under the terms of the GNU General Public License
  13   * as published by the Free Software Foundation, version 2.
  14   *
  15   * Textpattern is distributed in the hope that it will be useful,
  16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18   * GNU General Public License for more details.
  19   *
  20   * You should have received a copy of the GNU General Public License
  21   * along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
  22   */
  23  
  24  /**
  25   * Container.
  26   *
  27   * @since   4.6.0
  28   * @package Container
  29   */
  30  
  31  namespace Textpattern\Container;
  32  
  33  interface ContainerInterface
  34  {
  35      /**
  36       * Gets an instance for the given alias.
  37       *
  38       * @param  string $alias   The class alias
  39       * @param  array  $options Options
  40       * @return object Instance of the resolved class
  41       */
  42  
  43      public function getInstance($alias, array $options);
  44  
  45      /**
  46       * Removes a registered class.
  47       *
  48       * @param  string $alias The alias
  49       * @return \Textpattern\Container\ContainerInterface
  50       */
  51  
  52      public function remove($alias);
  53  
  54      /**
  55       * Registers a class.
  56       *
  57       * Throws an exception if the alias is taken. To replace an alias, first
  58       * call remove.
  59       *
  60       * @param  string $alias The alias
  61       * @param  string $class The class
  62       * @return \Textpattern\Container\ContainerInterface
  63       * @throws InvalidArgumentException
  64       */
  65  
  66      public function register($alias, $class);
  67  }

title

Description

title

Description

title

Description

title

title

Body