Passed
Pull Request — master (#228)
by
unknown
02:45
created
src/Picqer/Financials/Exact/Quotation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,10 +123,10 @@
 block discarded – undo
123 123
      */
124 124
     public function addItem(array $array)
125 125
     {
126
-        if (! isset($this->attributes['QuotationLines']) || $this->attributes['QuotationLines'] == null) {
126
+        if ( ! isset($this->attributes['QuotationLines']) || $this->attributes['QuotationLines'] == null) {
127 127
             $this->attributes['QuotationLines'] = [];
128 128
         }
129
-        if (! isset($array['LineNumber'])) {
129
+        if ( ! isset($array['LineNumber'])) {
130 130
             $array['LineNumber'] = count($this->attributes['QuotationLines']) + 1;
131 131
         }
132 132
         $this->attributes['QuotationLines'][] = $array;
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Query/Resultset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         // If we have one result which is not an assoc array, make it the first element of an array for the
36 36
         // collectionFromResult function so we always return a collection from filter
37 37
         if ((bool) count(array_filter(array_keys($result), 'is_string'))) {
38
-            $result = [ $result ];
38
+            $result = [$result];
39 39
         }
40 40
 
41 41
         $class = $this->class;
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/PurchaseInvoice.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
      * @return mixed
78 78
      */
79 79
     public function getSalesInvoiceLines() {
80
-        if(array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) {
80
+        if (array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) {
81 81
             $this->attributes['PurchaseInvoiceLines'] = (new PurchaseInvoiceLine($this->connection()))->filter("InvoiceID eq guid'{$this->ID}'");
82 82
         }
83 83
         return $this->attributes['PurchaseInvoiceLines'];
Please login to merge, or discard this patch.
src/Picqer/Financials/Exact/Model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
     /**
19 19
      * @var array The model's attributes
20 20
      */
21
-    protected $attributes = [ ];
21
+    protected $attributes = [];
22 22
     
23 23
     /**
24 24
      * @deferred array The model's collection values
25 25
      */
26
-    protected $deferred = [ ];
26
+    protected $deferred = [];
27 27
 
28 28
     /**
29 29
      * @var array The model's fillable attributes
30 30
      */
31
-    protected $fillable = [ ];
31
+    protected $fillable = [];
32 32
 
33 33
     /**
34 34
      * @var string The URL endpoint of this model
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         try {
137 137
             $isArray = isset($this->attributes[$key]) && is_array($this->attributes[$key]);
138
-            if($isArray && array_key_exists('__deferred', $this->attributes[$key])) {
138
+            if ($isArray && array_key_exists('__deferred', $this->attributes[$key])) {
139 139
                 $class = preg_replace('/(.+?)s?$/', __NAMESPACE__ . '\\\$1', $key); // Filter plural 's' and add namespace
140 140
                 $deferred = new $class($this->connection());
141 141
                 $uri = $this->attributes[$key]['__deferred']['uri'];
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             return $this->deferred[$key];
160 160
         }
161 161
         
162
-        if (isset( $this->attributes[$key] )) {
162
+        if (isset($this->attributes[$key])) {
163 163
             return $this->attributes[$key];
164 164
         }
165 165
     }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             return false;
198 198
         }
199 199
 
200
-        return ! empty( $this->attributes[$this->primaryKey] );
200
+        return ! empty($this->attributes[$this->primaryKey]);
201 201
     }
202 202
 
203 203
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     {
213 213
         $attributes = $this->attributes;
214 214
         if ($withDeferred) {
215
-            foreach($this->deferred as $attribute => $collection) {
215
+            foreach ($this->deferred as $attribute => $collection) {
216 216
                 if (empty($collection)) {
217 217
                     continue; // Leave orriginal array with __deferred key
218 218
                 }
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
      *
252 252
      * @return boolean
253 253
      */
254
-    public function userHasRights($action='GET')
254
+    public function userHasRights($action = 'GET')
255 255
     {
256
-        $action =  preg_match('/^GET|POST|PUT|DELETE$/i', $action) ? strtoupper($action) : 'GET';
256
+        $action = preg_match('/^GET|POST|PUT|DELETE$/i', $action) ? strtoupper($action) : 'GET';
257 257
         $result = $this->connection()->get('users/UserHasRights', [
258 258
             'endpoint' => "'{$this->url}'",
259 259
             'action' => "'{$action}'"
Please login to merge, or discard this patch.