| @@ -35,7 +35,6 @@ | ||
| 35 | 35 | /** | 
| 36 | 36 | * Constructor. | 
| 37 | 37 | * | 
| 38 | - * @param App $app | |
| 39 | 38 | * @param Server $server | 
| 40 | 39 | */ | 
| 41 | 40 | public function __construct(PreviewCreator $preview, Server $server) | 
| @@ -31,8 +31,6 @@ | ||
| 31 | 31 | /** | 
| 32 | 32 | * Constructor. | 
| 33 | 33 | * | 
| 34 | - * @param Router $router | |
| 35 | - * @param Hook $hook | |
| 36 | 34 | */ | 
| 37 | 35 | public function __construct(Database $db, LoggerInterface $logger, Converter $converter) | 
| 38 | 36 |      { | 
| @@ -32,8 +32,7 @@ | ||
| 32 | 32 | * Create result. | 
| 33 | 33 | * | 
| 34 | 34 | * @param string $path | 
| 35 | - * @param resource $stream | |
| 36 | - * @param null|mixed $resource | |
| 35 | + * @param resource $resource | |
| 37 | 36 | */ | 
| 38 | 37 | public function __construct(string $path, $resource = null) | 
| 39 | 38 |      { | 
| @@ -29,7 +29,6 @@ | ||
| 29 | 29 | /** | 
| 30 | 30 | * Delete file. | 
| 31 | 31 | * | 
| 32 | - * @param string $id | |
| 33 | 32 | * @param array $attributes | 
| 34 | 33 | * | 
| 35 | 34 | * @return bool | 
| @@ -694,7 +694,7 @@ discard block | ||
| 694 | 694 | * @param string $path | 
| 695 | 695 | * @param bool $new | 
| 696 | 696 | * | 
| 697 | - * @return bool | |
| 697 | + * @return string | |
| 698 | 698 | */ | 
| 699 | 699 | protected function verifyFile(?string $path, bool $new = false): string | 
| 700 | 700 |      { | 
| @@ -827,7 +827,7 @@ discard block | ||
| 827 | 827 | /** | 
| 828 | 828 | * Finalize put request. | 
| 829 | 829 | * | 
| 830 | - * @param resource|string $file | |
| 830 | + * @param string|null $file | |
| 831 | 831 | * @param bool $new | 
| 832 | 832 | * @param array $attributes | 
| 833 | 833 | * | 
| @@ -45,14 +45,14 @@ | ||
| 45 | 45 | * @param array | 
| 46 | 46 | **/ | 
| 47 | 47 | protected $temp_files = [ | 
| 48 | - '/^\._(.*)$/', // OS/X resource forks | |
| 49 | - '/^.DS_Store$/', // OS/X custom folder settings | |
| 48 | + '/^\._(.*)$/', // OS/X resource forks | |
| 49 | + '/^.DS_Store$/', // OS/X custom folder settings | |
| 50 | 50 | '/^desktop.ini$/', // Windows custom folder settings | 
| 51 | - '/^Thumbs.db$/', // Windows thumbnail cache | |
| 52 | - '/^.(.*).swpx$/', // ViM temporary files | |
| 53 | - '/^.(.*).swx$/', // ViM temporary files | |
| 54 | - '/^.(.*).swp$/', // ViM temporary files | |
| 55 | - '/^\.dat(.*)$/', // Smultron seems to create these | |
| 51 | + '/^Thumbs.db$/', // Windows thumbnail cache | |
| 52 | + '/^.(.*).swpx$/', // ViM temporary files | |
| 53 | + '/^.(.*).swx$/', // ViM temporary files | |
| 54 | + '/^.(.*).swp$/', // ViM temporary files | |
| 55 | + '/^\.dat(.*)$/', // Smultron seems to create these | |
| 56 | 56 | '/^~lock.(.*)#$/', // Windows 7 lockfiles | 
| 57 | 57 | ]; | 
| 58 | 58 | |
| @@ -108,14 +108,13 @@ | ||
| 108 | 108 | * | 
| 109 | 109 | * @param bool $reference | 
| 110 | 110 | * | 
| 111 | - * @return ObjectId | |
| 111 | + * @return ObjectId|null | |
| 112 | 112 | */ | 
| 113 | 113 | public function getShareId(bool $reference = false): ?ObjectId; | 
| 114 | 114 | |
| 115 | 115 | /** | 
| 116 | 116 | * Get share node. | 
| 117 | 117 | * | 
| 118 | - * @param bool $reference | |
| 119 | 118 | * | 
| 120 | 119 | * @return Collection | 
| 121 | 120 | */ | 
| @@ -60,7 +60,7 @@ | ||
| 60 | 60 | * | 
| 61 | 61 | * @param Server $server | 
| 62 | 62 | * @param Acl $acl | 
| 63 | - * @param Decorator $role_decorator | |
| 63 | + * @param RoleAttributeDecorator $role_decorator | |
| 64 | 64 | */ | 
| 65 | 65 | public function __construct(Server $server, Acl $acl, RoleAttributeDecorator $role_decorator) | 
| 66 | 66 |      { | 
| @@ -131,20 +131,20 @@ discard block | ||
| 131 | 131 | 'mime' => (string) $attributes['mime'], | 
| 132 | 132 | 'readonly' => (bool) $attributes['readonly'], | 
| 133 | 133 | 'directory' => $node instanceof Collection, | 
| 134 | -            'meta' => function ($node) { | |
| 134 | +            'meta' => function($node) { | |
| 135 | 135 | return (object) $node->getMetaAttributes(); | 
| 136 | 136 | }, | 
| 137 | -            'size' => function ($node) { | |
| 137 | +            'size' => function($node) { | |
| 138 | 138 | return $node->getSize(); | 
| 139 | 139 | }, | 
| 140 | -            'path' => function ($node) { | |
| 140 | +            'path' => function($node) { | |
| 141 | 141 |                  try { | 
| 142 | 142 | return $node->getPath(); | 
| 143 | 143 |                  } catch (\Exception $e) { | 
| 144 | 144 | return null; | 
| 145 | 145 | } | 
| 146 | 146 | }, | 
| 147 | -            'parent' => function ($node) { | |
| 147 | +            'parent' => function($node) { | |
| 148 | 148 | $parent = $node->getParent(); | 
| 149 | 149 | |
| 150 | 150 |                  if (null === $parent || $parent->isRoot()) { | 
| @@ -153,10 +153,10 @@ discard block | ||
| 153 | 153 | |
| 154 | 154 | return $this->decorate($node->getParent(), ['id', 'name', '_links']); | 
| 155 | 155 | }, | 
| 156 | -            'access' => function ($node) use ($acl) { | |
| 156 | +            'access' => function($node) use ($acl) { | |
| 157 | 157 | return $acl->getAclPrivilege($node); | 
| 158 | 158 | }, | 
| 159 | -            'share' => function ($node) { | |
| 159 | +            'share' => function($node) { | |
| 160 | 160 |                  if ($node->isShared() || !$node->isSpecial()) { | 
| 161 | 161 | return null; | 
| 162 | 162 | } | 
| @@ -167,7 +167,7 @@ discard block | ||
| 167 | 167 | return null; | 
| 168 | 168 | } | 
| 169 | 169 | }, | 
| 170 | -            'sharename' => function ($node) { | |
| 170 | +            'sharename' => function($node) { | |
| 171 | 171 |                  if (!$node->isShared()) { | 
| 172 | 172 | return null; | 
| 173 | 173 | } | 
| @@ -178,7 +178,7 @@ discard block | ||
| 178 | 178 | return null; | 
| 179 | 179 | } | 
| 180 | 180 | }, | 
| 181 | -            'shareowner' => function ($node) use ($server, $fs, $decorator) { | |
| 181 | +            'shareowner' => function($node) use ($server, $fs, $decorator) { | |
| 182 | 182 |                  if (!$node->isSpecial()) { | 
| 183 | 183 | return null; | 
| 184 | 184 | } | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | return null; | 
| 193 | 193 | } | 
| 194 | 194 | }, | 
| 195 | -            'owner' => function ($node) use ($server, $decorator) { | |
| 195 | +            'owner' => function($node) use ($server, $decorator) { | |
| 196 | 196 |                  try { | 
| 197 | 197 | return $decorator->decorate( | 
| 198 | 198 | $server->getUserById($node->getOwner()), | 
| @@ -216,20 +216,20 @@ discard block | ||
| 216 | 216 | protected function getTimeAttributes(NodeInterface $node, array $attributes): array | 
| 217 | 217 |      { | 
| 218 | 218 | return [ | 
| 219 | -            'created' => function ($node) use ($attributes) { | |
| 219 | +            'created' => function($node) use ($attributes) { | |
| 220 | 220 |                  return $attributes['created']->toDateTime()->format('c'); | 
| 221 | 221 | }, | 
| 222 | -            'changed' => function ($node) use ($attributes) { | |
| 222 | +            'changed' => function($node) use ($attributes) { | |
| 223 | 223 |                  return $attributes['changed']->toDateTime()->format('c'); | 
| 224 | 224 | }, | 
| 225 | -            'deleted' => function ($node) use ($attributes) { | |
| 225 | +            'deleted' => function($node) use ($attributes) { | |
| 226 | 226 |                  if (false === $attributes['deleted']) { | 
| 227 | 227 | return null; | 
| 228 | 228 | } | 
| 229 | 229 | |
| 230 | 230 |                  return $attributes['deleted']->toDateTime()->format('c'); | 
| 231 | 231 | }, | 
| 232 | -            'destroy' => function ($node) use ($attributes) { | |
| 232 | +            'destroy' => function($node) use ($attributes) { | |
| 233 | 233 |                  if (null === $attributes['destroy']) { | 
| 234 | 234 | return null; | 
| 235 | 235 | } | 
| @@ -262,7 +262,7 @@ discard block | ||
| 262 | 262 | return [ | 
| 263 | 263 | 'shared' => $node->isShared(), | 
| 264 | 264 | 'reference' => $node->isReference(), | 
| 265 | -            'filter' => function ($node) use ($attributes) { | |
| 265 | +            'filter' => function($node) use ($attributes) { | |
| 266 | 266 |                  if (null === $attributes['filter']) { | 
| 267 | 267 | return null; | 
| 268 | 268 | } | 
| @@ -107,7 +107,7 @@ | ||
| 107 | 107 | * | 
| 108 | 108 | * @param string $id | 
| 109 | 109 | * @param string $p | 
| 110 | - * @param string $version | |
| 110 | + * @param integer $version | |
| 111 | 111 | * | 
| 112 | 112 | * @return Response | 
| 113 | 113 | */ | 
| @@ -282,7 +282,7 @@ discard block | ||
| 282 | 282 | * @param array|string $id | 
| 283 | 283 | * @param array|string $p | 
| 284 | 284 | * @param int $offset | 
| 285 | - * @param int $legnth | |
| 285 | + * @param int $length | |
| 286 | 286 | * @param string $encode | 
| 287 | 287 | * @param bool $download | 
| 288 | 288 | * @param string $name | 
| @@ -1420,7 +1420,7 @@ discard block | ||
| 1420 | 1420 | * @param string $class Force set node type | 
| 1421 | 1421 | * @param bool $multiple Allow $id to be an array | 
| 1422 | 1422 | * @param bool $allow_root Allow instance of root collection | 
| 1423 | - * @param bool $deleted How to handle deleted node | |
| 1423 | + * @param integer $deleted How to handle deleted node | |
| 1424 | 1424 | * | 
| 1425 | 1425 | * @return NodeInterface | 
| 1426 | 1426 | */ | 
| @@ -1454,7 +1454,7 @@ discard block | ||
| 1454 | 1454 | * @param string $id | 
| 1455 | 1455 | * @param string $path | 
| 1456 | 1456 | * @param string $class Force set node type | 
| 1457 | - * @param bool $deleted How to handle deleted node | |
| 1457 | + * @param integer $deleted How to handle deleted node | |
| 1458 | 1458 | * | 
| 1459 | 1459 | * @return Generator | 
| 1460 | 1460 | */ | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | } | 
| 193 | 193 | } | 
| 194 | 194 | |
| 195 | -        return $this->bulk($id, $p, function ($node) use ($parent, $conflict, $move) { | |
| 195 | +        return $this->bulk($id, $p, function($node) use ($parent, $conflict, $move) { | |
| 196 | 196 |              if (true === $move) { | 
| 197 | 197 | $node = $node->setParent($parent, $conflict); | 
| 198 | 198 | } | 
| @@ -273,7 +273,7 @@ discard block | ||
| 273 | 273 | |
| 274 | 274 | $node = $this->_getNode($id, $p); | 
| 275 | 275 |          if ($node instanceof Collection) { | 
| 276 | -            return (new Response())->setBody(function () use ($node) { | |
| 276 | +            return (new Response())->setBody(function() use ($node) { | |
| 277 | 277 | $node->getZip(); | 
| 278 | 278 | }); | 
| 279 | 279 | } | 
| @@ -292,7 +292,7 @@ discard block | ||
| 292 | 292 | |
| 293 | 293 | return (new Response()) | 
| 294 | 294 | ->setOutputFormat(null) | 
| 295 | -          ->setBody(function () use ($node, $encode, $offset, $length) { | |
| 295 | +          ->setBody(function() use ($node, $encode, $offset, $length) { | |
| 296 | 296 | $mime = $node->getContentType(); | 
| 297 | 297 | $stream = $node->get(); | 
| 298 | 298 | $name = $node->getName(); | 
| @@ -365,7 +365,7 @@ discard block | ||
| 365 | 365 | */ | 
| 366 | 366 | public function postReadonly($id = null, $p = null, bool $readonly = true): Response | 
| 367 | 367 |      { | 
| 368 | -        return $this->bulk($id, $p, function ($node) use ($readonly) { | |
| 368 | +        return $this->bulk($id, $p, function($node) use ($readonly) { | |
| 369 | 369 | $node->setReadonly($readonly); | 
| 370 | 370 | |
| 371 | 371 | return ['code' => 204]; | 
| @@ -618,7 +618,7 @@ discard block | ||
| 618 | 618 | */ | 
| 619 | 619 | public function postMetaAttributes(?string $id = null, ?string $p = null): Response | 
| 620 | 620 |      { | 
| 621 | -        return $this->bulk($id, $p, function ($node) { | |
| 621 | +        return $this->bulk($id, $p, function($node) { | |
| 622 | 622 | $node->setMetaAttributes($_POST); | 
| 623 | 623 | |
| 624 | 624 | return ['code' => 204]; | 
| @@ -706,7 +706,7 @@ discard block | ||
| 706 | 706 | ); | 
| 707 | 707 | } | 
| 708 | 708 | |
| 709 | -        return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { | |
| 709 | +        return $this->bulk($id, $p, function($node) use ($parent, $conflict) { | |
| 710 | 710 | $result = $node->copyTo($parent, $conflict); | 
| 711 | 711 | |
| 712 | 712 | return [ | 
| @@ -770,7 +770,7 @@ discard block | ||
| 770 | 770 | ); | 
| 771 | 771 | } | 
| 772 | 772 | |
| 773 | -        return $this->bulk($id, $p, function ($node) use ($parent, $conflict) { | |
| 773 | +        return $this->bulk($id, $p, function($node) use ($parent, $conflict) { | |
| 774 | 774 | $result = $node->setParent($parent, $conflict); | 
| 775 | 775 |              if (NodeInterface::CONFLICT_RENAME === $conflict) { | 
| 776 | 776 | return [ | 
| @@ -829,7 +829,7 @@ discard block | ||
| 829 | 829 | $at = $this->_verifyAttributes(['destroy' => $at])['destroy']; | 
| 830 | 830 | } | 
| 831 | 831 | |
| 832 | -        return $this->bulk($id, $p, function ($node) use ($force, $ignore_flag, $at) { | |
| 832 | +        return $this->bulk($id, $p, function($node) use ($force, $ignore_flag, $at) { | |
| 833 | 833 |              if (null === $at) { | 
| 834 | 834 | $node->delete($force && $node->isDeleted() || $force && $ignore_flag); | 
| 835 | 835 |              } else { |