Skip to content

Commit

Permalink
rename exception
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jan 10, 2016
1 parent 3f81d4e commit 1b5997e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

All Notable changes to `laravel-medialibrary` will be documented in this file

#3.12.2
- Removed support for laravel-glide v3
- Added missing `InvalidNewOrder`-exception

#3.12.1
*Important node: there is a bug in this version that prevents the creation
of derived files*
- Add support for laravel-glide v3

#3.12.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"illuminate/console": "^5.1",
"illuminate/database": "^5.1",
"illuminate/support": "^5.1",
"spatie/laravel-glide": "^2.2.4|^3.0",
"spatie/laravel-glide": "^2.2.4",
"spatie/pdf-to-image": "^1.0",
"spatie/string": "^2.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

use Exception;

class SortableException extends Exception
class InvalidNewOrder extends Exception
{
}
6 changes: 3 additions & 3 deletions src/SortableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Spatie\MediaLibrary;

use Spatie\MediaLibrary\Exceptions\SortableException;
use Spatie\MediaLibrary\Exceptions\InvalidNewOrder;

trait SortableTrait
{
Expand Down Expand Up @@ -46,12 +46,12 @@ public function scopeOrdered(\Illuminate\Database\Eloquent\Builder $query)
* @param array $ids
* @param int $startOrder
*
* @throws SortableException
* @throws InvalidNewOrder
*/
public static function setNewOrder($ids, $startOrder = 1)
{
if (!is_array($ids)) {
throw new SortableException('You must pass an array to setNewOrder');
throw new InvalidNewOrder('You must pass an array to setNewOrder');
}
foreach ($ids as $id) {
$model = static::find($id);
Expand Down

0 comments on commit 1b5997e

Please sign in to comment.