Permalink
Browse files

Fix whitespace and remove duplicate method calls.

  • Loading branch information...
1 parent eeec362 commit 15c94dee4dbab5a5e1710e980f20b47509e392bb @markstory markstory committed Apr 7, 2012
Showing with 10 additions and 6 deletions.
  1. +8 −4 lib/Cake/Model/Permission.php
  2. +2 −2 lib/Cake/Test/Case/Utility/HashTest.php
@@ -223,13 +223,17 @@ public function getAclLink($aro, $aco) {
if (empty($obj['Aro']) || empty($obj['Aco'])) {
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(
- 'aro' => current(Hash::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id')),
- 'aco' => current(Hash::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id')),
+ 'aro' => $aro,
+ 'aco' => $aco,
'link' => $this->find('all', array('conditions' => array(
- $this->alias . '.aro_id' => current(Hash::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id')),
- $this->alias . '.aco_id' => current(Hash::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id'))
+ $this->alias . '.aro_id' => $aro,
+ $this->alias . '.aco_id' => $aco
)))
);
}
@@ -1044,8 +1044,8 @@ public function testSortNumeric() {
*/
public function testSortNatural() {
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(
array('Item' => array('image' => 'img1.jpg')),
array('Item' => array('image' => 'img99.jpg')),

0 comments on commit 15c94de

Please sign in to comment.