interface_exists does not work how I expected, switch to is_subclass_of

This commit is contained in:
Dane Everitt 2017-09-30 12:06:16 -05:00
parent 048784607d
commit 238ce435d6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 12 additions and 1 deletions

View file

@ -187,7 +187,7 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
public function all()
{
$instance = $this->getBuilder();
if (interface_exists(SearchableInterface::class)) {
if (is_subclass_of(get_called_class(), SearchableInterface::class)) {
$instance = $instance->search($this->searchTerm);
}