@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | { |
26 | 26 | public const ERROR_CSS_FILE_NOT_FOUND = 60901; |
27 | 27 | |
28 | - /** |
|
29 | - * @var string |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var string |
|
30 | + */ |
|
31 | 31 | private string $path; |
32 | 32 | |
33 | - /** |
|
34 | - * @var string |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var string |
|
35 | + */ |
|
36 | 36 | private string $fileName = 'highlight.css'; |
37 | 37 | |
38 | 38 | public function __construct() |
@@ -55,22 +55,22 @@ discard block |
||
55 | 55 | $this->path = $path; |
56 | 56 | } |
57 | 57 | |
58 | - /** |
|
59 | - * Retrieves the raw CSS source for the highlighting. |
|
60 | - * |
|
61 | - * @return string |
|
62 | - */ |
|
58 | + /** |
|
59 | + * Retrieves the raw CSS source for the highlighting. |
|
60 | + * |
|
61 | + * @return string |
|
62 | + */ |
|
63 | 63 | public function getCSS() : string |
64 | 64 | { |
65 | 65 | return FileHelper::readContents($this->path); |
66 | 66 | } |
67 | 67 | |
68 | - /** |
|
69 | - * Retrieves a fully formed `code` tag with the CSS, |
|
70 | - * to inject inline into an HTML document. |
|
71 | - * |
|
72 | - * @return string |
|
73 | - */ |
|
68 | + /** |
|
69 | + * Retrieves a fully formed `code` tag with the CSS, |
|
70 | + * to inject inline into an HTML document. |
|
71 | + * |
|
72 | + * @return string |
|
73 | + */ |
|
74 | 74 | public function getStyleTag() : string |
75 | 75 | { |
76 | 76 | return sprintf( |
@@ -79,23 +79,23 @@ discard block |
||
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
82 | - /** |
|
83 | - * Retrieves the path to the stylesheet file. |
|
84 | - * |
|
85 | - * @return string |
|
86 | - */ |
|
82 | + /** |
|
83 | + * Retrieves the path to the stylesheet file. |
|
84 | + * |
|
85 | + * @return string |
|
86 | + */ |
|
87 | 87 | public function getStylesheetPath() : string |
88 | 88 | { |
89 | 89 | return $this->path; |
90 | 90 | } |
91 | 91 | |
92 | - /** |
|
93 | - * Retrieves the URL to the stylesheet file, given the |
|
94 | - * local URL to the application's vendor folder. |
|
95 | - * |
|
96 | - * @param string $vendorURL The URL to the vendor folder (must be accessible in the webroot). |
|
97 | - * @return string |
|
98 | - */ |
|
92 | + /** |
|
93 | + * Retrieves the URL to the stylesheet file, given the |
|
94 | + * local URL to the application's vendor folder. |
|
95 | + * |
|
96 | + * @param string $vendorURL The URL to the vendor folder (must be accessible in the webroot). |
|
97 | + * @return string |
|
98 | + */ |
|
99 | 99 | public function getStylesheetURL(string $vendorURL) : string |
100 | 100 | { |
101 | 101 | return sprintf( |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class Mailcode_Renderer |
23 | 23 | { |
24 | - /** |
|
25 | - * @var boolean |
|
26 | - */ |
|
24 | + /** |
|
25 | + * @var boolean |
|
26 | + */ |
|
27 | 27 | protected bool $highlighted = false; |
28 | 28 | |
29 | - /** |
|
30 | - * Sets whether to output highlighted commands instead of the default plain text. |
|
31 | - * |
|
32 | - * @param bool $highlighted |
|
33 | - * @return Mailcode_Renderer |
|
34 | - */ |
|
29 | + /** |
|
30 | + * Sets whether to output highlighted commands instead of the default plain text. |
|
31 | + * |
|
32 | + * @param bool $highlighted |
|
33 | + * @return Mailcode_Renderer |
|
34 | + */ |
|
35 | 35 | public function setOutputHighlighted(bool $highlighted=true) : Mailcode_Renderer |
36 | 36 | { |
37 | 37 | $this->highlighted = $highlighted; |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | return $this; |
40 | 40 | } |
41 | 41 | |
42 | - /** |
|
43 | - * Converts a show variable command to string. |
|
44 | - * |
|
45 | - * @param string $variableName The variable name, with or without $ sign. |
|
46 | - * @return string |
|
47 | - */ |
|
42 | + /** |
|
43 | + * Converts a show variable command to string. |
|
44 | + * |
|
45 | + * @param string $variableName The variable name, with or without $ sign. |
|
46 | + * @return string |
|
47 | + */ |
|
48 | 48 | public function showVar(string $variableName) : string |
49 | 49 | { |
50 | 50 | return $this->command2string(Mailcode_Factory::show()->var($variableName)); |
@@ -28,21 +28,21 @@ discard block |
||
28 | 28 | public const ERROR_INVALID_DUMMY_COMMAND_TYPE = 45903; |
29 | 29 | public const ERROR_INVALID_COMMAND_CLASS = 45904; |
30 | 30 | |
31 | - /** |
|
32 | - * @var Mailcode_Commands_Command[] |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var Mailcode_Commands_Command[] |
|
33 | + */ |
|
34 | 34 | private array $commands = array(); |
35 | 35 | |
36 | - /** |
|
37 | - * @var array<string,Mailcode_Commands_Command> |
|
38 | - */ |
|
36 | + /** |
|
37 | + * @var array<string,Mailcode_Commands_Command> |
|
38 | + */ |
|
39 | 39 | private static array $dummyCommands = array(); |
40 | 40 | |
41 | - /** |
|
42 | - * Retrieves a list of all available command IDs. |
|
43 | - * |
|
44 | - * @return string[] |
|
45 | - */ |
|
41 | + /** |
|
42 | + * Retrieves a list of all available command IDs. |
|
43 | + * |
|
44 | + * @return string[] |
|
45 | + */ |
|
46 | 46 | public function getIDs() : array |
47 | 47 | { |
48 | 48 | static $ids = array(); |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | return $result; |
89 | 89 | } |
90 | 90 | |
91 | - /** |
|
92 | - * Gets an available command by its ID. |
|
93 | - * |
|
94 | - * @param string $id |
|
95 | - * @return Mailcode_Commands_Command |
|
96 | - */ |
|
91 | + /** |
|
92 | + * Gets an available command by its ID. |
|
93 | + * |
|
94 | + * @param string $id |
|
95 | + * @return Mailcode_Commands_Command |
|
96 | + */ |
|
97 | 97 | public function getByID(string $id) : Mailcode_Commands_Command |
98 | 98 | { |
99 | 99 | static $instances = array(); |
@@ -106,15 +106,15 @@ discard block |
||
106 | 106 | return $instances[$id]; |
107 | 107 | } |
108 | 108 | |
109 | - /** |
|
110 | - * Retrieves the ID of a command by its name. |
|
111 | - * |
|
112 | - * @param string $name |
|
113 | - * @throws Mailcode_Exception |
|
114 | - * @return string |
|
115 | - * |
|
116 | - * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
117 | - */ |
|
109 | + /** |
|
110 | + * Retrieves the ID of a command by its name. |
|
111 | + * |
|
112 | + * @param string $name |
|
113 | + * @throws Mailcode_Exception |
|
114 | + * @return string |
|
115 | + * |
|
116 | + * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
117 | + */ |
|
118 | 118 | public function getIDByName(string $name) : string |
119 | 119 | { |
120 | 120 | $items = $this->getAll(); |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | return in_array($id, $ids); |
144 | 144 | } |
145 | 145 | |
146 | - /** |
|
147 | - * Checks wether the specified name exists. |
|
148 | - * |
|
149 | - * @param string $name For example: "showvar". |
|
150 | - * @return bool |
|
151 | - */ |
|
146 | + /** |
|
147 | + * Checks wether the specified name exists. |
|
148 | + * |
|
149 | + * @param string $name For example: "showvar". |
|
150 | + * @return bool |
|
151 | + */ |
|
152 | 152 | public function nameExists(string $name) : bool |
153 | 153 | { |
154 | 154 | $items = $this->getAll(); |
@@ -216,14 +216,14 @@ discard block |
||
216 | 216 | return $class; |
217 | 217 | } |
218 | 218 | |
219 | - /** |
|
220 | - * Translates the command type to the expected class naming scheme. |
|
221 | - * |
|
222 | - * Example: not-empty => NotEmpty |
|
223 | - * |
|
224 | - * @param string $type |
|
225 | - * @return string |
|
226 | - */ |
|
219 | + /** |
|
220 | + * Translates the command type to the expected class naming scheme. |
|
221 | + * |
|
222 | + * Example: not-empty => NotEmpty |
|
223 | + * |
|
224 | + * @param string $type |
|
225 | + * @return string |
|
226 | + */ |
|
227 | 227 | private function adjustTypeName(string $type) : string |
228 | 228 | { |
229 | 229 | $type = str_replace('-', ' ', $type); |
@@ -22,9 +22,9 @@ |
||
22 | 22 | { |
23 | 23 | public const REGEX_VARIABLE_NAME = '/\$\s*([A-Z0-9_]+)\s*\.\s*([A-Z0-9_]+)|\$\s*([A-Z0-9_]+)/six'; |
24 | 24 | |
25 | - /** |
|
26 | - * @var Mailcode_Variables_Collection_Regular |
|
27 | - */ |
|
25 | + /** |
|
26 | + * @var Mailcode_Variables_Collection_Regular |
|
27 | + */ |
|
28 | 28 | protected Mailcode_Variables_Collection_Regular $collection; |
29 | 29 | |
30 | 30 | /** |