This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
12
{
13
/**
14
* @var Collection
15
*/
16
protected $fields;
17
18
/**
19
* @var int
20
*/
21
protected $width;
22
23
/**
24
* Column constructor.
25
*
26
* @param int $width
27
*/
28
public function __construct($width = 12)
29
{
30
$this->width = $width;
31
$this->fields = new Collection();
32
}
33
34
/**
35
* Add a filter to this column.
36
*
37
* @param Field $field
38
*/
39
public function add(Field $field)
40
{
41
$this->fields->push($field);
42
}
43
44
/**
45
* Remove fields from column.
46
*
47
* @param $fields
48
*/
49
public function removeFields($fields)
50
{
51
$this->fields = $this->fields->reject(function (Field $field) use ($fields) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.