Completed
Pull Request — master (#173)
by
unknown
03:28
created
src/Components/ExcelExport.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function initialize(Grid $grid)
66 66
     {
67 67
         parent::initialize($grid);
68
-        Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) {
68
+        Event::listen(Grid::EVENT_PREPARE, function(Grid $grid) {
69 69
             if ($this->grid !== $grid) {
70 70
                 return;
71 71
             }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         if (version_compare(Application::VERSION, '5.0.0', '<')) {
158 158
             $provider->getPaginationFactory()->setPageName('page_unused');
159 159
         } else {
160
-            Paginator::currentPageResolver(function () {
160
+            Paginator::currentPageResolver(function() {
161 161
                 return 1;
162 162
             });
163 163
         }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     public function getOnFileCreate()
273 273
     {
274 274
         if ($this->on_file_create === null) {
275
-            $this->on_file_create = function (LaravelExcelWriter $excel) {
275
+            $this->on_file_create = function(LaravelExcelWriter $excel) {
276 276
                 $excel->sheet($this->getSheetName(), $this->getOnSheetCreate());
277 277
             };
278 278
         }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     public function getOnSheetCreate()
297 297
     {
298 298
         if ($this->on_sheet_create === null) {
299
-            $this->on_sheet_create = function (LaravelExcelWorksheet $sheet) {
299
+            $this->on_sheet_create = function(LaravelExcelWorksheet $sheet) {
300 300
                 $sheet->fromArray($this->getData(), null, 'A1', false, false);
301 301
             };
302 302
         }
Please login to merge, or discard this patch.
resources/views/default/components/filters/date_range_picker.php 1 patch
Spacing   +3 added lines, -3 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
         };
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 $('[name="<?= $component->getStartInputName() ?>"]').val('');
49 49
                 $('[name="<?= $component->getEndInputName() ?>"]').val('');
50 50
 
51
-                <?php if($component->isSubmittedOnChange()): ?>
51
+                <?php if ($component->isSubmittedOnChange()): ?>
52 52
                 var end = $('[name="<?= $component->getEndInputName() ?>"]');
53 53
                 end.get(0).form.submit();
54 54
                 <?php endif ?>
Please login to merge, or discard this patch.
resources/views/default/components/filters/checkboxes.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 /** @var Nayjest\Grids\Components\SelectFilter $component */
3 3
 $value = $component->getValue();
4 4
 if (!is_array($value)) $value = [];
5
-$id = uniqid() . mt_rand();
5
+$id = uniqid().mt_rand();
6 6
 ?>
7 7
 <div class="btn-group">
8 8
     <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
                 </label>
26 26
             </div>
27 27
         </li>
28
-        <?php foreach($component->getVariants() as $val => $label): ?>
29
-            <?php if(is_array($label)):?>
28
+        <?php foreach ($component->getVariants() as $val => $label): ?>
29
+            <?php if (is_array($label)):?>
30 30
                 <?php
31 31
                 $class = '';
32
-                if(array_intersect(array_keys($label['values']), array_keys($value))) {
32
+                if (array_intersect(array_keys($label['values']), array_keys($value))) {
33 33
                     $class = ' in';
34 34
                 }
35 35
                 ?>
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
                                 </label>
52 52
                             </div>
53 53
                         <?php endif ?>
54
-                        <?php foreach($label['values'] as $option_val=>$option_label):?>
54
+                        <?php foreach ($label['values'] as $option_val=>$option_label):?>
55 55
                             <div>
56 56
                                 <label>
57 57
                                     <input
58 58
                                         type="checkbox"
59
-                                        <?php if(!empty($value[$option_val])) echo "checked='checked'" ?>
59
+                                        <?php if (!empty($value[$option_val])) echo "checked='checked'" ?>
60 60
                                         name="<?= $component->getInputName() ?>[<?= $option_val ?>]"
61 61
                                     >
62 62
                                     <span><?= $option_label ?></span>
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                     <label>
71 71
                         <input
72 72
                             type="checkbox"
73
-                            <?php if(!empty($value[$val])) echo "checked='checked'" ?>
73
+                            <?php if (!empty($value[$val])) echo "checked='checked'" ?>
74 74
                             name="<?= $component->getInputName() ?>[<?= $val ?>]"
75 75
                         >
76 76
                         <span><?= $label ?></span>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /** @var Nayjest\Grids\Components\SelectFilter $component */
3 3
 $value = $component->getValue();
4
-if (!is_array($value)) $value = [];
4
+if (!is_array($value)) {
5
+    $value = [];
6
+}
5 7
 $id = uniqid() . mt_rand();
6 8
 ?>
7 9
 <div class="btn-group">
Please login to merge, or discard this patch.
src/FieldConfig.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function getLabel()
151 151
     {
152
-        return $this->label ? : ucwords(str_replace(array('-', '_', '.'), ' ', $this->name));
152
+        return $this->label ?: ucwords(str_replace(array('-', '_', '.'), ' ', $this->name));
153 153
     }
154 154
 
155 155
     /**
@@ -333,20 +333,20 @@  discard block
 block discarded – undo
333 333
         }
334 334
     }
335 335
     
336
-    public function addStyleAttribute($name, $value){
337
-        $this->styleAttributes = $this->styleAttributes. $name. ':' . $value . ';';
336
+    public function addStyleAttribute($name, $value) {
337
+        $this->styleAttributes = $this->styleAttributes.$name.':'.$value.';';
338 338
         return $this;
339 339
     }
340 340
 
341
-    public function getStyleAttributes(){
341
+    public function getStyleAttributes() {
342 342
         return $this->styleAttributes;
343 343
     }
344 344
 
345
-    public function setFormat($format){
345
+    public function setFormat($format) {
346 346
         $this->format = $format;
347 347
     }
348 348
 
349
-    public function getFormat(){
349
+    public function getFormat() {
350 350
         return $this->format;
351 351
     }
352 352
 }
Please login to merge, or discard this patch.
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
                     0,
Please login to merge, or discard this patch.