From 1502a8b5c2ae16d57e887ce2fc6ed6302ec10de9 Mon Sep 17 00:00:00 2001 From: Casper Bakker Date: Thu, 1 Jul 2021 11:23:38 +0200 Subject: [PATCH] Update code style in readme --- README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 875de4b2..249aadd8 100644 --- a/README.md +++ b/README.md @@ -61,24 +61,32 @@ $connection->setRedirectUrl('CALLBACK_URL'); $connection->setExactClientId('CLIENT_ID'); $connection->setExactClientSecret('CLIENT_SECRET'); -if (getValue('authorizationcode')) // Retrieves authorizationcode from database - $connection->setAuthorizationCode(getValue('authorizationcode')); +if (getValue('authorizationcode')) { + // Retrieves authorizationcode from database + $connection->setAuthorizationCode(getValue('authorizationcode')); +} -if (getValue('accesstoken')) // Retrieves accesstoken from database - $connection->setAccessToken(unserialize(getValue('accesstoken'))); +if (getValue('accesstoken')) { + // Retrieves accesstoken from database + $connection->setAccessToken(unserialize(getValue('accesstoken'))); +} -if (getValue('refreshtoken')) // Retrieves refreshtoken from database - $connection->setRefreshToken(getValue('refreshtoken')); +if (getValue('refreshtoken')) { + // Retrieves refreshtoken from database + $connection->setRefreshToken(getValue('refreshtoken')); +} -if (getValue('expires_in')) // Retrieves expires timestamp from database - $connection->setTokenExpires(getValue('expires_in')); +if (getValue('expires_in')) { + // Retrieves expires timestamp from database + $connection->setTokenExpires(getValue('expires_in')); +} // Make the client connect and exchange tokens try { - $connection->connect(); + $connection->connect(); } catch (\Exception $e) { - throw new Exception('Could not connect to Exact: ' . $e->getMessage()); + throw new Exception('Could not connect to Exact: ' . $e->getMessage()); } // Save the new tokens for next connections @@ -158,9 +166,9 @@ $items = $item->filter("Code eq '$productcode'"); // Uses filters as described i // Create new invoice with invoice lines $invoiceLines[] = [ - 'Item' => $itemId, - 'Quantity' => $orderproduct['amount'], - 'UnitPrice' => $orderproduct['price'] + 'Item' => $itemId, + 'Quantity' => $orderproduct['amount'], + 'UnitPrice' => $orderproduct['price'] ]; $salesInvoice = new SalesInvoice($connection);