for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sco\Admin\View\Extensions;
use Illuminate\Database\Eloquent\Builder;
use Sco\Admin\Contracts\View\Filters\FilterInterface;
class Filters extends Extension
{
public function add($value)
if (!($value instanceof FilterInterface)) {
throw new \InvalidArgumentException(
sprintf(
'filter must be %s',
FilterInterface::class
)
);
}
public function getActive()
$this->filter(function (FilterInterface $filter) {
return $filter->isActive();
});
public function apply(Builder $query)
$this->getActive()->each(function (FilterInterface $filter) use ($query) {
each
$this->getActive()
null
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
$filter->apply($query);
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.