@@ -36,94 +36,94 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | interface IURLGenerator { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Regex for matching http(s) urls |
|
| 41 | - * |
|
| 42 | - * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 43 | - * |
|
| 44 | - * @since 25.0.0 |
|
| 45 | - */ |
|
| 46 | - public const URL_REGEX = '/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi'; |
|
| 39 | + /** |
|
| 40 | + * Regex for matching http(s) urls |
|
| 41 | + * |
|
| 42 | + * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 43 | + * |
|
| 44 | + * @since 25.0.0 |
|
| 45 | + */ |
|
| 46 | + public const URL_REGEX = '/(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)/mi'; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * Returns the URL for a route |
|
| 50 | - * @param string $routeName the name of the route |
|
| 51 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 52 | - * @return string the url |
|
| 53 | - * @since 6.0.0 |
|
| 54 | - */ |
|
| 55 | - public function linkToRoute(string $routeName, array $arguments = []): string; |
|
| 48 | + /** |
|
| 49 | + * Returns the URL for a route |
|
| 50 | + * @param string $routeName the name of the route |
|
| 51 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 52 | + * @return string the url |
|
| 53 | + * @since 6.0.0 |
|
| 54 | + */ |
|
| 55 | + public function linkToRoute(string $routeName, array $arguments = []): string; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Returns the absolute URL for a route |
|
| 59 | - * @param string $routeName the name of the route |
|
| 60 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 61 | - * @return string the absolute url |
|
| 62 | - * @since 8.0.0 |
|
| 63 | - */ |
|
| 64 | - public function linkToRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 57 | + /** |
|
| 58 | + * Returns the absolute URL for a route |
|
| 59 | + * @param string $routeName the name of the route |
|
| 60 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 61 | + * @return string the absolute url |
|
| 62 | + * @since 8.0.0 |
|
| 63 | + */ |
|
| 64 | + public function linkToRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * @param string $routeName |
|
| 68 | - * @param array $arguments |
|
| 69 | - * @return string |
|
| 70 | - * @since 15.0.0 |
|
| 71 | - */ |
|
| 72 | - public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 66 | + /** |
|
| 67 | + * @param string $routeName |
|
| 68 | + * @param array $arguments |
|
| 69 | + * @return string |
|
| 70 | + * @since 15.0.0 |
|
| 71 | + */ |
|
| 72 | + public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Returns an URL for an image or file |
|
| 76 | - * @param string $appName the name of the app |
|
| 77 | - * @param string $file the name of the file |
|
| 78 | - * @param array $args array with param=>value, will be appended to the returned url |
|
| 79 | - * The value of $args will be urlencoded |
|
| 80 | - * @return string the url |
|
| 81 | - * @since 6.0.0 |
|
| 82 | - */ |
|
| 83 | - public function linkTo(string $appName, string $file, array $args = []): string; |
|
| 74 | + /** |
|
| 75 | + * Returns an URL for an image or file |
|
| 76 | + * @param string $appName the name of the app |
|
| 77 | + * @param string $file the name of the file |
|
| 78 | + * @param array $args array with param=>value, will be appended to the returned url |
|
| 79 | + * The value of $args will be urlencoded |
|
| 80 | + * @return string the url |
|
| 81 | + * @since 6.0.0 |
|
| 82 | + */ |
|
| 83 | + public function linkTo(string $appName, string $file, array $args = []): string; |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 87 | - * @param string $appName the name of the app |
|
| 88 | - * @param string $file the name of the file |
|
| 89 | - * @return string the url |
|
| 90 | - * @since 6.0.0 |
|
| 91 | - */ |
|
| 92 | - public function imagePath(string $appName, string $file): string; |
|
| 85 | + /** |
|
| 86 | + * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 87 | + * @param string $appName the name of the app |
|
| 88 | + * @param string $file the name of the file |
|
| 89 | + * @return string the url |
|
| 90 | + * @since 6.0.0 |
|
| 91 | + */ |
|
| 92 | + public function imagePath(string $appName, string $file): string; |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * Makes an URL absolute |
|
| 97 | - * @param string $url the url in the ownCloud host |
|
| 98 | - * @return string the absolute version of the url |
|
| 99 | - * @since 6.0.0 |
|
| 100 | - */ |
|
| 101 | - public function getAbsoluteURL(string $url): string; |
|
| 95 | + /** |
|
| 96 | + * Makes an URL absolute |
|
| 97 | + * @param string $url the url in the ownCloud host |
|
| 98 | + * @return string the absolute version of the url |
|
| 99 | + * @since 6.0.0 |
|
| 100 | + */ |
|
| 101 | + public function getAbsoluteURL(string $url): string; |
|
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * @param string $key |
|
| 105 | - * @return string url to the online documentation |
|
| 106 | - * @since 8.0.0 |
|
| 107 | - */ |
|
| 108 | - public function linkToDocs(string $key): string; |
|
| 103 | + /** |
|
| 104 | + * @param string $key |
|
| 105 | + * @return string url to the online documentation |
|
| 106 | + * @since 8.0.0 |
|
| 107 | + */ |
|
| 108 | + public function linkToDocs(string $key): string; |
|
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * Returns the URL of the default page based on the system configuration |
|
| 112 | - * and the apps visible for the current user |
|
| 113 | - * @return string |
|
| 114 | - * @since 23.0.0 |
|
| 115 | - */ |
|
| 116 | - public function linkToDefaultPageUrl(): string; |
|
| 110 | + /** |
|
| 111 | + * Returns the URL of the default page based on the system configuration |
|
| 112 | + * and the apps visible for the current user |
|
| 113 | + * @return string |
|
| 114 | + * @since 23.0.0 |
|
| 115 | + */ |
|
| 116 | + public function linkToDefaultPageUrl(): string; |
|
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * @return string base url of the current request |
|
| 120 | - * @since 13.0.0 |
|
| 121 | - */ |
|
| 122 | - public function getBaseUrl(): string; |
|
| 118 | + /** |
|
| 119 | + * @return string base url of the current request |
|
| 120 | + * @since 13.0.0 |
|
| 121 | + */ |
|
| 122 | + public function getBaseUrl(): string; |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * @return string webroot part of the base url |
|
| 126 | - * @since 23.0.0 |
|
| 127 | - */ |
|
| 128 | - public function getWebroot(): string; |
|
| 124 | + /** |
|
| 125 | + * @return string webroot part of the base url |
|
| 126 | + * @since 23.0.0 |
|
| 127 | + */ |
|
| 128 | + public function getWebroot(): string; |
|
| 129 | 129 | } |