@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | const ERROR_COMMAND_DOES_NOT_EXIST = 45902; |
| 28 | 28 | const ERROR_INVALID_DUMMY_COMMAND_TYPE = 45903; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @var Mailcode_Commands_Command[] |
|
| 32 | - */ |
|
| 30 | + /** |
|
| 31 | + * @var Mailcode_Commands_Command[] |
|
| 32 | + */ |
|
| 33 | 33 | private $commands = array(); |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var array<string,Mailcode_Commands_Command> |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @var array<string,Mailcode_Commands_Command> |
|
| 37 | + */ |
|
| 38 | 38 | private static $dummyCommands = array(); |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Retrieves a list of all available command IDs. |
|
| 42 | - * |
|
| 43 | - * @return string[] |
|
| 44 | - */ |
|
| 40 | + /** |
|
| 41 | + * Retrieves a list of all available command IDs. |
|
| 42 | + * |
|
| 43 | + * @return string[] |
|
| 44 | + */ |
|
| 45 | 45 | public function getIDs() : array |
| 46 | 46 | { |
| 47 | 47 | static $ids = array(); |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | return $result; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * Gets an available command by its ID. |
|
| 92 | - * |
|
| 93 | - * @param string $id |
|
| 94 | - * @return Mailcode_Commands_Command |
|
| 95 | - */ |
|
| 90 | + /** |
|
| 91 | + * Gets an available command by its ID. |
|
| 92 | + * |
|
| 93 | + * @param string $id |
|
| 94 | + * @return Mailcode_Commands_Command |
|
| 95 | + */ |
|
| 96 | 96 | public function getByID(string $id) : Mailcode_Commands_Command |
| 97 | 97 | { |
| 98 | 98 | static $instances = array(); |
@@ -105,15 +105,15 @@ discard block |
||
| 105 | 105 | return $instances[$id]; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Retrieves the ID of a command by its name. |
|
| 110 | - * |
|
| 111 | - * @param string $name |
|
| 112 | - * @throws Mailcode_Exception |
|
| 113 | - * @return string |
|
| 114 | - * |
|
| 115 | - * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
| 116 | - */ |
|
| 108 | + /** |
|
| 109 | + * Retrieves the ID of a command by its name. |
|
| 110 | + * |
|
| 111 | + * @param string $name |
|
| 112 | + * @throws Mailcode_Exception |
|
| 113 | + * @return string |
|
| 114 | + * |
|
| 115 | + * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
| 116 | + */ |
|
| 117 | 117 | public function getIDByName(string $name) : string |
| 118 | 118 | { |
| 119 | 119 | $items = $this->getAll(); |
@@ -142,12 +142,12 @@ discard block |
||
| 142 | 142 | return in_array($id, $ids); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - /** |
|
| 146 | - * Checks wether the specified name exists. |
|
| 147 | - * |
|
| 148 | - * @param string $name For example: "showvar". |
|
| 149 | - * @return bool |
|
| 150 | - */ |
|
| 145 | + /** |
|
| 146 | + * Checks wether the specified name exists. |
|
| 147 | + * |
|
| 148 | + * @param string $name For example: "showvar". |
|
| 149 | + * @return bool |
|
| 150 | + */ |
|
| 151 | 151 | public function nameExists(string $name) : bool |
| 152 | 152 | { |
| 153 | 153 | $items = $this->getAll(); |
@@ -201,14 +201,14 @@ discard block |
||
| 201 | 201 | return $class; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * Translates the command type to the expected class naming scheme. |
|
| 206 | - * |
|
| 207 | - * Example: not-empty => NotEmpty |
|
| 208 | - * |
|
| 209 | - * @param string $type |
|
| 210 | - * @return string |
|
| 211 | - */ |
|
| 204 | + /** |
|
| 205 | + * Translates the command type to the expected class naming scheme. |
|
| 206 | + * |
|
| 207 | + * Example: not-empty => NotEmpty |
|
| 208 | + * |
|
| 209 | + * @param string $type |
|
| 210 | + * @return string |
|
| 211 | + */ |
|
| 212 | 212 | private function adjustTypeName(string $type) : string |
| 213 | 213 | { |
| 214 | 214 | $type = str_replace('-', ' ', $type); |