@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Metadata; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid; |
6 | 6 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $options = array_merge($defaults, $options); |
33 | 33 | |
34 | 34 | // normalize the orderings |
35 | - $options['orderings'] = array_map(function ($order) { |
|
35 | + $options['orderings'] = array_map(function($order) { |
|
36 | 36 | $order = strtolower($order); |
37 | 37 | |
38 | 38 | if (false === in_array($order, ['asc', 'desc'])) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Metadata; |
6 | 6 | |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | { |
18 | 18 | parent::__construct($name); |
19 | 19 | |
20 | - array_map(function (GridMetadata $grid) { |
|
20 | + array_map(function(GridMetadata $grid) { |
|
21 | 21 | $grid->attachClassMetadata($this); |
22 | 22 | }, $grids); |
23 | - array_map(function (QueryMetadata $query) { |
|
23 | + array_map(function(QueryMetadata $query) { |
|
24 | 24 | }, $queries); |
25 | 25 | |
26 | 26 | $this->grids = $grids; |
@@ -11,6 +11,9 @@ |
||
11 | 11 | private $grids; |
12 | 12 | private $queries; |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $name |
|
16 | + */ |
|
14 | 17 | public function __construct($name, array $grids, array $queries = []) |
15 | 18 | { |
16 | 19 | parent::__construct($name); |
@@ -69,6 +69,9 @@ discard block |
||
69 | 69 | return $this; |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param string $alias |
|
74 | + */ |
|
72 | 75 | public function addAction(ActionInterface $action, $alias = null): self |
73 | 76 | { |
74 | 77 | $this->actions[$alias] = $action; |
@@ -76,6 +79,9 @@ discard block |
||
76 | 79 | return $this; |
77 | 80 | } |
78 | 81 | |
82 | + /** |
|
83 | + * @param string $alias |
|
84 | + */ |
|
79 | 85 | public function addFilter(FilterInterface $filter, $alias = null) |
80 | 86 | { |
81 | 87 | $this->filters[$alias] = $filter; |
@@ -83,6 +89,9 @@ discard block |
||
83 | 89 | return $this; |
84 | 90 | } |
85 | 91 | |
92 | + /** |
|
93 | + * @param string $alias |
|
94 | + */ |
|
86 | 95 | public function addColumn(ColumnInterface $column, $alias = null) |
87 | 96 | { |
88 | 97 | $this->columns[$alias] = $column; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Filter; |
6 | 6 | |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | private function getChoices(array $supportedComparators, array $enabledComparators) |
35 | 35 | { |
36 | - $supported = array_keys(array_filter($this->getComparatorMap(), function ($comparator) use ($supportedComparators) { |
|
36 | + $supported = array_keys(array_filter($this->getComparatorMap(), function($comparator) use ($supportedComparators) { |
|
37 | 37 | return in_array($comparator, $supportedComparators); |
38 | 38 | })); |
39 | 39 | |
40 | - $supported = array_filter($supported, function ($comparator) use ($enabledComparators) { |
|
40 | + $supported = array_filter($supported, function($comparator) use ($enabledComparators) { |
|
41 | 41 | return in_array($comparator, $enabledComparators); |
42 | 42 | }); |
43 | 43 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Filter; |
6 | 6 | |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | case self::TYPE_NOT_EMPTY: |
94 | 94 | return; |
95 | 95 | case self::TYPE_CONTAINS: |
96 | - return '%' . $value . '%'; |
|
96 | + return '%'.$value.'%'; |
|
97 | 97 | case self::TYPE_NOT_CONTAINS: |
98 | - return '%' . $value . '%'; |
|
98 | + return '%'.$value.'%'; |
|
99 | 99 | case self::TYPE_STARTS_WITH: |
100 | - return $value . '%'; |
|
100 | + return $value.'%'; |
|
101 | 101 | case self::TYPE_ENDS_WITH: |
102 | - return '%' . $value; |
|
102 | + return '%'.$value; |
|
103 | 103 | case self::TYPE_IN: |
104 | 104 | return array_map('trim', explode(',', $value)); |
105 | 105 | case self::TYPE_NOT_IN: |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid; |
6 | 6 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | throw new \InvalidArgumentException(sprintf( |
53 | - 'Invalid filter form: ' . implode(', ', $message) |
|
53 | + 'Invalid filter form: '.implode(', ', $message) |
|
54 | 54 | )); |
55 | 55 | } |
56 | 56 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $criteria['criteria'] = $query->getExpression(); |
73 | 73 | } else { |
74 | 74 | // filter and user criterias need to be combined |
75 | - $criteria['criteria'] = new Composite(Composite::AND, [$query->getExpression(), $criteria['criteria']]); |
|
75 | + $criteria['criteria'] = new Composite(Composite:: AND , [$query->getExpression(), $criteria['criteria']]); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Column; |
6 | 6 |