Browse Source

refactoring query compiler.

Taylor Otwell 12 years ago
parent
commit
25c78b8c55
3 changed files with 3 additions and 3 deletions
  1. 1 0
      .gitignore
  2. 1 0
      gitflow
  3. 1 3
      laravel/db/query/compiler.php

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+gitflow/*

+ 1 - 0
gitflow

@@ -0,0 +1 @@
+Subproject commit be5dabf88e98075b9bc936bfa7de0f54a21a0482

+ 1 - 3
laravel/db/query/compiler.php

@@ -31,9 +31,7 @@ class Compiler {
 			if ( ! is_null($query->$clause)) $sql[] = call_user_func(array($this, 'compile_'.$clause), $query->$clause);
 		}
 
-		foreach ($sql as $key => $value) { if (is_null($value) or (string) $value === '') unset($sql[$key]); }
-
-		return implode(' ', $sql);
+		return implode(' ', array_filter($sql, function($value) { return ! is_null($value) and (string) $value !== ''; }));
 	}
 
 	/**