Permalink
Browse files

General code cleanup

  • Loading branch information...
1 parent 814cc84 commit 3f15243858687b2f30e8af2cfd85b4836b631857 @lorenzo lorenzo committed Jan 16, 2014
@@ -137,20 +137,20 @@ protected function _stringExpression($generator) {
$value = $this->_flattenValue($this->_value, $generator, $type);
} else {
$template = '%s %s %s';
- $value = $this->_bindValue($generator, $this->_value, $this->_type);
+ $value = $this->_bindValue($this->_value, $generator, $this->_type);
}
return [$template, $value];
}
/**
* Registers a value in the placeholder generator and returns the generated placeholder
*
- * @param ValueBinder $generator
* @param mixed $value
+ * @param ValueBinder $generator
* @param string $type
* @return string generated placeholder
*/
- protected function _bindValue($generator, $value, $type) {
+ protected function _bindValue($value, $generator, $type) {
$placeholder = $generator->placeholder($this->_field);
$generator->bind($placeholder, $value, $type);
return $placeholder;
@@ -168,7 +168,7 @@ protected function _bindValue($generator, $value, $type) {
protected function _flattenValue($value, $generator, $type = null) {
$parts = [];
foreach ($value as $k => $v) {
- $parts[] = $this->_bindValue($generator, $v, $type);
+ $parts[] = $this->_bindValue($v, $generator, $type);
}
return implode(',', $parts);
}
@@ -19,7 +19,7 @@
use Cake\Database\ValueBinder;
/**
- * This expression represents SQL fragments that are use for comparing one tuple
+ * This expression represents SQL fragments that are used for comparing one tuple
* to another, one tuple to a set of other tuples or one tuple to an expression
*/
class TupleComparison extends Comparison {
@@ -101,7 +101,7 @@ protected function _stringifyValues($generator) {
continue;
}
- $type = $valType = $multiType && isset($type[$i]) ? $type[$i] : $type;
+ $valType = $multiType && isset($type[$i]) ? $type[$i] : $type;
$values[] = $this->_bindValue($generator, $value, $valType);
}
@@ -127,7 +127,7 @@ protected function _bindValue($generator, $value, $type) {
* Traverses the tree of expressions stored in this object, visiting first
* expressions in the left hand side and then the rest.
*
- * Callback function receives as its only argument an instance of an ExpresisonInterface
+ * Callback function receives as its only argument an instance of an ExpressoinInterface
*
* @param callable $callable
* @return void
@@ -145,7 +145,6 @@ public function traverse(callable $callable) {
}
foreach ($value as $i => $value) {
- $type = isset($this->_type[$i]) ? $this->_type[$i] : null;
if ($this->isMulti()) {
foreach ($value as $v) {
$this->_traverseValue($v, $callable);
@@ -128,7 +128,7 @@ public function transformRow($row) {
protected function _joinCondition(array $options) {
$conditions = [];
$tAlias = $this->target()->alias();
- $sAlias = $this->_sourceTable->alias();
+ $sAlias = $this->sourceTable()->alias();
$foreignKey = (array)$options['foreignKey'];
$primaryKey = (array)$this->_sourceTable->primaryKey();
@@ -160,7 +160,7 @@ public function testConvertColumn($type, $expected) {
*
* @return void
*/
- public function testConvertCompositPrimaryKey() {
+ public function testConvertCompositePrimaryKey() {
$driver = $this->getMock('Cake\Database\Driver\Sqlite');
$dialect = new SqliteSchema($driver);

0 comments on commit 3f15243

Please sign in to comment.