Completed
Push — master ( b0df54...0c9057 )
by Ben
10s
created
classes/PHPTAL/Dom/PHPTALDocumentBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class PHPTAL_Dom_PHPTALDocumentBuilder extends PHPTAL_Dom_DocumentBuilder
24 24
 {
25
-    private $_xmlns;   /* PHPTAL_Dom_XmlnsState */
25
+    private $_xmlns; /* PHPTAL_Dom_XmlnsState */
26 26
     private $encoding;
27 27
 
28 28
     public function __construct()
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     public function onDocumentEnd()
53 53
     {
54 54
         if (count($this->_stack) > 0) {
55
-            $left='</'.$this->_current->getQualifiedName().'>';
56
-            for ($i = count($this->_stack)-1; $i>0; $i--) $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
55
+            $left = '</'.$this->_current->getQualifiedName().'>';
56
+            for ($i = count($this->_stack)-1; $i > 0; $i--) $left .= '</'.$this->_stack[$i]->getQualifiedName().'>';
57 57
             throw new PHPTAL_ParserException("Not all elements were closed before end of the document. Missing: ".$left,
58 58
                         $this->file, $this->line);
59 59
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         $node = new PHPTAL_Dom_Element($element_qname, $namespace_uri, $attrnodes, $this->getXmlnsState());
131 131
         $this->pushNode($node);
132
-        $this->_stack[] =  $this->_current;
132
+        $this->_stack[] = $this->_current;
133 133
         $this->_current = $node;
134 134
     }
135 135
 
Please login to merge, or discard this patch.
classes/PHPTAL/GetTextTranslator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * Encoding must be set before calling addDomain!
105 105
      */
106
-    public function addDomain($domain, $path='./locale/')
106
+    public function addDomain($domain, $path = './locale/')
107 107
     {
108 108
         bindtextdomain($domain, $path);
109 109
         if ($this->_encoding) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      *
141 141
      * @param bool $htmlencode if true, output will be HTML-escaped.
142 142
      */
143
-    public function translate($key, $htmlencode=true)
143
+    public function translate($key, $htmlencode = true)
144 144
     {
145 145
         if ($this->_canonicalize) $key = self::_canonicalizeKey($key);
146 146
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $key_ = trim($key_);
169 169
         $key_ = str_replace("\n", "", $key_);
170 170
         $key_ = str_replace("\r", "", $key_);
171
-        for ($i = 0; $i<strlen($key_); $i++) {
171
+        for ($i = 0; $i < strlen($key_); $i++) {
172 172
             $c = $key_[$i];
173 173
             $o = ord($c);
174 174
             if ($o < 5 || $o > 127) {
Please login to merge, or discard this patch.
tools/phptal_lint.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         try
29 29
         {
30
-            if (! empty($_SERVER['REQUEST_URI'])) {
30
+            if (!empty($_SERVER['REQUEST_URI'])) {
31 31
                 throw new Exception("Please use this tool from command line");
32 32
             }
33 33
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 echo " Skipped ".$this->plural($lint->skipped, "non-template file").".";
77 77
             }
78 78
             echo "\n";
79
-            if (! $custom_extensions && count($lint->skipped_filenames)) {
79
+            if (!$custom_extensions && count($lint->skipped_filenames)) {
80 80
                 echo "Skipped file(s): ", implode(', ', array_keys($lint->skipped_filenames)), ".\n";
81 81
             }
82 82
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 echo "\n";
87 87
                 exit(2);
88 88
             } else if (count($lint->warnings)) {
89
-                echo "Found ".$this->plural(count($lint->warnings),"warning").":\n";
89
+                echo "Found ".$this->plural(count($lint->warnings), "warning").":\n";
90 90
                 $this->display_erorr_array($lint->warnings);
91 91
                 echo "\n";
92 92
                 exit(0);
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
                 exit($lint->checked ? 0 : 1);
96 96
             }
97 97
         }
98
-        catch(Exception $e) {
99
-            fwrite(STDERR, $e->getMessage() . "\n");
98
+        catch (Exception $e) {
99
+            fwrite(STDERR, $e->getMessage()."\n");
100 100
             $errcode = $e->getCode();
101 101
             exit($errcode ? $errcode : 1);
102 102
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     function usage()
120 120
     {
121 121
         $this->require_phptal();
122
-        echo "PHPTAL Lint 1.1.3 (PHPTAL ", strtr(PHPTAL_VERSION,"_","."), ")\n";
122
+        echo "PHPTAL Lint 1.1.3 (PHPTAL ", strtr(PHPTAL_VERSION, "_", "."), ")\n";
123 123
 
124 124
         echo "Usage: phptal_lint.php [-e extensions] [-i php_file_or_directory] file_or_directory_to_check ...\n";
125 125
         echo "  -e comma-separated list of extensions\n";
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
     function extended_getopt(array $options)
137 137
     {
138 138
         $results = array('--filenames--'=>array());
139
-        for ($i = 1; $i < count($_SERVER['argv']); $i ++) {
139
+        for ($i = 1; $i < count($_SERVER['argv']); $i++) {
140 140
             if (in_array($_SERVER['argv'][$i], $options)) {
141
-                $results[substr($_SERVER['argv'][$i], 1)][] = $_SERVER['argv'][++ $i];
141
+                $results[substr($_SERVER['argv'][$i], 1)][] = $_SERVER['argv'][++$i];
142 142
             } else if ($_SERVER['argv'][$i] == '--') {
143
-                $results['--filenames--'] = array_merge($results['--filenames--'], array_slice($_SERVER['argv'],$i+1));
143
+                $results['--filenames--'] = array_merge($results['--filenames--'], array_slice($_SERVER['argv'], $i+1));
144 144
                 break;
145 145
             } else if (substr($_SERVER['argv'][$i], 0, 1) == '-') {
146 146
                     $this->usage();
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         if (class_exists('PHPTAL', false)) return;
173 173
 
174
-        $myphptal = dirname(__FILE__) . '/../classes/PHPTAL.php';
174
+        $myphptal = dirname(__FILE__).'/../classes/PHPTAL.php';
175 175
         if (file_exists($myphptal)) {
176 176
             require_once $myphptal;
177 177
         } else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     }
203 203
 
204 204
     function acceptExtensions(array $ext) {
205
-        $this->accept_pattern = '/\.(?:' . implode('|', $ext) . ')$/i';
205
+        $this->accept_pattern = '/\.(?:'.implode('|', $ext).')$/i';
206 206
     }
207 207
 
208 208
     protected function reportProgress($symbol)
@@ -226,17 +226,17 @@  discard block
 block discarded – undo
226 226
 
227 227
             if ($entry->isDir()) {
228 228
                 $this->reportProgress('.');
229
-                $this->scan($path . DIRECTORY_SEPARATOR . $filename);
229
+                $this->scan($path.DIRECTORY_SEPARATOR.$filename);
230 230
                 continue;
231 231
             }
232 232
 
233
-            if (! preg_match($this->accept_pattern, $filename)) {
233
+            if (!preg_match($this->accept_pattern, $filename)) {
234 234
                 $this->skipped++;
235 235
                 $this->skipped_filenames[$filename] = true;
236 236
                 continue;
237 237
             }
238 238
 
239
-            $result = $this->testFile($path . DIRECTORY_SEPARATOR . $filename);
239
+            $result = $this->testFile($path.DIRECTORY_SEPARATOR.$filename);
240 240
 
241 241
             if (self::TEST_OK == $result) {
242 242
                 $this->reportProgress('.');
@@ -258,25 +258,25 @@  discard block
 block discarded – undo
258 258
     function testFile($fullpath)
259 259
     {
260 260
         try {
261
-            $this->checked ++;
261
+            $this->checked++;
262 262
             $phptal = new PHPTAL($fullpath);
263 263
             $phptal->setForceReparse(true);
264 264
             $phptal->prepare();
265 265
             return self::TEST_OK;
266 266
         }
267
-        catch(PHPTAL_UnknownModifierException $e) {
267
+        catch (PHPTAL_UnknownModifierException $e) {
268 268
             if ($this->skipUnknownModifiers && is_callable(array($e, 'getModifierName'))) {
269 269
                 $this->warnings[] = array(dirname($fullpath), basename($fullpath), "Unknown expression modifier: ".$e->getModifierName()." (use -i to include your custom modifier functions)", $e->getLine());
270 270
                 return self::TEST_SKIPPED;
271 271
             }
272 272
             $log_exception = $e;
273 273
         }
274
-        catch(Exception $e) {
274
+        catch (Exception $e) {
275 275
             $log_exception = $e;
276 276
         }
277 277
 
278 278
         // Takes exception from either of the two catch blocks above
279
-        $this->errors[] = array(dirname($fullpath) , basename($fullpath) , $log_exception->getMessage() , $log_exception->getLine());
279
+        $this->errors[] = array(dirname($fullpath), basename($fullpath), $log_exception->getMessage(), $log_exception->getLine());
280 280
         return self::TEST_ERROR;
281 281
     }
282 282
 }
Please login to merge, or discard this patch.
classes/PHPTAL/Php/Attribute/I18N/Target.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
  */
31 31
 class PHPTAL_Php_Attribute_I18N_Data extends PHPTAL_Php_Attribute
32 32
 {
33
-    public function before(PHPTAL_Php_CodeWriter $codewriter){}
34
-    public function after(PHPTAL_Php_CodeWriter $codewriter){}
33
+    public function before(PHPTAL_Php_CodeWriter $codewriter) {}
34
+    public function after(PHPTAL_Php_CodeWriter $codewriter) {}
35 35
 }
36 36
 
Please login to merge, or discard this patch.