@@ -31,54 +31,54 @@ |
||
31 | 31 | * @since 15.0.0 |
32 | 32 | */ |
33 | 33 | interface ITrashBackend { |
34 | - /** |
|
35 | - * List all trash items in the root of the trashbin |
|
36 | - * |
|
37 | - * @param IUser $user |
|
38 | - * @return ITrashItem[] |
|
39 | - * @since 15.0.0 |
|
40 | - */ |
|
41 | - public function listTrashRoot(IUser $user): array; |
|
34 | + /** |
|
35 | + * List all trash items in the root of the trashbin |
|
36 | + * |
|
37 | + * @param IUser $user |
|
38 | + * @return ITrashItem[] |
|
39 | + * @since 15.0.0 |
|
40 | + */ |
|
41 | + public function listTrashRoot(IUser $user): array; |
|
42 | 42 | |
43 | - /** |
|
44 | - * List all trash items in a subfolder in the trashbin |
|
45 | - * |
|
46 | - * @param ITrashItem $folder |
|
47 | - * @return ITrashItem[] |
|
48 | - * @since 15.0.0 |
|
49 | - */ |
|
50 | - public function listTrashFolder(ITrashItem $folder): array; |
|
43 | + /** |
|
44 | + * List all trash items in a subfolder in the trashbin |
|
45 | + * |
|
46 | + * @param ITrashItem $folder |
|
47 | + * @return ITrashItem[] |
|
48 | + * @since 15.0.0 |
|
49 | + */ |
|
50 | + public function listTrashFolder(ITrashItem $folder): array; |
|
51 | 51 | |
52 | - /** |
|
53 | - * Restore a trashbin item |
|
54 | - * |
|
55 | - * @param ITrashItem $item |
|
56 | - * @since 15.0.0 |
|
57 | - */ |
|
58 | - public function restoreItem(ITrashItem $item); |
|
52 | + /** |
|
53 | + * Restore a trashbin item |
|
54 | + * |
|
55 | + * @param ITrashItem $item |
|
56 | + * @since 15.0.0 |
|
57 | + */ |
|
58 | + public function restoreItem(ITrashItem $item); |
|
59 | 59 | |
60 | - /** |
|
61 | - * Permanently remove an item from trash |
|
62 | - * |
|
63 | - * @param ITrashItem $item |
|
64 | - * @since 15.0.0 |
|
65 | - */ |
|
66 | - public function removeItem(ITrashItem $item); |
|
60 | + /** |
|
61 | + * Permanently remove an item from trash |
|
62 | + * |
|
63 | + * @param ITrashItem $item |
|
64 | + * @since 15.0.0 |
|
65 | + */ |
|
66 | + public function removeItem(ITrashItem $item); |
|
67 | 67 | |
68 | - /** |
|
69 | - * Move a file or folder to trash |
|
70 | - * |
|
71 | - * @param IStorage $storage |
|
72 | - * @param string $internalPath |
|
73 | - * @return boolean whether or not the file was moved to trash, if false then the file should be deleted normally |
|
74 | - * @since 15.0.0 |
|
75 | - */ |
|
76 | - public function moveToTrash(IStorage $storage, string $internalPath): bool; |
|
68 | + /** |
|
69 | + * Move a file or folder to trash |
|
70 | + * |
|
71 | + * @param IStorage $storage |
|
72 | + * @param string $internalPath |
|
73 | + * @return boolean whether or not the file was moved to trash, if false then the file should be deleted normally |
|
74 | + * @since 15.0.0 |
|
75 | + */ |
|
76 | + public function moveToTrash(IStorage $storage, string $internalPath): bool; |
|
77 | 77 | |
78 | - /** |
|
79 | - * @param IUser $user |
|
80 | - * @param int $fileId |
|
81 | - * @return Node|null |
|
82 | - */ |
|
83 | - public function getTrashNodeById(IUser $user, int $fileId); |
|
78 | + /** |
|
79 | + * @param IUser $user |
|
80 | + * @param int $fileId |
|
81 | + * @return Node|null |
|
82 | + */ |
|
83 | + public function getTrashNodeById(IUser $user, int $fileId); |
|
84 | 84 | } |
@@ -29,49 +29,49 @@ |
||
29 | 29 | use Sabre\DAV\ICollection; |
30 | 30 | |
31 | 31 | abstract class AbstractTrashFolder extends AbstractTrash implements ICollection, ITrash { |
32 | - public function getChildren(): array { |
|
33 | - $entries = $this->trashManager->listTrashFolder($this->data); |
|
32 | + public function getChildren(): array { |
|
33 | + $entries = $this->trashManager->listTrashFolder($this->data); |
|
34 | 34 | |
35 | - $children = array_map(function (ITrashItem $entry) { |
|
36 | - if ($entry->getType() === FileInfo::TYPE_FOLDER) { |
|
37 | - return new TrashFolderFolder($this->trashManager, $entry); |
|
38 | - } |
|
39 | - return new TrashFolderFile($this->trashManager, $entry); |
|
40 | - }, $entries); |
|
35 | + $children = array_map(function (ITrashItem $entry) { |
|
36 | + if ($entry->getType() === FileInfo::TYPE_FOLDER) { |
|
37 | + return new TrashFolderFolder($this->trashManager, $entry); |
|
38 | + } |
|
39 | + return new TrashFolderFile($this->trashManager, $entry); |
|
40 | + }, $entries); |
|
41 | 41 | |
42 | - return $children; |
|
43 | - } |
|
42 | + return $children; |
|
43 | + } |
|
44 | 44 | |
45 | - public function getChild($name): ITrash { |
|
46 | - $entries = $this->getChildren(); |
|
45 | + public function getChild($name): ITrash { |
|
46 | + $entries = $this->getChildren(); |
|
47 | 47 | |
48 | - foreach ($entries as $entry) { |
|
49 | - if ($entry->getName() === $name) { |
|
50 | - return $entry; |
|
51 | - } |
|
52 | - } |
|
48 | + foreach ($entries as $entry) { |
|
49 | + if ($entry->getName() === $name) { |
|
50 | + return $entry; |
|
51 | + } |
|
52 | + } |
|
53 | 53 | |
54 | - throw new NotFound(); |
|
55 | - } |
|
54 | + throw new NotFound(); |
|
55 | + } |
|
56 | 56 | |
57 | - public function childExists($name): bool { |
|
58 | - try { |
|
59 | - $this->getChild($name); |
|
60 | - return true; |
|
61 | - } catch (NotFound $e) { |
|
62 | - return false; |
|
63 | - } |
|
64 | - } |
|
57 | + public function childExists($name): bool { |
|
58 | + try { |
|
59 | + $this->getChild($name); |
|
60 | + return true; |
|
61 | + } catch (NotFound $e) { |
|
62 | + return false; |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | - public function setName($name) { |
|
67 | - throw new Forbidden(); |
|
68 | - } |
|
66 | + public function setName($name) { |
|
67 | + throw new Forbidden(); |
|
68 | + } |
|
69 | 69 | |
70 | - public function createFile($name, $data = null) { |
|
71 | - throw new Forbidden(); |
|
72 | - } |
|
70 | + public function createFile($name, $data = null) { |
|
71 | + throw new Forbidden(); |
|
72 | + } |
|
73 | 73 | |
74 | - public function createDirectory($name) { |
|
75 | - throw new Forbidden(); |
|
76 | - } |
|
74 | + public function createDirectory($name) { |
|
75 | + throw new Forbidden(); |
|
76 | + } |
|
77 | 77 | } |
@@ -25,11 +25,11 @@ |
||
25 | 25 | namespace OCA\Files_Trashbin\Sabre; |
26 | 26 | |
27 | 27 | class TrashFile extends AbstractTrashFile { |
28 | - public function get() { |
|
29 | - return $this->data->getStorage()->fopen($this->data->getInternalPath() . '.d' . $this->getLastModified(), 'rb'); |
|
30 | - } |
|
28 | + public function get() { |
|
29 | + return $this->data->getStorage()->fopen($this->data->getInternalPath() . '.d' . $this->getLastModified(), 'rb'); |
|
30 | + } |
|
31 | 31 | |
32 | - public function getName(): string { |
|
33 | - return $this->data->getName() . '.d' . $this->getLastModified(); |
|
34 | - } |
|
32 | + public function getName(): string { |
|
33 | + return $this->data->getName() . '.d' . $this->getLastModified(); |
|
34 | + } |
|
35 | 35 | } |
@@ -45,45 +45,45 @@ |
||
45 | 45 | interface ISearchService { |
46 | 46 | |
47 | 47 | |
48 | - /** |
|
49 | - * generate a search request, based on an array: |
|
50 | - * |
|
51 | - * $request = |
|
52 | - * [ |
|
53 | - * 'providers' => (string/array) 'all' |
|
54 | - * 'author' => (string) owner of the document. |
|
55 | - * 'search' => (string) search string, |
|
56 | - * 'size' => (int) number of items to be return |
|
57 | - * 'page' => (int) page |
|
58 | - * 'parts' => (array) parts of document to search within, |
|
59 | - * 'options' = (array) search options, |
|
60 | - * 'tags' => (array) tags, |
|
61 | - * 'metatags' => (array) metatags, |
|
62 | - * 'subtags' => (array) subtags |
|
63 | - * ] |
|
64 | - * |
|
65 | - * 'providers' can be an array of providerIds |
|
66 | - * |
|
67 | - * @since 15.0.0 |
|
68 | - * |
|
69 | - * @param array $request |
|
70 | - * |
|
71 | - * @return ISearchRequest |
|
72 | - */ |
|
73 | - public function generateSearchRequest(array $request): ISearchRequest; |
|
48 | + /** |
|
49 | + * generate a search request, based on an array: |
|
50 | + * |
|
51 | + * $request = |
|
52 | + * [ |
|
53 | + * 'providers' => (string/array) 'all' |
|
54 | + * 'author' => (string) owner of the document. |
|
55 | + * 'search' => (string) search string, |
|
56 | + * 'size' => (int) number of items to be return |
|
57 | + * 'page' => (int) page |
|
58 | + * 'parts' => (array) parts of document to search within, |
|
59 | + * 'options' = (array) search options, |
|
60 | + * 'tags' => (array) tags, |
|
61 | + * 'metatags' => (array) metatags, |
|
62 | + * 'subtags' => (array) subtags |
|
63 | + * ] |
|
64 | + * |
|
65 | + * 'providers' can be an array of providerIds |
|
66 | + * |
|
67 | + * @since 15.0.0 |
|
68 | + * |
|
69 | + * @param array $request |
|
70 | + * |
|
71 | + * @return ISearchRequest |
|
72 | + */ |
|
73 | + public function generateSearchRequest(array $request): ISearchRequest; |
|
74 | 74 | |
75 | 75 | |
76 | - /** |
|
77 | - * Search documents |
|
78 | - * |
|
79 | - * @since 15.0.0 |
|
80 | - * |
|
81 | - * @param string $userId |
|
82 | - * @param ISearchRequest $searchRequest |
|
83 | - * |
|
84 | - * @return ISearchResult[] |
|
85 | - */ |
|
86 | - public function search(string $userId, ISearchRequest $searchRequest): array; |
|
76 | + /** |
|
77 | + * Search documents |
|
78 | + * |
|
79 | + * @since 15.0.0 |
|
80 | + * |
|
81 | + * @param string $userId |
|
82 | + * @param ISearchRequest $searchRequest |
|
83 | + * |
|
84 | + * @return ISearchResult[] |
|
85 | + */ |
|
86 | + public function search(string $userId, ISearchRequest $searchRequest): array; |
|
87 | 87 | |
88 | 88 | } |
89 | 89 |
@@ -41,24 +41,24 @@ |
||
41 | 41 | interface IProviderService { |
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * Check if the provider $providerId is already indexed. |
|
46 | - * |
|
47 | - * @since 15.0.0 |
|
48 | - * |
|
49 | - * @param string $providerId |
|
50 | - * |
|
51 | - * @return bool |
|
52 | - */ |
|
53 | - public function isProviderIndexed(string $providerId); |
|
44 | + /** |
|
45 | + * Check if the provider $providerId is already indexed. |
|
46 | + * |
|
47 | + * @since 15.0.0 |
|
48 | + * |
|
49 | + * @param string $providerId |
|
50 | + * |
|
51 | + * @return bool |
|
52 | + */ |
|
53 | + public function isProviderIndexed(string $providerId); |
|
54 | 54 | |
55 | 55 | |
56 | - /** |
|
57 | - * Add the Javascript API in the navigation page of an app. |
|
58 | - * |
|
59 | - * @since 15.0.0 |
|
60 | - */ |
|
61 | - public function addJavascriptAPI(); |
|
56 | + /** |
|
57 | + * Add the Javascript API in the navigation page of an app. |
|
58 | + * |
|
59 | + * @since 15.0.0 |
|
60 | + */ |
|
61 | + public function addJavascriptAPI(); |
|
62 | 62 | |
63 | 63 | |
64 | 64 | } |
@@ -46,41 +46,41 @@ |
||
46 | 46 | interface IIndexOptions { |
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * Get the value (as a string) for an option. |
|
51 | - * |
|
52 | - * @since 15.0.0 |
|
53 | - * |
|
54 | - * @param string $option |
|
55 | - * @param string $default |
|
56 | - * |
|
57 | - * @return string |
|
58 | - */ |
|
59 | - public function getOption(string $option, string $default = ''): string; |
|
49 | + /** |
|
50 | + * Get the value (as a string) for an option. |
|
51 | + * |
|
52 | + * @since 15.0.0 |
|
53 | + * |
|
54 | + * @param string $option |
|
55 | + * @param string $default |
|
56 | + * |
|
57 | + * @return string |
|
58 | + */ |
|
59 | + public function getOption(string $option, string $default = ''): string; |
|
60 | 60 | |
61 | - /** |
|
62 | - * Get the value (as an array) for an option. |
|
63 | - * |
|
64 | - * @since 15.0.0 |
|
65 | - * |
|
66 | - * @param string $option |
|
67 | - * @param array $default |
|
68 | - * |
|
69 | - * @return array |
|
70 | - */ |
|
71 | - public function getOptionArray(string $option, array $default = []): array; |
|
61 | + /** |
|
62 | + * Get the value (as an array) for an option. |
|
63 | + * |
|
64 | + * @since 15.0.0 |
|
65 | + * |
|
66 | + * @param string $option |
|
67 | + * @param array $default |
|
68 | + * |
|
69 | + * @return array |
|
70 | + */ |
|
71 | + public function getOptionArray(string $option, array $default = []): array; |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get the value (as an boolean) for an option. |
|
75 | - * |
|
76 | - * @since 15.0.0 |
|
77 | - * |
|
78 | - * @param string $option |
|
79 | - * @param bool $default |
|
80 | - * |
|
81 | - * @return bool |
|
82 | - */ |
|
83 | - public function getOptionBool(string $option, bool $default): bool; |
|
73 | + /** |
|
74 | + * Get the value (as an boolean) for an option. |
|
75 | + * |
|
76 | + * @since 15.0.0 |
|
77 | + * |
|
78 | + * @param string $option |
|
79 | + * @param bool $default |
|
80 | + * |
|
81 | + * @return bool |
|
82 | + */ |
|
83 | + public function getOptionBool(string $option, bool $default): bool; |
|
84 | 84 | |
85 | 85 | } |
86 | 86 |
@@ -26,16 +26,16 @@ |
||
26 | 26 | use OC\Authentication\Token\IToken; |
27 | 27 | |
28 | 28 | class ExpiredTokenException extends InvalidTokenException { |
29 | - /** @var IToken */ |
|
30 | - private $token; |
|
29 | + /** @var IToken */ |
|
30 | + private $token; |
|
31 | 31 | |
32 | - public function __construct(IToken $token) { |
|
33 | - parent::__construct(); |
|
32 | + public function __construct(IToken $token) { |
|
33 | + parent::__construct(); |
|
34 | 34 | |
35 | - $this->token = $token; |
|
36 | - } |
|
35 | + $this->token = $token; |
|
36 | + } |
|
37 | 37 | |
38 | - public function getToken(): IToken { |
|
39 | - return $this->token; |
|
40 | - } |
|
38 | + public function getToken(): IToken { |
|
39 | + return $this->token; |
|
40 | + } |
|
41 | 41 | } |
@@ -25,12 +25,12 @@ |
||
25 | 25 | * @since 15.0.0 |
26 | 26 | */ |
27 | 27 | interface IVersionManager extends IVersionBackend { |
28 | - /** |
|
29 | - * Register a new backend |
|
30 | - * |
|
31 | - * @param string $storageType |
|
32 | - * @param IVersionBackend $backend |
|
33 | - * @since 15.0.0 |
|
34 | - */ |
|
35 | - public function registerBackend(string $storageType, IVersionBackend $backend); |
|
28 | + /** |
|
29 | + * Register a new backend |
|
30 | + * |
|
31 | + * @param string $storageType |
|
32 | + * @param IVersionBackend $backend |
|
33 | + * @since 15.0.0 |
|
34 | + */ |
|
35 | + public function registerBackend(string $storageType, IVersionBackend $backend); |
|
36 | 36 | } |
@@ -31,23 +31,23 @@ |
||
31 | 31 | |
32 | 32 | class Version15000Date20181029084625 extends SimpleMigrationStep { |
33 | 33 | |
34 | - /** |
|
35 | - * @param IOutput $output |
|
36 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | - * @param array $options |
|
38 | - * @return null|ISchemaWrapper |
|
39 | - */ |
|
40 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
41 | - /** @var ISchemaWrapper $schema */ |
|
42 | - $schema = $schemaClosure(); |
|
34 | + /** |
|
35 | + * @param IOutput $output |
|
36 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
37 | + * @param array $options |
|
38 | + * @return null|ISchemaWrapper |
|
39 | + */ |
|
40 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
41 | + /** @var ISchemaWrapper $schema */ |
|
42 | + $schema = $schemaClosure(); |
|
43 | 43 | |
44 | - $table = $schema->getTable('share'); |
|
45 | - $table->addColumn('label', 'string', [ |
|
46 | - 'notnull' => false, |
|
47 | - 'length' => 255, |
|
48 | - ]); |
|
44 | + $table = $schema->getTable('share'); |
|
45 | + $table->addColumn('label', 'string', [ |
|
46 | + 'notnull' => false, |
|
47 | + 'length' => 255, |
|
48 | + ]); |
|
49 | 49 | |
50 | - return $schema; |
|
51 | - } |
|
50 | + return $schema; |
|
51 | + } |
|
52 | 52 | |
53 | 53 | } |