Completed
Push — master ( 3539dd...b3ee9f )
by Stephan
02:55 queued 01:12
created
src/Picqer/Financials/Exact/Query/Findable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string (guid)
50 50
      */
51
-    public function findId($code, $key='Code'){
52
-        if ( $this->isFillable($key) ) {
51
+    public function findId($code, $key = 'Code') {
52
+        if ($this->isFillable($key)) {
53 53
             $format = ($this->url == 'crm/Accounts' && $key === 'Code') ? '%18s' : '%s';
54 54
             if (preg_match('/^[\w]{8}-([\w]{4}-){3}[\w]{12}$/', $code)) {
55 55
                 $format = "guid'$format'";
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                 '$select' => $this->primaryKey,
66 66
                 '$orderby' => $this->primaryKey,
67 67
             ];
68
-            if( $records = $this->connection()->get($this->url, $request) ){
68
+            if ($records = $this->connection()->get($this->url, $request)) {
69 69
                 return $records[0][$this->primaryKey];
70 70
             }
71 71
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         $result = $this->connection()->get($this->url, $request, $headers);
99 99
 
100
-        if (!empty($divisionId)) {
100
+        if ( ! empty($divisionId)) {
101 101
             $this->connection()->setDivision($originalDivision); // Restore division
102 102
         }
103 103
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         // If we have one result which is not an assoc array, make it the first element of an array for the
133 133
         // collectionFromResult function so we always return a collection from filter
134 134
         if ((bool) count(array_filter(array_keys($result), 'is_string'))) {
135
-            $result = [ $result ];
135
+            $result = [$result];
136 136
         }
137 137
 
138 138
         while ($this->connection()->nextUrl !== null)
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
             
142 142
             // If we have one result which is not an assoc array, make it the first element of an array for the array_merge function
143 143
             if ((bool) count(array_filter(array_keys($nextResult), 'is_string'))) {
144
-                $nextResult = [ $nextResult ];
144
+                $nextResult = [$nextResult];
145 145
             }
146 146
             
147 147
             $result = array_merge($result, $nextResult);
148 148
         }
149
-        $collection = [ ];
149
+        $collection = [];
150 150
         foreach ($result as $r) {
151 151
             $collection[] = new self($this->connection(), $r);
152 152
         }
Please login to merge, or discard this patch.