Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Merge pull request #3 from AyrtonRicardo/master
Browse files Browse the repository at this point in the history
Ajustes no dictionary
  • Loading branch information
italolelis committed Sep 5, 2014
2 parents f7961fb + 0c031a9 commit 2dc05dc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ composer.lock
/resources/cache/*
resources/cache
resources/cache/*
/build/
/build/

2 changes: 1 addition & 1 deletion src/Easy/Collections/ArrayList.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function offsetExists($offset)
public function offsetGet($offset)
{
if ($this->containsKey($offset) === false) {
throw new OutOfBoundsException('No element at position ' . $index);
throw new OutOfBoundsException('No element at position ' . $offset);
}

return $this->array[$offset];
Expand Down
3 changes: 2 additions & 1 deletion src/Easy/Collections/CollectionArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ public function matching(Criteria $criteria)
$filtered = array_filter($filtered, $filter);
}

if ($orderings = $criteria->getOrderings()) {
$orderings = $criteria->getOrderings();
if ($orderings) {
$next = null;
foreach (array_reverse($orderings) as $field => $ordering) {
$next = ClosureExpressionVisitor::sortByField($field, $ordering == 'DESC' ? -1 : 1, $next);
Expand Down
2 changes: 1 addition & 1 deletion src/Easy/Collections/Dictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function offsetExists($offset)
public function offsetGet($offset)
{
if ($this->containsKey($offset) === false) {
throw new OutOfBoundsException('No element at position ' . $index);
throw new OutOfBoundsException('No element at position ' . $offset);
}

if (is_object($offset)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Easy/Tests/Collections/DictionaryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ArrayObject;
use Easy\Collections\Dictionary;
use InvalidArgumentException;
use PHPUnit_Framework_Error_Notice;
use OutOfBoundsException;
use stdClass;

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testGetItem()
}

/**
* @expectedException PHPUnit_Framework_Error_Notice
* @expectedException OutOfBoundsException
*/
public function testGetInvalidItem()
{
Expand Down

0 comments on commit 2dc05dc

Please sign in to comment.