Completed
Push — master ( 063e7f...e25cba )
by Chris
02:38
created
php/hamle/Field/Button.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,6 +42,6 @@
 block discarded – undo
42 42
   }
43 43
 
44 44
   function isClicked() {
45
-    return isset($_REQUEST[$this->form . "_" . $this->name]);
45
+    return isset($_REQUEST[$this->form."_".$this->name]);
46 46
   }
47 47
 }
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
php/hamle/Parse.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $i = self::indentLevel($indent);
158 158
         unset($m[0]);
159 159
         switch (strlen($code) ? $code[0] : ($textcode ? $textcode : "")) {
160
-          case "|": //Control Tag
160
+          case "|" : //Control Tag
161 161
             if ($code == "|snippet")
162 162
               $hTag = new Tag\Snippet($text);
163 163
             elseif ($code == "|form")
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
             break;
193 193
           default:
194 194
             $attr = array();
195
-            if(isset($params[0]) && $params[0] == "[") {
195
+            if (isset($params[0]) && $params[0] == "[") {
196 196
               $param = substr($params, 1, strlen($params) - 2);
197
-              $param = str_replace('+','%2B', $param);
198
-              $param = str_replace('\\&','%26', $param);
197
+              $param = str_replace('+', '%2B', $param);
198
+              $param = str_replace('\\&', '%26', $param);
199 199
 //              parse_str($param, $attr);
200 200
               $attr = $this->parseQueryString($param);
201 201
             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
               if ($s[0] == ".") $class[] = substr($s, 1);
207 207
               if ($s[0] == "!") $ref = substr($s, 1);
208 208
             }
209
-            if($ref)
209
+            if ($ref)
210 210
               $hTag = new Tag\DynHtml($tag, $class, $attr, $id, $ref);
211 211
             else
212 212
               $hTag = new Tag\Html($tag, $class, $attr, $id);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
         else
220 220
           $this->root[] = $hTag;
221 221
       } else
222
-        throw new ParseError("Unable to parse line {$this->lineNo}\n\"$line\"/" . preg_last_error());
222
+        throw new ParseError("Unable to parse line {$this->lineNo}\n\"$line\"/".preg_last_error());
223 223
       $this->lineNo++;
224 224
     }
225 225
   }
226 226
 
