Completed
Push — master ( 3dcfcd...bf2930 )
by David
30s
created
lib/Dwoo/Plugins/Blocks/PluginWithelse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         }
90 90
 
91 91
         $block                      = &$compiler->getCurrentBlock();
92
-        $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE;
92
+        $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE;
93 93
 
94 94
         return '';
95 95
     }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Blocks/PluginForelse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         }
90 90
 
91 91
         $block                      = &$compiler->getCurrentBlock();
92
-        $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE;
92
+        $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE;
93 93
 
94 94
         return '';
95 95
     }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Blocks/PluginForeachelse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         }
90 90
 
91 91
         $block                      = &$compiler->getCurrentBlock();
92
-        $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE;
92
+        $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE;
93 93
 
94 94
         return '';
95 95
     }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginExtendsCheckCompile.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
     $tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
49 49
 
50 50
     if ($tpl === null) {
51
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
51
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.':'.$identifier.'" not found.');
52 52
     } elseif ($tpl === false) {
53
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . '" does not support includes.');
53
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.'" does not support includes.');
54 54
     }
55 55
 
56 56
     $cmp = clone $compiler;
@@ -62,23 +62,23 @@  discard block
 block discarded – undo
62 62
         $compiler->addUsedPlugin($plugin, $type);
63 63
     }
64 64
 
65
-    $out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";
65
+    $out = '\'\';// checking for modification in '.$resource.':'.$identifier."\r\n";
66 66
 
67 67
     $modCheck = $tpl->getIsModifiedCode();
68 68
 
