@@ -125,6 +125,6 @@ |
||
125 | 125 | */ |
126 | 126 | public function getPermissions(): int |
127 | 127 | { |
128 | - return Constants::PERMISSION_READ | Constants::PERMISSION_UPDATE | Constants::PERMISSION_DELETE; |
|
128 | + return Constants::PERMISSION_READ|Constants::PERMISSION_UPDATE|Constants::PERMISSION_DELETE; |
|
129 | 129 | } |
130 | 130 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function isReadable(): bool |
93 | 93 | { |
94 | - return ($this->getPermissions() & Constants::PERMISSION_READ) === Constants::PERMISSION_READ; |
|
94 | + return ($this->getPermissions()&Constants::PERMISSION_READ) === Constants::PERMISSION_READ; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function isUpdateable(): bool |
101 | 101 | { |
102 | - return ($this->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE; |
|
102 | + return ($this->getPermissions()&Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,6 +107,6 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function isDeletable(): bool |
109 | 109 | { |
110 | - return ($this->getPermissions() & Constants::PERMISSION_DELETE) === Constants::PERMISSION_DELETE; |
|
110 | + return ($this->getPermissions()&Constants::PERMISSION_DELETE) === Constants::PERMISSION_DELETE; |
|
111 | 111 | } |
112 | 112 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | if (!@rmdir($this->getLocalPath())) { |
71 | 71 | $files = @scandir($this->getLocalPath()); |
72 | - if (($files === false) || ($files === [ '.', '..' ])) { |
|
72 | + if (($files === false) || ($files === ['.', '..'])) { |
|
73 | 73 | throw new GenericFileException(); |
74 | 74 | } else { |
75 | 75 | throw new NotPermittedException(); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function isCreatable(): bool |
205 | 205 | { |
206 | - return ($this->getPermissions() & Constants::PERMISSION_CREATE) === Constants::PERMISSION_CREATE; |
|
206 | + return ($this->getPermissions()&Constants::PERMISSION_CREATE) === Constants::PERMISSION_CREATE; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $exampleProxyUrl = $this->urlGenerator->getBaseUrl() . '/sites/' . urlencode($exampleSite) . '/'; |
62 | 62 | $exampleFullUrl = $this->urlGenerator->linkToRouteAbsolute( |
63 | 63 | Application::APP_NAME . '.Pico.getRoot', |
64 | - [ 'site' => $exampleSite ] |
|
64 | + ['site' => $exampleSite] |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | $internalBaseUrl = $this->urlGenerator->getBaseUrl() . '/index.php/apps/' . Application::APP_NAME . '/'; |
@@ -135,7 +135,7 @@ |
||
135 | 135 | { |
136 | 136 | if (!$this->getProxyRequest()) { |
137 | 137 | $route = Application::APP_NAME . '.Pico.getRoot'; |
138 | - $parameters = [ 'site' => $this->getSite() ]; |
|
138 | + $parameters = ['site' => $this->getSite()]; |
|
139 | 139 | return $this->urlGenerator->linkToRoute($route, $parameters); |
140 | 140 | } else { |
141 | 141 | return \OC::$WEBROOT . '/sites/' . urlencode($this->getSite()) . '/'; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function setType(int $type): self |
190 | 190 | { |
191 | - if (!in_array($type, [ self::TYPE_PUBLIC, self::TYPE_PRIVATE ], true)) { |
|
191 | + if (!in_array($type, [self::TYPE_PUBLIC, self::TYPE_PRIVATE], true)) { |
|
192 | 192 | throw new \UnexpectedValueException(); |
193 | 193 | } |
194 | 194 | |
@@ -411,15 +411,15 @@ discard block |
||
411 | 411 | |
412 | 412 | $creation = 0; |
413 | 413 | if (!empty($data['creation'])) { |
414 | - $creation = is_numeric($data['creation']) ? (int) $data['creation'] : strtotime($data['creation']); |
|
414 | + $creation = is_numeric($data['creation']) ? (int)$data['creation'] : strtotime($data['creation']); |
|
415 | 415 | } |
416 | 416 | |
417 | - $this->setId(isset($data['id']) ? (int) $data['id'] : 0) |
|
417 | + $this->setId(isset($data['id']) ? (int)$data['id'] : 0) |
|
418 | 418 | ->setUserId($data['user_id']) |
419 | 419 | ->setName($data['name']) |
420 | 420 | ->setSite($data['site']) |
421 | 421 | ->setTheme($data['theme'] ?? 'default') |
422 | - ->setType(isset($data['type']) ? (int) $data['type'] : self::TYPE_PUBLIC) |
|
422 | + ->setType(isset($data['type']) ? (int)$data['type'] : self::TYPE_PUBLIC) |
|
423 | 423 | ->setOptions($options) |
424 | 424 | ->setPath($data['path']) |
425 | 425 | ->setCreation($creation) |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $lastModified = $file->getMTime(); |
77 | 77 | $mimeType = $file->getMimeType(); |
78 | 78 | |
79 | - if (($file->getPermissions() & Constants::PERMISSION_READ) !== Constants::PERMISSION_READ) { |
|
79 | + if (($file->getPermissions()&Constants::PERMISSION_READ) !== Constants::PERMISSION_READ) { |
|
80 | 80 | throw new NotPermittedException(); |
81 | 81 | } |
82 | 82 | } catch (InvalidPathException $e) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function cacheFor(int $cacheSeconds): self |
124 | 124 | { |
125 | - if($cacheSeconds > 0) { |
|
125 | + if ($cacheSeconds > 0) { |
|
126 | 126 | $this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds . ', public'); |
127 | 127 | $this->addHeader('Pragma', 'public'); |
128 | 128 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(string $message = null) |
39 | 39 | { |
40 | - parent::__construct(Application::APP_NAME, '404', [ 'message' => $message ], 'guest'); |
|
40 | + parent::__construct(Application::APP_NAME, '404', ['message' => $message], 'guest'); |
|
41 | 41 | $this->setStatus(Http::STATUS_NOT_FOUND); |
42 | 42 | } |
43 | 43 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(string $message = null) |
39 | 39 | { |
40 | - parent::__construct(Application::APP_NAME, '403', [ 'message' => $message ], 'guest'); |
|
40 | + parent::__construct(Application::APP_NAME, '403', ['message' => $message], 'guest'); |
|
41 | 41 | $this->setStatus(Http::STATUS_FORBIDDEN); |
42 | 42 | } |
43 | 43 | } |