Completed
Push — master ( 52ba0a...f7e181 )
by Vitaliy
06:24
created
src/ObjectDataRow.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         } else {
28 28
             try {
29 29
                 return $this->src->{$fieldName};
30
-            } catch(Exception $e) {
30
+            } catch (Exception $e) {
31 31
                 throw new RuntimeException(
32 32
                     "Can't read '$fieldName' property from DataRow"
33 33
                 );
Please login to merge, or discard this patch.
resources/views/default/components/filters/date_picker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /** @var Nayjest\Grids\Components\Filter $component */
3 3
 ?>
4
-<?php if($component->getLabel()): ?>
4
+<?php if ($component->getLabel()): ?>
5 5
     <span><?= $component->getLabel() ?></span>
6 6
 <?php endif ?>
7 7
 <input
Please login to merge, or discard this patch.
src/Components/ColumnsHider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     {
47 47
         $row = $this->getDataRow();
48 48
         $out = '';
49
-        foreach($this->grid->getConfig()->getColumns() as $column) {
49
+        foreach ($this->grid->getConfig()->getColumns() as $column) {
50 50
             $component = new TableCell($column);
51 51
             $component->initialize($this->grid);
52 52
             $component->setContent($column->getValue($row));
Please login to merge, or discard this patch.
resources/views/default/components/filters/date_range_picker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 /** @var Nayjest\Grids\Components\Filters\DateRangePicker $component */
3 3
 $id = uniqid();
4 4
 ?>
5
-<?php if($component->getLabel()): ?>
5
+<?php if ($component->getLabel()): ?>
6 6
     <span>
7 7
         <span class="glyphicon glyphicon-calendar"></span>
8 8
         <?= $component->getLabel() ?>
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             start.val(picker.startDate.format(options.format));
37 37
             var end = $('[name="<?= $component->getEndInputName() ?>"]')
38 38
             end.val(picker.endDate.format(options.format));
39
-            <?php if($component->isSubmittedOnChange()): ?>
39
+            <?php if ($component->isSubmittedOnChange()): ?>
40 40
             	end.get(0).form.submit();
41 41
             <?php endif ?>
42 42
         };
Please login to merge, or discard this patch.
resources/views/default/components/filters_row.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,19 +4,19 @@
 block discarded – undo
4 4
  * @var Nayjest\Grids\FieldConfig $column
5 5
  */
6 6
 ?>
7
-<?php if($grid->getFiltering()->available()): ?>
7
+<?php if ($grid->getFiltering()->available()): ?>
8 8
     <tr>
9
-            <?php foreach($columns as $column): ?>
9
+            <?php foreach ($columns as $column): ?>
10 10
                 <td
11 11
                     class="column-<?= $column->getName() ?>"
12
-                    <?= $column->isHidden()?'style="display:none"':'' ?>
12
+                    <?= $column->isHidden() ? 'style="display:none"' : '' ?>
13 13
                     >
14 14
                     <?php if ($column->hasFilters()): ?>
15
-                        <?php foreach($column->getFilters() as $filter): ?>
15
+                        <?php foreach ($column->getFilters() as $filter): ?>
16 16
                             <?= $grid->getFiltering()->render($filter) ?>
17 17
                         <?php endforeach ?>
18 18
                     <?php endif ?>
19
-                    <?= $component->renderComponents('filters_row_column_' . $column->getName()) ?>
19
+                    <?= $component->renderComponents('filters_row_column_'.$column->getName()) ?>
20 20
                 </td>
21 21
             <?php endforeach ?>
22 22
             <?= $grid->getInputProcessor()->getSortingHiddenInputsHtml() ?>
Please login to merge, or discard this patch.
src/FilterConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,6 +121,6 @@
 block discarded – undo
121 121
 
122 122
     public function getId()
123 123
     {
124
-        return $this->getName() . '-' . $this->getOperator();
124
+        return $this->getName().'-'.$this->getOperator();
125 125
     }
126 126
 }
Please login to merge, or discard this patch.
src/Build/Setup.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $b = new Blueprint(self::GRID_CLASS, [
84 84
             new BuildDataProvider(),
85
-            new CustomInstruction(function (Scaffold $s) {
85
+            new CustomInstruction(function(Scaffold $s) {
86 86
                 /** @var EloquentDataProvider $provider */
87 87
                 $provider = $s->getInput('data_provider');
88 88
                 $is_eloquent = $provider  instanceof EloquentDataProvider;
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     {
120 120
         $blueprint = new Blueprint(self::COMPONENT_CLASS, [
121 121
 
122
-            new CustomInstruction(function (Scaffold $s) {
122
+            new CustomInstruction(function(Scaffold $s) {
123 123
                 if ($s->input instanceof Closure) {
124 124
                     $s->class = 'Nayjest\Grids\Components\RenderFunc';
125 125
                     $s->constructor_arguments = [$s->input];
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
                 } elseif (is_string($s->input)) {
128 128
                     $s->class = 'Nayjest\Grids\Components\RenderFunc';
129 129
                     $out = $s->input;
130
-                    $s->constructor_arguments = [function () use ($out) {
130
+                    $s->constructor_arguments = [function() use ($out) {
131 131
                         return $out;
132 132
                     }];
133 133
                     $s->input = [];
134 134
                 }
135 135
             }, Instruction::PHASE_PRE_INST),
136
-            new CustomMapping('type', function ($type, Scaffold $s) {
136
+            new CustomMapping('type', function($type, Scaffold $s) {
137 137
                 if (strpos($type, '\\') !== false) {
138 138
                     $s->class = $type;
139 139
                 } else {
140
-                    $s->class = 'Nayjest\Grids\Components\\' . str_replace(
140
+                    $s->class = 'Nayjest\Grids\Components\\'.str_replace(
141 141
                             ' ',
142 142
                             '',
143 143
                             ucwords(str_replace(array('-', '_'), ' ', $type))
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         $blueprint->add(new Rename('component', 'add_component'));
151 151
         $blueprint->add(new Build('add_component', $blueprint));
152
-        $blueprint->add(new CallMethodWith('add_component','addComponent'));
152
+        $blueprint->add(new CallMethodWith('add_component', 'addComponent'));
153 153
 
154 154
         return $blueprint;
155 155
     }
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
     {
164 164
         return new Blueprint(self::FILTER_CLASS, [
165 165
             new SimpleValueAsField('name'),
166
-            new CustomMapping('type', function ($type, Scaffold $s) {
167
-                switch($type) {
166
+            new CustomMapping('type', function($type, Scaffold $s) {
167
+                switch ($type) {
168 168
                     case 'select':
169 169
                         $s->class = 'Nayjest\Grids\SelectFilterConfig';
170 170
                         break;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
                         break;
173 173
                 }
174 174
             }, null, Instruction::PHASE_PRE_INST),
175
-            new Rename(0,'name'),
176
-            new Rename(1,'operator'),
175
+            new Rename(0, 'name'),
176
+            new Rename(1, 'operator'),
177 177
         ]);
178 178
     }
179 179
 
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
         }
193 193
         return new Blueprint(self::COLUMN_CLASS, [
194 194
             new SimpleValueAsField('name'),
195
-            new Rename(0,'name'),
195
+            new Rename(0, 'name'),
196 196
             new BuildChildren('filters', $filter_blueprint),
197 197
 
198 198
             new Rename('filter', 'add_filter'),
199 199
             new Build('add_filter', $filter_blueprint),
200
-            new CallMethodWith('add_filter','addFilter'),
200
+            new CallMethodWith('add_filter', 'addFilter'),
201 201
         ]);
202 202
     }
203 203
 }
Please login to merge, or discard this patch.
src/Components/OneCellRow.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $opening = "<tr><td colspan=\"$colspan\">";
17 17
         $closing = '</td></tr>';
18 18
         return $this->wrapWithOutsideComponents(
19
-            $opening . $this->renderInnerComponents() . $closing
19
+            $opening.$this->renderInnerComponents().$closing
20 20
         );
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
src/Components/CsvExport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function initialize(Grid $grid)
49 49
     {
50 50
         parent::initialize($grid);
51
-        Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) {
51
+        Event::listen(Grid::EVENT_PREPARE, function(Grid $grid) {
52 52
             if ($this->grid !== $grid) {
53 53
                 return;
54 54
             }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function getFileName()
75 75
     {
76
-        return $this->fileName . static::CSV_EXT;
76
+        return $this->fileName.static::CSV_EXT;
77 77
     }
78 78
 
79 79
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     protected function setCsvHeaders(Response $response)
99 99
     {
100 100
         $response->header('Content-Type', 'application/csv');
101
-        $response->header('Content-Disposition', 'attachment; filename=' . $this->getFileName());
101
+        $response->header('Content-Disposition', 'attachment; filename='.$this->getFileName());
102 102
         $response->header('Pragma', 'no-cache');
103 103
     }
104 104
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $file = fopen('php://output', 'w');
114 114
 
115 115
         header('Content-Type: text/csv');
116
-        header('Content-Disposition: attachment; filename="'. $this->getFileName() .'"');
116
+        header('Content-Disposition: attachment; filename="'.$this->getFileName().'"');
117 117
         header('Pragma: no-cache');
118 118
 
119 119
         set_time_limit(0);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $output = [];
131 131
             foreach ($this->grid->getConfig()->getColumns() as $column) {
132 132
                 if (!$column->isHidden()) {
133
-                    $output[] = $this->escapeString( $column->getValue($row) );
133
+                    $output[] = $this->escapeString($column->getValue($row));
134 134
                 }
135 135
             }
136 136
             fputcsv($file, $output, static::CSV_DELIMITER);
Please login to merge, or discard this patch.