227 227
   function parseQueryString($qs) {
228 228
     $out = [];
229
-    foreach(explode('&',$qs) as $s) {
230
-      $kv = explode('=',$s,2);
231
-      $out[urldecode($kv[0])] = isset($kv[1])?urldecode($kv[1]):null;
229
+    foreach (explode('&', $qs) as $s) {
230
+      $kv = explode('=', $s, 2);
231
+      $out[urldecode($kv[0])] = isset($kv[1]) ?urldecode($kv[1]) : null;
232 232
     }
233 233
     return $out;
234 234
   }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     $m = array();
247 247
     while ($this->lineNo + 1 < $this->lineCount &&
248 248
         (!trim($this->lines[$this->lineNo + 1]) ||
249
-            preg_match('/^(\s){' . $indent . '}((\s)+[^\s].*)$/',
249
+            preg_match('/^(\s){'.$indent.'}((\s)+[^\s].*)$/',
250 250
                 $this->lines[$this->lineNo + 1], $m))) {
251 251
       if (trim($this->lines[$this->lineNo + 1]))
252 252
         $out[] = $m[2];
Please login to merge, or discard this patch.
php/hamle/Text/Func.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
    */
44 44
   function __construct($s) {
45 45
     $m = array();
46
-    if (!preg_match('/^\$\((' . self::REGEX_FUNCSEL . '*)(.*)\)$/', $s, $m))
46
+    if (!preg_match('/^\$\(('.self::REGEX_FUNCSEL.'*)(.*)\)$/', $s, $m))
47 47
       throw new ParseError("Unable to read \$ func in '$s'");
48 48
     if (trim($m[2]))
49 49
       $this->sub = new FuncSub($m[2]);
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
     }
87 87
     $rand = false;
88 88
     if (preg_match_all('/\\^(-?)([a-zA-Z0-9\_]*)/', $s, $m)) {
89
-      foreach($m[0] as $k=>$mv)
89
+      foreach ($m[0] as $k=>$mv)
90 90
         if ($m[2][$k]) {
91
-          $dir = $m[1][$k] == "-"?Hamle\Hamle::SORT_DESCENDING:Hamle\Hamle::SORT_ASCENDING;
91
+          $dir = $m[1][$k] == "-" ?Hamle\Hamle::SORT_DESCENDING : Hamle\Hamle::SORT_ASCENDING;
92 92
           $att['sort'][$m[2][$k]] = $dir;
93 93
         } else $rand = true;
94 94
     }
95
-    if($rand)
95
+    if ($rand)
96 96
       $att['sort'] = [""=>$att['dir'] = Hamle\Hamle::SORT_RANDOM];
97 97
     return $att;
98 98
   }
@@ -110,25 +110,25 @@  discard block
 block discarded – undo
110 110
    * @return string PHP Code
111 111
    */
112 112
   function toPHP() {
113
-    $sub = $this->sub ? "->" . $this->sub->toPHP() : "";
114
-    if($this->scope instanceof Scope) {
115
-      return $this->scope->toPHP() . $sub;
116
-    } elseif($this->scope === true) {
113
+    $sub = $this->sub ? "->".$this->sub->toPHP() : "";
114
+    if ($this->scope instanceof Scope) {
115
+      return $this->scope->toPHP().$sub;
116
+    } elseif ($this->scope === true) {
117 117
       return "Hamle\\Scope::get(0)$sub";
118 118
     }
119
-    $limit = Text::varToCode($this->sortlimit['sort']) . "," .
120
-        $this->sortlimit['limit'] . "," . $this->sortlimit['offset'];
119
+    $limit = Text::varToCode($this->sortlimit['sort']).",".
120
+        $this->sortlimit['limit'].",".$this->sortlimit['offset'];
121 121
     if (count($this->filt['tag']))
122
-      return "Hamle\\Run::modelTypeTags(" .
123
-      Text::varToCode($this->filt['tag']) . ",$limit)$sub";
122
+      return "Hamle\\Run::modelTypeTags(".
123
+      Text::varToCode($this->filt['tag']).",$limit)$sub";
124 124
     if (count($this->filt['id']))
125 125
       if (isset($this->filt['id']['*']) && count($this->filt['id']['*']) == 1)
126
-        return "Hamle\\Run::modelId(" .
127
-        Text::varToCode(current($this->filt['id']['*'])) .
126
+        return "Hamle\\Run::modelId(".
127
+        Text::varToCode(current($this->filt['id']['*'])).
128 128
         ",$limit)$sub";
129 129
       else
130
-        return "Hamle\\Run::modelTypeId(" .
131
-        Text::varToCode($this->filt['id']) . ",$limit)$sub";
130
+        return "Hamle\\Run::modelTypeId(".
131
+        Text::varToCode($this->filt['id']).",$limit)$sub";
132 132
     return "";
133 133
   }
134 134
 
Please login to merge, or discard this patch.
php/hamle/Form.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     $this->setup();
55 55
     $fields = $this->_fields;
56 56
     $this->_fields = array();
57
-    foreach($fields as $v) {
57
+    foreach ($fields as $v) {
58 58
       $this->_fields[$v->name] = $v;
59 59
       $v->form($this->_name);
60 60
     }
@@ -64,23 +64,23 @@  discard block
 block discarded – undo
64 64
   
65 65
   function process() {
66 66
     $clicked = "";
67
-    foreach($this->_fields as $f)
68
-      if($f instanceOf Field\Button)
69
-        if($f->isClicked())
67
+    foreach ($this->_fields as $f)
68
+      if ($f instanceOf Field\Button)
69
+        if ($f->isClicked())
70 70
           $clicked = $f;
71
-    foreach($this->_fields as $f)
72
-      $f->doProcess($clicked?true:false);
73
-    if($clicked)
71
+    foreach ($this->_fields as $f)
72
+      $f->doProcess($clicked ?true:false);
73
+    if ($clicked)
74 74
       try {
75 75
         $this->onSubmit($clicked);
76
-      } catch(Exception\FormInvalid $e) {
76
+      } catch (Exception\FormInvalid $e) {
77 77
         $this->hint = $e->getMessage();
78 78
       }
79 79
   }
80 80
   
81 81
   function isValid() {
82 82
     $valid = true;
83
-    foreach($this->_fields as $f)
83
+    foreach ($this->_fields as $f)
84 84
       $valid = $f->valid && $valid;
85 85
     return $valid;
86 86
   }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     return $this->_fields;
96 96
   }
97 97
   function getField($n) {
98
-    if(!isset($this->_fields[$n]))
98
+    if (!isset($this->_fields[$n]))
99 99
       throw new Exception\NoKey("unable to find form field ($n)");
100 100
     return $this->_fields[$n];
101 101
   }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
   }
105 105
   
106 106
   function getHTMLProp() {
107
-    return array('action'=>'','method'=>'post','name'=>$this->_name,
107
+    return array('action'=>'', 'method'=>'post', 'name'=>$this->_name,
108 108
                                         'enctype'=>'multipart/form-data');
109 109
   }
110 110
 
Please login to merge, or discard this patch.
php/hamle/Tag/Html.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,22 +42,22 @@  discard block
 block discarded – undo
42 42
   function __construct($tag, $class = array(), $attr = array(), $id = "") {
43 43
     parent::__construct();
44 44
     $this->opt = $attr;
45
-    if(isset($attr['class']) && !is_array($attr['class']))
46
-      $this->opt['class'] = $attr['class']?explode(" ",$attr['class']):array();
45
+    if (isset($attr['class']) && !is_array($attr['class']))
46
+      $this->opt['class'] = $attr['class'] ?explode(" ", $attr['class']) : array();
47 47
     $this->source = array();
48 48
     $this->type = $tag ? $tag : "div";
49
-    if($class) {
49
+    if ($class) {
50 50
       if (isset($this->opt['class']))
51 51
         $this->opt['class'] = array_merge($this->opt['class'], $class);
52 52
       else
53 53
         $this->opt['class'] = $class;
54 54
     }
55
-    if($id) $this->opt['id'] = $id;
55
+    if ($id) $this->opt['id'] = $id;
56 56
   }
57 57
 
58 58
   function renderStTag() {
59 59
     $close = in_array($this->type, self::$selfCloseTags) ? " />" : ">";
60
-    return "<{$this->type}" . $this->optToTags() . $close;
60
+    return "<{$this->type}".$this->optToTags().$close;
61 61
   }
62 62
 
63 63
   function renderEnTag() {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
       if (!$v instanceof H\Text)
80 80
         $v = new H\Text($v);
81 81
       $k = new H\Text($k);
82
-      $out[] = " " . $k->toHTML() . "=\"" . $v->toHTMLAtt() . "\"";
82
+      $out[] = " ".$k->toHTML()."=\"".$v->toHTMLAtt()."\"";
83 83
     }
84 84
     return implode("", $out);
85 85
   }
Please login to merge, or discard this patch.
php/hamle/Hamle.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 
64 64
   public $baseModel;
65 65
 
66
-  const REL_CHILD = 0x01;  /* Child Relation */
66
+  const REL_CHILD = 0x01; /* Child Relation */
67 67
   const REL_PARENT = 0x02; /* Parent Relation */
68
-  const REL_ANY = 0x03;    /* Unspecified or any relation */
68
+  const REL_ANY = 0x03; /* Unspecified or any relation */
69 69
   
70
-  const SORT_NATURAL = 0x00;    /* Sort in what ever order is 'default' */
71
-  const SORT_ASCENDING = 0x02;  /* Sort Ascending */
70
+  const SORT_NATURAL = 0x00; /* Sort in what ever order is 'default' */
71
+  const SORT_ASCENDING = 0x02; /* Sort Ascending */
72 72
   const SORT_DESCENDING = 0x03; /* Sort Decending */
73
-  const SORT_RANDOM = 0x04;     /* Sort Randomly */
73
+  const SORT_RANDOM = 0x04; /* Sort Randomly */
74 74
   /**
75 75
    * Create new HAMLE Parser
76 76
    * 
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
    */
82 82
   function __construct($baseModel, $setup = NULL) {
83 83
     self::$me = $this;
84
-    if(!$setup)
84
+    if (!$setup)
85 85
       $setup = new Setup();
86 86
     $this->parse = new Parse();
87
-    if(!$setup instanceOf Setup)
87
+    if (!$setup instanceOf Setup)
88 88
       throw new Exception\Unsupported("Unsupported Setup Helper was passed, it must extends hamleSetup");
89
-    if(!$baseModel instanceOf Model)
89
+    if (!$baseModel instanceOf Model)
90 90
       throw new Exception\Unsupported("Unsupported Model(".get_class($baseModel).") Type was passed, it must implement hamleModel");
91 91
     $this->setup = $setup;
92 92
     $this->baseModel = $baseModel;
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
   }
95 95
 
96 96
   function initSnipFiles() {
97
-    if($this->snipMod == 0) {
97
+    if ($this->snipMod == 0) {
98 98
       $this->snipFiles = $this->setup->snippetFiles();
99
-      foreach($this->snipFiles as $f) {
99
+      foreach ($this->snipFiles as $f) {
100 100
         if (!file_exists($f)) throw new Exception\NotFound("Unable to find Snippet File ($f)");
101 101
         $this->snipFiles = max($this->snipFiles, filemtime($f));
102 102
       }
@@ -111,17 +111,17 @@  discard block
 block discarded – undo
111 111
    */
112 112
   function load($hamleFile, \Closure $parseFunc = null) {
113 113
     $template = $this->setup->templatePath($hamleFile);
114
-      if(!file_exists($template)) 
114
+      if (!file_exists($template)) 
115 115
         throw new Exception\NotFound("Unable to find HAMLE Template ($template)");
116 116
     $this->cacheFile = $this->setup->cachePath(
117
-                  str_replace("/","-",$hamleFile).".php");
117
+                  str_replace("/", "-", $hamleFile).".php");
118 118
     $this->setup->debugLog("Set cache file path to ({$this->cacheFile})");
119
-    $cacheFileAge = is_file($this->cacheFile)?filemtime($this->cacheFile):0;
119
+    $cacheFileAge = is_file($this->cacheFile) ?filemtime($this->cacheFile) : 0;
120 120
     $cacheDirty = !$this->cache ||
121 121
         $cacheFileAge < $this->snipMod || $cacheFileAge < filemtime($template);
122
-    if($cacheDirty) {
122
+    if ($cacheDirty) {
123 123
       $this->setup->debugLog("Parsing File ($template to {$this->cacheFile})");
124
-      $this->parse($parseFunc?"":file_get_contents($template), $parseFunc);
124
+      $this->parse($parseFunc ? "" : file_get_contents($template), $parseFunc);
125 125
     } else
126 126
       $this->setup->debugLog("Using Cached file ({$this->cacheFile})");
127 127
     return $this;
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
    * @throws Exception\ParseError if unable to write to the cache file
136 136
    */
137 137
   function parse($hamleCode, \Closure $parseFunc = null) {
138
-    if(!$this->cacheFile)
138
+    if (!$this->cacheFile)
139 139
         $this->cacheFile = $this->setup->cachePath("string.hamle.php");
140
-    if($parseFunc)
140
+    if ($parseFunc)
141 141
       $parseFunc($this->parse);
142 142
     else
143 143
       $this->parse->str($hamleCode);
144 144
     $this->setup->debugLog("Loading Snippet Files");
145
-    foreach($this->snipFiles as $snip)
145
+    foreach ($this->snipFiles as $snip)
146 146
       $this->parse->parseSnip(file_get_contents($snip));
147 147
     $this->setup->debugLog("Applying Snippet Files");
148 148
     $this->parse->applySnip();
149 149
     $this->setup->debugLog("Executing Parse Filters");
150
-    foreach($this->setup->getFilters() as $filter)
150
+    foreach ($this->setup->getFilters() as $filter)
151 151
       $this->parse->parseFilter($filter);
152 152
     $this->setup->debugLog("Updating Cache File ({$this->cacheFile})");
153
-    if(FALSE === file_put_contents($this->cacheFile, $this->parse->output()))
153
+    if (FALSE === file_put_contents($this->cacheFile, $this->parse->output()))
154 154
       throw new Exception\ParseError(
155 155
                       "Unable to write to cache file ({$this->cacheFile})");
156 156
   }
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
    */
162 162
   function string($hamleString) {
163 163
     $md5 = md5($hamleString);
164
-    $stringId = substr($md5,0,12).substr($md5,24,8);
164
+    $stringId = substr($md5, 0, 12).substr($md5, 24, 8);
165 165
     $this->cacheFile = $this->setup->cachePath("string.$stringId.hamle.php");
166
-    if(!is_file($this->cacheFile))
166
+    if (!is_file($this->cacheFile))
167 167
       $this->parse($hamleString);
168 168
   }
169 169
 
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
       $baseModel = $this->baseModel;
180 180
       $this->baseModel = null;
181 181
       $currentModel = $baseModel == Scope::getTopScope();
182
-      if(!$currentModel && $baseModel) Scope::add($baseModel);
182
+      if (!$currentModel && $baseModel) Scope::add($baseModel);
183 183
       require $this->cacheFile;
184
-      if(!$currentModel && $baseModel) Scope::done();
184
+      if (!$currentModel && $baseModel) Scope::done();
185 185
       $this->baseModel = $baseModel;
186 186
       $out = ob_get_contents();
187 187
       ob_end_clean();
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
    * @return int The line number being passed by the parser
199 199
    */
200 200
   static function getLineNo() {
201
-    if(!isset(self::$me))
201
+    if (!isset(self::$me))
202 202
       return 0;
203 203
     return self::$me->parse->getLineNo();
204 204
   }
Please login to merge, or discard this patch.
php/hamle/Text/SimpleVar.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,26 +34,26 @@  discard block
 block discarded – undo
34 34
   protected $filter;
35 35
 
36 36
   function __construct($s) {
37
-    if(FALSE !== $pos = strpos($s,'|')) {
38
-      $this->var = substr($s,1,$pos-1);
39
-      $this->filter = new Filter(substr($s, $pos+1), $this);
37
+    if (FALSE !== $pos = strpos($s, '|')) {
38
+      $this->var = substr($s, 1, $pos - 1);
39
+      $this->filter = new Filter(substr($s, $pos + 1), $this);
40 40
     } else {
41 41
       $this->var = substr($s, 1);
42 42
     }
43 43
   }
44 44
 
45 45
   function toHTML($escape = false) {
46
-    if($escape)
47
-      return "<?=htmlspecialchars(" .$this->toPHP() . ")?>";
48
-    return "<?=" . $this->toPHP() . "?>";
46
+    if ($escape)
47
+      return "<?=htmlspecialchars(".$this->toPHP().")?>";
48
+    return "<?=".$this->toPHP()."?>";
49 49
   }
50 50
 
51 51
   function toPHP() {
52
-    return $this->filter?$this->filter->toPHP():$this->toPHPVar();
52
+    return $this->filter ? $this->filter->toPHP() : $this->toPHPVar();
53 53
   }
54 54
 
55 55
   function toPHPVar() {
56
-    return "Hamle\\Scope::get()->hamleGet(" . Text::varToCode($this->var) . ")";
56
+    return "Hamle\\Scope::get()->hamleGet(".Text::varToCode($this->var).")";
57 57
   }
58 58
 
59 59
   /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
    */
63 63
   function setValue($value) {
64 64
     $model = \Seufert\Hamle\Scope::get();
65
-    if(!$model instanceof WriteModel)
65
+    if (!$model instanceof WriteModel)
66 66
       throw new \RuntimeException('Can only write to model that implements WriteModel');
67 67
     $model->hamleSet($this->var, $value);
68 68
     return $model;
Please login to merge, or discard this patch.
php/hamle/Text/Complex.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
   protected $filter;
38 38
 
39 39
   function __construct($s) {
40
-    if(FALSE !== $pos = strpos($s,'|')) {
41
-      $this->filter = new Filter(substr($s, $pos+1), $this);
42
-      $s = substr($s,0,$pos);
40
+    if (FALSE !== $pos = strpos($s, '|')) {
41
+      $this->filter = new Filter(substr($s, $pos + 1), $this);
42
+      $s = substr($s, 0, $pos);
43 43
     }
44 44
     $s = preg_split("/-[>!]/", $s);
45 45
     // if(count($s) == 1) $s = explode("-!",$s[0]);
@@ -55,19 +55,19 @@  discard block
 block discarded – undo
55 55
   }
56 56
 
57 57
   function toHTML($escape = false) {
58
-    if($escape)
59
-      return "<?=htmlspecialchars(" .$this->toPHP() . ")?>";
60
-    return "<?=" . $this->toPHP() . "?>";
58
+    if ($escape)
59
+      return "<?=htmlspecialchars(".$this->toPHP().")?>";
60
+    return "<?=".$this->toPHP()."?>";
61 61
   }
62 62
   function toPHP() {
63
-    return $this->filter?$this->filter->toPHP():$this->toPHPVar();
63
+    return $this->filter ? $this->filter->toPHP() : $this->toPHPVar();
64 64
   }
65 65
   function toPHPVar() {
66 66
     if ($this->sel) {
67 67
       $sel = array();
68 68
       foreach ($this->sel as $s)
69 69
         $sel[] = "hamleGet('$s')";
70
-      return $this->func->toPHP() . "->" . implode('->', $sel);
70
+      return $this->func->toPHP()."->".implode('->', $sel);
71 71
     } else
72 72
       return $this->func->toPHP();
73 73
   }
Please login to merge, or discard this patch.
php/hamle/Text.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
   }
102 102
 
103 103
   function doEval() {
104
-    return eval('use Seufert\Hamle; return ' . $this->toPHP() . ';');
104
+    return eval('use Seufert\Hamle; return '.$this->toPHP().';');
105 105
   }
106 106
 
107 107
   static function varToCode($var) {
108 108
     if (is_array($var)) {
109 109
       $code = array();
110 110
       foreach ($var as $key => $value)
111
-        $code[] = self::varToCode($key) . "=>" . self::varToCode($value);
112
-      return 'array(' . implode(",", $code) . ')'; //remove unnecessary coma
111
+        $code[] = self::varToCode($key)."=>".self::varToCode($value);
112
+      return 'array('.implode(",", $code).')'; //remove unnecessary coma
113 113
     } elseif (is_bool($var)) {
114 114
       return ($var ? 'TRUE' : 'FALSE');
115 115
     } elseif (is_int($var) || is_float($var) || is_numeric($var)) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     } elseif ($var instanceof Text) {
118 118
       return $var->toPHP();
119 119
     } else {
120
-      return "'" . str_replace(array('$', "'"), array('\\$', "\\'"), $var) . "'";
120
+      return "'".str_replace(array('$', "'"), array('\\$', "\\'"), $var)."'";
121 121
     }
122 122
   }
123 123
 
Please login to merge, or discard this patch.