@@ -130,7 +130,7 @@ |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * @param $method |
|
133 | + * @param string $method |
|
134 | 134 | * @param array $params |
135 | 135 | * @param string $position |
136 | 136 | * @return $this |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | if ($transactions) { |
235 | 235 | foreach ($transactions as $transaction) { |
236 | - $this->addOperation($prefix.'_addTrans', [ |
|
236 | + $this->addOperation($prefix . '_addTrans', [ |
|
237 | 237 | $transaction->orderId, |
238 | 238 | $transaction->affiliation, |
239 | 239 | $transaction->total, |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | if ($transaction->items) { |
248 | 248 | foreach ($transaction->items as $item) { |
249 | - $this->addOperation($prefix.'_addItem', [ |
|
249 | + $this->addOperation($prefix . '_addItem', [ |
|
250 | 250 | $item->orderId, |
251 | 251 | $item->sku, |
252 | 252 | $item->name, |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param $string |
23 | 23 | * @param $tree |
24 | 24 | * @param bool $selected |
25 | - * @return bool|string |
|
25 | + * @return string|false |
|
26 | 26 | */ |
27 | 27 | public function treeOptions($value, $string, $tree, $selected = false) |
28 | 28 | { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param $string |
38 | 38 | * @param array $array |
39 | 39 | * @param int $level |
40 | - * @return array |
|
40 | + * @return boolean |
|
41 | 41 | */ |
42 | 42 | public function optionTree( |
43 | 43 | $tree, |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * @param $options |
|
76 | + * @param string $options |
|
77 | 77 | * @param bool $value |
78 | 78 | * @param bool $string |
79 | 79 | * @param bool $selected |
80 | - * @return bool|string |
|
80 | + * @return string|false |
|
81 | 81 | */ |
82 | 82 | public function options( |
83 | 83 | $options, |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | { |
10 | 10 | $return = ""; |
11 | 11 | |
12 | - $return .= '<option value="0"'.($selected !== "" && $selected == '0' ? ' selected="selected"' |
|
13 | - : '').'>'.translator()->translate("NO").'</option>'; |
|
14 | - $return .= '<option value="1"'.($selected == '1' ? ' selected="selected"' |
|
15 | - : '').'>'.translator()->translate("YES").'</option>'; |
|
12 | + $return .= '<option value="0"' . ($selected !== "" && $selected == '0' ? ' selected="selected"' |
|
13 | + : '') . '>' . translator()->translate("NO") . '</option>'; |
|
14 | + $return .= '<option value="1"' . ($selected == '1' ? ' selected="selected"' |
|
15 | + : '') . '>' . translator()->translate("YES") . '</option>'; |
|
16 | 16 | |
17 | 17 | return $return; |
18 | 18 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $return = ''; |
90 | 90 | foreach ($options as $key => $option) { |
91 | 91 | if (is_string($key) && is_array($option) && !isset($option[$value])) { |
92 | - $return .= '<optgroup label="'.$key.'">'; |
|
92 | + $return .= '<optgroup label="' . $key . '">'; |
|
93 | 93 | $return .= $this->options($option, $value, $string, |
94 | 94 | $selected); |
95 | 95 | $return .= '</optgroup>'; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $oDisabled = ($oDisabled === true) ? ' disabled="disabled" ' |
116 | 116 | : ''; |
117 | 117 | |
118 | - $return .= '<option value="'.$oValue.'"'.$oSelected.''.$oDisabled.'>'.$oString.'</option>'; |
|
118 | + $return .= '<option value="' . $oValue . '"' . $oSelected . '' . $oDisabled . '>' . $oString . '</option>'; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $oString = $option; |
150 | 150 | } |
151 | 151 | $oSelected = ($oValue == $selected) ? ' checked="checked" ' : ''; |
152 | - $return .= '<input type="radio" name="'.$name.'" value="'.$oValue.'" '.$oSelected.' >'.$oString.$separator; |
|
152 | + $return .= '<input type="radio" name="' . $name . '" value="' . $oValue . '" ' . $oSelected . ' >' . $oString . $separator; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | return $return; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - return " ".implode(" ", $return); |
|
188 | + return " " . implode(" ", $return); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -9,6 +9,9 @@ |
||
9 | 9 | protected $_defaultPlaceholder = "head"; |
10 | 10 | protected $_pack = false; |
11 | 11 | |
12 | + /** |
|
13 | + * @param string $file |
|
14 | + */ |
|
12 | 15 | public function add($file, $placeholder = false) |
13 | 16 | { |
14 | 17 | return $this->addFile($file, 'add', $placeholder); |
@@ -132,7 +132,7 @@ |
||
132 | 132 | |
133 | 133 | public function buildURL($source) |
134 | 134 | { |
135 | - return $this->getBaseUrl().$source.(in_array(\Nip_File_System::instance()->getExtension($source), |
|
135 | + return $this->getBaseUrl() . $source . (in_array(\Nip_File_System::instance()->getExtension($source), |
|
136 | 136 | array("js", "php")) ? '' : '.js'); |
137 | 137 | } |
138 | 138 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | protected $tags = []; |
25 | 25 | |
26 | 26 | /** |
27 | - * @return array |
|
27 | + * @return AbstractTag[] |
|
28 | 28 | */ |
29 | 29 | public function getTags() |
30 | 30 | { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * @param $path |
|
43 | + * @param string $path |
|
44 | 44 | * @return string |
45 | 45 | */ |
46 | 46 | public function generateUrl($path) |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * @param null $baseDir |
|
64 | + * @param string $baseDir |
|
65 | 65 | */ |
66 | 66 | public function setBaseDir($baseDir) |
67 | 67 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | /** |
85 | 85 | * @param AbstractTag $tag |
86 | - * @param null $name |
|
86 | + * @param string $name |
|
87 | 87 | * @return $this |
88 | 88 | */ |
89 | 89 | public function addTag($tag, $name = null) |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function generateUrl($path) |
47 | 47 | { |
48 | - return $this->getBaseDir().$path; |
|
48 | + return $this->getBaseDir() . $path; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function addDefault($size) |
129 | 129 | { |
130 | - $fullSize = $size.'x'.$size; |
|
130 | + $fullSize = $size . 'x' . $size; |
|
131 | 131 | $tag = new LinkIcon(); |
132 | 132 | $tag->setSizes($fullSize) |
133 | - ->setHref($this->generateUrl('/favicon-'.$fullSize.'.png')); |
|
134 | - $this->addTag($tag, 'default-'.$fullSize); |
|
133 | + ->setHref($this->generateUrl('/favicon-' . $fullSize . '.png')); |
|
134 | + $this->addTag($tag, 'default-' . $fullSize); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | public function addAndroidIcon() |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @param $lang |
71 | - * @return mixed|string |
|
71 | + * @return string |
|
72 | 72 | */ |
73 | 73 | public function changeLangURL($lang) |
74 | 74 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * Checks SESSION, GET and Nip_Request and selects requested language |
83 | 83 | * If language not requested, falls back to default |
84 | 84 | * |
85 | - * @return string |
|
85 | + * @return boolean |
|
86 | 86 | */ |
87 | 87 | public function getLanguage() |
88 | 88 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
124 | - * @param mixed $request |
|
124 | + * @param null|\Nip\Request $request |
|
125 | 125 | */ |
126 | 126 | public function setRequest($request) |
127 | 127 | { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | /** |
152 | 152 | * gets the default language to be used when translating |
153 | - * @return string $language |
|
153 | + * @return boolean $language |
|
154 | 154 | */ |
155 | 155 | public function getDefaultLanguage() |
156 | 156 | { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * |
208 | 208 | * @param bool|string $slug |
209 | 209 | * @param bool|string $language |
210 | - * @return string |
|
210 | + * @return boolean |
|
211 | 211 | */ |
212 | 212 | public function hasTranslation($slug = false, $language = false) |
213 | 213 | { |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function changeLangURL($lang) |
74 | 74 | { |
75 | - $newURL = str_replace('language='.$this->getLanguage(), '', CURRENT_URL); |
|
76 | - $newURL = $newURL.(strpos($newURL, '?') == false ? '?' : '&').'language='.$lang; |
|
75 | + $newURL = str_replace('language=' . $this->getLanguage(), '', CURRENT_URL); |
|
76 | + $newURL = $newURL . (strpos($newURL, '?') == false ? '?' : '&') . 'language=' . $lang; |
|
77 | 77 | |
78 | 78 | return $newURL; |
79 | 79 | } |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | $this->selectedLanguage = $language; |
140 | 140 | $_SESSION['language'] = $language; |
141 | 141 | |
142 | - $code = $this->languageCodes[$language] ? $this->languageCodes[$language] : $language."_".strtoupper($language); |
|
142 | + $code = $this->languageCodes[$language] ? $this->languageCodes[$language] : $language . "_" . strtoupper($language); |
|
143 | 143 | |
144 | - putenv('LC_ALL='.$code); |
|
144 | + putenv('LC_ALL=' . $code); |
|
145 | 145 | setlocale(LC_ALL, $code); |
146 | 146 | setlocale(LC_NUMERIC, 'en_US'); |
147 | 147 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if ($return) { |
195 | 195 | if ($params) { |
196 | 196 | foreach ($params as $key => $value) { |
197 | - $return = str_replace("#{".$key."}", $value, $return); |
|
197 | + $return = str_replace("#{" . $key . "}", $value, $return); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | abstract protected function doTranslation($slug, $language = false); |
74 | 74 | |
75 | 75 | /** |
76 | - * @param $slug |
|
76 | + * @param boolean|string $slug |
|
77 | 77 | * @param bool $language |
78 | 78 | * @return bool |
79 | 79 | */ |
@@ -81,6 +81,6 @@ |
||
81 | 81 | { |
82 | 82 | $return = $this->doTranslation($slug, $language); |
83 | 83 | |
84 | - return (bool)$return; |
|
84 | + return (bool) $return; |
|
85 | 85 | } |
86 | 86 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * Adds a language to the dictionary |
34 | 34 | * |
35 | 35 | * @param string $language |
36 | - * @return I18n |
|
36 | + * @return Database |
|
37 | 37 | */ |
38 | 38 | public function addLanguage($language) |
39 | 39 | { |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | /** |
363 | 363 | * @param $word |
364 | - * @return mixed |
|
364 | + * @return string |
|
365 | 365 | */ |
366 | 366 | protected function doCamelize($word) |
367 | 367 | { |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | |
371 | 371 | /** |
372 | 372 | * @param $word |
373 | - * @return mixed |
|
373 | + * @return string |
|
374 | 374 | */ |
375 | 375 | protected function doHyphenize($word) |
376 | 376 | { |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | /** |
407 | 407 | * @param $word |
408 | - * @return mixed |
|
408 | + * @return string |
|
409 | 409 | */ |
410 | 410 | public function pluralize($word) |
411 | 411 | { |
@@ -77,6 +77,9 @@ |
||
77 | 77 | return $this->_current; |
78 | 78 | } |
79 | 79 | |
80 | + /** |
|
81 | + * @param string $locale |
|
82 | + */ |
|
80 | 83 | public function setCurrent($locale) |
81 | 84 | { |
82 | 85 | if ($this->isSupported($locale)) { |