for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Neimheadh\SonataAnnotationBundle\Annotation\Sonata;
use Attribute;
use Neimheadh\SonataAnnotationBundle\Annotation\AbstractField;
use Neimheadh\SonataAnnotationBundle\Annotation\PositionAnnotationInterface;
use ReflectionException;
/**
* Datagrid field annotation.
*
* Allow you to configure the datagrid for the annotated field.
* @Annotation
* @Target("PROPERTY")
* @author Marko Kunic <[email protected]>
* @author Mathieu Wambre <[email protected]>
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
class DatagridField extends AbstractField implements PositionAnnotationInterface
{
* Filtering options.
* @var array
public array $filterOptions = [];
* Datagrid form field type options.
public array $fieldOptions = [];
* {@inheritDoc}
* @param array $filterOptions Filtering options.
* @param array $fieldOptions Datagrid form field type options.
* @throws ReflectionException
public function __construct(
$type = null,
array $fieldDescriptionOptions = [],
?int $position = null,
array $filterOptions = [],
$filterOptions
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
/** @scrutinizer ignore-unused */ array $filterOptions = [],
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
array $fieldOptions = []
) {
$this->filterOptions = $fieldOptions;
$this->fieldOptions = $fieldOptions;
parent::__construct($type, $fieldDescriptionOptions, $position);
}
* Get field settings.
* @return array
public function getSettings(): array
return [
$this->type,
$this->filterOptions,
$this->fieldOptions,
$this->fieldDescriptionOptions,
];
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.