69 69
     if ($modCheck) {
70
-        $out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
70
+        $out .= 'if (!('.$modCheck.')) { ob_end_clean(); return false; }';
71 71
     } else {
72 72
         $out .= 'try {
73
-	$tpl = $this->templateFactory("' . $resource . '", "' . $identifier . '");
73
+	$tpl = $this->templateFactory("' . $resource.'", "'.$identifier.'");
74 74
 } catch (Dwoo\Exception $e) {
75
-	$this->triggerError(\'Load Templates : Resource <em>' . $resource . '</em> was not added to Dwoo, can not extend <em>' . $identifier . '</em>\', E_USER_WARNING);
75
+	$this->triggerError(\'Load Templates : Resource <em>' . $resource.'</em> was not added to Dwoo, can not extend <em>'.$identifier.'</em>\', E_USER_WARNING);
76 76
 }
77 77
 if ($tpl === null)
78
-	$this->triggerError(\'Load Templates : Resource "' . $resource . ':' . $identifier . '" was not found.\', E_USER_WARNING);
78
+	$this->triggerError(\'Load Templates : Resource "' . $resource.':'.$identifier.'" was not found.\', E_USER_WARNING);
79 79
 elseif ($tpl === false)
80
-	$this->triggerError(\'Load Templates : Resource "' . $resource . '" does not support extends.\', E_USER_WARNING);
81
-if ($tpl->getUid() != "' . $tpl->getUid() . '") { ob_end_clean(); return false; }';
80
+	$this->triggerError(\'Load Templates : Resource "' . $resource.'" does not support extends.\', E_USER_WARNING);
81
+if ($tpl->getUid() != "' . $tpl->getUid().'") { ob_end_clean(); return false; }';
82 82
     }
83 83
 
84 84
     return $out;
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginMailto.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
     $address .= '?';
48 48
 
49 49
     if (!empty($subject)) {
50
-        $address .= 'subject=' . rawurlencode($subject) . '&';
50
+        $address .= 'subject='.rawurlencode($subject).'&';
51 51
     }
52 52
     if (!empty($cc)) {
53
-        $address .= 'cc=' . rawurlencode($cc) . '&';
53
+        $address .= 'cc='.rawurlencode($cc).'&';
54 54
     }
55 55
     if (!empty($bcc)) {
56
-        $address .= 'bcc=' . rawurlencode($bcc) . '&';
56
+        $address .= 'bcc='.rawurlencode($bcc).'&';
57 57
     }
58 58
     if (!empty($newsgroups)) {
59
-        $address .= 'newsgroups=' . rawurlencode($newsgroups) . '&';
59
+        $address .= 'newsgroups='.rawurlencode($newsgroups).'&';
60 60
     }
61 61
     if (!empty($followupto)) {
62
-        $address .= 'followupto=' . rawurlencode($followupto) . '&';
62
+        $address .= 'followupto='.rawurlencode($followupto).'&';
63 63
     }
64 64
 
65 65
     $address = rtrim($address, '?&');
@@ -69,34 +69,34 @@  discard block
 block discarded – undo
69 69
 
70 70
         case 'none':
71 71
         case null:
72
-            return '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
72
+            return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
73 73
 
74 74
         case 'js':
75 75
         case 'javascript':
76
-            $str = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');';
76
+            $str = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');';
77 77
             $len = strlen($str);
78 78
 
79 79
             $out = '';
80 80
             for ($i = 0; $i < $len; ++ $i) {
81
-                $out .= '%' . bin2hex($str[$i]);
81
+                $out .= '%'.bin2hex($str[$i]);
82 82
             }
83 83
 
84
-            return '<script type="text/javascript">eval(unescape(\'' . $out . '\'));</script>';
84
+            return '<script type="text/javascript">eval(unescape(\''.$out.'\'));</script>';
85 85
 
86 86
             break;
87 87
         case 'javascript_charcode':
88 88
         case 'js_charcode':
89 89
         case 'jscharcode':
90 90
         case 'jschar':
91
-            $str = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
91
+            $str = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
92 92
             $len = strlen($str);
93 93
 
94
-            $out = '<script type="text/javascript">' . "\n<!--\ndocument.write(Str.fromCharCode(";
94
+            $out = '<script type="text/javascript">'."\n<!--\ndocument.write(Str.fromCharCode(";
95 95
             for ($i = 0; $i < $len; ++ $i) {
96
-                $out .= ord($str[$i]) . ',';
96
+                $out .= ord($str[$i]).',';
97 97
             }
98 98
 
99
-            return rtrim($out, ',') . "));\n-->\n</script>\n";
99
+            return rtrim($out, ',')."));\n-->\n</script>\n";
100 100
 
101 101
             break;
102 102
 
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
             $len = strlen($address);
110 110
             for ($i = 0; $i < $len; ++ $i) {
111 111
                 if (preg_match('#\w#', $address[$i])) {
112
-                    $out .= '%' . bin2hex($address[$i]);
112
+                    $out .= '%'.bin2hex($address[$i]);
113 113
                 } else {
114 114
                     $out .= $address[$i];
115 115
                 }
116 116
             }
117
-            $out .= '" ' . $extra . '>';
117
+            $out .= '" '.$extra.'>';
118 118
             $len = strlen($text);
119 119
             for ($i = 0; $i < $len; ++ $i) {
120
-                $out .= '&#x' . bin2hex($text[$i]);
120
+                $out .= '&#x'.bin2hex($text[$i]);
121 121
             }
122 122
 
123
-            return $out . '</a>';
123
+            return $out.'</a>';
124 124
 
125 125
         default:
126 126
             $dwoo->triggerError('Mailto: <em>encode</em> argument is invalid, it must be one of : <em>none (= no value), js, js_charcode or hex</em>', E_USER_WARNING);
Please login to merge, or discard this patch.
lib/Dwoo/Template/Str.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         $this->cacheTime = $cacheTime;
125 125
 
126 126
         if ($compileId !== null) {
127
-            $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
127
+            $this->compileId = str_replace('../', '__', strtr($compileId, '\\%?=!:;'.PATH_SEPARATOR, '/-------'));
128 128
         }
129 129
 
130 130
         if ($cacheId !== null) {
131
-            $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
131
+            $this->cacheId = str_replace('../', '__', strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------'));
132 132
         }
133 133
     }
134 134
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) {
277 277
             // already checked, return cache file
278 278
             return $cachedFile;
279
-        } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === - 1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength)) && $this->isValidCompiledFile($this->getCompiledFilename($core))) {
279
+        } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === - 1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME']-$cacheLength)) && $this->isValidCompiledFile($this->getCompiledFilename($core))) {
280 280
             // cache is still valid and can be loaded
281 281
             self::$cache['cached'][$this->cacheId] = true;
282 282
 
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
         // thanks for his help on avoiding concurency issues
305 305
         $temp = tempnam($cacheDir, 'temp');
306 306
         if (!($file = @fopen($temp, 'wb'))) {
307
-            $temp = $cacheDir . uniqid('temp');
307
+            $temp = $cacheDir.uniqid('temp');
308 308
             if (!($file = @fopen($temp, 'wb'))) {
309
-                trigger_error('Error writing temporary file \'' . $temp . '\'', E_USER_WARNING);
309
+                trigger_error('Error writing temporary file \''.$temp.'\'', E_USER_WARNING);
310 310
 
311 311
                 return false;
312 312
             }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
     {
343 343
         $cachedFile = $this->getCacheFilename($core);
344 344
 
345
-        return !file_exists($cachedFile) || (filectime($cachedFile) < (time() - $olderThan) && unlink($cachedFile));
345
+        return !file_exists($cachedFile) || (filectime($cachedFile) < (time()-$olderThan) && unlink($cachedFile));
346 346
     }
347 347
 
348 348
     /**
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
             $this->compileId = $this->name;
450 450
         }
451 451
 
452
-        return $core->getCompileDir() . $this->compileId . '.d' . Core::RELEASE_TAG . '.php';
452
+        return $core->getCompileDir().$this->compileId.'.d'.Core::RELEASE_TAG.'.php';
453 453
     }
454 454
 
455 455
     /**
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
             if (isset($_SERVER['REQUEST_URI']) === true) {
468 468
                 $cacheId = $_SERVER['REQUEST_URI'];
469 469
             } elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) {
470
-                $cacheId = $_SERVER['SCRIPT_FILENAME'] . '-' . implode('-', $_SERVER['argv']);
470
+                $cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']);
471 471
             } else {
472 472
                 $cacheId = '';
473 473
             }
474 474
             // force compiled id generation
475 475
             $this->getCompiledFilename($core);
476 476
 
477
-            $this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;' . PATH_SEPARATOR, '/-------'));
477
+            $this->cacheId = str_replace('../', '__', $this->compileId.strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------'));
478 478
         }
479 479
 
480
-        return $core->getCacheDir() . $this->cacheId . '.html';
480
+        return $core->getCacheDir().$this->cacheId.'.html';
481 481
     }
482 482
 
483 483
     /**
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
         }
515 515
 
516 516
         $retries = 3;
517
-        while ($retries --) {
517
+        while ($retries--) {
518 518
             @mkdir($path, $chmod, true);
519 519
             if (is_dir($path)) {
520 520
                 break;
@@ -527,9 +527,9 @@  discard block
 block discarded – undo
527 527
             $path    = strtr(str_replace($baseDir, '', $path), '\\', '/');
528 528
             $folders = explode('/', trim($path, '/'));
529 529
             foreach ($folders as $folder) {
530
-                $baseDir .= $folder . DIRECTORY_SEPARATOR;
530
+                $baseDir .= $folder.DIRECTORY_SEPARATOR;
531 531
                 if (!chmod($baseDir, $chmod)) {
532
-                    throw new Exception('Unable to chmod ' . "$baseDir to $chmod: " . print_r(error_get_last(), true));
532
+                    throw new Exception('Unable to chmod '."$baseDir to $chmod: ".print_r(error_get_last(), true));
533 533
                 }
534 534
             }
535 535
         }
Please login to merge, or discard this patch.