[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
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-2015 Zend Technologies USA Inc. (http://www.zend.com) 7 * @license http://framework.zend.com/license/new-bsd New BSD License 8 */ 9 namespace Zend\Code\Generator; 10 11 interface TraitUsageInterface 12 { 13 /** 14 * Add a class to "use" classes 15 * 16 * @param string $use 17 * @param string|null $useAlias 18 * @return self 19 */ 20 public function addUse($use, $useAlias = null); 21 22 /** 23 * Returns the "use" classes 24 * 25 * @return array 26 */ 27 public function getUses(); 28 29 /** 30 * Add trait takes an array of trait options or string as arguments. 31 * 32 * Array Format: 33 * key: traitName value: String 34 * 35 * key: aliases value: array of arrays 36 * key: method value: @see addTraitAlias 37 * key: alias value: @see addTraitAlias 38 * key: visibility value: @see addTraitAlias 39 * 40 * key: insteadof value: array of arrays 41 * key: method value: @see self::addTraitOverride 42 * key: traitToReplace value: @see self::addTraitOverride 43 * 44 * @param mixed $trait String | Array 45 * @return self 46 */ 47 public function addTrait($trait); 48 49 /** 50 * Add multiple traits. Trait can be an array of trait names or array of trait 51 * configurations 52 * 53 * @param array $traitName Array of string names or configurations (@see addTrait) 54 * @return self 55 */ 56 public function addTraits(array $traits); 57 58 /** 59 * Check to see if the class has a trait defined 60 * 61 * @param strint $traitName 62 * @return bool 63 */ 64 public function hasTrait($traitName); 65 66 /** 67 * Get a list of trait names 68 * 69 * @return array 70 */ 71 public function getTraits(); 72 73 /** 74 * Remove a trait by its name 75 * 76 * @param $traitName 77 */ 78 public function removeTrait($traitName); 79 80 /** 81 * Add a trait alias. This will be used to generate the AS portion of the use statement. 82 * 83 * $method: 84 * This method provides 2 ways for defining the trait method. 85 * Option 1: String 86 * Option 2: Array 87 * key: traitName value: name of trait 88 * key: method value: trait method 89 * 90 * $alias: 91 * Alias is a string representing the new method name. 92 * 93 * $visibilty: 94 * ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PRIVATE| ReflectionMethod::IS_PROTECTED 95 * 96 * @param mixed $method String or Array 97 * @param string $alias 98 * @param int $visiblity 99 */ 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 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |