Completed
Pull Request — master (#5)
by Daniel
08:11 queued 06:07
created
lib/Cell/PropertyType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
lib/Filter/NumberFilter.php 2 patches
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -4,20 +4,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Filter/StringFilter.php 2 patches
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -4,20 +4,15 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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:
Please login to merge, or discard this patch.
lib/GridFactory.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
lib/GridOptions.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -33,6 +33,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Metadata/Driver/AnnotationDriver.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/FilterFormFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,6 +74,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/Filter/BooleanFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             );
Please login to merge, or discard this patch.