for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Napp\Core\Dbal\Criteria;
class WithSearchQueryCriterion implements CriterionInterface
{
/** @var string */
protected $searchQuery;
/** @var array */
protected $field;
/**
* WithSearchQueryCriterion constructor.
*
* @param string $searchQuery
* @param string|null $field
*/
public function __construct(string $searchQuery, string $field = null)
$this->searchQuery = $searchQuery;
$this->field = $field;
$field
null
string
array
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
public function apply($query)
if (null === $this->field) {
return $query;
$query->getQuery()->where($this->field, 'LIKE', '%'.$this->searchQuery.'%');
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..