Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

TraitUsageInterface.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 4.35 KiB


001  <?php
002  /**
003   * Zend Framework (http://framework.zend.com/)
004   *
005   * @link      http://github.com/zendframework/zf2 for the canonical source repository
006   * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
007   * @license   http://framework.zend.com/license/new-bsd New BSD License
008   */
009   
010  namespace Zend\Code\Generator;
011   
012  interface TraitUsageInterface
013  {
014      /**
015       * Add a class to "use" classes
016       *
017       * @param  string $use
018       * @param  string|null $useAlias
019       * @return self
020       */
021      public function addUse($use, $useAlias = null);
022   
023      /**
024       * Returns the "use" classes
025       *
026       * @return array
027       */
028      public function getUses();
029   
030      /**
031       * Add trait takes an array of trait options or string as arguments.
032       *
033       * Array Format:
034       * key: traitName value: String
035       *
036       * key: aliases value: array of arrays
037       *      key: method value: @see addTraitAlias
038       *      key: alias value: @see addTraitAlias
039       *      key: visibility value: @see addTraitAlias
040       *
041       * key: insteadof value: array of arrays
042       *      key: method value: @see self::addTraitOverride
043       *      key: traitToReplace value: @see self::addTraitOverride
044       *
045       * @param mixed $trait String | Array
046       * @return self
047       */
048      public function addTrait($trait);
049   
050      /**
051       * Add multiple traits.  Trait can be an array of trait names or array of trait
052       * configurations
053       *
054       * @param array $traits Array of string names or configurations (@see addTrait)
055       * @return self
056       */
057      public function addTraits(array $traits);
058   
059      /**
060       * Check to see if the class has a trait defined
061       *
062       * @param string $traitName
063       * @return bool
064       */
065      public function hasTrait($traitName);
066   
067      /**
068       * Get a list of trait names
069       *
070       * @return array
071       */
072      public function getTraits();
073   
074      /**
075       * Remove a trait by its name
076       *
077       * @param string $traitName
078       */
079      public function removeTrait($traitName);
080   
081      /**
082       * Add a trait alias.  This will be used to generate the AS portion of the use statement.
083       *
084       * $method:
085       * This method provides 2 ways for defining the trait method.
086       * Option 1: String
087       * Option 2: Array
088       * key: traitName value: name of trait
089       * key: method value: trait method
090       *
091       * $alias:
092       * Alias is a string representing the new method name.
093       *
094       * $visibilty:
095       * ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE | ReflectionMethod::IS_PROTECTED
096       *
097       * @param mixed $method String or Array
098       * @param string $alias
099       * @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  }
161