@@ -13,7 +13,7 @@ |
||
13 | 13 | $autoload = realpath($root.'/../vendor/autoload.php'); |
14 | 14 | |
15 | 15 | // we need the autoloader to be present |
16 | - if(!file_exists($autoload)) { |
|
16 | + if (!file_exists($autoload)) { |
|
17 | 17 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
18 | 18 | } |
19 | 19 |
@@ -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 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $autoload = realpath($root.'/../vendor/autoload.php'); |
14 | 14 | |
15 | 15 | // we need the autoloader to be present |
16 | - if(!file_exists($autoload)) { |
|
16 | + if (!file_exists($autoload)) { |
|
17 | 17 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
18 | 18 | } |
19 | 19 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $text = t('This text is in the global scope.'); |
4 | 4 | |
5 | 5 | $text2 = t( |
6 | - 'It is possible to write long texts ' . |
|
7 | - 'using text concatenation in the source ' . |
|
6 | + 'It is possible to write long texts '. |
|
7 | + 'using text concatenation in the source '. |
|
8 | 8 | 'code to keep it readable.' |
9 | 9 | ); |
10 | 10 | \ No newline at end of file |
@@ -10,19 +10,19 @@ discard block |
||
10 | 10 | |
11 | 11 | const STORAGE_FORMAT_VERSION = 1; |
12 | 12 | |
13 | - /** |
|
14 | - * @var Localization_Scanner |
|
15 | - */ |
|
13 | + /** |
|
14 | + * @var Localization_Scanner |
|
15 | + */ |
|
16 | 16 | protected $scanner; |
17 | 17 | |
18 | - /** |
|
19 | - * @var Localization_Scanner_StringHash[] |
|
20 | - */ |
|
18 | + /** |
|
19 | + * @var Localization_Scanner_StringHash[] |
|
20 | + */ |
|
21 | 21 | protected $hashes = array(); |
22 | 22 | |
23 | - /** |
|
24 | - * @var array |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var array |
|
25 | + */ |
|
26 | 26 | protected $warnings = array(); |
27 | 27 | |
28 | 28 | public function __construct(Localization_Scanner $scanner) |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | return $string; |
52 | 52 | } |
53 | 53 | |
54 | - /** |
|
55 | - * Adds a single translateable string. |
|
56 | - * |
|
57 | - * @param Localization_Scanner_StringInfo $string |
|
58 | - * @return Localization_Scanner_StringsCollection |
|
59 | - */ |
|
54 | + /** |
|
55 | + * Adds a single translateable string. |
|
56 | + * |
|
57 | + * @param Localization_Scanner_StringInfo $string |
|
58 | + * @return Localization_Scanner_StringsCollection |
|
59 | + */ |
|
60 | 60 | protected function add(Localization_Scanner_StringInfo $string) |
61 | 61 | { |
62 | 62 | $hash = $string->getHash(); |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | return $this; |
70 | 70 | } |
71 | 71 | |
72 | - /** |
|
73 | - * Retrieves all available translateable strings, |
|
74 | - * grouped by their hash to identify unique strings. |
|
75 | - * |
|
76 | - * @return Localization_Scanner_StringHash[] |
|
77 | - */ |
|
72 | + /** |
|
73 | + * Retrieves all available translateable strings, |
|
74 | + * grouped by their hash to identify unique strings. |
|
75 | + * |
|
76 | + * @return Localization_Scanner_StringHash[] |
|
77 | + */ |
|
78 | 78 | public function getHashes() |
79 | 79 | { |
80 | 80 | return array_values($this->hashes); |
@@ -133,32 +133,32 @@ discard block |
||
133 | 133 | return true; |
134 | 134 | } |
135 | 135 | |
136 | - /** |
|
137 | - * Whether the parser reported warnings during the |
|
138 | - * search for translateable texts. |
|
139 | - * |
|
140 | - * @return bool |
|
141 | - */ |
|
136 | + /** |
|
137 | + * Whether the parser reported warnings during the |
|
138 | + * search for translateable texts. |
|
139 | + * |
|
140 | + * @return bool |
|
141 | + */ |
|
142 | 142 | public function hasWarnings() : bool |
143 | 143 | { |
144 | 144 | return !empty($this->warnings); |
145 | 145 | } |
146 | 146 | |
147 | - /** |
|
148 | - * Retrieves the amount of warnings. |
|
149 | - * @return int |
|
150 | - */ |
|
147 | + /** |
|
148 | + * Retrieves the amount of warnings. |
|
149 | + * @return int |
|
150 | + */ |
|
151 | 151 | public function countWarnings() : int |
152 | 152 | { |
153 | 153 | return count($this->warnings); |
154 | 154 | } |
155 | 155 | |
156 | - /** |
|
157 | - * Retrieves all warning messages that were added |
|
158 | - * during the search for translateable texts, if any. |
|
159 | - * |
|
160 | - * @return Localization_Scanner_StringsCollection_Warning[] |
|
161 | - */ |
|
156 | + /** |
|
157 | + * Retrieves all warning messages that were added |
|
158 | + * during the search for translateable texts, if any. |
|
159 | + * |
|
160 | + * @return Localization_Scanner_StringsCollection_Warning[] |
|
161 | + */ |
|
162 | 162 | public function getWarnings() : array |
163 | 163 | { |
164 | 164 | $result = array(); |
@@ -185,12 +185,12 @@ discard block |
||
185 | 185 | return $amount; |
186 | 186 | } |
187 | 187 | |
188 | - /** |
|
189 | - * Retrieves all string hashed for the specified source. |
|
190 | - * |
|
191 | - * @param string $id |
|
192 | - * @return \AppLocalize\Localization_Scanner_StringHash[] |
|
193 | - */ |
|
188 | + /** |
|
189 | + * Retrieves all string hashed for the specified source. |
|
190 | + * |
|
191 | + * @param string $id |
|
192 | + * @return \AppLocalize\Localization_Scanner_StringHash[] |
|
193 | + */ |
|
194 | 194 | public function getHashesBySourceID(string $id) |
195 | 195 | { |
196 | 196 | $hashes = array(); |
@@ -204,12 +204,12 @@ discard block |
||
204 | 204 | return $hashes; |
205 | 205 | } |
206 | 206 | |
207 | - /** |
|
208 | - * Retrieves all hashes for the specified language ID. |
|
209 | - * |
|
210 | - * @param string $languageID The language ID, e.g. "PHP" |
|
211 | - * @return \AppLocalize\Localization_Scanner_StringHash[] |
|
212 | - */ |
|
207 | + /** |
|
208 | + * Retrieves all hashes for the specified language ID. |
|
209 | + * |
|
210 | + * @param string $languageID The language ID, e.g. "PHP" |
|
211 | + * @return \AppLocalize\Localization_Scanner_StringHash[] |
|
212 | + */ |
|
213 | 213 | public function getHashesByLanguageID(string $languageID) |
214 | 214 | { |
215 | 215 | $hashes = array(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $hash = $string->getHash(); |
63 | 63 | |
64 | - if(!isset($this->hashes[$hash])) { |
|
64 | + if (!isset($this->hashes[$hash])) { |
|
65 | 65 | $this->hashes[$hash] = new Localization_Scanner_StringHash($this, $hash); |
66 | 66 | } |
67 | 67 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function getHash($hash) |
89 | 89 | { |
90 | - if(isset($this->hashes[$hash])) { |
|
90 | + if (isset($this->hashes[$hash])) { |
|
91 | 91 | return $this->hashes[$hash]; |
92 | 92 | } |
93 | 93 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'warnings' => array() |
107 | 107 | ); |
108 | 108 | |
109 | - foreach($this->hashes as $hash) |
|
109 | + foreach ($this->hashes as $hash) |
|
110 | 110 | { |
111 | 111 | $data['hashes'] = array_merge($data['hashes'], $hash->toArray()); |
112 | 112 | } |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | |
119 | 119 | public function fromArray($array) : bool |
120 | 120 | { |
121 | - if(!isset($array['formatVersion']) || $array['formatVersion'] != self::STORAGE_FORMAT_VERSION) { |
|
121 | + if (!isset($array['formatVersion']) || $array['formatVersion'] != self::STORAGE_FORMAT_VERSION) { |
|
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | |
125 | - foreach($array['hashes'] as $entry) |
|
125 | + foreach ($array['hashes'] as $entry) |
|
126 | 126 | { |
127 | 127 | $string = Localization_Scanner_StringInfo::fromArray($this, $entry); |
128 | 128 | $this->add($string); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | { |
164 | 164 | $result = array(); |
165 | 165 | |
166 | - foreach($this->warnings as $def) { |
|
166 | + foreach ($this->warnings as $def) { |
|
167 | 167 | $result[] = new Localization_Scanner_StringsCollection_Warning($def); |
168 | 168 | } |
169 | 169 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function countFiles() : int |
179 | 179 | { |
180 | 180 | $amount = 0; |
181 | - foreach($this->hashes as $hash) { |
|
181 | + foreach ($this->hashes as $hash) { |
|
182 | 182 | $amount = $amount + $hash->countFiles(); |
183 | 183 | } |
184 | 184 | |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | { |
196 | 196 | $hashes = array(); |
197 | 197 | |
198 | - foreach($this->hashes as $hash) { |
|
199 | - if($hash->hasSourceID($id)) { |
|
198 | + foreach ($this->hashes as $hash) { |
|
199 | + if ($hash->hasSourceID($id)) { |
|
200 | 200 | $hashes[] = $hash; |
201 | 201 | } |
202 | 202 | } |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | { |
215 | 215 | $hashes = array(); |
216 | 216 | |
217 | - foreach($this->hashes as $hash) { |
|
218 | - if($hash->hasLanguageType($languageID)) { |
|
217 | + foreach ($this->hashes as $hash) { |
|
218 | + if ($hash->hasLanguageType($languageID)) { |
|
219 | 219 | $hashes[] = $hash; |
220 | 220 | } |
221 | 221 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class Localization_Scanner_StringInfo |
6 | 6 | { |
7 | - /** |
|
8 | - * @var Localization_Scanner_StringsCollection |
|
9 | - */ |
|
7 | + /** |
|
8 | + * @var Localization_Scanner_StringsCollection |
|
9 | + */ |
|
10 | 10 | protected $collection; |
11 | 11 | |
12 | 12 | protected $properties = array(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function getProperty($name) |
76 | 76 | { |
77 | - if(isset($this->properties[$name])) { |
|
77 | + if (isset($this->properties[$name])) { |
|
78 | 78 | return $this->properties[$name]; |
79 | 79 | } |
80 | 80 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $array['line'] |
124 | 124 | ); |
125 | 125 | |
126 | - foreach($array['properties'] as $name => $value) { |
|
126 | + foreach ($array['properties'] as $name => $value) { |
|
127 | 127 | $string->setProperty($name, $value); |
128 | 128 | } |
129 | 129 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $entries = array(); |
50 | 50 | |
51 | - foreach($this->strings as $string) { |
|
51 | + foreach ($this->strings as $string) { |
|
52 | 52 | $entries[] = $string->toArray(); |
53 | 53 | } |
54 | 54 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | { |
69 | 69 | $amount = 0; |
70 | 70 | |
71 | - foreach($this->strings as $string) { |
|
72 | - if($string->isFile()) { |
|
71 | + foreach ($this->strings as $string) { |
|
72 | + if ($string->isFile()) { |
|
73 | 73 | $amount++; |
74 | 74 | } |
75 | 75 | } |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | |
85 | 85 | public function hasLanguageType(string $type) : bool |
86 | 86 | { |
87 | - foreach($this->strings as $string) { |
|
88 | - if($string->getLanguageType() == $type) { |
|
87 | + foreach ($this->strings as $string) { |
|
88 | + if ($string->getLanguageType() == $type) { |
|
89 | 89 | return true; |
90 | 90 | } |
91 | 91 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function getText() : string |
97 | 97 | { |
98 | - if(isset($this->strings[0])) { |
|
98 | + if (isset($this->strings[0])) { |
|
99 | 99 | return $this->strings[0]->getText(); |
100 | 100 | } |
101 | 101 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $translator = Localization::getTranslator(); |
128 | 128 | $text = $translator->getHashTranslation($this->getHash()); |
129 | 129 | |
130 | - if($text !== null) { |
|
130 | + if ($text !== null) { |
|
131 | 131 | return $text; |
132 | 132 | } |
133 | 133 | |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | { |
143 | 143 | $files = array(); |
144 | 144 | |
145 | - foreach($this->strings as $string) |
|
145 | + foreach ($this->strings as $string) |
|
146 | 146 | { |
147 | - if(!$string->isFile()) { |
|
147 | + if (!$string->isFile()) { |
|
148 | 148 | continue; |
149 | 149 | } |
150 | 150 | |
151 | 151 | $file = $string->getSourceFile(); |
152 | - if(!in_array($file, $files)) { |
|
152 | + if (!in_array($file, $files)) { |
|
153 | 153 | $files[] = $file; |
154 | 154 | } |
155 | 155 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $files = $this->getFiles(); |
169 | 169 | $result = array(); |
170 | 170 | |
171 | - foreach($files as $path) { |
|
171 | + foreach ($files as $path) { |
|
172 | 172 | $result[] = basename($path); |
173 | 173 | } |
174 | 174 |
@@ -13,19 +13,19 @@ discard block |
||
13 | 13 | */ |
14 | 14 | class Localization_Scanner_StringHash |
15 | 15 | { |
16 | - /** |
|
17 | - * @var Localization_Scanner_StringsCollection |
|
18 | - */ |
|
16 | + /** |
|
17 | + * @var Localization_Scanner_StringsCollection |
|
18 | + */ |
|
19 | 19 | protected $collection; |
20 | 20 | |
21 | - /** |
|
22 | - * @var string |
|
23 | - */ |
|
21 | + /** |
|
22 | + * @var string |
|
23 | + */ |
|
24 | 24 | protected $hash; |
25 | 25 | |
26 | - /** |
|
27 | - * @var Localization_Scanner_StringInfo[] |
|
28 | - */ |
|
26 | + /** |
|
27 | + * @var Localization_Scanner_StringInfo[] |
|
28 | + */ |
|
29 | 29 | protected $strings = array(); |
30 | 30 | |
31 | 31 | protected $sourceIDs = array(); |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | return $entries; |
56 | 56 | } |
57 | 57 | |
58 | - /** |
|
59 | - * Retrieves all individual string locations where this text was found. |
|
60 | - * @return Localization_Scanner_StringInfo[] |
|
61 | - */ |
|
58 | + /** |
|
59 | + * Retrieves all individual string locations where this text was found. |
|
60 | + * @return Localization_Scanner_StringInfo[] |
|
61 | + */ |
|
62 | 62 | public function getStrings() |
63 | 63 | { |
64 | 64 | return $this->strings; |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | return count($this->strings); |
119 | 119 | } |
120 | 120 | |
121 | - /** |
|
122 | - * Retrieves the translated text, if any. |
|
123 | - * @return string |
|
124 | - */ |
|
121 | + /** |
|
122 | + * Retrieves the translated text, if any. |
|
123 | + * @return string |
|
124 | + */ |
|
125 | 125 | public function getTranslatedText() : string |
126 | 126 | { |
127 | 127 | $translator = Localization::getTranslator(); |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | return ''; |
135 | 135 | } |
136 | 136 | |
137 | - /** |
|
138 | - * Retrieves a list of all file names, with relative paths. |
|
139 | - * @return string[] |
|
140 | - */ |
|
137 | + /** |
|
138 | + * Retrieves a list of all file names, with relative paths. |
|
139 | + * @return string[] |
|
140 | + */ |
|
141 | 141 | public function getFiles() : array |
142 | 142 | { |
143 | 143 | $files = array(); |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | return $files; |
160 | 160 | } |
161 | 161 | |
162 | - /** |
|
163 | - * Retrieves a list of all file names this string is used in. |
|
164 | - * @return string[] |
|
165 | - */ |
|
162 | + /** |
|
163 | + * Retrieves a list of all file names this string is used in. |
|
164 | + * @return string[] |
|
165 | + */ |
|
166 | 166 | public function getFileNames() : array |
167 | 167 | { |
168 | 168 | $files = $this->getFiles(); |
@@ -179,13 +179,13 @@ discard block |
||
179 | 179 | return $result; |
180 | 180 | } |
181 | 181 | |
182 | - /** |
|
183 | - * Retrieves a text comprised of all strings that are relevant |
|
184 | - * for a full text search, imploded together. Used in the search |
|
185 | - * function to find matching strings. |
|
186 | - * |
|
187 | - * @return string |
|
188 | - */ |
|
182 | + /** |
|
183 | + * Retrieves a text comprised of all strings that are relevant |
|
184 | + * for a full text search, imploded together. Used in the search |
|
185 | + * function to find matching strings. |
|
186 | + * |
|
187 | + * @return string |
|
188 | + */ |
|
189 | 189 | public function getSearchString() : string |
190 | 190 | { |
191 | 191 | $parts = array($this->getTranslatedText(), $this->getText()); |
@@ -49,8 +49,8 @@ |
||
49 | 49 | $examples[] = '1.500'; |
50 | 50 | |
51 | 51 | if ($decimalPositions > 0) { |
52 | - $examples[] = '50,' . substr($decimals, 0, $decimalPositions); |
|
53 | - $examples[] = '1.500,' . substr($decimals, 0, $decimalPositions); |
|
52 | + $examples[] = '50,'.substr($decimals, 0, $decimalPositions); |
|
53 | + $examples[] = '1.500,'.substr($decimals, 0, $decimalPositions); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $examples; |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function parseFile($file) |
96 | 96 | { |
97 | - $this->log(sprintf('Parsing file [' . $file . '].')); |
|
97 | + $this->log(sprintf('Parsing file ['.$file.'].')); |
|
98 | 98 | |
99 | 99 | $language = $this->parser->parseFile($file); |
100 | 100 | |
101 | 101 | $texts = $language->getTexts(); |
102 | 102 | |
103 | - foreach($texts as $def) |
|
103 | + foreach ($texts as $def) |
|
104 | 104 | { |
105 | 105 | $this->collection->addFromFile( |
106 | 106 | $this->getID(), |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $warnings = $language->getWarnings(); |
115 | 115 | |
116 | - foreach($warnings as $warning) { |
|
116 | + foreach ($warnings as $warning) { |
|
117 | 117 | $this->collection->addWarning($warning); |
118 | 118 | } |
119 | 119 | } |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | $amount = 0; |
141 | 141 | |
142 | 142 | $hashes = $this->getHashes($scanner); |
143 | - foreach($hashes as $hash) { |
|
143 | + foreach ($hashes as $hash) { |
|
144 | 144 | $text = $translator->getHashTranslation($hash->getHash()); |
145 | - if(empty($text)) { |
|
145 | + if (empty($text)) { |
|
146 | 146 | $amount++; |
147 | 147 | } |
148 | 148 | } |
@@ -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) |
@@ -6,24 +6,24 @@ |
||
6 | 6 | |
7 | 7 | class Localization_Source_Folder extends Localization_Source |
8 | 8 | { |
9 | - /** |
|
10 | - * The folder under which all translateable files are kept. |
|
11 | - * @var string |
|
12 | - */ |
|
9 | + /** |
|
10 | + * The folder under which all translateable files are kept. |
|
11 | + * @var string |
|
12 | + */ |
|
13 | 13 | protected $sourcesFolder; |
14 | 14 | |
15 | - /** |
|
16 | - * @var string |
|
17 | - */ |
|
15 | + /** |
|
16 | + * @var string |
|
17 | + */ |
|
18 | 18 | protected $id; |
19 | 19 | |
20 | - /** |
|
21 | - * @param string $alias An alias for this source, to recognize it by. |
|
22 | - * @param string $label The human readable label, used in the editor. |
|
23 | - * @param string $group A human readable group label to group several sources by. Used in the editor. |
|
24 | - * @param string $storageFolder The folder in which to store the localization files. |
|
25 | - * @param string $sourcesFolder The folder in which to analyze files to find translateable strings. |
|
26 | - */ |
|
20 | + /** |
|
21 | + * @param string $alias An alias for this source, to recognize it by. |
|
22 | + * @param string $label The human readable label, used in the editor. |
|
23 | + * @param string $group A human readable group label to group several sources by. Used in the editor. |
|
24 | + * @param string $storageFolder The folder in which to store the localization files. |
|
25 | + * @param string $sourcesFolder The folder in which to analyze files to find translateable strings. |
|
26 | + */ |
|
27 | 27 | public function __construct(string $alias, string $label, string $group, string $storageFolder, string $sourcesFolder) |
28 | 28 | { |
29 | 29 | parent::__construct($alias, $label, $group, $storageFolder); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function excludeFolder(string $folder) : Localization_Source_Folder |
51 | 51 | { |
52 | - if(!in_array($folder, $this->excludes['folders'])) { |
|
52 | + if (!in_array($folder, $this->excludes['folders'])) { |
|
53 | 53 | $this->excludes['folders'][] = $folder; |
54 | 54 | } |
55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function excludeFolders(array $folders) : Localization_Source_Folder |
60 | 60 | { |
61 | - foreach($folders as $folder) { |
|
61 | + foreach ($folders as $folder) { |
|
62 | 62 | $this->excludeFolder($folder); |
63 | 63 | } |
64 | 64 |