Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hasMedia method signature compatible with getMedia in InteractsWithMedia #3712

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

sten
Copy link
Contributor

@sten sten commented Sep 27, 2024

The $filters arg of hasMedia does not allow the callable type, while it just calls getMedia which does allow it.

public function hasMedia(string $collectionName = 'default', array $filters = []): bool
    {
        return count($this->getMedia($collectionName, $filters)) ? true : false;
    }

    /**
     * Get media collection by its collectionName.
     */
    public function getMedia(string $collectionName = 'default', array|callable $filters = []): MediaCollections\Models\Collections\MediaCollection
    { 
//omitted 
    }

…ithMedia.php

The $filters arg of hasMedia does not allow the callable type, while it just calls getMedia which does allow it.
@timvandijck
Copy link
Member

Good spot. Thank you!

@timvandijck timvandijck merged commit dc28567 into spatie:main Oct 18, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants