@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | * @method string getSharedKey() |
36 | 36 | */ |
37 | 37 | |
38 | -class SharingACL extends PermissionEntity implements \JsonSerializable |
|
39 | -{ |
|
38 | +class SharingACL extends PermissionEntity implements \JsonSerializable { |
|
40 | 39 | |
41 | 40 | protected |
42 | 41 | $itemId, |
@@ -67,8 +66,7 @@ discard block |
||
67 | 66 | * which is a value of any type other than a resource. |
68 | 67 | * @since 5.4.0 |
69 | 68 | */ |
70 | - function jsonSerialize() |
|
71 | - { |
|
69 | + function jsonSerialize() { |
|
72 | 70 | return [ |
73 | 71 | 'acl_id' => $this->getId(), |
74 | 72 | 'item_id' => $this->getItemId(), |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | |
34 | 34 | |
35 | -class File extends Entity implements \JsonSerializable{ |
|
35 | +class File extends Entity implements \JsonSerializable { |
|
36 | 36 | |
37 | 37 | use EntityJSONSerializer; |
38 | 38 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | |
65 | 65 | |
66 | -class Credential extends Entity implements \JsonSerializable{ |
|
66 | +class Credential extends Entity implements \JsonSerializable { |
|
67 | 67 | |
68 | 68 | use EntityJSONSerializer; |
69 | 69 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | |
38 | 38 | |
39 | -class Vault extends Entity implements \JsonSerializable{ |
|
39 | +class Vault extends Entity implements \JsonSerializable { |
|
40 | 40 | |
41 | 41 | use EntityJSONSerializer; |
42 | 42 |
@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | * which is a value of any type other than a resource. |
63 | 63 | * @since 5.4.0 |
64 | 64 | */ |
65 | - function jsonSerialize() |
|
66 | - { |
|
65 | + function jsonSerialize() { |
|
67 | 66 | return [ |
68 | 67 | 'req_id' => $this->getId(), |
69 | 68 | 'item_id' => $this->getItemId(), |
@@ -78,7 +77,7 @@ discard block |
||
78 | 77 | ]; |
79 | 78 | } |
80 | 79 | |
81 | - function asACLJson(){ |
|
80 | + function asACLJson() { |
|
82 | 81 | return [ |
83 | 82 | 'item_id' => $this->getItemId(), |
84 | 83 | 'item_guid' => $this->getItemGuid(), |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | private $userId; |
23 | 23 | |
24 | - public function __construct($AppName, IRequest $request, $UserId){ |
|
24 | + public function __construct($AppName, IRequest $request, $UserId) { |
|
25 | 25 | parent::__construct($AppName, $request); |
26 | 26 | $this->userId = $UserId; |
27 | 27 | } |
@@ -272,7 +272,9 @@ |
||
272 | 272 | protected function unpad($data) { |
273 | 273 | $length = $this->getKeySize(); |
274 | 274 | $last = ord($data[strlen($data) - 1]); |
275 | - if ($last > $length) return false; |
|
275 | + if ($last > $length) { |
|
276 | + return false; |
|
277 | + } |
|
276 | 278 | if (substr($data, -1 * $last) !== str_repeat(chr($last), $last)) { |
277 | 279 | return false; |
278 | 280 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $setting = (in_array($methodName, $publicMethods)) ? 'link_sharing_enabled' : 'user_sharing_enabled'; |
27 | 27 | $sharing_enabled = ($this->settings->isEnabled($setting)); |
28 | 28 | |
29 | - if(in_array($methodName, $user_pub_methods)){ |
|
29 | + if(in_array($methodName, $user_pub_methods)) { |
|
30 | 30 | $sharing_enabled = ($this->settings->isEnabled('link_sharing_enabled') || $this->settings->isEnabled('user_sharing_enabled')); |
31 | 31 | } |
32 | 32 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function __construct($AppName, |
24 | 24 | IRequest $request, |
25 | 25 | $UserId, |
26 | - FileService $fileService){ |
|
26 | + FileService $fileService) { |
|
27 | 27 | parent::__construct( |
28 | 28 | $AppName, |
29 | 29 | $request, |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId)); |
66 | 66 | } |
67 | 67 | |
68 | - public function updateFile($file_id, $file_data, $filename){ |
|
68 | + public function updateFile($file_id, $file_data, $filename) { |
|
69 | 69 | try{ |
70 | 70 | $file = $this->fileService->getFile($file_id, $this->userId); |
71 | 71 | } catch (\Exception $doesNotExistException){ |
72 | 72 | |
73 | 73 | } |
74 | - if($file){ |
|
74 | + if($file) { |
|
75 | 75 | if($file_data) { |
76 | 76 | $file->setFileData($file_data); |
77 | 77 | } |
78 | 78 | if($filename) { |
79 | 79 | $file->setFilename($filename); |
80 | 80 | } |
81 | - if($filename || $file_data){ |
|
81 | + if($filename || $file_data) { |
|
82 | 82 | new JSONResponse($this->fileService->updateFile($file)); |
83 | 83 | } |
84 | 84 | } |