aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/federatedfilesharing/l10n/sk.js1
-rw-r--r--apps/federatedfilesharing/l10n/sk.json1
-rw-r--r--apps/federation/l10n/sk.js1
-rw-r--r--apps/federation/l10n/sk.json1
-rw-r--r--apps/files/l10n/ru.js2
-rw-r--r--apps/files/l10n/ru.json2
-rw-r--r--apps/files/l10n/sk.js8
-rw-r--r--apps/files/l10n/sk.json8
-rw-r--r--apps/files_sharing/l10n/zh_CN.js6
-rw-r--r--apps/files_sharing/l10n/zh_CN.json6
-rw-r--r--apps/systemtags/l10n/sk.js58
-rw-r--r--apps/systemtags/l10n/sk.json56
-rw-r--r--apps/systemtags/lib/Activity/Listener.php2
-rw-r--r--apps/updatenotification/l10n/sk.js3
-rw-r--r--apps/updatenotification/l10n/sk.json3
-rw-r--r--apps/workflowengine/l10n/sk.js1
-rw-r--r--apps/workflowengine/l10n/sk.json1
-rwxr-xr-xautotest.sh14
-rw-r--r--lib/base.php1
-rw-r--r--lib/private/App/AppManager.php2
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php1
-rw-r--r--lib/private/AppFramework/Http/Dispatcher.php3
-rw-r--r--lib/private/AppFramework/Middleware/MiddlewareDispatcher.php21
-rw-r--r--lib/private/AppFramework/Utility/ControllerMethodReflector.php54
-rw-r--r--lib/private/SystemTag/ManagerFactory.php5
-rw-r--r--lib/private/SystemTag/SystemTag.php11
-rw-r--r--lib/private/SystemTag/SystemTagManager.php63
-rw-r--r--lib/private/SystemTag/SystemTagObjectMapper.php31
-rw-r--r--lib/public/AppFramework/Http/Response.php4
-rw-r--r--lib/public/AppFramework/Utility/IControllerMethodReflector.php9
-rw-r--r--lib/public/SystemTag/ISystemTag.php9
-rw-r--r--lib/public/SystemTag/ISystemTagManager.php39
-rw-r--r--lib/public/SystemTag/ISystemTagManagerFactory.php5
-rw-r--r--lib/public/SystemTag/ISystemTagObjectMapper.php19
-rw-r--r--lib/public/SystemTag/ManagerEvent.php10
-rw-r--r--lib/public/SystemTag/MapperEvent.php11
-rw-r--r--lib/public/SystemTag/SystemTagsEntityEvent.php7
-rw-r--r--lib/public/SystemTag/TagAlreadyExistsException.php1
-rw-r--r--lib/public/SystemTag/TagNotFoundException.php5
-rw-r--r--tests/lib/AppFramework/Http/DispatcherTest.php28
-rw-r--r--tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php2
41 files changed, 330 insertions, 185 deletions
diff --git a/apps/federatedfilesharing/l10n/sk.js b/apps/federatedfilesharing/l10n/sk.js
index e0844f3e57f..ae3c60a3135 100644
--- a/apps/federatedfilesharing/l10n/sk.js
+++ b/apps/federatedfilesharing/l10n/sk.js
@@ -38,6 +38,7 @@ OC.L10N.register(
"Share with me through my #Nextcloud Federated Cloud ID, see %s" : "Sprístupnite mi obsah prostredníctvom môjho #Nextcloud Federated Cloud ID, viac na %s",
"Share with me through my #Nextcloud Federated Cloud ID" : "Sprístupnite mi obsah prostredníctvom môjho #Nextcloud Federated Cloud ID",
"Sharing" : "Sprístupnenie",
+ "Federated file sharing" : "Združené sprístupňovanie súborov",
"Federated Cloud Sharing" : "Sprístupnenie prostredníctvom Federated Cloud",
"Open documentation" : "Otvoriť dokumentáciu",
"Adjust how people can share between servers." : "Nastavte ako môžu ľudia medzi sebou zdieľať servery.",
diff --git a/apps/federatedfilesharing/l10n/sk.json b/apps/federatedfilesharing/l10n/sk.json
index 0bc24068a60..2263551d316 100644
--- a/apps/federatedfilesharing/l10n/sk.json
+++ b/apps/federatedfilesharing/l10n/sk.json
@@ -36,6 +36,7 @@
"Share with me through my #Nextcloud Federated Cloud ID, see %s" : "Sprístupnite mi obsah prostredníctvom môjho #Nextcloud Federated Cloud ID, viac na %s",
"Share with me through my #Nextcloud Federated Cloud ID" : "Sprístupnite mi obsah prostredníctvom môjho #Nextcloud Federated Cloud ID",
"Sharing" : "Sprístupnenie",
+ "Federated file sharing" : "Združené sprístupňovanie súborov",
"Federated Cloud Sharing" : "Sprístupnenie prostredníctvom Federated Cloud",
"Open documentation" : "Otvoriť dokumentáciu",
"Adjust how people can share between servers." : "Nastavte ako môžu ľudia medzi sebou zdieľať servery.",
diff --git a/apps/federation/l10n/sk.js b/apps/federation/l10n/sk.js
index 4b82f2c9b60..7a842a3961a 100644
--- a/apps/federation/l10n/sk.js
+++ b/apps/federation/l10n/sk.js
@@ -5,6 +5,7 @@ OC.L10N.register(
"Server is already in the list of trusted servers." : "Server sa už nachádza v zozname dôveryhodných serverov",
"No server to federate with found" : "Server pre združenie sa nenašiel",
"Could not add server" : "Nebolo možné pridať server",
+ "Federation" : "Združovanie",
"Trusted servers" : "Dôveryhodné servery",
"Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing." : "Združovanie vám umožňuje sa pripojiť k iným dôveryhodným serverom za účelom výmeny adresára používateľov. Používa sa to napr. pre automatické doplňovanie používateľov pri združenom zdieľaní.",
"Add server automatically once a federated share was created successfully" : "Pridať server automaticky akonáhle je úspešne vytvorené združené zdieľanie",
diff --git a/apps/federation/l10n/sk.json b/apps/federation/l10n/sk.json
index 48e06ce374f..16da9ab4022 100644
--- a/apps/federation/l10n/sk.json
+++ b/apps/federation/l10n/sk.json
@@ -3,6 +3,7 @@
"Server is already in the list of trusted servers." : "Server sa už nachádza v zozname dôveryhodných serverov",
"No server to federate with found" : "Server pre združenie sa nenašiel",
"Could not add server" : "Nebolo možné pridať server",
+ "Federation" : "Združovanie",
"Trusted servers" : "Dôveryhodné servery",
"Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing." : "Združovanie vám umožňuje sa pripojiť k iným dôveryhodným serverom za účelom výmeny adresára používateľov. Používa sa to napr. pre automatické doplňovanie používateľov pri združenom zdieľaní.",
"Add server automatically once a federated share was created successfully" : "Pridať server automaticky akonáhle je úspešne vytvorené združené zdieľanie",
diff --git a/apps/files/l10n/ru.js b/apps/files/l10n/ru.js
index d4bce72110e..5f4912587b7 100644
--- a/apps/files/l10n/ru.js
+++ b/apps/files/l10n/ru.js
@@ -81,7 +81,7 @@ OC.L10N.register(
"Favorited" : "Избранное",
"Favorite" : "Добавить в избранное",
"New folder" : "Новый каталог",
- "Upload file" : "Зарузить файл",
+ "Upload file" : "Загрузить файл",
"Not favorited" : "Не избранное",
"Remove from favorites" : "Удалить из избранных",
"Add to favorites" : "Добавить в избранное",
diff --git a/apps/files/l10n/ru.json b/apps/files/l10n/ru.json
index 705a2a75c7c..65cc92c052e 100644
--- a/apps/files/l10n/ru.json
+++ b/apps/files/l10n/ru.json
@@ -79,7 +79,7 @@
"Favorited" : "Избранное",
"Favorite" : "Добавить в избранное",
"New folder" : "Новый каталог",
- "Upload file" : "Зарузить файл",
+ "Upload file" : "Загрузить файл",
"Not favorited" : "Не избранное",
"Remove from favorites" : "Удалить из избранных",
"Add to favorites" : "Добавить в избранное",
diff --git a/apps/files/l10n/sk.js b/apps/files/l10n/sk.js
index 89da1860307..c609ee92197 100644
--- a/apps/files/l10n/sk.js
+++ b/apps/files/l10n/sk.js
@@ -20,6 +20,7 @@ OC.L10N.register(
"…" : "...",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} z {totalSize} ({bitrate})",
"Target folder does not exist any more" : "Cieľový priečinok už neexistuje",
+ "Error when assembling chunks, status code {status}" : "Chyba pri zostavovaní kusov, kód chyby {status}",
"Actions" : "Akcie",
"Download" : "Sťahovanie",
"Rename" : "Premenovať",
@@ -65,6 +66,7 @@ OC.L10N.register(
"{used} used" : "{used} použitých",
"\"{name}\" is an invalid file name." : "\"{name}\" je neplatné meno súboru.",
"File name cannot be empty." : "Meno súboru nemôže byť prázdne",
+ "\"/\" is not allowed inside a file name." : "Znak \"/\" nie je povolený v názve súboru.",
"\"{name}\" is not an allowed filetype" : "\"{name}\" nie je povolený typ súboru",
"Storage of {owner} is full, files can not be updated or synced anymore!" : "Úložisko používateľa {owner} je plné, súbory sa viac nedajú aktualizovať ani synchronizovať.",
"Your storage is full, files can not be updated or synced anymore!" : "Vaše úložisko je plné. Súbory nemožno aktualizovať ani synchronizovať!",
@@ -144,6 +146,10 @@ OC.L10N.register(
"Tags" : "Štítky",
"Deleted files" : "Zmazané súbory",
"Text file" : "Textový súbor",
- "New text file.txt" : "Nový text file.txt"
+ "New text file.txt" : "Nový text file.txt",
+ "Move" : "Presunúť",
+ "A new file or folder has been <strong>deleted</strong>" : "Nový súbor alebo priečinok bol <strong>zmazaný</strong>",
+ "A new file or folder has been <strong>restored</strong>" : "Nový súbor alebo priečinok bol<strong>obnovený</strong>",
+ "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Použi túto adresu pre <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">prístup ku svojím súborom cez WebDAV</a>"
},
"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
diff --git a/apps/files/l10n/sk.json b/apps/files/l10n/sk.json
index 7e764476c8b..59d387b91b1 100644
--- a/apps/files/l10n/sk.json
+++ b/apps/files/l10n/sk.json
@@ -18,6 +18,7 @@
"…" : "...",
"{loadedSize} of {totalSize} ({bitrate})" : "{loadedSize} z {totalSize} ({bitrate})",
"Target folder does not exist any more" : "Cieľový priečinok už neexistuje",
+ "Error when assembling chunks, status code {status}" : "Chyba pri zostavovaní kusov, kód chyby {status}",
"Actions" : "Akcie",
"Download" : "Sťahovanie",
"Rename" : "Premenovať",
@@ -63,6 +64,7 @@
"{used} used" : "{used} použitých",
"\"{name}\" is an invalid file name." : "\"{name}\" je neplatné meno súboru.",
"File name cannot be empty." : "Meno súboru nemôže byť prázdne",
+ "\"/\" is not allowed inside a file name." : "Znak \"/\" nie je povolený v názve súboru.",
"\"{name}\" is not an allowed filetype" : "\"{name}\" nie je povolený typ súboru",
"Storage of {owner} is full, files can not be updated or synced anymore!" : "Úložisko používateľa {owner} je plné, súbory sa viac nedajú aktualizovať ani synchronizovať.",
"Your storage is full, files can not be updated or synced anymore!" : "Vaše úložisko je plné. Súbory nemožno aktualizovať ani synchronizovať!",
@@ -142,6 +144,10 @@
"Tags" : "Štítky",
"Deleted files" : "Zmazané súbory",
"Text file" : "Textový súbor",
- "New text file.txt" : "Nový text file.txt"
+ "New text file.txt" : "Nový text file.txt",
+ "Move" : "Presunúť",
+ "A new file or folder has been <strong>deleted</strong>" : "Nový súbor alebo priečinok bol <strong>zmazaný</strong>",
+ "A new file or folder has been <strong>restored</strong>" : "Nový súbor alebo priečinok bol<strong>obnovený</strong>",
+ "Use this address to <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">access your Files via WebDAV</a>" : "Použi túto adresu pre <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">prístup ku svojím súborom cez WebDAV</a>"
},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
} \ No newline at end of file
diff --git a/apps/files_sharing/l10n/zh_CN.js b/apps/files_sharing/l10n/zh_CN.js
index de33a357fbb..1b7a35ccf4c 100644
--- a/apps/files_sharing/l10n/zh_CN.js
+++ b/apps/files_sharing/l10n/zh_CN.js
@@ -88,6 +88,7 @@ OC.L10N.register(
"Can't change permissions for public share links" : "不能改变公共分享链接权限",
"Cannot increase permissions" : "不能增加权限",
"Share API is disabled" : "共享 API 已被禁用",
+ "File sharing" : "文件共享",
"This share is password-protected" : "这是一个密码保护的共享",
"The password is wrong. Try again." : "用户名或密码错误!请重试",
"Password" : "密码",
@@ -99,7 +100,7 @@ OC.L10N.register(
"Reasons might be:" : "可能原因是:",
"the item was removed" : "此项已移除",
"the link expired" : "链接过期",
- "sharing is disabled" : "分享已禁用",
+ "sharing is disabled" : "已禁用共享",
"For more info, please ask the person who sent this link." : "欲知详情,请联系发给你链接的人。",
"shared by %s" : "共享者 %s",
"Download" : "下载",
@@ -109,6 +110,7 @@ OC.L10N.register(
"Upload files to %s" : "上传文件到 %s",
"Select or drop files" : "选择或删除文件",
"Uploading files…" : "上传文件 … ",
- "Uploaded files:" : "上传的文件: "
+ "Uploaded files:" : "上传的文件: ",
+ "%s is publicly shared" : "%s 是公开共享"
},
"nplurals=1; plural=0;");
diff --git a/apps/files_sharing/l10n/zh_CN.json b/apps/files_sharing/l10n/zh_CN.json
index 982d0bd238a..c76961670a3 100644
--- a/apps/files_sharing/l10n/zh_CN.json
+++ b/apps/files_sharing/l10n/zh_CN.json
@@ -86,6 +86,7 @@
"Can't change permissions for public share links" : "不能改变公共分享链接权限",
"Cannot increase permissions" : "不能增加权限",
"Share API is disabled" : "共享 API 已被禁用",
+ "File sharing" : "文件共享",
"This share is password-protected" : "这是一个密码保护的共享",
"The password is wrong. Try again." : "用户名或密码错误!请重试",
"Password" : "密码",
@@ -97,7 +98,7 @@
"Reasons might be:" : "可能原因是:",
"the item was removed" : "此项已移除",
"the link expired" : "链接过期",
- "sharing is disabled" : "分享已禁用",
+ "sharing is disabled" : "已禁用共享",
"For more info, please ask the person who sent this link." : "欲知详情,请联系发给你链接的人。",
"shared by %s" : "共享者 %s",
"Download" : "下载",
@@ -107,6 +108,7 @@
"Upload files to %s" : "上传文件到 %s",
"Select or drop files" : "选择或删除文件",
"Uploading files…" : "上传文件 … ",
- "Uploaded files:" : "上传的文件: "
+ "Uploaded files:" : "上传的文件: ",
+ "%s is publicly shared" : "%s 是公开共享"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/systemtags/l10n/sk.js b/apps/systemtags/l10n/sk.js
new file mode 100644
index 00000000000..77ddf39e4bb
--- /dev/null
+++ b/apps/systemtags/l10n/sk.js
@@ -0,0 +1,58 @@
+OC.L10N.register(
+ "systemtags",
+ {
+ "Tags" : "Štítky",
+ "Update" : "Aktualizovať",
+ "Create" : "Vytvoriť",
+ "Select tag…" : "Vyber štítok...",
+ "Tagged files" : "Súbory so štítkom",
+ "Select tags to filter by" : "Vybrať štítky pre filter",
+ "No tags found" : "Štítky sa nenašli",
+ "Please select tags to filter by" : "Vyberte štítky pre filtrovanie",
+ "No files found for the selected tags" : "Neboli nájdené žiadne súbory označené vybranými štítkami",
+ "Added system tag %1$s" : "Pridaný systémový štítok %1$s",
+ "Added system tag {systemtag}" : "Pridaný systémový štítok {systemtag}",
+ "%1$s added system tag %2$s" : "%1$s pridal(a) systémový štítok %2$s",
+ "{actor} added system tag {systemtag}" : "{actor} pridal(a) systémový štítok {systemtag}",
+ "Removed system tag %1$s" : "Odstránený systémový štítok %1$s",
+ "Removed system tag {systemtag}" : "Odstránený systémový štítok {systemtag}",
+ "%1$s removed system tag %2$s" : "%1$s odstránil(a) systémový štítok %2$s",
+ "{actor} removed system tag {systemtag}" : "{actor} odstránil(a) systémový štítok {systemtag}",
+ "You created system tag %1$s" : "Vytvorili ste systémový štítok %1$s",
+ "You created system tag {systemtag}" : "Vytvorili ste systémový štítok {systemtag}",
+ "%1$s created system tag %2$s" : "%1$s vytvoril systémový štítok %2$s",
+ "{actor} created system tag {systemtag}" : "{actor} vytvoril(a) systémový štítok {systemtag}",
+ "You deleted system tag %1$s" : "Zmazali ste systémový štítok %1$s",
+ "You deleted system tag {systemtag}" : "Odstránili ste systémový štítok {systemtag}",
+ "%1$s deleted system tag %2$s" : "%1$s zmazal(a) systémový štítok %2$s",
+ "{actor} deleted system tag {systemtag}" : "{actor} odstránil(a) systémový štítok {systemtag}",
+ "You updated system tag %2$s to %1$s" : "Aktualizovali ste systémový štítok %2$s na %1$s",
+ "You updated system tag {oldsystemtag} to {newsystemtag}" : "Aktualizovali ste systémový štítok {oldsystemtag} na {newsystemtag}",
+ "%1$s updated system tag %3$s to %2$s" : "%1$s aktualizoval(a) systémový štítok %3$s na %2$s",
+ "{actor} updated system tag {oldsystemtag} to {newsystemtag}" : "{actor} aktualizoval(a) systémový štítok {oldsystemtag} na {newsystemtag}",
+ "You added system tag %2$s to %1$s" : "Pridali ste systémový štítok %2$s na %1$s",
+ "You added system tag {systemtag} to {file}" : "K {file} ste pridali systémový štítok {systemtag}",
+ "%1$s added system tag %3$s to %2$s" : "%1$s k %2$s pridal(a) systémový štítok %3$s",
+ "{actor} added system tag {systemtag} to {file}" : " {actor} k {file} pridal(a) systémový štítok {systemtag}",
+ "You removed system tag %2$s from %1$s" : "Z %2$s ste odstránili systémový štítok %1$s",
+ "You removed system tag {systemtag} from {file}" : "Z {file} ste odstránili systémový štítok {systemtag}",
+ "%1$s removed system tag %3$s from %2$s" : "%1$s odstránil(a) systémový štítok %3$s z %2$s",
+ "{actor} removed system tag {systemtag} from {file}" : "{actor} odstránil(a) systémový štítok {systemtag} z {file}",
+ "%s (restricted)" : "%s (obmedzené)",
+ "%s (invisible)" : "%s (neviditeľné)",
+ "<strong>System tags</strong> for a file have been modified" : "<strong>Systémové štítky</strong> súboru boli upravené",
+ "Collaborative tags" : "Značky pre spoluprácu",
+ "Create and edit collaborative tags. These tags affect all users." : "Vytvárajte a upravujte štítky pre spoluprácu. Tieto značky ovplyvnia všetkých používateľov.",
+ "Select tag …" : "Vybrať štítok ...",
+ "Name" : "Názov",
+ "Delete" : "Zmazať",
+ "Public" : "Verejné",
+ "Restricted" : "Obmedzené",
+ "Invisible" : "Neviditeľné",
+ "Reset" : "Vynulovať",
+ "No files in here" : "Žiadne súbory",
+ "No entries found in this folder" : "V tomto priečinku sa nič nenašlo",
+ "Size" : "Veľkosť",
+ "Modified" : "Upravené"
+},
+"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
diff --git a/apps/systemtags/l10n/sk.json b/apps/systemtags/l10n/sk.json
new file mode 100644
index 00000000000..a4d4bb32264
--- /dev/null
+++ b/apps/systemtags/l10n/sk.json
@@ -0,0 +1,56 @@
+{ "translations": {
+ "Tags" : "Štítky",
+ "Update" : "Aktualizovať",
+ "Create" : "Vytvoriť",
+ "Select tag…" : "Vyber štítok...",
+ "Tagged files" : "Súbory so štítkom",
+ "Select tags to filter by" : "Vybrať štítky pre filter",
+ "No tags found" : "Štítky sa nenašli",
+ "Please select tags to filter by" : "Vyberte štítky pre filtrovanie",
+ "No files found for the selected tags" : "Neboli nájdené žiadne súbory označené vybranými štítkami",
+ "Added system tag %1$s" : "Pridaný systémový štítok %1$s",
+ "Added system tag {systemtag}" : "Pridaný systémový štítok {systemtag}",
+ "%1$s added system tag %2$s" : "%1$s pridal(a) systémový štítok %2$s",
+ "{actor} added system tag {systemtag}" : "{actor} pridal(a) systémový štítok {systemtag}",
+ "Removed system tag %1$s" : "Odstránený systémový štítok %1$s",
+ "Removed system tag {systemtag}" : "Odstránený systémový štítok {systemtag}",
+ "%1$s removed system tag %2$s" : "%1$s odstránil(a) systémový štítok %2$s",
+ "{actor} removed system tag {systemtag}" : "{actor} odstránil(a) systémový štítok {systemtag}",
+ "You created system tag %1$s" : "Vytvorili ste systémový štítok %1$s",
+ "You created system tag {systemtag}" : "Vytvorili ste systémový štítok {systemtag}",
+ "%1$s created system tag %2$s" : "%1$s vytvoril systémový štítok %2$s",
+ "{actor} created system tag {systemtag}" : "{actor} vytvoril(a) systémový štítok {systemtag}",
+ "You deleted system tag %1$s" : "Zmazali ste systémový štítok %1$s",
+ "You deleted system tag {systemtag}" : "Odstránili ste systémový štítok {systemtag}",
+ "%1$s deleted system tag %2$s" : "%1$s zmazal(a) systémový štítok %2$s",
+ "{actor} deleted system tag {systemtag}" : "{actor} odstránil(a) systémový štítok {systemtag}",
+ "You updated system tag %2$s to %1$s" : "Aktualizovali ste systémový štítok %2$s na %1$s",
+ "You updated system tag {oldsystemtag} to {newsystemtag}" : "Aktualizovali ste systémový štítok {oldsystemtag} na {newsystemtag}",
+ "%1$s updated system tag %3$s to %2$s" : "%1$s aktualizoval(a) systémový štítok %3$s na %2$s",
+ "{actor} updated system tag {oldsystemtag} to {newsystemtag}" : "{actor} aktualizoval(a) systémový štítok {oldsystemtag} na {newsystemtag}",
+ "You added system tag %2$s to %1$s" : "Pridali ste systémový štítok %2$s na %1$s",
+ "You added system tag {systemtag} to {file}" : "K {file} ste pridali systémový štítok {systemtag}",
+ "%1$s added system tag %3$s to %2$s" : "%1$s k %2$s pridal(a) systémový štítok %3$s",
+ "{actor} added system tag {systemtag} to {file}" : " {actor} k {file} pridal(a) systémový štítok {systemtag}",
+ "You removed system tag %2$s from %1$s" : "Z %2$s ste odstránili systémový štítok %1$s",
+ "You removed system tag {systemtag} from {file}" : "Z {file} ste odstránili systémový štítok {systemtag}",
+ "%1$s removed system tag %3$s from %2$s" : "%1$s odstránil(a) systémový štítok %3$s z %2$s",
+ "{actor} removed system tag {systemtag} from {file}" : "{actor} odstránil(a) systémový štítok {systemtag} z {file}",
+ "%s (restricted)" : "%s (obmedzené)",
+ "%s (invisible)" : "%s (neviditeľné)",
+ "<strong>System tags</strong> for a file have been modified" : "<strong>Systémové štítky</strong> súboru boli upravené",
+ "Collaborative tags" : "Značky pre spoluprácu",
+ "Create and edit collaborative tags. These tags affect all users." : "Vytvárajte a upravujte štítky pre spoluprácu. Tieto značky ovplyvnia všetkých používateľov.",
+ "Select tag …" : "Vybrať štítok ...",
+ "Name" : "Názov",
+ "Delete" : "Zmazať",
+ "Public" : "Verejné",
+ "Restricted" : "Obmedzené",
+ "Invisible" : "Neviditeľné",
+ "Reset" : "Vynulovať",
+ "No files in here" : "Žiadne súbory",
+ "No entries found in this folder" : "V tomto priečinku sa nič nenašlo",
+ "Size" : "Veľkosť",
+ "Modified" : "Upravené"
+},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
+} \ No newline at end of file
diff --git a/apps/systemtags/lib/Activity/Listener.php b/apps/systemtags/lib/Activity/Listener.php
index c33e42c28f6..b2b760ac344 100644
--- a/apps/systemtags/lib/Activity/Listener.php
+++ b/apps/systemtags/lib/Activity/Listener.php
@@ -110,7 +110,7 @@ class Listener {
$activity->setApp('systemtags')
->setType('systemtags')
->setAuthor($actor)
- ->setObject('systemtag', $tag->getId(), $tag->getName());
+ ->setObject('systemtag', (int)$tag->getId(), $tag->getName());
if ($event->getEvent() === ManagerEvent::EVENT_CREATE) {
$activity->setSubject(Provider::CREATE_TAG, [
$actor,
diff --git a/apps/updatenotification/l10n/sk.js b/apps/updatenotification/l10n/sk.js
index aaa96cebf0c..e03b9ebb29e 100644
--- a/apps/updatenotification/l10n/sk.js
+++ b/apps/updatenotification/l10n/sk.js
@@ -3,13 +3,14 @@ OC.L10N.register(
{
"Could not start updater, please try the manual update" : "Nebolo možné spustiť aktualizátor, skúste prosím manuálnu aktualizáciu",
"{version} is available. Get more information on how to update." : "{version} je dostupná. Získajte viac informácií o postupe aktualizácie.",
- "Update notifications" : "Upozornenia aktualizácií",
+ "Update notifications" : "Aktualizovať hlásenia",
"Channel updated" : "Kanál bol aktualizovaný",
"The update server could not be reached since %d days to check for new updates." : "Aktualizačný server je nedostupný %d dní pre kontrolu aktualizácií.",
"Please check the Nextcloud and server log files for errors." : "Chyby skontrolujte prosím v logoch Nextcloud a webového servera",
"Update to %1$s is available." : "Je dostupná aktualizácia na verziu %1$s.",
"Update for %1$s to version %2$s is available." : "Pre %1$s je dostupná aktualizácia na verziu %2$s.",
"Update for {app} to version %s is available." : "Pre {app} je dostupná aktualizácia na verziu %s.",
+ "Update notification" : "Aktualizovať hlásenie",
"A new version is available: %s" : "Je dostupná nová verzia: %s",
"Open updater" : "Otvoriť aktualizátor",
"Download now" : "Stiahnuť teraz",
diff --git a/apps/updatenotification/l10n/sk.json b/apps/updatenotification/l10n/sk.json
index 67391c3c882..c9ab08aa98f 100644
--- a/apps/updatenotification/l10n/sk.json
+++ b/apps/updatenotification/l10n/sk.json
@@ -1,13 +1,14 @@
{ "translations": {
"Could not start updater, please try the manual update" : "Nebolo možné spustiť aktualizátor, skúste prosím manuálnu aktualizáciu",
"{version} is available. Get more information on how to update." : "{version} je dostupná. Získajte viac informácií o postupe aktualizácie.",
- "Update notifications" : "Upozornenia aktualizácií",
+ "Update notifications" : "Aktualizovať hlásenia",
"Channel updated" : "Kanál bol aktualizovaný",
"The update server could not be reached since %d days to check for new updates." : "Aktualizačný server je nedostupný %d dní pre kontrolu aktualizácií.",
"Please check the Nextcloud and server log files for errors." : "Chyby skontrolujte prosím v logoch Nextcloud a webového servera",
"Update to %1$s is available." : "Je dostupná aktualizácia na verziu %1$s.",
"Update for %1$s to version %2$s is available." : "Pre %1$s je dostupná aktualizácia na verziu %2$s.",
"Update for {app} to version %s is available." : "Pre {app} je dostupná aktualizácia na verziu %s.",
+ "Update notification" : "Aktualizovať hlásenie",
"A new version is available: %s" : "Je dostupná nová verzia: %s",
"Open updater" : "Otvoriť aktualizátor",
"Download now" : "Stiahnuť teraz",
diff --git a/apps/workflowengine/l10n/sk.js b/apps/workflowengine/l10n/sk.js
index 8df92bdda39..fd19128944b 100644
--- a/apps/workflowengine/l10n/sk.js
+++ b/apps/workflowengine/l10n/sk.js
@@ -59,6 +59,7 @@ OC.L10N.register(
"Check %s is invalid" : "Kontrola %s je neplatná",
"Check #%s does not exist" : "Kontrola #%s neexistuje",
"Workflow" : "Systém práce",
+ "Files workflow engine" : "Typ spôsobu práce súborov",
"Open documentation" : "Otvoriť dokumentáciu",
"Add rule group" : "Pridať skupinu pravidiel",
"Short rule description" : "Zobraziť popis pravidla",
diff --git a/apps/workflowengine/l10n/sk.json b/apps/workflowengine/l10n/sk.json
index f380d30840e..8be52def123 100644
--- a/apps/workflowengine/l10n/sk.json
+++ b/apps/workflowengine/l10n/sk.json
@@ -57,6 +57,7 @@
"Check %s is invalid" : "Kontrola %s je neplatná",
"Check #%s does not exist" : "Kontrola #%s neexistuje",
"Workflow" : "Systém práce",
+ "Files workflow engine" : "Typ spôsobu práce súborov",
"Open documentation" : "Otvoriť dokumentáciu",
"Add rule group" : "Pridať skupinu pravidiel",
"Short rule description" : "Zobraziť popis pravidla",
diff --git a/autotest.sh b/autotest.sh
index ff59386e1bc..d8f62ce2367 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -380,17 +380,9 @@ function execute_tests {
echo "No coverage"
fi
- if [ -d "$2" ]; then
- for f in $(find "$2" -name '*Test.php'); do
- echo "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" / "$f" "$3"
- "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$f" "$3"
- RESULT=$?
- done;
- else
- echo "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
- "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
- RESULT=$?
- fi
+ echo "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
+ "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
+ RESULT=$?
if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then
cd ..
diff --git a/lib/base.php b/lib/base.php
index 05da2814d4c..c5eabe1910a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -373,6 +373,7 @@ class OC {
// get third party apps
$ocVersion = \OCP\Util::getVersion();
+ $ocVersion = implode('.', $ocVersion);
$incompatibleApps = $appManager->getIncompatibleApps($ocVersion);
$incompatibleShippedApps = [];
foreach ($incompatibleApps as $appInfo) {
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index 690dcfe5639..4bf15c23fab 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -397,7 +397,7 @@ class AppManager implements IAppManager {
*
* @internal
*/
- public function getIncompatibleApps($version) {
+ public function getIncompatibleApps(string $version): array {
$apps = $this->getInstalledApps();
$incompatibleApps = array();
foreach ($apps as $appId) {
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index 8bf9ca15349..4dbc360c0c4 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -174,6 +174,7 @@ abstract class Fetcher {
$this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => Util::INFO, 'message' => 'Could not connect to appstore']);
return [];
} catch (\Exception $e) {
+ $this->logger->logException($e, ['app' => 'appstoreFetcher', 'level' => Util::INFO]);
return [];
}
}
diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php
index 6219ba47a41..7b9ad015de6 100644
--- a/lib/private/AppFramework/Http/Dispatcher.php
+++ b/lib/private/AppFramework/Http/Dispatcher.php
@@ -105,9 +105,6 @@ class Dispatcher {
} catch(\Exception $exception){
$response = $this->middlewareDispatcher->afterException(
$controller, $methodName, $exception);
- if ($response === null) {
- throw $exception;
- }
}
$response = $this->middlewareDispatcher->afterController(
diff --git a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
index 60d2ae8b5c9..e1262b6c712 100644
--- a/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
+++ b/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -30,7 +31,7 @@ namespace OC\AppFramework\Middleware;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Response;
-use OCP\AppFramework\MiddleWare;
+use OCP\AppFramework\Middleware;
/**
* This class is used to store and run all the middleware in correct order
@@ -53,7 +54,7 @@ class MiddlewareDispatcher {
* Constructor
*/
public function __construct(){
- $this->middlewares = array();
+ $this->middlewares = [];
$this->middlewareCounter = 0;
}
@@ -71,7 +72,7 @@ class MiddlewareDispatcher {
* returns an array with all middleware elements
* @return array the middlewares
*/
- public function getMiddlewares(){
+ public function getMiddlewares(): array {
return $this->middlewares;
}
@@ -84,10 +85,10 @@ class MiddlewareDispatcher {
* @param string $methodName the name of the method that will be called on
* the controller
*/
- public function beforeController(Controller $controller, $methodName){
+ public function beforeController(Controller $controller, string $methodName){
// we need to count so that we know which middlewares we have to ask in
// case there is an exception
- $middlewareCount = count($this->middlewares);
+ $middlewareCount = \count($this->middlewares);
for($i = 0; $i < $middlewareCount; $i++){
$this->middlewareCounter++;
$middleware = $this->middlewares[$i];
@@ -111,7 +112,7 @@ class MiddlewareDispatcher {
* exception
* @throws \Exception the passed in exception if it can't handle it
*/
- public function afterException(Controller $controller, $methodName, \Exception $exception){
+ public function afterException(Controller $controller, string $methodName, \Exception $exception): Response {
for($i=$this->middlewareCounter-1; $i>=0; $i--){
$middleware = $this->middlewares[$i];
try {
@@ -134,8 +135,8 @@ class MiddlewareDispatcher {
* @param Response $response the generated response from the controller
* @return Response a Response object
*/
- public function afterController(Controller $controller, $methodName, Response $response){
- for($i=count($this->middlewares)-1; $i>=0; $i--){
+ public function afterController(Controller $controller, string $methodName, Response $response): Response {
+ for($i= \count($this->middlewares)-1; $i>=0; $i--){
$middleware = $this->middlewares[$i];
$response = $middleware->afterController($controller, $methodName, $response);
}
@@ -153,8 +154,8 @@ class MiddlewareDispatcher {
* @param string $output the generated output from a response
* @return string the output that should be printed
*/
- public function beforeOutput(Controller $controller, $methodName, $output){
- for($i=count($this->middlewares)-1; $i>=0; $i--){
+ public function beforeOutput(Controller $controller, string $methodName, string $output): string {
+ for($i= \count($this->middlewares)-1; $i>=0; $i--){
$middleware = $this->middlewares[$i];
$output = $middleware->beforeOutput($controller, $methodName, $output);
}
diff --git a/lib/private/AppFramework/Utility/ControllerMethodReflector.php b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
index 7c777c52c12..ef4a1959d66 100644
--- a/lib/private/AppFramework/Utility/ControllerMethodReflector.php
+++ b/lib/private/AppFramework/Utility/ControllerMethodReflector.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -42,32 +43,34 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @param object $object an object or classname
* @param string $method the method which we want to inspect
*/
- public function reflect($object, $method){
+ public function reflect($object, string $method){
$reflection = new \ReflectionMethod($object, $method);
$docs = $reflection->getDocComment();
- // extract everything prefixed by @ and first letter uppercase
- preg_match_all('/^\h+\*\h+@(?P<annotation>[A-Z]\w+)((?P<parameter>.*))?$/m', $docs, $matches);
- foreach($matches['annotation'] as $key => $annontation) {
- $annotationValue = $matches['parameter'][$key];
- if(isset($annotationValue[0]) && $annotationValue[0] === '(' && $annotationValue[strlen($annotationValue) - 1] === ')') {
- $cutString = substr($annotationValue, 1, -1);
- $cutString = str_replace(' ', '', $cutString);
- $splittedArray = explode(',', $cutString);
- foreach($splittedArray as $annotationValues) {
- list($key, $value) = explode('=', $annotationValues);
- $this->annotations[$annontation][$key] = $value;
+ if ($docs !== false) {
+ // extract everything prefixed by @ and first letter uppercase
+ preg_match_all('/^\h+\*\h+@(?P<annotation>[A-Z]\w+)((?P<parameter>.*))?$/m', $docs, $matches);
+ foreach ($matches['annotation'] as $key => $annontation) {
+ $annotationValue = $matches['parameter'][$key];
+ if (isset($annotationValue[0]) && $annotationValue[0] === '(' && $annotationValue[\strlen($annotationValue) - 1] === ')') {
+ $cutString = substr($annotationValue, 1, -1);
+ $cutString = str_replace(' ', '', $cutString);
+ $splittedArray = explode(',', $cutString);
+ foreach ($splittedArray as $annotationValues) {
+ list($key, $value) = explode('=', $annotationValues);
+ $this->annotations[$annontation][$key] = $value;
+ }
+ continue;
}
- continue;
+
+ $this->annotations[$annontation] = [$annotationValue];
}
- $this->annotations[$annontation] = [$annotationValue];
+ // extract type parameter information
+ preg_match_all('/@param\h+(?P<type>\w+)\h+\$(?P<var>\w+)/', $docs, $matches);
+ $this->types = array_combine($matches['var'], $matches['type']);
}
- // extract type parameter information
- preg_match_all('/@param\h+(?P<type>\w+)\h+\$(?P<var>\w+)/', $docs, $matches);
- $this->types = array_combine($matches['var'], $matches['type']);
-
foreach ($reflection->getParameters() as $param) {
// extract type information from PHP 7 scalar types and prefer them
// over phpdoc annotations
@@ -78,10 +81,9 @@ class ControllerMethodReflector implements IControllerMethodReflector {
}
}
+ $default = null;
if($param->isOptional()) {
$default = $param->getDefaultValue();
- } else {
- $default = null;
}
$this->parameters[$param->name] = $default;
}
@@ -94,18 +96,18 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @return string|null type in the type parameters (@param int $something)
* would return int or null if not existing
*/
- public function getType($parameter) {
+ public function getType(string $parameter) {
if(array_key_exists($parameter, $this->types)) {
return $this->types[$parameter];
- } else {
- return null;
}
+
+ return null;
}
/**
* @return array the arguments of the method with key => default value
*/
- public function getParameters() {
+ public function getParameters(): array {
return $this->parameters;
}
@@ -114,7 +116,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @param string $name the name of the annotation
* @return bool true if the annotation is found
*/
- public function hasAnnotation($name) {
+ public function hasAnnotation(string $name): bool {
return array_key_exists($name, $this->annotations);
}
@@ -125,7 +127,7 @@ class ControllerMethodReflector implements IControllerMethodReflector {
* @param string $key the string of the annotation
* @return string
*/
- public function getAnnotationParameter($name, $key) {
+ public function getAnnotationParameter(string $name, string $key): string {
if(isset($this->annotations[$name][$key])) {
return $this->annotations[$name][$key];
}
diff --git a/lib/private/SystemTag/ManagerFactory.php b/lib/private/SystemTag/ManagerFactory.php
index 12af2523f47..839a819a04a 100644
--- a/lib/private/SystemTag/ManagerFactory.php
+++ b/lib/private/SystemTag/ManagerFactory.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -57,7 +58,7 @@ class ManagerFactory implements ISystemTagManagerFactory {
* @return ISystemTagManager
* @since 9.0.0
*/
- public function getManager() {
+ public function getManager(): ISystemTagManager {
return new SystemTagManager(
$this->serverContainer->getDatabaseConnection(),
$this->serverContainer->getGroupManager(),
@@ -72,7 +73,7 @@ class ManagerFactory implements ISystemTagManagerFactory {
* @return ISystemTagObjectMapper
* @since 9.0.0
*/
- public function getObjectMapper() {
+ public function getObjectMapper(): ISystemTagObjectMapper {
return new SystemTagObjectMapper(
$this->serverContainer->getDatabaseConnection(),
$this->getManager(),
diff --git a/lib/private/SystemTag/SystemTag.php b/lib/private/SystemTag/SystemTag.php
index 15eb15efd9e..3b0cf23c9a8 100644
--- a/lib/private/SystemTag/SystemTag.php
+++ b/lib/private/SystemTag/SystemTag.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -55,7 +56,7 @@ class SystemTag implements ISystemTag {
* @param bool $userVisible whether the tag is user visible
* @param bool $userAssignable whether the tag is user assignable
*/
- public function __construct($id, $name, $userVisible, $userAssignable) {
+ public function __construct(string $id, string $name, bool $userVisible, bool $userAssignable) {
$this->id = $id;
$this->name = $name;
$this->userVisible = $userVisible;
@@ -65,28 +66,28 @@ class SystemTag implements ISystemTag {
/**
* {@inheritdoc}
*/
- public function getId() {
+ public function getId(): string {
return $this->id;
}
/**
* {@inheritdoc}
*/
- public function getName() {
+ public function getName(): string {
return $this->name;
}
/**
* {@inheritdoc}
*/
- public function isUserVisible() {
+ public function isUserVisible(): bool {
return $this->userVisible;
}
/**
* {@inheritdoc}
*/
- public function isUserAssignable() {
+ public function isUserAssignable(): bool {
return $this->userAssignable;
}
}
diff --git a/lib/private/SystemTag/SystemTagManager.php b/lib/private/SystemTag/SystemTagManager.php
index 642ce515801..055b744e5c3 100644
--- a/lib/private/SystemTag/SystemTagManager.php
+++ b/lib/private/SystemTag/SystemTagManager.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -65,6 +66,7 @@ class SystemTagManager implements ISystemTagManager {
* Constructor.
*
* @param IDBConnection $connection database connection
+ * @param IGroupManager $groupManager
* @param EventDispatcherInterface $dispatcher
*/
public function __construct(
@@ -87,8 +89,8 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function getTagsByIds($tagIds) {
- if (!is_array($tagIds)) {
+ public function getTagsByIds($tagIds): array {
+ if (!\is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -117,7 +119,7 @@ class SystemTagManager implements ISystemTagManager {
$result->closeCursor();
- if (count($tags) !== count($tagIds)) {
+ if (\count($tags) !== \count($tagIds)) {
throw new TagNotFoundException(
'Tag id(s) not found', 0, null, array_diff($tagIds, array_keys($tags))
);
@@ -129,14 +131,14 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function getAllTags($visibilityFilter = null, $nameSearchPattern = null) {
+ public function getAllTags($visibilityFilter = null, $nameSearchPattern = null): array {
$tags = [];
$query = $this->connection->getQueryBuilder();
$query->select('*')
->from(self::TAG_TABLE);
- if (!is_null($visibilityFilter)) {
+ if (!\is_null($visibilityFilter)) {
$query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter)));
}
@@ -167,14 +169,11 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function getTag($tagName, $userVisible, $userAssignable) {
- $userVisible = (int)$userVisible;
- $userAssignable = (int)$userAssignable;
-
+ public function getTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag {
$result = $this->selectTagQuery
->setParameter('name', $tagName)
- ->setParameter('visibility', $userVisible)
- ->setParameter('editable', $userAssignable)
+ ->setParameter('visibility', $userVisible ? 1 : 0)
+ ->setParameter('editable', $userAssignable ? 1 : 0)
->execute();
$row = $result->fetch();
@@ -191,16 +190,13 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function createTag($tagName, $userVisible, $userAssignable) {
- $userVisible = (int)$userVisible;
- $userAssignable = (int)$userAssignable;
-
+ public function createTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag {
$query = $this->connection->getQueryBuilder();
$query->insert(self::TAG_TABLE)
->values([
'name' => $query->createNamedParameter($tagName),
- 'visibility' => $query->createNamedParameter($userVisible),
- 'editable' => $query->createNamedParameter($userAssignable),
+ 'visibility' => $query->createNamedParameter($userVisible ? 1 : 0),
+ 'editable' => $query->createNamedParameter($userAssignable ? 1 : 0),
]);
try {
@@ -216,10 +212,10 @@ class SystemTagManager implements ISystemTagManager {
$tagId = $query->getLastInsertId();
$tag = new SystemTag(
- (int)$tagId,
+ (string)$tagId,
$tagName,
- (bool)$userVisible,
- (bool)$userAssignable
+ $userVisible,
+ $userAssignable
);
$this->dispatcher->dispatch(ManagerEvent::EVENT_CREATE, new ManagerEvent(
@@ -232,10 +228,7 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function updateTag($tagId, $tagName, $userVisible, $userAssignable) {
- $userVisible = (int)$userVisible;
- $userAssignable = (int)$userAssignable;
-
+ public function updateTag(string $tagId, string $tagName, bool $userVisible, bool $userAssignable) {
try {
$tags = $this->getTagsByIds($tagId);
} catch (TagNotFoundException $e) {
@@ -246,10 +239,10 @@ class SystemTagManager implements ISystemTagManager {
$beforeUpdate = array_shift($tags);
$afterUpdate = new SystemTag(
- (int) $tagId,
+ $tagId,
$tagName,
- (bool) $userVisible,
- (bool) $userAssignable
+ $userVisible,
+ $userAssignable
);
$query = $this->connection->getQueryBuilder();
@@ -259,8 +252,8 @@ class SystemTagManager implements ISystemTagManager {
->set('editable', $query->createParameter('editable'))
->where($query->expr()->eq('id', $query->createParameter('tagid')))
->setParameter('name', $tagName)
- ->setParameter('visibility', $userVisible)
- ->setParameter('editable', $userAssignable)
+ ->setParameter('visibility', $userVisible ? 1 : 0)
+ ->setParameter('editable', $userAssignable ? 1 : 0)
->setParameter('tagid', $tagId);
try {
@@ -286,7 +279,7 @@ class SystemTagManager implements ISystemTagManager {
* {@inheritdoc}
*/
public function deleteTags($tagIds) {
- if (!is_array($tagIds)) {
+ if (!\is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -337,7 +330,7 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function canUserAssignTag(ISystemTag $tag, IUser $user) {
+ public function canUserAssignTag(ISystemTag $tag, IUser $user): bool {
// early check to avoid unneeded group lookups
if ($tag->isUserAssignable() && $tag->isUserVisible()) {
return true;
@@ -365,7 +358,7 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function canUserSeeTag(ISystemTag $tag, IUser $user) {
+ public function canUserSeeTag(ISystemTag $tag, IUser $user): bool {
if ($tag->isUserVisible()) {
return true;
}
@@ -378,13 +371,13 @@ class SystemTagManager implements ISystemTagManager {
}
private function createSystemTagFromRow($row) {
- return new SystemTag((int)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']);
+ return new SystemTag((string)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']);
}
/**
* {@inheritdoc}
*/
- public function setTagGroups(ISystemTag $tag, $groupIds) {
+ public function setTagGroups(ISystemTag $tag, array $groupIds) {
// delete relationships first
$this->connection->beginTransaction();
try {
@@ -418,7 +411,7 @@ class SystemTagManager implements ISystemTagManager {
/**
* {@inheritdoc}
*/
- public function getTagGroups(ISystemTag $tag) {
+ public function getTagGroups(ISystemTag $tag): array {
$groupIds = [];
$query = $this->connection->getQueryBuilder();
$query->select('gid')
diff --git a/lib/private/SystemTag/SystemTagObjectMapper.php b/lib/private/SystemTag/SystemTagObjectMapper.php
index 75bf37c652c..8ecc46b4357 100644
--- a/lib/private/SystemTag/SystemTagObjectMapper.php
+++ b/lib/private/SystemTag/SystemTagObjectMapper.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -63,8 +64,8 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
/**
* {@inheritdoc}
*/
- public function getTagIdsForObjects($objIds, $objectType) {
- if (!is_array($objIds)) {
+ public function getTagIdsForObjects($objIds, string $objectType): array {
+ if (!\is_array($objIds)) {
$objIds = [$objIds];
} else if (empty($objIds)) {
return [];
@@ -99,8 +100,8 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
/**
* {@inheritdoc}
*/
- public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = '') {
- if (!is_array($tagIds)) {
+ public function getObjectIdsForTags($tagIds, string $objectType, int $limit = 0, string $offset = ''): array {
+ if (!\is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -113,7 +114,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
->andWhere($query->expr()->eq('objecttype', $query->createNamedParameter($objectType)));
if ($limit) {
- if (count($tagIds) !== 1) {
+ if (\count($tagIds) !== 1) {
throw new \InvalidArgumentException('Limit is only allowed with a single tag');
}
@@ -138,8 +139,8 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
/**
* {@inheritdoc}
*/
- public function assignTags($objId, $objectType, $tagIds) {
- if (!is_array($tagIds)) {
+ public function assignTags(string $objId, string $objectType, $tagIds) {
+ if (!\is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -173,8 +174,8 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
/**
* {@inheritdoc}
*/
- public function unassignTags($objId, $objectType, $tagIds) {
- if (!is_array($tagIds)) {
+ public function unassignTags(string $objId, string $objectType, $tagIds) {
+ if (!\is_array($tagIds)) {
$tagIds = [$tagIds];
}
@@ -201,10 +202,10 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
/**
* {@inheritdoc}
*/
- public function haveTag($objIds, $objectType, $tagId, $all = true) {
+ public function haveTag($objIds, string $objectType, string $tagId, bool $all = true): bool {
$this->assertTagsExist([$tagId]);
- if (!is_array($objIds)) {
+ if (!\is_array($objIds)) {
$objIds = [$objIds];
}
@@ -232,10 +233,10 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
$result->closeCursor();
if ($all) {
- return ((int)$row[0] === count($objIds));
- } else {
- return (bool) $row;
+ return ((int)$row[0] === \count($objIds));
}
+
+ return (bool) $row;
}
/**
@@ -247,7 +248,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
*/
private function assertTagsExist($tagIds) {
$tags = $this->tagManager->getTagsByIds($tagIds);
- if (count($tags) !== count($tagIds)) {
+ if (\count($tags) !== \count($tagIds)) {
// at least one tag missing, bail out
$foundTagIds = array_map(
function(ISystemTag $tag) {
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index e47e01349e7..512b312dae1 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -232,11 +232,11 @@ class Response {
/**
* By default renders no output
- * @return string|null
+ * @return string
* @since 6.0.0
*/
public function render() {
- return null;
+ return '';
}
diff --git a/lib/public/AppFramework/Utility/IControllerMethodReflector.php b/lib/public/AppFramework/Utility/IControllerMethodReflector.php
index e9fb4a5a969..e2074b9fe00 100644
--- a/lib/public/AppFramework/Utility/IControllerMethodReflector.php
+++ b/lib/public/AppFramework/Utility/IControllerMethodReflector.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -40,7 +41,7 @@ interface IControllerMethodReflector {
* @return void
* @since 8.0.0
*/
- public function reflect($object, $method);
+ public function reflect($object, string $method);
/**
* Inspects the PHPDoc parameters for types
@@ -51,13 +52,13 @@ interface IControllerMethodReflector {
* would return int or null if not existing
* @since 8.0.0
*/
- public function getType($parameter);
+ public function getType(string $parameter);
/**
* @return array the arguments of the method with key => default value
* @since 8.0.0
*/
- public function getParameters();
+ public function getParameters(): array;
/**
* Check if a method contains an annotation
@@ -66,6 +67,6 @@ interface IControllerMethodReflector {
* @return bool true if the annotation is found
* @since 8.0.0
*/
- public function hasAnnotation($name);
+ public function hasAnnotation(string $name): bool;
}
diff --git a/lib/public/SystemTag/ISystemTag.php b/lib/public/SystemTag/ISystemTag.php
index 539c7835fae..da434e8b5a0 100644
--- a/lib/public/SystemTag/ISystemTag.php
+++ b/lib/public/SystemTag/ISystemTag.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -36,7 +37,7 @@ interface ISystemTag {
*
* @since 9.0.0
*/
- public function getId();
+ public function getId(): string;
/**
* Returns the tag display name
@@ -45,7 +46,7 @@ interface ISystemTag {
*
* @since 9.0.0
*/
- public function getName();
+ public function getName(): string;
/**
* Returns whether the tag is visible for regular users
@@ -54,7 +55,7 @@ interface ISystemTag {
*
* @since 9.0.0
*/
- public function isUserVisible();
+ public function isUserVisible(): bool;
/**
* Returns whether the tag can be assigned to objects by regular users
@@ -63,7 +64,7 @@ interface ISystemTag {
*
* @since 9.0.0
*/
- public function isUserAssignable();
+ public function isUserAssignable(): bool;
}
diff --git a/lib/public/SystemTag/ISystemTagManager.php b/lib/public/SystemTag/ISystemTagManager.php
index fff0a439116..4cce106790a 100644
--- a/lib/public/SystemTag/ISystemTagManager.php
+++ b/lib/public/SystemTag/ISystemTagManager.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -37,15 +38,15 @@ interface ISystemTagManager {
*
* @param array|string $tagIds id or array of unique ids of the tag to retrieve
*
- * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key
+ * @return ISystemTag[] array of system tags with tag id as key
*
* @throws \InvalidArgumentException if at least one given tag ids is invalid (string instead of integer, etc.)
- * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag ids did no exist
+ * @throws TagNotFoundException if at least one given tag ids did no exist
* The message contains a json_encoded array of the ids that could not be found
*
* @since 9.0.0
*/
- public function getTagsByIds($tagIds);
+ public function getTagsByIds($tagIds): array;
/**
* Returns the tag object matching the given attributes.
@@ -54,13 +55,13 @@ interface ISystemTagManager {
* @param bool $userVisible whether the tag is visible by users
* @param bool $userAssignable whether the tag is assignable by users
*
- * @return \OCP\SystemTag\ISystemTag system tag
+ * @return ISystemTag system tag
*
- * @throws \OCP\SystemTag\TagNotFoundException if tag does not exist
+ * @throws TagNotFoundException if tag does not exist
*
* @since 9.0.0
*/
- public function getTag($tagName, $userVisible, $userAssignable);
+ public function getTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag;
/**
* Creates the tag object using the given attributes.
@@ -69,13 +70,13 @@ interface ISystemTagManager {
* @param bool $userVisible whether the tag is visible by users
* @param bool $userAssignable whether the tag is assignable by users
*
- * @return \OCP\SystemTag\ISystemTag system tag
+ * @return ISystemTag system tag
*
- * @throws \OCP\SystemTag\TagAlreadyExistsException if tag already exists
+ * @throws TagAlreadyExistsException if tag already exists
*
* @since 9.0.0
*/
- public function createTag($tagName, $userVisible, $userAssignable);
+ public function createTag(string $tagName, bool $userVisible, bool $userAssignable): ISystemTag;
/**
* Returns all known tags, optionally filtered by visibility.
@@ -83,11 +84,11 @@ interface ISystemTagManager {
* @param bool|null $visibilityFilter filter by visibility if non-null
* @param string $nameSearchPattern optional search pattern for the tag name
*
- * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found
+ * @return ISystemTag[] array of system tags or empty array if none found
*
* @since 9.0.0
*/
- public function getAllTags($visibilityFilter = null, $nameSearchPattern = null);
+ public function getAllTags($visibilityFilter = null, $nameSearchPattern = null): array;
/**
* Updates the given tag
@@ -97,20 +98,20 @@ interface ISystemTagManager {
* @param bool $userVisible whether the tag is visible by users
* @param bool $userAssignable whether the tag is assignable by users
*
- * @throws \OCP\SystemTag\TagNotFoundException if tag with the given id does not exist
- * @throws \OCP\SystemTag\TagAlreadyExistsException if there is already another tag
+ * @throws TagNotFoundException if tag with the given id does not exist
+ * @throws TagAlreadyExistsException if there is already another tag
* with the same attributes
*
* @since 9.0.0
*/
- public function updateTag($tagId, $newName, $userVisible, $userAssignable);
+ public function updateTag(string $tagId, string $newName, bool $userVisible, bool $userAssignable);
/**
* Delete the given tags from the database and all their relationships.
*
* @param string|array $tagIds array of tag ids
*
- * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist
+ * @throws TagNotFoundException if at least one tag did not exist
*
* @since 9.0.0
*/
@@ -127,7 +128,7 @@ interface ISystemTagManager {
*
* @since 9.1.0
*/
- public function canUserAssignTag(ISystemTag $tag, IUser $user);
+ public function canUserAssignTag(ISystemTag $tag, IUser $user): bool;
/**
* Checks whether the given user is allowed to see the tag with the given id.
@@ -139,7 +140,7 @@ interface ISystemTagManager {
*
* @since 9.1.0
*/
- public function canUserSeeTag(ISystemTag $tag, IUser $userId);
+ public function canUserSeeTag(ISystemTag $tag, IUser $user): bool;
/**
* Set groups that can assign a given tag.
@@ -149,7 +150,7 @@ interface ISystemTagManager {
*
* @since 9.1.0
*/
- public function setTagGroups(ISystemTag $tag, $groupIds);
+ public function setTagGroups(ISystemTag $tag, array $groupIds);
/**
* Get groups that can assign a given tag.
@@ -160,5 +161,5 @@ interface ISystemTagManager {
*
* @since 9.1.0
*/
- public function getTagGroups(ISystemTag $tag);
+ public function getTagGroups(ISystemTag $tag): array;
}
diff --git a/lib/public/SystemTag/ISystemTagManagerFactory.php b/lib/public/SystemTag/ISystemTagManagerFactory.php
index 0d652697490..25956b41df4 100644
--- a/lib/public/SystemTag/ISystemTagManagerFactory.php
+++ b/lib/public/SystemTag/ISystemTagManagerFactory.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -47,7 +48,7 @@ interface ISystemTagManagerFactory {
* @return ISystemTagManager
* @since 9.0.0
*/
- public function getManager();
+ public function getManager(): ISystemTagManager;
/**
* creates and returns an instance of the system tag object
@@ -56,5 +57,5 @@ interface ISystemTagManagerFactory {
* @return ISystemTagObjectMapper
* @since 9.0.0
*/
- public function getObjectMapper();
+ public function getObjectMapper(): ISystemTagObjectMapper;
}
diff --git a/lib/public/SystemTag/ISystemTagObjectMapper.php b/lib/public/SystemTag/ISystemTagObjectMapper.php
index 3e28ab15773..1705bde23c5 100644
--- a/lib/public/SystemTag/ISystemTagObjectMapper.php
+++ b/lib/public/SystemTag/ISystemTagObjectMapper.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -51,7 +52,7 @@ interface ISystemTagObjectMapper {
*
* @since 9.0.0
*/
- public function getTagIdsForObjects($objIds, $objectType);
+ public function getTagIdsForObjects($objIds, string $objectType): array;
/**
* Get a list of objects tagged with $tagIds.
@@ -63,14 +64,14 @@ interface ISystemTagObjectMapper {
*
* @return string[] array of object ids or empty array if none found
*
- * @throws \OCP\SystemTag\TagNotFoundException if at least one of the
+ * @throws TagNotFoundException if at least one of the
* given tags does not exist
* @throws \InvalidArgumentException When a limit is specified together with
* multiple tag ids
*
* @since 9.0.0
*/
- public function getObjectIdsForTags($tagIds, $objectType, $limit = 0, $offset = '');
+ public function getObjectIdsForTags($tagIds, string $objectType, int $limit = 0, string $offset = ''): array;
/**
* Assign the given tags to the given object.
@@ -84,12 +85,12 @@ interface ISystemTagObjectMapper {
* @param string $objectType object type
* @param string|array $tagIds tag id or array of tag ids to assign
*
- * @throws \OCP\SystemTag\TagNotFoundException if at least one of the
+ * @throws TagNotFoundException if at least one of the
* given tags does not exist
*
* @since 9.0.0
*/
- public function assignTags($objId, $objectType, $tagIds);
+ public function assignTags(string $objId, string $objectType, $tagIds);
/**
* Unassign the given tags from the given object.
@@ -103,12 +104,12 @@ interface ISystemTagObjectMapper {
* @param string $objectType object type
* @param string|array $tagIds tag id or array of tag ids to unassign
*
- * @throws \OCP\SystemTag\TagNotFoundException if at least one of the
+ * @throws TagNotFoundException if at least one of the
* given tags does not exist
*
* @since 9.0.0
*/
- public function unassignTags($objId, $objectType, $tagIds);
+ public function unassignTags(string $objId, string $objectType, $tagIds);
/**
* Checks whether the given objects have the given tag.
@@ -122,10 +123,10 @@ interface ISystemTagObjectMapper {
* @return bool true if the condition set by $all is matched, false
* otherwise
*
- * @throws \OCP\SystemTag\TagNotFoundException if the tag does not exist
+ * @throws TagNotFoundException if the tag does not exist
*
* @since 9.0.0
*/
- public function haveTag($objIds, $objectType, $tagId, $all = true);
+ public function haveTag($objIds, string $objectType, string $tagId, bool $all = true): bool;
}
diff --git a/lib/public/SystemTag/ManagerEvent.php b/lib/public/SystemTag/ManagerEvent.php
index bb9fcc01f83..452c0d5da8f 100644
--- a/lib/public/SystemTag/ManagerEvent.php
+++ b/lib/public/SystemTag/ManagerEvent.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -52,7 +53,7 @@ class ManagerEvent extends Event {
* @param ISystemTag|null $beforeTag
* @since 9.0.0
*/
- public function __construct($event, ISystemTag $tag, ISystemTag $beforeTag = null) {
+ public function __construct(string $event, ISystemTag $tag, ISystemTag $beforeTag = null) {
$this->event = $event;
$this->tag = $tag;
$this->beforeTag = $beforeTag;
@@ -62,7 +63,7 @@ class ManagerEvent extends Event {
* @return string
* @since 9.0.0
*/
- public function getEvent() {
+ public function getEvent(): string {
return $this->event;
}
@@ -70,15 +71,16 @@ class ManagerEvent extends Event {
* @return ISystemTag
* @since 9.0.0
*/
- public function getTag() {
+ public function getTag(): ISystemTag {
return $this->tag;
}
/**
* @return ISystemTag
* @since 9.0.0
+ * @throws \BadMethodCallException
*/
- public function getTagBefore() {
+ public function getTagBefore(): ISystemTag {
if ($this->event !== self::EVENT_UPDATE) {
throw new \BadMethodCallException('getTagBefore is only available on the update Event');
}
diff --git a/lib/public/SystemTag/MapperEvent.php b/lib/public/SystemTag/MapperEvent.php
index a86497c8440..d98caf1317b 100644
--- a/lib/public/SystemTag/MapperEvent.php
+++ b/lib/public/SystemTag/MapperEvent.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -53,7 +54,7 @@ class MapperEvent extends Event {
* @param int[] $tags
* @since 9.0.0
*/
- public function __construct($event, $objectType, $objectId, array $tags) {
+ public function __construct(string $event, string $objectType, string $objectId, array $tags) {
$this->event = $event;
$this->objectType = $objectType;
$this->objectId = $objectId;
@@ -64,7 +65,7 @@ class MapperEvent extends Event {
* @return string
* @since 9.0.0
*/
- public function getEvent() {
+ public function getEvent(): string {
return $this->event;
}
@@ -72,7 +73,7 @@ class MapperEvent extends Event {
* @return string
* @since 9.0.0
*/
- public function getObjectType() {
+ public function getObjectType(): string {
return $this->objectType;
}
@@ -80,7 +81,7 @@ class MapperEvent extends Event {
* @return string
* @since 9.0.0
*/
- public function getObjectId() {
+ public function getObjectId(): string {
return $this->objectId;
}
@@ -88,7 +89,7 @@ class MapperEvent extends Event {
* @return int[]
* @since 9.0.0
*/
- public function getTags() {
+ public function getTags(): array {
return $this->tags;
}
}
diff --git a/lib/public/SystemTag/SystemTagsEntityEvent.php b/lib/public/SystemTag/SystemTagsEntityEvent.php
index 15ae4439986..e439c16d9c6 100644
--- a/lib/public/SystemTag/SystemTagsEntityEvent.php
+++ b/lib/public/SystemTag/SystemTagsEntityEvent.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -45,7 +46,7 @@ class SystemTagsEntityEvent extends Event {
* @param string $event
* @since 9.1.0
*/
- public function __construct($event) {
+ public function __construct(string $event) {
$this->event = $event;
$this->collections = [];
}
@@ -59,7 +60,7 @@ class SystemTagsEntityEvent extends Event {
* @throws \OutOfBoundsException when the entity name is already taken
* @since 9.1.0
*/
- public function addEntityCollection($name, \Closure $entityExistsFunction) {
+ public function addEntityCollection(string $name, \Closure $entityExistsFunction) {
if (isset($this->collections[$name])) {
throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"');
}
@@ -71,7 +72,7 @@ class SystemTagsEntityEvent extends Event {
* @return \Closure[]
* @since 9.1.0
*/
- public function getEntityCollections() {
+ public function getEntityCollections(): array {
return $this->collections;
}
}
diff --git a/lib/public/SystemTag/TagAlreadyExistsException.php b/lib/public/SystemTag/TagAlreadyExistsException.php
index caf0d9f08bc..fbe8234d281 100644
--- a/lib/public/SystemTag/TagAlreadyExistsException.php
+++ b/lib/public/SystemTag/TagAlreadyExistsException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
diff --git a/lib/public/SystemTag/TagNotFoundException.php b/lib/public/SystemTag/TagNotFoundException.php
index 9b06259807f..9f83c20e6c5 100644
--- a/lib/public/SystemTag/TagNotFoundException.php
+++ b/lib/public/SystemTag/TagNotFoundException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -43,7 +44,7 @@ class TagNotFoundException extends \RuntimeException {
* @param string[] $tags
* @since 9.0.0
*/
- public function __construct($message = '', $code = 0, \Exception $previous = null, array $tags = []) {
+ public function __construct(string $message = '', int $code = 0, \Exception $previous = null, array $tags = []) {
parent::__construct($message, $code, $previous);
$this->tags = $tags;
}
@@ -52,7 +53,7 @@ class TagNotFoundException extends \RuntimeException {
* @return string[]
* @since 9.0.0
*/
- public function getMissingTags() {
+ public function getMissingTags(): array {
return $this->tags;
}
}
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php
index 95fa3c2a047..221e27e3b68 100644
--- a/tests/lib/AppFramework/Http/DispatcherTest.php
+++ b/tests/lib/AppFramework/Http/DispatcherTest.php
@@ -26,10 +26,12 @@ namespace Test\AppFramework\Http;
use OC\AppFramework\Http\Dispatcher;
use OC\AppFramework\Http\Request;
+use OC\AppFramework\Middleware\MiddlewareDispatcher;
use OC\AppFramework\Utility\ControllerMethodReflector;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Controller;
use OCP\IConfig;
@@ -75,7 +77,9 @@ class TestController extends Controller {
class DispatcherTest extends \Test\TestCase {
+ /** @var MiddlewareDispatcher */
private $middlewareDispatcher;
+ /** @var Dispatcher */
private $dispatcher;
private $controllerMethod;
private $response;
@@ -120,14 +124,13 @@ class DispatcherTest extends \Test\TestCase {
$this->reflector = new ControllerMethodReflector();
$this->dispatcher = new Dispatcher(
- $this->http, $this->middlewareDispatcher, $this->reflector,
+ $this->http,
+ $this->middlewareDispatcher,
+ $this->reflector,
$this->request
);
- $this->response = $this->getMockBuilder(
- '\OCP\AppFramework\Http\Response')
- ->disableOriginalConstructor()
- ->getMock();
+ $this->response = $this->createMock(Response::class);
$this->lastModified = new \DateTime(null, new \DateTimeZone('GMT'));
$this->etag = 'hi';
@@ -162,7 +165,7 @@ class DispatcherTest extends \Test\TestCase {
->with($this->equalTo($this->controller),
$this->equalTo($this->controllerMethod),
$this->equalTo($exception))
- ->will($this->returnValue(null));
+ ->willThrowException($exception);
return;
}
} else {
@@ -221,10 +224,9 @@ class DispatcherTest extends \Test\TestCase {
public function testDispatcherReturnsArrayWith2Entries() {
- $this->setMiddlewareExpectations();
+ $this->setMiddlewareExpectations('');
- $response = $this->dispatcher->dispatch($this->controller,
- $this->controllerMethod);
+ $response = $this->dispatcher->dispatch($this->controller, $this->controllerMethod);
$this->assertNull($response[0]);
$this->assertEquals(array(), $response[1]);
$this->assertNull($response[2]);
@@ -264,12 +266,14 @@ class DispatcherTest extends \Test\TestCase {
public function testExceptionThrowsIfCanNotBeHandledByAfterException() {
$out = 'yo';
$httpHeaders = 'Http';
- $responseHeaders = array('hell' => 'yeah');
+ $responseHeaders = ['hell' => 'yeah'];
$this->setMiddlewareExpectations($out, $httpHeaders, $responseHeaders, true, false);
$this->expectException(\Exception::class);
- $response = $this->dispatcher->dispatch($this->controller,
- $this->controllerMethod);
+ $this->dispatcher->dispatch(
+ $this->controller,
+ $this->controllerMethod
+ );
}
diff --git a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
index b2f78c17fe6..e6c2c1b4f53 100644
--- a/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
+++ b/tests/lib/AppFramework/Middleware/MiddlewareDispatcherTest.php
@@ -283,6 +283,8 @@ class MiddlewareDispatcherTest extends \Test\TestCase {
->method('beforeController');
$m3->expects($this->never())
->method('afterController');
+ $m3->method('beforeOutput')
+ ->will($this->returnArgument(2));
$this->dispatcher->registerMiddleware($m3);