Passed
Push — master ( 2eb561...334cb8 )
by Joël
08:06
created
src/helpers/gettext_helper.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
  */
13 13
 
14 14
 if (!function_exists('__')) {
15
-   /**
16
-    * Search translation to simple expression
17
-    *
18
-    * @param  string $expression
19
-    * @param  string $domain
20
-    * @param  string $category
21
-    * @return string
22
-   */
15
+    /**
16
+     * Search translation to simple expression
17
+     *
18
+     * @param  string $expression
19
+     * @param  string $domain
20
+     * @param  string $category
21
+     * @return string
22
+     */
23 23
     function __($expression, $domain=null, $category=null)
24 24
     {
25 25
         if (!empty($domain)) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     * @param  string $category
21 21
     * @return string
22 22
    */
23
-    function __($expression, $domain=null, $category=null)
23
+    function __($expression, $domain = null, $category = null)
24 24
     {
25 25
         if (!empty($domain)) {
26 26
             (new \Gettext())->changeDomain($domain);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param string $domain
47 47
      * @param string $category
48 48
      */
49
-    function _e($expression, $domain=null, $category=null)
49
+    function _e($expression, $domain = null, $category = null)
50 50
     {
51 51
         echo (__($expression, $domain, $category));
52 52
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
         $expression_singular,
69 69
         $expression_plural,
70 70
         $number,
71
-        $domain=null,
72
-        $category=null
71
+        $domain = null,
72
+        $category = null
73 73
     ) {
74 74
         $number = (int) $number;
75 75
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     * @param  string $category
21 21
     * @return string
22 22
    */
23
-    function __($expression, $domain=null, $category=null)
23
+    function __($expression, $domain=NULL, $category=NULL)
24 24
     {
25 25
         if (!empty($domain)) {
26 26
             (new \Gettext())->changeDomain($domain);
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      * @param string $domain
47 47
      * @param string $category
48 48
      */
49
-    function _e($expression, $domain=null, $category=null)
49
+    function _e($expression, $domain=NULL, $category=NULL)
50 50
     {
51 51
         echo (__($expression, $domain, $category));
52 52
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
         $expression_singular,
69 69
         $expression_plural,
70 70
         $number,
71
-        $domain=null,
72
-        $category=null
71
+        $domain=NULL,
72
+        $category=NULL
73 73
     ) {
74 74
         $number = (int) $number;
75 75
 
Please login to merge, or discard this patch.
src/libraries/Gettext.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
         log_message(
118 118
             (is_string($isBindTextDomainCodeSet) ? 'info' : 'error'),
119
-            'Gettext Library -> Bind ' .
120
-            'text domain: ' . $this->_textDomain . ' - ' .
121
-            'with code set: ' . $this->_catalogCodeSet
119
+            'Gettext Library -> Bind '.
120
+            'text domain: '.$this->_textDomain.' - '.
121
+            'with code set: '.$this->_catalogCodeSet
122 122
         );
123 123
 
124 124
         return $this;
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
      */
132 132
     private function _bindTextDomain()
133 133
     {
134
-        $isBindTextDomain = bindtextdomain($this->_textDomain, APPPATH . $this->_localeDir);
134
+        $isBindTextDomain = bindtextdomain($this->_textDomain, APPPATH.$this->_localeDir);
135 135
 
136 136
         log_message(
137 137
             (is_string($isBindTextDomain) ? 'info' : 'error'),
138
-            'Gettext Library -> Bind ' .
139
-            'text domain: ' . $this->_textDomain . ' - ' .
140
-            'with directory: ' . APPPATH . $this->_localeDir
138
+            'Gettext Library -> Bind '.
139
+            'text domain: '.$this->_textDomain.' - '.
140
+            'with directory: '.APPPATH.$this->_localeDir
141 141
         );
142 142
 
143 143
         return $this;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         log_message(
156 156
             (is_string($isSetTextDomain) ? 'info' : 'error'),
157
-            'Gettext Library -> Set text domain: ' . $this->_textDomain
157
+            'Gettext Library -> Set text domain: '.$this->_textDomain
158 158
         );
159 159
 
160 160
         return $this;
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 
172 172
         log_message(
173 173
             (is_string($isSetLocale) ? 'info' : 'error'),
174
-            'Gettext Library -> ' .
175
-            'Set locale: ' . (is_array($this->_locale) ? print_r($this->_locale, TRUE) : $this->_locale) . ' ' .
176
-            'for category: ' . $this->_category
174
+            'Gettext Library -> '.
175
+            'Set locale: '.(is_array($this->_locale) ? print_r($this->_locale, TRUE) : $this->_locale).' '.
176
+            'for category: '.$this->_category
177 177
         );
178 178
 
179 179
         // the new current locale, or FALSE if the locale is not implemented on your platform
@@ -189,22 +189,22 @@  discard block
 block discarded – undo
189 189
      */
190 190
     private function _putEnv()
191 191
     {
192
-        $isPutEnv = putenv('LANGUAGE=' . $this->_locale);
192
+        $isPutEnv = putenv('LANGUAGE='.$this->_locale);
193 193
         log_message(
194 194
             ($isPutEnv ? 'info' : 'error'),
195
-            'Gettext Library -> Set environment LANGUAGE: ' . $this->_locale
195
+            'Gettext Library -> Set environment LANGUAGE: '.$this->_locale
196 196
         );
197 197
 
198
-        $isPutEnv = putenv('LANG=' . $this->_locale);
198
+        $isPutEnv = putenv('LANG='.$this->_locale);
199 199
         log_message(
200 200
             ($isPutEnv ? 'info' : 'error'),
201
-            'Gettext Library -> Set environment LANG: ' . $this->_locale
201
+            'Gettext Library -> Set environment LANG: '.$this->_locale
202 202
         );
203 203
 
204
-        $isPutEnv = putenv($this->_category . '=' . $this->_locale);
204
+        $isPutEnv = putenv($this->_category.'='.$this->_locale);
205 205
         log_message(
206 206
             ($isPutEnv ? 'info' : 'error'),
207
-            'Gettext Library -> Set environment category ' . $this->_category . ': ' . $this->_locale
207
+            'Gettext Library -> Set environment category '.$this->_category.': '.$this->_locale
208 208
         );
209 209
 
210 210
         return $this;
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
      */
218 218
     private function _checkLocaleFile()
219 219
     {
220
-        $file = APPPATH . $this->_localeDir .
221
-            '/' . $this->_locale . '/LC_MESSAGES/' . $this->_textDomain . '.mo';
220
+        $file = APPPATH.$this->_localeDir.
221
+            '/'.$this->_locale.'/LC_MESSAGES/'.$this->_textDomain.'.mo';
222 222
 
223 223
         log_message(
224 224
             (is_file($file) ? 'info' : 'error'),
225
-            'Gettext Library -> Check MO file exists: ' . $file
225
+            'Gettext Library -> Check MO file exists: '.$file
226 226
         );
227 227
 
228 228
         return $this;
Please login to merge, or discard this patch.