@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function __construct(string $hostname, string $client_id, string $client_secret, string $username, string $password, $handler = null, $verify_ssl = true) |
70 | 70 | { |
71 | - if(! session_id()) { |
|
71 | + if (!session_id()) { |
|
72 | 72 | session_start(); |
73 | 73 | } |
74 | 74 | |
75 | - $sessionKey = 'sharefile-session' . '_' . $hostname . '_' . $client_id . '_' . $client_secret . '_' . $username . '_' . $password; |
|
75 | + $sessionKey = 'sharefile-session'.'_'.$hostname.'_'.$client_id.'_'.$client_secret.'_'.$username.'_'.$password; |
|
76 | 76 | |
77 | - if (! $this->isAuthenticated($sessionKey)) { |
|
77 | + if (!$this->isAuthenticated($sessionKey)) { |
|
78 | 78 | $response = $this->authenticate($hostname, $client_id, $client_secret, $username, $password, $handler); |
79 | 79 | |
80 | - if (! isset($response['access_token']) || ! isset($response['subdomain'])) { |
|
80 | + if (!isset($response['access_token']) || !isset($response['subdomain'])) { |
|
81 | 81 | throw new Exception("Incorrect response from Authentication: 'access_token' or 'subdomain' is missing."); |
82 | 82 | } |
83 | 83 | |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | |
454 | 454 | // First Chunk |
455 | 455 | $data = $this->readChunk($stream, $chunkSize); |
456 | - while (! ((strlen($data) < $chunkSize) || feof($stream))) { |
|
456 | + while (!((strlen($data) < $chunkSize) || feof($stream))) { |
|
457 | 457 | $parameters = $this->buildHttpQuery( |
458 | 458 | [ |
459 | 459 | 'index' => $index, |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | */ |
550 | 550 | public function getItemAccessControls(string $itemId, string $userId = ''):array |
551 | 551 | { |
552 | - if (! empty($userId)) { |
|
552 | + if (!empty($userId)) { |
|
553 | 553 | return $this->get("AccessControls(principalid={$userId},itemid={$itemId})"); |
554 | 554 | } else { |
555 | 555 | return $this->get("Items({$itemId})/AccessControls"); |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | protected function readChunk($stream, int $chunkSize) |
685 | 685 | { |
686 | 686 | $chunk = ''; |
687 | - while (! feof($stream) && $chunkSize > 0) { |
|
687 | + while (!feof($stream) && $chunkSize > 0) { |
|
688 | 688 | $part = fread($stream, $chunkSize); |
689 | 689 | if ($part === false) { |
690 | 690 | throw new Exception('Error reading from $stream.'); |
@@ -723,8 +723,8 @@ discard block |
||
723 | 723 | { |
724 | 724 | return http_build_query( |
725 | 725 | array_map( |
726 | - function ($parameter) { |
|
727 | - if (! is_bool($parameter)) { |
|
726 | + function($parameter) { |
|
727 | + if (!is_bool($parameter)) { |
|
728 | 728 | return $parameter; |
729 | 729 | } |
730 | 730 | |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | */ |
745 | 745 | protected function jsonValidator($data = null):bool |
746 | 746 | { |
747 | - if (! empty($data)) { |
|
747 | + if (!empty($data)) { |
|
748 | 748 | @json_decode($data); |
749 | 749 | |
750 | 750 | return json_last_error() === JSON_ERROR_NONE; |