Skip to content

Commit

Permalink
correct typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jul 13, 2015
1 parent 3b8eb96 commit 6860ef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

##2.1.1
- Bugfix: correct typehint in HasMediaTrait

##2.1.0
- Added some convenience methods for some frequent used manipulations

Expand Down
4 changes: 2 additions & 2 deletions src/HasMediaTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ public function updateMedia(array $newMediaArray, $collectionName = 'default')
protected function removeMediaItemsNotPresentInArray(array $newMediaArray, $collectionName = 'default')
{
$this->getMedia($collectionName, [])
->filter(function (HasMedia $currentMediaItem) use ($newMediaArray) {
->filter(function (Media $currentMediaItem) use ($newMediaArray) {
return !in_array($currentMediaItem->id, collect($newMediaArray)->lists('id')->toArray());
})
->map(function (HasMedia $media) {
->map(function (Media $media) {
$media->delete();
});
}
Expand Down

0 comments on commit 6860ef3

Please sign in to comment.