@@ -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 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function configureOptions(OptionsResolver $options) |
50 | 50 | { |
51 | 51 | $options->setDefault('data_class', StringFilterData::class); |
52 | - $options->setDefault('empty_data', function (FormInterface $form) { |
|
52 | + $options->setDefault('empty_data', function(FormInterface $form) { |
|
53 | 53 | return new BooleanFilterData( |
54 | 54 | $form->get('value')->getData() |
55 | 55 | ); |
@@ -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 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $options->setDefault('comparators', array_keys(self::$comparatorMap)); |
79 | 79 | $options->setDefault('data_class', StringFilterData::class); |
80 | - $options->setDefault('empty_data', function (FormInterface $form) { |
|
80 | + $options->setDefault('empty_data', function(FormInterface $form) { |
|
81 | 81 | return new StringFilterData( |
82 | 82 | $form->get('comparator')->getData(), |
83 | 83 | $form->get('value')->getData() |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | |
88 | 88 | private function getChoices(array $supportedComparators, array $enabledComparators) |
89 | 89 | { |
90 | - $supported = array_keys(array_filter(self::$comparatorMap, function ($comparator) use ($supportedComparators) { |
|
90 | + $supported = array_keys(array_filter(self::$comparatorMap, function($comparator) use ($supportedComparators) { |
|
91 | 91 | return in_array($comparator, $supportedComparators); |
92 | 92 | })); |
93 | 93 | |
94 | - $supported = array_filter($supported, function ($comparator) use ($enabledComparators) { |
|
94 | + $supported = array_filter($supported, function($comparator) use ($enabledComparators) { |
|
95 | 95 | return in_array($comparator, $enabledComparators); |
96 | 96 | }); |
97 | 97 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | case self::TYPE_NOT_EMPTY: |
109 | 109 | return null; |
110 | 110 | case self::TYPE_CONTAINS: |
111 | - return '%' . $value . '%'; |
|
111 | + return '%'.$value.'%'; |
|
112 | 112 | case self::TYPE_NOT_CONTAINS: |
113 | - return '%' . $value . '%'; |
|
113 | + return '%'.$value.'%'; |
|
114 | 114 | case self::TYPE_STARTS_WITH: |
115 | - return $value . '%'; |
|
115 | + return $value.'%'; |
|
116 | 116 | case self::TYPE_ENDS_WITH: |
117 | - return '%' . $value; |
|
117 | + return '%'.$value; |
|
118 | 118 | case self::TYPE_IN: |
119 | 119 | return array_map('trim', explode(',', $value)); |
120 | 120 | case self::TYPE_NOT_IN: |
@@ -6,7 +6,6 @@ |
||
6 | 6 | |
7 | 7 | use Psi\Component\Grid\FilterDataInterface; |
8 | 8 | use Psi\Component\Grid\FilterInterface; |
9 | -use Psi\Component\ObjectAgent\Capabilities; |
|
10 | 9 | use Psi\Component\ObjectAgent\Query\Comparison; |
11 | 10 | use Psi\Component\ObjectAgent\Query\Expression; |
12 | 11 | use Psi\Component\ObjectAgent\Query\Query; |
@@ -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 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $options->setDefault('comparators', self::$validComparators); |
67 | 67 | $options->setDefault('data_class', StringFilterData::class); |
68 | - $options->setDefault('empty_data', function (FormInterface $form) { |
|
68 | + $options->setDefault('empty_data', function(FormInterface $form) { |
|
69 | 69 | return new StringFilterData( |
70 | 70 | $form->get('comparator')->getData(), |
71 | 71 | $form->get('value')->getData() |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | |
76 | 76 | private function getChoices(array $supportedComparators, array $enabledComparators) |
77 | 77 | { |
78 | - $supported = array_filter(self::$validComparators, function ($comparator) use ($supportedComparators) { |
|
78 | + $supported = array_filter(self::$validComparators, function($comparator) use ($supportedComparators) { |
|
79 | 79 | return in_array($comparator, $supportedComparators); |
80 | 80 | }); |
81 | 81 | |
82 | - $supported = array_filter($supported, function ($comparator) use ($enabledComparators) { |
|
82 | + $supported = array_filter($supported, function($comparator) use ($enabledComparators) { |
|
83 | 83 | return in_array($comparator, $enabledComparators); |
84 | 84 | }); |
85 | 85 |
@@ -6,7 +6,6 @@ |
||
6 | 6 | |
7 | 7 | use Psi\Component\Grid\FilterDataInterface; |
8 | 8 | use Psi\Component\Grid\FilterInterface; |
9 | -use Psi\Component\ObjectAgent\Capabilities; |
|
10 | 9 | use Psi\Component\ObjectAgent\Query\Comparison; |
11 | 10 | use Psi\Component\ObjectAgent\Query\Expression; |
12 | 11 | use Psi\Component\ObjectAgent\Query\Query; |
@@ -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\Cell; |
6 | 6 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $options->setDefault('property', null); |
28 | 28 | $options->setAllowedTypes('property', ['string', 'null']); |
29 | - $options->setNormalizer('property', function (OptionsResolver $options, $value) { |
|
29 | + $options->setNormalizer('property', function(OptionsResolver $options, $value) { |
|
30 | 30 | if (null !== $value) { |
31 | 31 | return $value; |
32 | 32 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | -declare(strict_types=1); |
|
5 | +declare(strict_types = 1); |
|
6 | 6 | |
7 | 7 | namespace Psi\Component\Grid\Cell; |
8 | 8 |
@@ -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 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public function __construct($name, array $grids) |
14 | 14 | { |
15 | 15 | parent::__construct($name); |
16 | - array_map(function (GridMetadata $grid) { |
|
16 | + array_map(function(GridMetadata $grid) { |
|
17 | 17 | }, $grids); |
18 | 18 | |
19 | 19 | $this->grids = $grids; |
@@ -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 | |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | $expressions[] = $filter->getExpression($field, $filterData); |
75 | 75 | } |
76 | 76 | |
77 | - return new Composite(Composite::AND, $expressions); |
|
77 | + return new Composite(Composite:: AND , $expressions); |
|
78 | 78 | } |
79 | 79 | } |
@@ -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 | |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | $options = array_merge($defaults, $options); |
31 | - $orderings = array_map(function ($order) { |
|
31 | + $orderings = array_map(function($order) { |
|
32 | 32 | $order = strtolower($order); |
33 | 33 | |
34 | - if (false === in_array($order, [ 'asc', 'desc' ])) { |
|
34 | + if (false === in_array($order, ['asc', 'desc'])) { |
|
35 | 35 | throw new \InvalidArgumentException(sprintf( |
36 | 36 | 'Order must be either "asc" or "desc" got "%s"', |
37 | 37 | $order |
@@ -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 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function getHeaders() |
30 | 30 | { |
31 | 31 | $headers = []; |
32 | - foreach(array_keys($this->gridMetadata->getColumns()) as $headerName) { |
|
32 | + foreach (array_keys($this->gridMetadata->getColumns()) as $headerName) { |
|
33 | 33 | $sort = null; |
34 | 34 | if (isset($this->orderings[$headerName])) { |
35 | 35 | $sort = $this->orderings[$headerName]; |