Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( 759348...75fc1b )
by Cristian
03:32
created
src/Crud.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         $relationFields = [];
103 103
 
104
-        foreach($fields as $field){
104
+        foreach ($fields as $field) {
105 105
             if (isset($field['model']))
106 106
             {
107 107
                 array_push($relationFields, $field);
@@ -129,14 +129,14 @@  discard block
 block discarded – undo
129 129
 
130 130
         foreach ($fields_with_relationships as $key => $field)
131 131
         {
132
-            if (isset($field['pivot']) && $field['pivot'] )
132
+            if (isset($field['pivot']) && $field['pivot'])
133 133
             {
134
-                $values = isset($data[$field['name']])?$data[$field['name']]:[];
134
+                $values = isset($data[$field['name']]) ? $data[$field['name']] : [];
135 135
                 $model->{$field['name']}()->sync($values);
136 136
 
137
-                if( isset($field['pivotFields']) ){
138
-                    foreach($field['pivotFields'] as $pivotField){
139
-                       foreach($data[$pivotField] as $pivot_id =>  $field){
137
+                if (isset($field['pivotFields'])) {
138
+                    foreach ($field['pivotFields'] as $pivotField) {
139
+                       foreach ($data[$pivotField] as $pivot_id =>  $field) {
140 140
                          $model->{$field['name']}()->updateExistingPivot($pivot_id, [$pivotField => $field]);
141 141
                        }
142 142
                     }
@@ -304,11 +304,11 @@  discard block
 block discarded – undo
304 304
                 if (isset($field['subfields']))
305 305
                     {
306 306
                     $fields[$k]['value'] = [];
307
-                    foreach($field['subfields'] as $key => $subfield){
307
+                    foreach ($field['subfields'] as $key => $subfield) {
308 308
                         $fields[$k]['value'][] = $entry->{$subfield['name']};
309 309
                     }
310 310
 
311
-                }else{
311
+                } else {
312 312
                     $fields[$k]['value'] = $entry->{$field['name']};
313 313
                 }
314 314
             }
@@ -427,13 +427,13 @@  discard block
 block discarded – undo
427 427
     public function allowAccess($access)
428 428
     {
429 429
         // $this->addButtons((array)$access);
430
-        return $this->access = array_merge(array_diff((array)$access, $this->access), $this->access);
430
+        return $this->access = array_merge(array_diff((array) $access, $this->access), $this->access);
431 431
     }
432 432
 
433 433
     public function denyAccess($access)
434 434
     {
435 435
         // $this->removeButtons((array)$access);
436
-        return $this->access = array_diff($this->access, (array)$access);
436
+        return $this->access = array_diff($this->access, (array) $access);
437 437
     }
438 438
 
439 439
     /**
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
      */
647 647
     public function addDefaultTypeToColumn($column)
648 648
     {
649
-        if (array_key_exists('name', (array)$column))
649
+        if (array_key_exists('name', (array) $column))
650 650
         {
651 651
             $default_type = $this->getFieldTypeFromDbColumnType($column['name']);
652 652
             return array_merge(['type' => $default_type], $column);
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
      * @param [field or column]
663 663
      */
664 664
     public function addDefaultLabel($array) {
665
-        if (!array_key_exists('label', (array)$array) && array_key_exists('name', (array)$array)) {
665
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
666 666
             $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array);
667 667
             return $array;
668 668
         }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
      * @param [array] $options Field-type-specific information.
739 739
      * @param string $form    The form to add the field to (create/update/both)
740 740
      */
741
-    public function addField($field, $form='both')
741
+    public function addField($field, $form = 'both')
742 742
     {
743 743
         // if the field_defition_array array is a string, it means the programmer was lazy and has only passed the name
744 744
         // set some default values, so the field will still work
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         }
777 777
     }
778 778
 
779
-    public function addFields($fields, $form='both')
779
+    public function addFields($fields, $form = 'both')
780 780
     {
781 781
         if (count($fields)) {
782 782
             foreach ($fields as $field) {
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
      * @param  string $name Field name (as defined with the addField() procedure)
791 791
      * @param  string $form update/create/both
792 792
      */
793
-    public function removeField($name, $form='both')
793
+    public function removeField($name, $form = 'both')
794 794
     {
795 795
         switch (strtolower($form)) {
796 796
             case 'create':
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
      * @param  array $array_of_names A simple array of the names of the fields to be removed.
814 814
      * @param  string $form          update/create/both
815 815
      */
816
-    public function removeFields($array_of_names, $form='both')
816
+    public function removeFields($array_of_names, $form = 'both')
817 817
     {
818 818
         if (!empty($array_of_names)) {
819 819
             foreach ($array_of_names as $name) {
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
         array_map(function($field) {
951 951
             // $this->labels[$field] = $this->makeLabel($field);
952 952
 
953
-            $new_field =  [
953
+            $new_field = [
954 954
                                 'name' => $field,
955 955
                                 'label' => ucfirst($field),
956 956
                                 'value' => '', 'default' => $this->field_types[$field]['default'],
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 
1304 1304
     public function orderColumns($order)
1305 1305
     {
1306
-        $this->setSort('columns', (array)$order);
1306
+        $this->setSort('columns', (array) $order);
1307 1307
     }
1308 1308
 
1309 1309
 
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 
1379 1379
     public function orderFields($order)
1380 1380
     {
1381
-        $this->setSort('fields', (array)$order);
1381
+        $this->setSort('fields', (array) $order);
1382 1382
     }
1383 1383
 
1384 1384
 
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
         if (!empty($this->{$type}))
1425 1425
         {
1426 1426
             $this->{$type} = array_map(function($field) use ($fields, $attributes) {
1427
-                if (in_array($field['name'], (array)$fields)) $field = array_merge($field, $attributes);
1427
+                if (in_array($field['name'], (array) $fields)) $field = array_merge($field, $attributes);
1428 1428
 
1429 1429
                 return $field;
1430 1430
             }, $this->{$type});
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
                 if (is_numeric($key = array_search($item, array_column($this->{$items}, 'name')))) $elements[] = $this->{$items}[$key];
1455 1455
             }
1456 1456
 
1457
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use($items) {return !in_array($item['name'], $this->sort[$items]);}));
1457
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use($items) {return !in_array($item['name'], $this->sort[$items]); }));
1458 1458
         }
1459 1459
 
1460 1460
         return $this->{$items};
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
     // cred ca ia valorile din tabela de legatura ca sa ti le afiseze in select
1468 1468
     public function getRelationValues($model, $field, $where = [], $order = [])
1469 1469
     {
1470
-        $order = (array)$order;
1470
+        $order = (array) $order;
1471 1471
         $values = $model->select('*');
1472 1472
 
1473 1473
         if (!empty($where)) call_user_func_array([$values, $where[0]], array_slice($where, 1));
Please login to merge, or discard this patch.