[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/zendframework/zend-code/src/Generator/ -> TraitUsageInterface.php (source)

   1  <?php
   2  /**
   3   * Zend Framework (http://framework.zend.com/)
   4   *
   5   * @link      http://github.com/zendframework/zf2 for the canonical source repository
   6   * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
   7   * @license   http://framework.zend.com/license/new-bsd New BSD License
   8   */
   9  
  10  namespace Zend\Code\Generator;
  11  
  12  interface TraitUsageInterface
  13  {
  14      /**
  15       * Add a class to "use" classes
  16       *
  17       * @param  string $use
  18       * @param  string|null $useAlias
  19       * @return self
  20       */
  21      public function addUse($use, $useAlias = null);
  22  
  23      /**
  24       * Returns the "use" classes
  25       *
  26       * @return array
  27       */
  28      public function getUses();
  29  
  30      /**
  31       * Add trait takes an array of trait options or string as arguments.
  32       *
  33       * Array Format:
  34       * key: traitName value: String
  35       *
  36       * key: aliases value: array of arrays
  37       *      key: method value: @see addTraitAlias
  38       *      key: alias value: @see addTraitAlias
  39       *      key: visibility value: @see addTraitAlias
  40       *
  41       * key: insteadof value: array of arrays
  42       *      key: method value: @see self::addTraitOverride
  43       *      key: traitToReplace value: @see self::addTraitOverride
  44       *
  45       * @param mixed $trait String | Array
  46       * @return self
  47       */
  48      public function addTrait($trait);
  49  
  50      /**
  51       * Add multiple traits.  Trait can be an array of trait names or array of trait
  52       * configurations
  53       *
  54       * @param array $traits Array of string names or configurations (@see addTrait)
  55       * @return self
  56       */
  57      public function addTraits(array $traits);
  58  
  59      /**
  60       * Check to see if the class has a trait defined
  61       *
  62       * @param string $traitName
  63       * @return bool
  64       */
  65      public function hasTrait($traitName);
  66  
  67      /**
  68       * Get a list of trait names
  69       *
  70       * @return array
  71       */
  72      public function getTraits();
  73  
  74      /**
  75       * Remove a trait by its name
  76       *
  77       * @param string $traitName
  78       */
  79      public function removeTrait($traitName);
  80  
  81      /**
  82       * Add a trait alias.  This will be used to generate the AS portion of the use statement.
  83       *
  84       * $method:
  85       * This method provides 2 ways for defining the trait method.
  86       * Option 1: String
  87       * Option 2: Array
  88       * key: traitName value: name of trait
  89       * key: method value: trait method
  90       *
  91       * $alias:
  92       * Alias is a string representing the new method name.
  93       *
  94       * $visibilty:
  95       * ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE | ReflectionMethod::IS_PROTECTED
  96       *
  97       * @param mixed $method String or Array
  98       * @param string $alias
  99       * @param null|int $visibility
 100       */
 101      public function addTraitAlias($method, $alias, $visibility = null);
 102  
 103      /**
 104       * @return array
 105       */
 106      public function getTraitAliases();
 107  
 108      /**
 109       * Add a trait method override.  This will be used to generate the INSTEADOF portion of the use
 110       * statement.
 111       *
 112       * $method:
 113       * This method provides 2 ways for defining the trait method.
 114       * Option 1: String Format: <trait name>::<method name>
 115       * Option 2: Array
 116       * key: traitName value: trait name
 117       * key: method value: method name
 118       *
 119       * $traitToReplace:
 120       * The name of the trait that you wish to supersede.
 121       *
 122       * This method provides 2 ways for defining the trait method.
 123       * Option 1: String of trait to replace
 124       * Option 2: Array of strings of traits to replace
 125  
 126       * @param mixed $method
 127       * @param mixed $traitsToReplace
 128       */
 129      public function addTraitOverride($method, $traitsToReplace);
 130  
 131      /**
 132       * Remove an override for a given trait::method
 133       *
 134       * $method:
 135       * This method provides 2 ways for defining the trait method.
 136       * Option 1: String Format: <trait name>::<method name>
 137       * Option 2: Array
 138       * key: traitName value: trait name
 139       * key: method value: method name
 140       *
 141       * $overridesToRemove:
 142       * The name of the trait that you wish to remove.
 143       *
 144       * This method provides 2 ways for defining the trait method.
 145       * Option 1: String of trait to replace
 146       * Option 2: Array of strings of traits to replace
 147       *
 148       * @param mixed $method
 149       * @param mixed $overridesToRemove
 150       * @return self
 151       */
 152      public function removeTraitOverride($method, $overridesToRemove = null);
 153  
 154      /**
 155       * Return trait overrides
 156       *
 157       * @return array
 158       */
 159      public function getTraitOverrides();
 160  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1