for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace DevMakerLab\LaravelFilters;
use Illuminate\Database\Query\Builder;
abstract class AbstractFilter
{
public function __construct(array $args = [])
$this->setAttributes($args);
}
protected function setAttributes(array $attributes): void
foreach (get_class_vars(static::class) as $key => $value) {
if (isset($attributes[$key])) {
$this->$key = $attributes[$key];
public static function isApplicable(... $args): bool
$args
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public static function isApplicable(/** @scrutinizer ignore-unused */ ... $args): bool
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return true;
/**
* @throws NoApplyFilterRuleException
*/
public function apply(Builder $queryBuilder): void
$queryBuilder
public function apply(/** @scrutinizer ignore-unused */ Builder $queryBuilder): void
throw new NoApplyFilterRuleException(self::class);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.