for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ONGR\FilterManagerBundle\Filter\Widget;
use ONGR\FilterManagerBundle\Filter\FilterInterface;
use ONGR\FilterManagerBundle\Filter\FilterState;
use ONGR\FilterManagerBundle\Filter\Relation\RelationAwareTrait;
use Symfony\Component\HttpFoundation\Request;
/**
* This class generalises filters using single field value from request.
abstract class AbstractSingleRequestValueFilter implements FilterInterface
{
use RelationAwareTrait;
* @var string
private $requestField;
* @var array
private $tags = [];
* {@inheritdoc}
public function getState(Request $request)
$state = new FilterState();
$value = $request->get($this->getRequestField());
if (isset($value) && $value !== '') {
$value = is_array($value) ? array_values($value) : $value;
$state->setActive(true);
$state->setValue($value);
$state->setUrlParameters([$this->getRequestField() => $value]);
}
return $state;
* @return string
public function getRequestField()
return $this->requestField;
* @param string $requestField
public function setRequestField($requestField)
$this->requestField = $requestField;
public function getTags()
return $this->tags;
* @param string $tags
public function setTags($tags)
$this->tags = $tags;
$tags
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..
public function isRelated()
return false;
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..