Skip to content

Commit

Permalink
Fix whitespace and remove duplicate method calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 7, 2012
1 parent eeec362 commit 15c94de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions lib/Cake/Model/Permission.php
Expand Up @@ -223,13 +223,17 @@ public function getAclLink($aro, $aco) {
if (empty($obj['Aro']) || empty($obj['Aco'])) { if (empty($obj['Aro']) || empty($obj['Aco'])) {
return false; return false;
} }
$aro = Hash::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id');
$aco = Hash::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id');
$aro = current($aro);
$aco = current($aco);


return array( return array(
'aro' => current(Hash::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id')), 'aro' => $aro,
'aco' => current(Hash::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id')), 'aco' => $aco,
'link' => $this->find('all', array('conditions' => array( 'link' => $this->find('all', array('conditions' => array(
$this->alias . '.aro_id' => current(Hash::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id')), $this->alias . '.aro_id' => $aro,
$this->alias . '.aco_id' => current(Hash::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id')) $this->alias . '.aco_id' => $aco
))) )))
); );
} }
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/HashTest.php
Expand Up @@ -1044,8 +1044,8 @@ public function testSortNumeric() {
*/ */
public function testSortNatural() { public function testSortNatural() {
if (version_compare(PHP_VERSION, '5.4.0', '<')) { if (version_compare(PHP_VERSION, '5.4.0', '<')) {
$this->markTestSkipped('SORT_NATURAL is available since PHP 5.4.'); $this->markTestSkipped('SORT_NATURAL is available since PHP 5.4.');
} }
$items = array( $items = array(
array('Item' => array('image' => 'img1.jpg')), array('Item' => array('image' => 'img1.jpg')),
array('Item' => array('image' => 'img99.jpg')), array('Item' => array('image' => 'img99.jpg')),
Expand Down

0 comments on commit 15c94de

Please sign in to comment.