Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
TraitUsageInterface.php
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-2015 Zend Technologies USA Inc. (http://www.zend.com)
007 * @license http://framework.zend.com/license/new-bsd New BSD License
008 */
009 namespace Zend\Code\Generator;
010
011 interface TraitUsageInterface
012 {
013 /**
014 * Add a class to "use" classes
015 *
016 * @param string $use
017 * @param string|null $useAlias
018 * @return self
019 */
020 public function addUse($use, $useAlias = null);
021
022 /**
023 * Returns the "use" classes
024 *
025 * @return array
026 */
027 public function getUses();
028
029 /**
030 * Add trait takes an array of trait options or string as arguments.
031 *
032 * Array Format:
033 * key: traitName value: String
034 *
035 * key: aliases value: array of arrays
036 * key: method value: @see addTraitAlias
037 * key: alias value: @see addTraitAlias
038 * key: visibility value: @see addTraitAlias
039 *
040 * key: insteadof value: array of arrays
041 * key: method value: @see self::addTraitOverride
042 * key: traitToReplace value: @see self::addTraitOverride
043 *
044 * @param mixed $trait String | Array
045 * @return self
046 */
047 public function addTrait($trait);
048
049 /**
050 * Add multiple traits. Trait can be an array of trait names or array of trait
051 * configurations
052 *
053 * @param array $traitName Array of string names or configurations (@see addTrait)
054 * @return self
055 */
056 public function addTraits(array $traits);
057
058 /**
059 * Check to see if the class has a trait defined
060 *
061 * @param strint $traitName
062 * @return bool
063 */
064 public function hasTrait($traitName);
065
066 /**
067 * Get a list of trait names
068 *
069 * @return array
070 */
071 public function getTraits();
072
073 /**
074 * Remove a trait by its name
075 *
076 * @param $traitName
077 */
078 public function removeTrait($traitName);
079
080 /**
081 * Add a trait alias. This will be used to generate the AS portion of the use statement.
082 *
083 * $method:
084 * This method provides 2 ways for defining the trait method.
085 * Option 1: String
086 * Option 2: Array
087 * key: traitName value: name of trait
088 * key: method value: trait method
089 *
090 * $alias:
091 * Alias is a string representing the new method name.
092 *
093 * $visibilty:
094 * ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE| ReflectionMethod::IS_PROTECTED
095 *
096 * @param mixed $method String or Array
097 * @param string $alias
098 * @param int $visiblity
099 */
100 public function addTraitAlias($method, $alias, $visibility = null);
101
102 /**
103 * @return array
104 */
105 public function getTraitAliases();
106
107 /**
108 * Add a trait method override. This will be used to generate the INSTEADOF portion of the use
109 * statement.
110 *
111 * $method:
112 * This method provides 2 ways for defining the trait method.
113 * Option 1: String Format: <trait name>::<method name>
114 * Option 2: Array
115 * key: traitName value: trait name
116 * key: method value: method name
117 *
118 * $traitToReplace:
119 * The name of the trait that you wish to supersede.
120 *
121 * This method provides 2 ways for defining the trait method.
122 * Option 1: String of trait to replace
123 * Option 2: Array of strings of traits to replace
124
125 * @param mixed $method
126 * @param mixed $traitToReplace
127 */
128 public function addTraitOverride($method, $traitsToReplace);
129
130 /**
131 * Remove an override for a given trait::method
132 *
133 * $method:
134 * This method provides 2 ways for defining the trait method.
135 * Option 1: String Format: <trait name>::<method name>
136 * Option 2: Array
137 * key: traitName value: trait name
138 * key: method value: method name
139 *
140 * $overridesToRemove:
141 * The name of the trait that you wish to remove.
142 *
143 * This method provides 2 ways for defining the trait method.
144 * Option 1: String of trait to replace
145 * Option 2: Array of strings of traits to replace
146 *
147 * @param $traitAndMethod
148 * @param null $overridesToRemove
149 * @return $this
150 */
151 public function removeTraitOverride($method, $overridesToRemove = null);
152
153 /**
154 * Return trait overrides
155 *
156 * @return array
157 */
158 public function getTraitOverrides();
159 }
160