@@ -34,35 +34,35 @@ |
||
34 | 34 | */ |
35 | 35 | class UserAddedEvent extends Event { |
36 | 36 | |
37 | - /** @var IGroup */ |
|
38 | - private $group; |
|
37 | + /** @var IGroup */ |
|
38 | + private $group; |
|
39 | 39 | |
40 | - /*** @var IUser */ |
|
41 | - private $user; |
|
40 | + /*** @var IUser */ |
|
41 | + private $user; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @since 18.0.0 |
|
45 | - */ |
|
46 | - public function __construct(IGroup $group, IUser $user) { |
|
47 | - parent::__construct(); |
|
48 | - $this->group = $group; |
|
49 | - $this->user = $user; |
|
50 | - } |
|
43 | + /** |
|
44 | + * @since 18.0.0 |
|
45 | + */ |
|
46 | + public function __construct(IGroup $group, IUser $user) { |
|
47 | + parent::__construct(); |
|
48 | + $this->group = $group; |
|
49 | + $this->user = $user; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return IGroup |
|
54 | - * @since 18.0.0 |
|
55 | - */ |
|
56 | - public function getGroup(): IGroup { |
|
57 | - return $this->group; |
|
58 | - } |
|
52 | + /** |
|
53 | + * @return IGroup |
|
54 | + * @since 18.0.0 |
|
55 | + */ |
|
56 | + public function getGroup(): IGroup { |
|
57 | + return $this->group; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return IUser |
|
62 | - * @since 18.0.0 |
|
63 | - */ |
|
64 | - public function getUser(): IUser { |
|
65 | - return $this->user; |
|
66 | - } |
|
60 | + /** |
|
61 | + * @return IUser |
|
62 | + * @since 18.0.0 |
|
63 | + */ |
|
64 | + public function getUser(): IUser { |
|
65 | + return $this->user; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | } |
@@ -29,48 +29,48 @@ |
||
29 | 29 | |
30 | 30 | class Token implements IToken { |
31 | 31 | |
32 | - /** @var Manager */ |
|
33 | - private $manager; |
|
34 | - private $data; |
|
32 | + /** @var Manager */ |
|
33 | + private $manager; |
|
34 | + private $data; |
|
35 | 35 | |
36 | - public function __construct(Manager $manager, $data) { |
|
37 | - $this->manager = $manager; |
|
38 | - $this->data = $data; |
|
39 | - } |
|
36 | + public function __construct(Manager $manager, $data) { |
|
37 | + $this->manager = $manager; |
|
38 | + $this->data = $data; |
|
39 | + } |
|
40 | 40 | |
41 | - public function extend(): void { |
|
42 | - $this->manager->refreshToken($this->data['token']); |
|
43 | - } |
|
41 | + public function extend(): void { |
|
42 | + $this->manager->refreshToken($this->data['token']); |
|
43 | + } |
|
44 | 44 | |
45 | - public function invalidate(): void { |
|
46 | - $this->manager->invalidateToken($this->data['token']); |
|
47 | - } |
|
45 | + public function invalidate(): void { |
|
46 | + $this->manager->invalidateToken($this->data['token']); |
|
47 | + } |
|
48 | 48 | |
49 | - public function getFile(): File { |
|
50 | - if ($this->data['share_id'] !== null) { |
|
51 | - return $this->manager->getShareForToken($this->data['share_id']); |
|
52 | - } |
|
53 | - return $this->manager->getFileForToken($this->data['user_id'], $this->data['file_id'], $this->data['file_path']); |
|
54 | - } |
|
49 | + public function getFile(): File { |
|
50 | + if ($this->data['share_id'] !== null) { |
|
51 | + return $this->manager->getShareForToken($this->data['share_id']); |
|
52 | + } |
|
53 | + return $this->manager->getFileForToken($this->data['user_id'], $this->data['file_id'], $this->data['file_path']); |
|
54 | + } |
|
55 | 55 | |
56 | - public function getToken(): string { |
|
57 | - return $this->data['token']; |
|
58 | - } |
|
56 | + public function getToken(): string { |
|
57 | + return $this->data['token']; |
|
58 | + } |
|
59 | 59 | |
60 | - public function useTokenScope(): void { |
|
61 | - $this->manager->invokeTokenScope($this->data['user_id']); |
|
62 | - } |
|
60 | + public function useTokenScope(): void { |
|
61 | + $this->manager->invokeTokenScope($this->data['user_id']); |
|
62 | + } |
|
63 | 63 | |
64 | - public function hasBeenAccessed(): bool { |
|
65 | - return (bool) $this->data['accessed']; |
|
66 | - } |
|
64 | + public function hasBeenAccessed(): bool { |
|
65 | + return (bool) $this->data['accessed']; |
|
66 | + } |
|
67 | 67 | |
68 | - public function getEditor(): string { |
|
69 | - return $this->data['editor_id']; |
|
70 | - } |
|
68 | + public function getEditor(): string { |
|
69 | + return $this->data['editor_id']; |
|
70 | + } |
|
71 | 71 | |
72 | - public function getUser(): string { |
|
73 | - return $this->data['user_id']; |
|
74 | - } |
|
72 | + public function getUser(): string { |
|
73 | + return $this->data['user_id']; |
|
74 | + } |
|
75 | 75 | |
76 | 76 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher |
28 | 28 | */ |
29 | 29 | abstract class BasicEmitter implements Emitter { |
30 | - use EmitterTrait; |
|
30 | + use EmitterTrait; |
|
31 | 31 | } |
@@ -36,12 +36,12 @@ |
||
36 | 36 | * @since 18.0.0 |
37 | 37 | */ |
38 | 38 | interface IFileCheck extends IEntityCheck { |
39 | - /** |
|
40 | - * @param IStorage $storage |
|
41 | - * @param string $path |
|
42 | - * @param bool $isDir |
|
43 | - * @since 18.0.0 |
|
44 | - */ |
|
45 | - public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
39 | + /** |
|
40 | + * @param IStorage $storage |
|
41 | + * @param string $path |
|
42 | + * @param bool $isDir |
|
43 | + * @since 18.0.0 |
|
44 | + */ |
|
45 | + public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void; |
|
46 | 46 | |
47 | 47 | } |
@@ -35,54 +35,54 @@ |
||
35 | 35 | **/ |
36 | 36 | interface IMimeTypeDetector { |
37 | 37 | |
38 | - /** |
|
39 | - * detect mimetype only based on filename, content of file is not used |
|
40 | - * @param string $path |
|
41 | - * @return string |
|
42 | - * @since 8.2.0 |
|
43 | - */ |
|
44 | - public function detectPath($path); |
|
38 | + /** |
|
39 | + * detect mimetype only based on filename, content of file is not used |
|
40 | + * @param string $path |
|
41 | + * @return string |
|
42 | + * @since 8.2.0 |
|
43 | + */ |
|
44 | + public function detectPath($path); |
|
45 | 45 | |
46 | - /** |
|
47 | - * detect mimetype only based on the content of file |
|
48 | - * @param string $path |
|
49 | - * @return string |
|
50 | - * @since 18.0.0 |
|
51 | - */ |
|
52 | - public function detectContent(string $path): string; |
|
46 | + /** |
|
47 | + * detect mimetype only based on the content of file |
|
48 | + * @param string $path |
|
49 | + * @return string |
|
50 | + * @since 18.0.0 |
|
51 | + */ |
|
52 | + public function detectContent(string $path): string; |
|
53 | 53 | |
54 | - /** |
|
55 | - * detect mimetype based on both filename and content |
|
56 | - * |
|
57 | - * @param string $path |
|
58 | - * @return string |
|
59 | - * @since 8.2.0 |
|
60 | - */ |
|
61 | - public function detect($path); |
|
54 | + /** |
|
55 | + * detect mimetype based on both filename and content |
|
56 | + * |
|
57 | + * @param string $path |
|
58 | + * @return string |
|
59 | + * @since 8.2.0 |
|
60 | + */ |
|
61 | + public function detect($path); |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get a secure mimetype that won't expose potential XSS. |
|
65 | - * |
|
66 | - * @param string $mimeType |
|
67 | - * @return string |
|
68 | - * @since 8.2.0 |
|
69 | - */ |
|
70 | - public function getSecureMimeType($mimeType); |
|
63 | + /** |
|
64 | + * Get a secure mimetype that won't expose potential XSS. |
|
65 | + * |
|
66 | + * @param string $mimeType |
|
67 | + * @return string |
|
68 | + * @since 8.2.0 |
|
69 | + */ |
|
70 | + public function getSecureMimeType($mimeType); |
|
71 | 71 | |
72 | - /** |
|
73 | - * detect mimetype based on the content of a string |
|
74 | - * |
|
75 | - * @param string $data |
|
76 | - * @return string |
|
77 | - * @since 8.2.0 |
|
78 | - */ |
|
79 | - public function detectString($data); |
|
72 | + /** |
|
73 | + * detect mimetype based on the content of a string |
|
74 | + * |
|
75 | + * @param string $data |
|
76 | + * @return string |
|
77 | + * @since 8.2.0 |
|
78 | + */ |
|
79 | + public function detectString($data); |
|
80 | 80 | |
81 | - /** |
|
82 | - * Get path to the icon of a file type |
|
83 | - * @param string $mimeType the MIME type |
|
84 | - * @return string the url |
|
85 | - * @since 8.2.0 |
|
86 | - */ |
|
87 | - public function mimeTypeIcon($mimeType); |
|
81 | + /** |
|
82 | + * Get path to the icon of a file type |
|
83 | + * @param string $mimeType the MIME type |
|
84 | + * @return string the url |
|
85 | + * @since 8.2.0 |
|
86 | + */ |
|
87 | + public function mimeTypeIcon($mimeType); |
|
88 | 88 | } |
@@ -31,40 +31,40 @@ |
||
31 | 31 | use OCP\WorkflowEngine\IEntity; |
32 | 32 | |
33 | 33 | trait TFileCheck { |
34 | - /** @var IStorage */ |
|
35 | - protected $storage; |
|
34 | + /** @var IStorage */ |
|
35 | + protected $storage; |
|
36 | 36 | |
37 | - /** @var string */ |
|
38 | - protected $path; |
|
37 | + /** @var string */ |
|
38 | + protected $path; |
|
39 | 39 | |
40 | - /** @var bool */ |
|
41 | - protected $isDir; |
|
40 | + /** @var bool */ |
|
41 | + protected $isDir; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param IStorage $storage |
|
45 | - * @param string $path |
|
46 | - * @param bool $isDir |
|
47 | - * @since 18.0.0 |
|
48 | - */ |
|
49 | - public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void { |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - $this->isDir = $isDir; |
|
53 | - } |
|
43 | + /** |
|
44 | + * @param IStorage $storage |
|
45 | + * @param string $path |
|
46 | + * @param bool $isDir |
|
47 | + * @since 18.0.0 |
|
48 | + */ |
|
49 | + public function setFileInfo(IStorage $storage, string $path, bool $isDir = false): void { |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + $this->isDir = $isDir; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @throws \OCP\Files\NotFoundException |
|
57 | - */ |
|
58 | - public function setEntitySubject(IEntity $entity, $subject): void { |
|
59 | - if ($entity instanceof File) { |
|
60 | - if (!$subject instanceof Node) { |
|
61 | - throw new \UnexpectedValueException( |
|
62 | - 'Expected Node subject for File entity, got {class}', |
|
63 | - ['app' => Application::APP_ID, 'class' => get_class($subject)] |
|
64 | - ); |
|
65 | - } |
|
66 | - $this->storage = $subject->getStorage(); |
|
67 | - $this->path = $subject->getPath(); |
|
68 | - } |
|
69 | - } |
|
55 | + /** |
|
56 | + * @throws \OCP\Files\NotFoundException |
|
57 | + */ |
|
58 | + public function setEntitySubject(IEntity $entity, $subject): void { |
|
59 | + if ($entity instanceof File) { |
|
60 | + if (!$subject instanceof Node) { |
|
61 | + throw new \UnexpectedValueException( |
|
62 | + 'Expected Node subject for File entity, got {class}', |
|
63 | + ['app' => Application::APP_ID, 'class' => get_class($subject)] |
|
64 | + ); |
|
65 | + } |
|
66 | + $this->storage = $subject->getStorage(); |
|
67 | + $this->path = $subject->getPath(); |
|
68 | + } |
|
69 | + } |
|
70 | 70 | } |
@@ -33,38 +33,38 @@ |
||
33 | 33 | */ |
34 | 34 | class NodeRemovedFromCache extends Event { |
35 | 35 | |
36 | - /** @var IStorage */ |
|
37 | - private $storage; |
|
36 | + /** @var IStorage */ |
|
37 | + private $storage; |
|
38 | 38 | |
39 | - /** @var string */ |
|
40 | - private $path; |
|
39 | + /** @var string */ |
|
40 | + private $path; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IStorage $storage |
|
44 | - * @param string $path |
|
45 | - * @since 18.0.0 |
|
46 | - */ |
|
47 | - public function __construct(IStorage $storage, |
|
48 | - string $path) { |
|
49 | - parent::__construct(); |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - } |
|
42 | + /** |
|
43 | + * @param IStorage $storage |
|
44 | + * @param string $path |
|
45 | + * @since 18.0.0 |
|
46 | + */ |
|
47 | + public function __construct(IStorage $storage, |
|
48 | + string $path) { |
|
49 | + parent::__construct(); |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return IStorage |
|
56 | - * @since 18.0.0 |
|
57 | - */ |
|
58 | - public function getStorage(): IStorage { |
|
59 | - return $this->storage; |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return IStorage |
|
56 | + * @since 18.0.0 |
|
57 | + */ |
|
58 | + public function getStorage(): IStorage { |
|
59 | + return $this->storage; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @return string |
|
64 | - * @since 18.0.0 |
|
65 | - */ |
|
66 | - public function getPath(): string { |
|
67 | - return $this->path; |
|
68 | - } |
|
62 | + /** |
|
63 | + * @return string |
|
64 | + * @since 18.0.0 |
|
65 | + */ |
|
66 | + public function getPath(): string { |
|
67 | + return $this->path; |
|
68 | + } |
|
69 | 69 | |
70 | 70 | } |
@@ -33,38 +33,38 @@ |
||
33 | 33 | */ |
34 | 34 | class FileCacheUpdated extends Event { |
35 | 35 | |
36 | - /** @var IStorage */ |
|
37 | - private $storage; |
|
36 | + /** @var IStorage */ |
|
37 | + private $storage; |
|
38 | 38 | |
39 | - /** @var string */ |
|
40 | - private $path; |
|
39 | + /** @var string */ |
|
40 | + private $path; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IStorage $storage |
|
44 | - * @param string $path |
|
45 | - * @since 18.0.0 |
|
46 | - */ |
|
47 | - public function __construct(IStorage $storage, |
|
48 | - string $path) { |
|
49 | - parent::__construct(); |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - } |
|
42 | + /** |
|
43 | + * @param IStorage $storage |
|
44 | + * @param string $path |
|
45 | + * @since 18.0.0 |
|
46 | + */ |
|
47 | + public function __construct(IStorage $storage, |
|
48 | + string $path) { |
|
49 | + parent::__construct(); |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return IStorage |
|
56 | - * @since 18.0.0 |
|
57 | - */ |
|
58 | - public function getStorage(): IStorage { |
|
59 | - return $this->storage; |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return IStorage |
|
56 | + * @since 18.0.0 |
|
57 | + */ |
|
58 | + public function getStorage(): IStorage { |
|
59 | + return $this->storage; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @return string |
|
64 | - * @since 18.0.0 |
|
65 | - */ |
|
66 | - public function getPath(): string { |
|
67 | - return $this->path; |
|
68 | - } |
|
62 | + /** |
|
63 | + * @return string |
|
64 | + * @since 18.0.0 |
|
65 | + */ |
|
66 | + public function getPath(): string { |
|
67 | + return $this->path; |
|
68 | + } |
|
69 | 69 | |
70 | 70 | } |
@@ -33,38 +33,38 @@ |
||
33 | 33 | */ |
34 | 34 | class NodeAddedToCache extends Event { |
35 | 35 | |
36 | - /** @var IStorage */ |
|
37 | - private $storage; |
|
36 | + /** @var IStorage */ |
|
37 | + private $storage; |
|
38 | 38 | |
39 | - /** @var string */ |
|
40 | - private $path; |
|
39 | + /** @var string */ |
|
40 | + private $path; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param IStorage $storage |
|
44 | - * @param string $path |
|
45 | - * @since 18.0.0 |
|
46 | - */ |
|
47 | - public function __construct(IStorage $storage, |
|
48 | - string $path) { |
|
49 | - parent::__construct(); |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - } |
|
42 | + /** |
|
43 | + * @param IStorage $storage |
|
44 | + * @param string $path |
|
45 | + * @since 18.0.0 |
|
46 | + */ |
|
47 | + public function __construct(IStorage $storage, |
|
48 | + string $path) { |
|
49 | + parent::__construct(); |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return IStorage |
|
56 | - * @since 18.0.0 |
|
57 | - */ |
|
58 | - public function getStorage(): IStorage { |
|
59 | - return $this->storage; |
|
60 | - } |
|
54 | + /** |
|
55 | + * @return IStorage |
|
56 | + * @since 18.0.0 |
|
57 | + */ |
|
58 | + public function getStorage(): IStorage { |
|
59 | + return $this->storage; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @return string |
|
64 | - * @since 18.0.0 |
|
65 | - */ |
|
66 | - public function getPath(): string { |
|
67 | - return $this->path; |
|
68 | - } |
|
62 | + /** |
|
63 | + * @return string |
|
64 | + * @since 18.0.0 |
|
65 | + */ |
|
66 | + public function getPath(): string { |
|
67 | + return $this->path; |
|
68 | + } |
|
69 | 69 | |
70 | 70 | } |