Skip to content

Commit

Permalink
Fixed CS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 9, 2014
1 parent 689f689 commit 4d80011
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Collection/CollectionTrait.php
Expand Up @@ -19,10 +19,10 @@
use Cake\Collection\Collection; use Cake\Collection\Collection;
use Cake\Collection\Iterator\ExtractIterator; use Cake\Collection\Iterator\ExtractIterator;
use Cake\Collection\Iterator\FilterIterator; use Cake\Collection\Iterator\FilterIterator;
use Cake\Collection\Iterator\InsertIterator;
use Cake\Collection\Iterator\MapReduce; use Cake\Collection\Iterator\MapReduce;
use Cake\Collection\Iterator\ReplaceIterator; use Cake\Collection\Iterator\ReplaceIterator;
use Cake\Collection\Iterator\SortIterator; use Cake\Collection\Iterator\SortIterator;
use Cake\Collection\Iterator\InsertIterator;
use LimitIterator; use LimitIterator;


/** /**
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/Association.php
Expand Up @@ -435,7 +435,7 @@ public function attachTo(Query $query, array $options = []) {
$joinOptions = ['table' => 1, 'conditions' => 1, 'type' => 1]; $joinOptions = ['table' => 1, 'conditions' => 1, 'type' => 1];
$options['conditions']->add($dummy->clause('where') ?: []); $options['conditions']->add($dummy->clause('where') ?: []);
$query->join([$target->alias() => array_intersect_key($options, $joinOptions)]); $query->join([$target->alias() => array_intersect_key($options, $joinOptions)]);

$this->_appendFields($query, $dummy, $options); $this->_appendFields($query, $dummy, $options);
$this->_formatAssociationResults($query, $dummy, $options); $this->_formatAssociationResults($query, $dummy, $options);
$this->_bindNewAssociations($query, $dummy, $options); $this->_bindNewAssociations($query, $dummy, $options);
Expand Down Expand Up @@ -540,7 +540,7 @@ protected function _formatAssociationResults($query, $surrogate, $options) {
if (!$formatters) { if (!$formatters) {
return; return;
} }

$property = $options['propertyPath']; $property = $options['propertyPath'];
$query->formatResults(function($results) use ($formatters, $property){ $query->formatResults(function($results) use ($formatters, $property){
$extracted = $results->extract($property)->compile(); $extracted = $results->extract($property)->compile();
Expand Down
3 changes: 1 addition & 2 deletions tests/TestCase/ORM/Association/BelongsToManyTest.php
Expand Up @@ -775,7 +775,7 @@ public function testEagerLoaderMultipleKeys() {
$this->article->primaryKey(['id', 'site_id']); $this->article->primaryKey(['id', 'site_id']);
$this->tag->primaryKey(['id', 'site_id']); $this->tag->primaryKey(['id', 'site_id']);


$table= TableRegistry::get('ArticlesTags'); $table = TableRegistry::get('ArticlesTags');
$table->schema([ $table->schema([
'article_id' => ['type' => 'integer'], 'article_id' => ['type' => 'integer'],
'tag_id' => ['type' => 'integer'], 'tag_id' => ['type' => 'integer'],
Expand Down Expand Up @@ -1540,5 +1540,4 @@ public function testAttachToBeforeFindExtraOptions() {
}]); }]);
} }



} }
6 changes: 3 additions & 3 deletions tests/TestCase/ORM/EagerLoaderTest.php
Expand Up @@ -358,17 +358,17 @@ public function testNormalizedPath() {
$this->assertEquals('clients', $normalized['clients']['aliasPath']); $this->assertEquals('clients', $normalized['clients']['aliasPath']);
$this->assertEquals('client', $normalized['clients']['propertyPath']); $this->assertEquals('client', $normalized['clients']['propertyPath']);


$assocs = $normalized['clients']['associations']; $assocs = $normalized['clients']['associations'];
$this->assertEquals('clients.orders', $assocs['orders']['aliasPath']); $this->assertEquals('clients.orders', $assocs['orders']['aliasPath']);
$this->assertEquals('client.order', $assocs['orders']['propertyPath']); $this->assertEquals('client.order', $assocs['orders']['propertyPath']);


$assocs = $assocs['orders']['associations']; $assocs = $assocs['orders']['associations'];
$this->assertEquals('clients.orders.orderTypes', $assocs['orderTypes']['aliasPath']); $this->assertEquals('clients.orders.orderTypes', $assocs['orderTypes']['aliasPath']);
$this->assertEquals('client.order.order_type', $assocs['orderTypes']['propertyPath']); $this->assertEquals('client.order.order_type', $assocs['orderTypes']['propertyPath']);
$this->assertEquals('clients.orders.stuff', $assocs['stuff']['aliasPath']); $this->assertEquals('clients.orders.stuff', $assocs['stuff']['aliasPath']);
$this->assertEquals('client.order.stuff', $assocs['stuff']['propertyPath']); $this->assertEquals('client.order.stuff', $assocs['stuff']['propertyPath']);


$assocs = $assocs['stuff']['associations']; $assocs = $assocs['stuff']['associations'];
$this->assertEquals( $this->assertEquals(
'clients.orders.stuff.stuffTypes', 'clients.orders.stuff.stuffTypes',
$assocs['stuffTypes']['aliasPath'] $assocs['stuffTypes']['aliasPath']
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/ORM/QueryTest.php
Expand Up @@ -1606,7 +1606,7 @@ public function testFormatBelongsToRecords() {
}); });
}); });
}]); }]);

$query->formatResults(function($results) { $query->formatResults(function($results) {
return $results->combine('id', 'author.idCopy'); return $results->combine('id', 'author.idCopy');
}); });
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Helper/PaginatorHelperTest.php
Expand Up @@ -755,7 +755,7 @@ public function testDefaultSortRemovedFromUrl() {
$result = $this->Paginator->next('Next'); $result = $this->Paginator->next('Next');
$expected = array( $expected = array(
'li' => array('class' => 'next'), 'li' => array('class' => 'next'),
'a' => array('rel' => 'next', 'href' => '/articles/index?page=2'), 'a' => array('rel' => 'next', 'href' => '/articles/index?page=2'),
'Next', 'Next',
'/a', '/a',
'/li' '/li'
Expand Down

0 comments on commit 4d80011

Please sign in to comment.