@@ -9,6 +9,9 @@ |
||
9 | 9 | { |
10 | 10 | private $grids; |
11 | 11 | |
12 | + /** |
|
13 | + * @param string $name |
|
14 | + */ |
|
12 | 15 | public function __construct($name, array $grids) |
13 | 16 | { |
14 | 17 | parent::__construct($name); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | public function __construct($name, array $grids) |
13 | 13 | { |
14 | 14 | parent::__construct($name); |
15 | - array_map(function (GridMetadata $grid) { |
|
15 | + array_map(function(GridMetadata $grid) { |
|
16 | 16 | }, $grids); |
17 | 17 | |
18 | 18 | $this->grids = $grids; |
@@ -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\Cell; |
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\Cell; |
6 | 6 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | $options->setDefault('property', null); |
26 | 26 | $options->setAllowedTypes('property', ['string', 'null']); |
27 | - $options->setNormalizer('property', function (OptionsResolver $options, $value) { |
|
27 | + $options->setNormalizer('property', function(OptionsResolver $options, $value) { |
|
28 | 28 | if (null !== $value) { |
29 | 29 | return $value; |
30 | 30 | } |
@@ -4,20 +4,14 @@ |
||
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Filter; |
6 | 6 | |
7 | -use Psi\Component\ObjectAgent\Capabilities; |
|
8 | 7 | use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
9 | -use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
10 | -use Symfony\Component\Form\Extension\Core\Type\FormType; |
|
11 | 8 | use Symfony\Component\Form\FormBuilderInterface; |
12 | -use Psi\Component\Grid\Metadata\GridMetadata; |
|
13 | 9 | use Psi\Component\ObjectAgent\Query\Comparison; |
14 | 10 | use Psi\Component\ObjectAgent\Query\Query; |
15 | 11 | use Psi\Component\Grid\FilterInterface; |
16 | 12 | use Psi\Component\ObjectAgent\Query\Expression; |
17 | 13 | use Symfony\Component\OptionsResolver\OptionsResolver; |
18 | 14 | use Symfony\Component\Form\FormInterface; |
19 | -use Symfony\Component\Form\AbstractType; |
|
20 | -use Symfony\Component\Validator\Constraints\NotNull; |
|
21 | 15 | use Psi\Component\Grid\FilterDataInterface; |
22 | 16 | use Symfony\Component\Form\Extension\Core\Type\NumberType; |
23 | 17 |
@@ -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 |
@@ -4,20 +4,15 @@ |
||
4 | 4 | |
5 | 5 | namespace Psi\Component\Grid\Filter; |
6 | 6 | |
7 | -use Psi\Component\ObjectAgent\Capabilities; |
|
8 | 7 | use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
9 | 8 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
10 | -use Symfony\Component\Form\Extension\Core\Type\FormType; |
|
11 | 9 | use Symfony\Component\Form\FormBuilderInterface; |
12 | -use Psi\Component\Grid\Metadata\GridMetadata; |
|
13 | 10 | use Psi\Component\ObjectAgent\Query\Comparison; |
14 | 11 | use Psi\Component\ObjectAgent\Query\Query; |
15 | 12 | use Psi\Component\Grid\FilterInterface; |
16 | 13 | use Psi\Component\ObjectAgent\Query\Expression; |
17 | 14 | use Symfony\Component\OptionsResolver\OptionsResolver; |
18 | 15 | use Symfony\Component\Form\FormInterface; |
19 | -use Symfony\Component\Form\AbstractType; |
|
20 | -use Symfony\Component\Validator\Constraints\NotNull; |
|
21 | 16 | use Psi\Component\Grid\FilterDataInterface; |
22 | 17 | |
23 | 18 | class StringFilter implements FilterInterface |
@@ -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 | use Psi\Component\ObjectAgent\AgentFinder; |
7 | 7 | use Psi\Component\ObjectAgent\Query\Query; |
8 | 8 | use Psi\Component\View\ViewFactory; |
9 | -use Psi\Component\Grid\Form\FilterType; |
|
10 | 9 | use Psi\Component\Grid\FilterFormFactory; |
11 | 10 | |
12 | 11 | class GridFactory |
@@ -33,6 +33,9 @@ |
||
33 | 33 | $this->variant = $options['variant']; |
34 | 34 | } |
35 | 35 | |
36 | + /** |
|
37 | + * @return integer |
|
38 | + */ |
|
36 | 39 | public function getCurrentPage() |
37 | 40 | { |
38 | 41 | return $this->currentPage; |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Doctrine\Common\Annotations\Reader; |
6 | 6 | use Metadata\Driver\DriverInterface; |
7 | -use Psi\Component\Grid\Metadata\Annotations; |
|
8 | 7 | use Psi\Component\Grid\Metadata\ClassMetadata; |
9 | 8 | use Psi\Component\Grid\Metadata\ColumnMetadata; |
10 | 9 | use Psi\Component\Grid\Metadata\GridMetadata; |