@@ -16,9 +16,9 @@ |
||
16 | 16 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
17 | 17 | } |
18 | 18 | |
19 | - /** |
|
20 | - * The composer autoloader |
|
21 | - */ |
|
19 | + /** |
|
20 | + * The composer autoloader |
|
21 | + */ |
|
22 | 22 | require_once $autoload; |
23 | 23 | |
24 | 24 | // the folder in which the localization .ini files are stored |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | abstract class Localization_Event |
22 | 22 | { |
23 | - /** |
|
24 | - * @var array |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var array |
|
25 | + */ |
|
26 | 26 | protected $args; |
27 | 27 | |
28 | 28 | public function __construct(array $args) |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | $this->args = $args; |
31 | 31 | } |
32 | 32 | |
33 | - /** |
|
34 | - * Fetches the argument at the specified index in the |
|
35 | - * event's arguments list, if it exists. |
|
36 | - * |
|
37 | - * @param int $index Zero-based index number. |
|
38 | - * @return mixed|NULL |
|
39 | - */ |
|
33 | + /** |
|
34 | + * Fetches the argument at the specified index in the |
|
35 | + * event's arguments list, if it exists. |
|
36 | + * |
|
37 | + * @param int $index Zero-based index number. |
|
38 | + * @return mixed|NULL |
|
39 | + */ |
|
40 | 40 | public function getArgument(int $index) |
41 | 41 | { |
42 | 42 | if(isset($this->args[$index])) { |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class Localization_Scanner_StringsCollection_Warning |
8 | 8 | { |
9 | - /** |
|
10 | - * @var array |
|
11 | - */ |
|
9 | + /** |
|
10 | + * @var array |
|
11 | + */ |
|
12 | 12 | protected $data; |
13 | 13 | |
14 | 14 | public function __construct(array $data) |
@@ -12,8 +12,8 @@ |
||
12 | 12 | const SERIALIZED_PROPERTIES = 'properties'; |
13 | 13 | |
14 | 14 | /** |
15 | - * @var Localization_Scanner_StringsCollection |
|
16 | - */ |
|
15 | + * @var Localization_Scanner_StringsCollection |
|
16 | + */ |
|
17 | 17 | protected $collection; |
18 | 18 | |
19 | 19 | /** |
@@ -9,24 +9,24 @@ |
||
9 | 9 | |
10 | 10 | class Localization_Source_Folder extends Localization_Source |
11 | 11 | { |
12 | - /** |
|
13 | - * The folder under which all translatable files are kept. |
|
14 | - * @var string |
|
15 | - */ |
|
12 | + /** |
|
13 | + * The folder under which all translatable files are kept. |
|
14 | + * @var string |
|
15 | + */ |
|
16 | 16 | protected $sourcesFolder; |
17 | 17 | |
18 | - /** |
|
19 | - * @var string |
|
20 | - */ |
|
18 | + /** |
|
19 | + * @var string |
|
20 | + */ |
|
21 | 21 | protected $id; |
22 | 22 | |
23 | - /** |
|
24 | - * @param string $alias An alias for this source, to recognize it by. |
|
25 | - * @param string $label The human-readable label, used in the editor. |
|
26 | - * @param string $group A human-readable group label to group several sources by. Used in the editor. |
|
27 | - * @param string $storageFolder The folder in which to store the localization files. |
|
28 | - * @param string $sourcesFolder The folder in which to analyze files to find translatable strings. |
|
29 | - */ |
|
23 | + /** |
|
24 | + * @param string $alias An alias for this source, to recognize it by. |
|
25 | + * @param string $label The human-readable label, used in the editor. |
|
26 | + * @param string $group A human-readable group label to group several sources by. Used in the editor. |
|
27 | + * @param string $storageFolder The folder in which to store the localization files. |
|
28 | + * @param string $sourcesFolder The folder in which to analyze files to find translatable strings. |
|
29 | + */ |
|
30 | 30 | public function __construct(string $alias, string $label, string $group, string $storageFolder, string $sourcesFolder) |
31 | 31 | { |
32 | 32 | parent::__construct($alias, $label, $group, $storageFolder); |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | abstract class Localization_Source |
8 | 8 | { |
9 | - /** |
|
10 | - * Human-readable label for the source. |
|
11 | - * @var string |
|
12 | - */ |
|
9 | + /** |
|
10 | + * Human-readable label for the source. |
|
11 | + * @var string |
|
12 | + */ |
|
13 | 13 | protected $label; |
14 | 14 | |
15 | - /** |
|
16 | - * Human-readable group name to categorize the source. |
|
17 | - * @var string |
|
18 | - */ |
|
15 | + /** |
|
16 | + * Human-readable group name to categorize the source. |
|
17 | + * @var string |
|
18 | + */ |
|
19 | 19 | protected $group; |
20 | 20 | |
21 | - /** |
|
22 | - * The folder in which the localization files are stored |
|
23 | - * @var string |
|
24 | - */ |
|
21 | + /** |
|
22 | + * The folder in which the localization files are stored |
|
23 | + * @var string |
|
24 | + */ |
|
25 | 25 | protected $storageFolder; |
26 | 26 | |
27 | - /** |
|
28 | - * @var string |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var string |
|
29 | + */ |
|
30 | 30 | protected $alias; |
31 | 31 | |
32 | - /** |
|
33 | - * Available during scanning. |
|
34 | - * @var Localization_Scanner_StringsCollection|NULL |
|
35 | - */ |
|
32 | + /** |
|
33 | + * Available during scanning. |
|
34 | + * @var Localization_Scanner_StringsCollection|NULL |
|
35 | + */ |
|
36 | 36 | protected $collection; |
37 | 37 | |
38 | - /** |
|
39 | - * Available during scanning. |
|
40 | - * @var Localization_Parser|NULL |
|
41 | - */ |
|
38 | + /** |
|
39 | + * Available during scanning. |
|
40 | + * @var Localization_Parser|NULL |
|
41 | + */ |
|
42 | 42 | protected $parser; |
43 | 43 | |
44 | 44 | public function __construct(string $alias, string $label, string $group, string $storageFolder) |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | const ERROR_UNSUPPORTED_FILE_EXTENSION = 40602; |
31 | 31 | const ERROR_INVALID_LANGUAGE_CLASS = 40603; |
32 | 32 | |
33 | - /** |
|
34 | - * @var Localization_Scanner |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var Localization_Scanner |
|
35 | + */ |
|
36 | 36 | protected $scanner; |
37 | 37 | |
38 | - /** |
|
39 | - * @var Localization_Scanner_StringsCollection |
|
40 | - */ |
|
38 | + /** |
|
39 | + * @var Localization_Scanner_StringsCollection |
|
40 | + */ |
|
41 | 41 | protected $collection; |
42 | 42 | |
43 | 43 | /** |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | $this->collection = $scanner->getCollection(); |
55 | 55 | } |
56 | 56 | |
57 | - /** |
|
58 | - * Parses a source file. Must have a valid supported file extension. |
|
59 | - * |
|
60 | - * @param string $path |
|
61 | - * @return Localization_Parser_Language |
|
62 | - * @throws Localization_Exception |
|
63 | - * |
|
64 | - * @see Localization_Parser::ERROR_UNSUPPORTED_FILE_EXTENSION |
|
65 | - */ |
|
57 | + /** |
|
58 | + * Parses a source file. Must have a valid supported file extension. |
|
59 | + * |
|
60 | + * @param string $path |
|
61 | + * @return Localization_Parser_Language |
|
62 | + * @throws Localization_Exception |
|
63 | + * |
|
64 | + * @see Localization_Parser::ERROR_UNSUPPORTED_FILE_EXTENSION |
|
65 | + */ |
|
66 | 66 | public function parseFile(string $path) : Localization_Parser_Language |
67 | 67 | { |
68 | 68 | $this->requireValidFile($path); |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | return $language; |
77 | 77 | } |
78 | 78 | |
79 | - /** |
|
80 | - * Parses the string for the specified language. |
|
81 | - * |
|
82 | - * @param string $languageID |
|
83 | - * @param string $code |
|
84 | - * @return Localization_Parser_Language |
|
85 | - * @throws Localization_Exception |
|
86 | - * |
|
87 | - * @see Localization_Parser::ERROR_INVALID_LANGUAGE_ID |
|
88 | - */ |
|
79 | + /** |
|
80 | + * Parses the string for the specified language. |
|
81 | + * |
|
82 | + * @param string $languageID |
|
83 | + * @param string $code |
|
84 | + * @return Localization_Parser_Language |
|
85 | + * @throws Localization_Exception |
|
86 | + * |
|
87 | + * @see Localization_Parser::ERROR_INVALID_LANGUAGE_ID |
|
88 | + */ |
|
89 | 89 | public function parseString(string $languageID, string $code) : Localization_Parser_Language |
90 | 90 | { |
91 | 91 | $this->requireValidLanguageID($languageID); |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | ); |
145 | 145 | } |
146 | 146 | |
147 | - /** |
|
148 | - * Retrieves a list of all language IDs that are supported. |
|
149 | - * @return string[] IDs list like "PHP", "Javascript" |
|
150 | - */ |
|
147 | + /** |
|
148 | + * Retrieves a list of all language IDs that are supported. |
|
149 | + * @return string[] IDs list like "PHP", "Javascript" |
|
150 | + */ |
|
151 | 151 | public function getLanguageIDs() : array |
152 | 152 | { |
153 | 153 | return array_values($this->languageMappings); |
154 | 154 | } |
155 | 155 | |
156 | - /** |
|
157 | - * @var array<string,Localization_Parser_Language> |
|
158 | - */ |
|
156 | + /** |
|
157 | + * @var array<string,Localization_Parser_Language> |
|
158 | + */ |
|
159 | 159 | protected $languageParsers = array(); |
160 | 160 | |
161 | 161 | /** |
@@ -209,12 +209,12 @@ discard block |
||
209 | 209 | ); |
210 | 210 | } |
211 | 211 | |
212 | - /** |
|
213 | - * Whether the specified file extension is supported. |
|
214 | - * |
|
215 | - * @param string $ext |
|
216 | - * @return bool |
|
217 | - */ |
|
212 | + /** |
|
213 | + * Whether the specified file extension is supported. |
|
214 | + * |
|
215 | + * @param string $ext |
|
216 | + * @return bool |
|
217 | + */ |
|
218 | 218 | public function isExtensionSupported(string $ext) : bool |
219 | 219 | { |
220 | 220 | $ext = strtolower($ext); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | protected $reverseStrings = array(); |
58 | 58 | |
59 | 59 | /** |
60 | - * @var Localization_Source[] |
|
61 | - */ |
|
60 | + * @var Localization_Source[] |
|
61 | + */ |
|
62 | 62 | private $sources = array(); |
63 | 63 | |
64 | 64 | /** |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | ); |
192 | 192 | } |
193 | 193 | |
194 | - /** |
|
195 | - * Retrieves all available strings for the specified locale, |
|
196 | - * as hash => text value pairs. |
|
197 | - * |
|
198 | - * @param Localization_Locale $locale |
|
199 | - * @throws Localization_Exception |
|
200 | - * @return string[] |
|
201 | - */ |
|
194 | + /** |
|
195 | + * Retrieves all available strings for the specified locale, |
|
196 | + * as hash => text value pairs. |
|
197 | + * |
|
198 | + * @param Localization_Locale $locale |
|
199 | + * @throws Localization_Exception |
|
200 | + * @return string[] |
|
201 | + */ |
|
202 | 202 | public function getStrings(Localization_Locale $locale) : array |
203 | 203 | { |
204 | 204 | $this->load($locale); |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | |
9 | 9 | abstract class Localization_Parser_Token |
10 | 10 | { |
11 | - /** |
|
12 | - * @var array|string |
|
13 | - */ |
|
11 | + /** |
|
12 | + * @var array|string |
|
13 | + */ |
|
14 | 14 | protected $definition; |
15 | 15 | |
16 | - /** |
|
17 | - * @var Localization_Parser_Token |
|
18 | - */ |
|
16 | + /** |
|
17 | + * @var Localization_Parser_Token |
|
18 | + */ |
|
19 | 19 | protected $parentToken; |
20 | 20 | |
21 | 21 | /** |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | 'value' => $this->getValue(), |
99 | 99 | 'line' => $this->getLine(), |
100 | 100 | 'isEncapsedString' => ConvertHelper::bool2string($this->isEncapsedString()) |
101 | - ); |
|
101 | + ); |
|
102 | 102 | } |
103 | 103 | } |