Completed
Pull Request — master (#3218)
by Vars
46:46 queued 34:29
created
lib/public/Files.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,6 +46,7 @@  discard block
 block discarded – undo
46 46
 class Files {
47 47
 	/**
48 48
 	 * Recusive deletion of folders
49
+	 * @param string $dir
49 50
 	 * @return bool
50 51
 	 * @since 5.0.0
51 52
 	 */
@@ -67,7 +68,7 @@  discard block
 block discarded – undo
67 68
 	/**
68 69
 	 * Search for files by mimetype
69 70
 	 * @param string $mimetype
70
-	 * @return array
71
+	 * @return \OC\Files\FileInfo[]
71 72
 	 * @since 6.0.0
72 73
 	 */
73 74
 	static public function searchByMime( $mimetype ) {
Please login to merge, or discard this patch.
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -45,92 +45,92 @@
 block discarded – undo
45 45
  * @since 5.0.0
46 46
  */
47 47
 class Files {
48
-	/**
49
-	 * Recusive deletion of folders
50
-	 * @return bool
51
-	 * @since 5.0.0
52
-	 */
53
-	static function rmdirr( $dir ) {
54
-		return \OC_Helper::rmdirr( $dir );
55
-	}
48
+    /**
49
+     * Recusive deletion of folders
50
+     * @return bool
51
+     * @since 5.0.0
52
+     */
53
+    static function rmdirr( $dir ) {
54
+        return \OC_Helper::rmdirr( $dir );
55
+    }
56 56
 
57
-	/**
58
-	 * Get the mimetype form a local file
59
-	 * @param string $path
60
-	 * @return string
61
-	 * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
62
-	 * @since 5.0.0
63
-	 */
64
-	static function getMimeType( $path ) {
65
-		return \OC::$server->getMimeTypeDetector()->detect($path);
66
-	}
57
+    /**
58
+     * Get the mimetype form a local file
59
+     * @param string $path
60
+     * @return string
61
+     * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
62
+     * @since 5.0.0
63
+     */
64
+    static function getMimeType( $path ) {
65
+        return \OC::$server->getMimeTypeDetector()->detect($path);
66
+    }
67 67
 
68
-	/**
69
-	 * Search for files by mimetype
70
-	 * @param string $mimetype
71
-	 * @return array
72
-	 * @since 6.0.0
73
-	 */
74
-	static public function searchByMime( $mimetype ) {
75
-		return(\OC\Files\Filesystem::searchByMime( $mimetype ));
76
-	}
68
+    /**
69
+     * Search for files by mimetype
70
+     * @param string $mimetype
71
+     * @return array
72
+     * @since 6.0.0
73
+     */
74
+    static public function searchByMime( $mimetype ) {
75
+        return(\OC\Files\Filesystem::searchByMime( $mimetype ));
76
+    }
77 77
 
78
-	/**
79
-	 * Copy the contents of one stream to another
80
-	 * @param resource $source
81
-	 * @param resource $target
82
-	 * @return int the number of bytes copied
83
-	 * @since 5.0.0
84
-	 */
85
-	public static function streamCopy( $source, $target ) {
86
-		list($count, ) = \OC_Helper::streamCopy( $source, $target );
87
-		return $count;
88
-	}
78
+    /**
79
+     * Copy the contents of one stream to another
80
+     * @param resource $source
81
+     * @param resource $target
82
+     * @return int the number of bytes copied
83
+     * @since 5.0.0
84
+     */
85
+    public static function streamCopy( $source, $target ) {
86
+        list($count, ) = \OC_Helper::streamCopy( $source, $target );
87
+        return $count;
88
+    }
89 89
 
90
-	/**
91
-	 * Create a temporary file with an unique filename
92
-	 * @param string $postfix
93
-	 * @return string
94
-	 *
95
-	 * temporary files are automatically cleaned up after the script is finished
96
-	 * @deprecated 8.1.0 use getTemporaryFile() of \OCP\ITempManager - \OC::$server->getTempManager()
97
-	 * @since 5.0.0
98
-	 */
99
-	public static function tmpFile( $postfix='' ) {
100
-		return \OC::$server->getTempManager()->getTemporaryFile($postfix);
101
-	}
90
+    /**
91
+     * Create a temporary file with an unique filename
92
+     * @param string $postfix
93
+     * @return string
94
+     *
95
+     * temporary files are automatically cleaned up after the script is finished
96
+     * @deprecated 8.1.0 use getTemporaryFile() of \OCP\ITempManager - \OC::$server->getTempManager()
97
+     * @since 5.0.0
98
+     */
99
+    public static function tmpFile( $postfix='' ) {
100
+        return \OC::$server->getTempManager()->getTemporaryFile($postfix);
101
+    }
102 102
 
103
-	/**
104
-	 * Create a temporary folder with an unique filename
105
-	 * @return string
106
-	 *
107
-	 * temporary files are automatically cleaned up after the script is finished
108
-	 * @deprecated 8.1.0 use getTemporaryFolder() of \OCP\ITempManager - \OC::$server->getTempManager()
109
-	 * @since 5.0.0
110
-	 */
111
-	public static function tmpFolder() {
112
-		return \OC::$server->getTempManager()->getTemporaryFolder();
113
-	}
103
+    /**
104
+     * Create a temporary folder with an unique filename
105
+     * @return string
106
+     *
107
+     * temporary files are automatically cleaned up after the script is finished
108
+     * @deprecated 8.1.0 use getTemporaryFolder() of \OCP\ITempManager - \OC::$server->getTempManager()
109
+     * @since 5.0.0
110
+     */
111
+    public static function tmpFolder() {
112
+        return \OC::$server->getTempManager()->getTemporaryFolder();
113
+    }
114 114
 
115
-	/**
116
-	 * Adds a suffix to the name in case the file exists
117
-	 * @param string $path
118
-	 * @param string $filename
119
-	 * @return string
120
-	 * @since 5.0.0
121
-	 */
122
-	public static function buildNotExistingFileName( $path, $filename ) {
123
-		return(\OC_Helper::buildNotExistingFileName( $path, $filename ));
124
-	}
115
+    /**
116
+     * Adds a suffix to the name in case the file exists
117
+     * @param string $path
118
+     * @param string $filename
119
+     * @return string
120
+     * @since 5.0.0
121
+     */
122
+    public static function buildNotExistingFileName( $path, $filename ) {
123
+        return(\OC_Helper::buildNotExistingFileName( $path, $filename ));
124
+    }
125 125
 
126
-	/**
127
-	 * Gets the Storage for an app - creates the needed folder if they are not
128
-	 * existent
129
-	 * @param string $app
130
-	 * @return \OC\Files\View
131
-	 * @since 5.0.0
132
-	 */
133
-	public static function getStorage( $app ) {
134
-		return \OC_App::getStorage( $app );
135
-	}
126
+    /**
127
+     * Gets the Storage for an app - creates the needed folder if they are not
128
+     * existent
129
+     * @param string $app
130
+     * @return \OC\Files\View
131
+     * @since 5.0.0
132
+     */
133
+    public static function getStorage( $app ) {
134
+        return \OC_App::getStorage( $app );
135
+    }
136 136
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 * @return bool
51 51
 	 * @since 5.0.0
52 52
 	 */
53
-	static function rmdirr( $dir ) {
54
-		return \OC_Helper::rmdirr( $dir );
53
+	static function rmdirr($dir) {
54
+		return \OC_Helper::rmdirr($dir);
55 55
 	}
56 56
 
57 57
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead
62 62
 	 * @since 5.0.0
63 63
 	 */
64
-	static function getMimeType( $path ) {
64
+	static function getMimeType($path) {
65 65
 		return \OC::$server->getMimeTypeDetector()->detect($path);
66 66
 	}
67 67
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	 * @return array
72 72
 	 * @since 6.0.0
73 73
 	 */
74
-	static public function searchByMime( $mimetype ) {
75
-		return(\OC\Files\Filesystem::searchByMime( $mimetype ));
74
+	static public function searchByMime($mimetype) {
75
+		return(\OC\Files\Filesystem::searchByMime($mimetype));
76 76
 	}
77 77
 
78 78
 	/**
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 	 * @return int the number of bytes copied
83 83
 	 * @since 5.0.0
84 84
 	 */
85
-	public static function streamCopy( $source, $target ) {
86
-		list($count, ) = \OC_Helper::streamCopy( $source, $target );
85
+	public static function streamCopy($source, $target) {
86
+		list($count,) = \OC_Helper::streamCopy($source, $target);
87 87
 		return $count;
88 88
 	}
89 89
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @deprecated 8.1.0 use getTemporaryFile() of \OCP\ITempManager - \OC::$server->getTempManager()
97 97
 	 * @since 5.0.0
98 98
 	 */
99
-	public static function tmpFile( $postfix='' ) {
99
+	public static function tmpFile($postfix = '') {
100 100
 		return \OC::$server->getTempManager()->getTemporaryFile($postfix);
101 101
 	}
102 102
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	 * @return string
120 120
 	 * @since 5.0.0
121 121
 	 */
122
-	public static function buildNotExistingFileName( $path, $filename ) {
123
-		return(\OC_Helper::buildNotExistingFileName( $path, $filename ));
122
+	public static function buildNotExistingFileName($path, $filename) {
123
+		return(\OC_Helper::buildNotExistingFileName($path, $filename));
124 124
 	}
125 125
 
126 126
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @return \OC\Files\View
131 131
 	 * @since 5.0.0
132 132
 	 */
133
-	public static function getStorage( $app ) {
134
-		return \OC_App::getStorage( $app );
133
+	public static function getStorage($app) {
134
+		return \OC_App::getStorage($app);
135 135
 	}
136 136
 }
Please login to merge, or discard this patch.
lib/public/Files/StorageAuthException.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
30 30
 	 * StorageAuthException constructor.
31 31
 	 *
32 32
 	 * @param string $message
33
-	 * @param int $code
34 33
 	 * @param \Exception $previous
35 34
 	 * @since 9.0.0
36 35
 	 */
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@
 block discarded – undo
27 27
  */
28 28
 class StorageAuthException extends StorageNotAvailableException {
29 29
 
30
-	/**
31
-	 * StorageAuthException constructor.
32
-	 *
33
-	 * @param string $message
34
-	 * @param int $code
35
-	 * @param \Exception $previous
36
-	 * @since 9.0.0
37
-	 */
38
-	public function __construct($message = '', \Exception $previous = null) {
39
-		$l = \OC::$server->getL10N('core');
40
-		parent::__construct($l->t('Storage unauthorized. %s', $message), self::STATUS_UNAUTHORIZED, $previous);
41
-	}
30
+    /**
31
+     * StorageAuthException constructor.
32
+     *
33
+     * @param string $message
34
+     * @param int $code
35
+     * @param \Exception $previous
36
+     * @since 9.0.0
37
+     */
38
+    public function __construct($message = '', \Exception $previous = null) {
39
+        $l = \OC::$server->getL10N('core');
40
+        parent::__construct($l->t('Storage unauthorized. %s', $message), self::STATUS_UNAUTHORIZED, $previous);
41
+    }
42 42
 }
Please login to merge, or discard this patch.
lib/public/Files/StorageBadConfigException.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
30 30
 	 * ExtStorageBadConfigException constructor.
31 31
 	 *
32 32
 	 * @param string $message
33
-	 * @param int $code
34 33
 	 * @param \Exception $previous
35 34
 	 * @since 9.0.0
36 35
 	 */
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,17 +27,17 @@
 block discarded – undo
27 27
  */
28 28
 class StorageBadConfigException extends StorageNotAvailableException {
29 29
 
30
-	/**
31
-	 * ExtStorageBadConfigException constructor.
32
-	 *
33
-	 * @param string $message
34
-	 * @param int $code
35
-	 * @param \Exception $previous
36
-	 * @since 9.0.0
37
-	 */
38
-	public function __construct($message = '', \Exception $previous = null) {
39
-		$l = \OC::$server->getL10N('core');
40
-		parent::__construct($l->t('Storage incomplete configuration. %s', $message), self::STATUS_INCOMPLETE_CONF, $previous);
41
-	}
30
+    /**
31
+     * ExtStorageBadConfigException constructor.
32
+     *
33
+     * @param string $message
34
+     * @param int $code
35
+     * @param \Exception $previous
36
+     * @since 9.0.0
37
+     */
38
+    public function __construct($message = '', \Exception $previous = null) {
39
+        $l = \OC::$server->getL10N('core');
40
+        parent::__construct($l->t('Storage incomplete configuration. %s', $message), self::STATUS_INCOMPLETE_CONF, $previous);
41
+    }
42 42
 
43 43
 }
Please login to merge, or discard this patch.
lib/public/Files/StorageConnectionException.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
30 30
 	 * StorageConnectionException constructor.
31 31
 	 *
32 32
 	 * @param string $message
33
-	 * @param int $code
34 33
 	 * @param \Exception $previous
35 34
 	 * @since 9.0.0
36 35
 	 */
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@
 block discarded – undo
27 27
  */
28 28
 class StorageConnectionException extends StorageNotAvailableException {
29 29
 
30
-	/**
31
-	 * StorageConnectionException constructor.
32
-	 *
33
-	 * @param string $message
34
-	 * @param int $code
35
-	 * @param \Exception $previous
36
-	 * @since 9.0.0
37
-	 */
38
-	public function __construct($message = '', \Exception $previous = null) {
39
-		$l = \OC::$server->getL10N('core');
40
-		parent::__construct($l->t('Storage connection error. %s', $message), self::STATUS_NETWORK_ERROR, $previous);
41
-	}
30
+    /**
31
+     * StorageConnectionException constructor.
32
+     *
33
+     * @param string $message
34
+     * @param int $code
35
+     * @param \Exception $previous
36
+     * @since 9.0.0
37
+     */
38
+    public function __construct($message = '', \Exception $previous = null) {
39
+        $l = \OC::$server->getL10N('core');
40
+        parent::__construct($l->t('Storage connection error. %s', $message), self::STATUS_NETWORK_ERROR, $previous);
41
+    }
42 42
 }
Please login to merge, or discard this patch.
lib/public/Files/StorageTimeoutException.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,6 @@
 block discarded – undo
30 30
 	 * StorageTimeoutException constructor.
31 31
 	 *
32 32
 	 * @param string $message
33
-	 * @param int $code
34 33
 	 * @param \Exception $previous
35 34
 	 * @since 9.0.0
36 35
 	 */
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,16 +27,16 @@
 block discarded – undo
27 27
  */
28 28
 class StorageTimeoutException extends StorageNotAvailableException {
29 29
 
30
-	/**
31
-	 * StorageTimeoutException constructor.
32
-	 *
33
-	 * @param string $message
34
-	 * @param int $code
35
-	 * @param \Exception $previous
36
-	 * @since 9.0.0
37
-	 */
38
-	public function __construct($message = '', \Exception $previous = null) {
39
-		$l = \OC::$server->getL10N('core');
40
-		parent::__construct($l->t('Storage connection timeout. %s', $message), self::STATUS_TIMEOUT, $previous);
41
-	}
30
+    /**
31
+     * StorageTimeoutException constructor.
32
+     *
33
+     * @param string $message
34
+     * @param int $code
35
+     * @param \Exception $previous
36
+     * @since 9.0.0
37
+     */
38
+    public function __construct($message = '', \Exception $previous = null) {
39
+        $l = \OC::$server->getL10N('core');
40
+        parent::__construct($l->t('Storage connection timeout. %s', $message), self::STATUS_TIMEOUT, $previous);
41
+    }
42 42
 }
Please login to merge, or discard this patch.
lib/public/Migration/IOutput.php 2 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,18 +32,21 @@  discard block
 block discarded – undo
32 32
 	/**
33 33
 	 * @param string $message
34 34
 	 * @since 9.1.0
35
+	 * @return void
35 36
 	 */
36 37
 	public function info($message);
37 38
 
38 39
 	/**
39 40
 	 * @param string $message
40 41
 	 * @since 9.1.0
42
+	 * @return void
41 43
 	 */
42 44
 	public function warning($message);
43 45
 
44 46
 	/**
45 47
 	 * @param int $max
46 48
 	 * @since 9.1.0
49
+	 * @return void
47 50
 	 */
48 51
 	public function startProgress($max = 0);
49 52
 
@@ -51,12 +54,13 @@  discard block
 block discarded – undo
51 54
 	 * @param int $step
52 55
 	 * @param string $description
53 56
 	 * @since 9.1.0
57
+	 * @return void
54 58
 	 */
55 59
 	public function advance($step = 1, $description = '');
56 60
 
57 61
 	/**
58
-	 * @param int $max
59 62
 	 * @since 9.1.0
63
+	 * @return void
60 64
 	 */
61 65
 	public function finishProgress();
62 66
 
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -30,35 +30,35 @@
 block discarded – undo
30 30
  */
31 31
 interface IOutput {
32 32
 
33
-	/**
34
-	 * @param string $message
35
-	 * @since 9.1.0
36
-	 */
37
-	public function info($message);
33
+    /**
34
+     * @param string $message
35
+     * @since 9.1.0
36
+     */
37
+    public function info($message);
38 38
 
39
-	/**
40
-	 * @param string $message
41
-	 * @since 9.1.0
42
-	 */
43
-	public function warning($message);
39
+    /**
40
+     * @param string $message
41
+     * @since 9.1.0
42
+     */
43
+    public function warning($message);
44 44
 
45
-	/**
46
-	 * @param int $max
47
-	 * @since 9.1.0
48
-	 */
49
-	public function startProgress($max = 0);
45
+    /**
46
+     * @param int $max
47
+     * @since 9.1.0
48
+     */
49
+    public function startProgress($max = 0);
50 50
 
51
-	/**
52
-	 * @param int $step
53
-	 * @param string $description
54
-	 * @since 9.1.0
55
-	 */
56
-	public function advance($step = 1, $description = '');
51
+    /**
52
+     * @param int $step
53
+     * @param string $description
54
+     * @since 9.1.0
55
+     */
56
+    public function advance($step = 1, $description = '');
57 57
 
58
-	/**
59
-	 * @param int $max
60
-	 * @since 9.1.0
61
-	 */
62
-	public function finishProgress();
58
+    /**
59
+     * @param int $max
60
+     * @since 9.1.0
61
+     */
62
+    public function finishProgress();
63 63
 
64 64
 }
Please login to merge, or discard this patch.
lib/public/SystemTag/ISystemTagManager.php 2 patches
Doc Comments   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,17 +102,19 @@  discard block
 block discarded – undo
102 102
 	 * with the same attributes
103 103
 	 *
104 104
 	 * @since 9.0.0
105
+	 * @return void
105 106
 	 */
106 107
 	public function updateTag($tagId, $newName, $userVisible, $userAssignable);
107 108
 
108 109
 	/**
109 110
 	 * Delete the given tags from the database and all their relationships.
110 111
 	 *
111
-	 * @param string|array $tagIds array of tag ids
112
+	 * @param string $tagIds array of tag ids
112 113
 	 *
113 114
 	 * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist
114 115
 	 *
115 116
 	 * @since 9.0.0
117
+	 * @return void
116 118
 	 */
117 119
 	public function deleteTags($tagIds);
118 120
 
@@ -123,7 +125,7 @@  discard block
 block discarded – undo
123 125
 	 * @param ISystemTag $tag tag to check permission for
124 126
 	 * @param IUser $user user to check permission for
125 127
 	 *
126
-	 * @return true if the user is allowed to assign/unassign the tag, false otherwise
128
+	 * @return boolean if the user is allowed to assign/unassign the tag, false otherwise
127 129
 	 *
128 130
 	 * @since 9.1.0
129 131
 	 */
@@ -133,9 +135,9 @@  discard block
 block discarded – undo
133 135
 	 * Checks whether the given user is allowed to see the tag with the given id.
134 136
 	 *
135 137
 	 * @param ISystemTag $tag tag to check permission for
136
-	 * @param IUser $user user to check permission for
138
+	 * @param IUser $userId user to check permission for
137 139
 	 *
138
-	 * @return true if the user can see the tag, false otherwise
140
+	 * @return boolean if the user can see the tag, false otherwise
139 141
 	 *
140 142
 	 * @since 9.1.0
141 143
 	 */
@@ -148,6 +150,7 @@  discard block
 block discarded – undo
148 150
 	 * @param string[] $groupIds group ids of groups that can assign/unassign the tag
149 151
 	 *
150 152
 	 * @since 9.1.0
153
+	 * @return void
151 154
 	 */
152 155
 	public function setTagGroups(ISystemTag $tag, $groupIds);
153 156
 
Please login to merge, or discard this patch.
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -33,133 +33,133 @@
 block discarded – undo
33 33
  */
34 34
 interface ISystemTagManager {
35 35
 
36
-	/**
37
-	 * Returns the tag objects matching the given tag ids.
38
-	 *
39
-	 * @param array|string $tagIds id or array of unique ids of the tag to retrieve
40
-	 *
41
-	 * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key
42
-	 *
43
-	 * @throws \InvalidArgumentException if at least one given tag ids is invalid (string instead of integer, etc.)
44
-	 * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag ids did no exist
45
-	 * 			The message contains a json_encoded array of the ids that could not be found
46
-	 *
47
-	 * @since 9.0.0
48
-	 */
49
-	public function getTagsByIds($tagIds);
36
+    /**
37
+     * Returns the tag objects matching the given tag ids.
38
+     *
39
+     * @param array|string $tagIds id or array of unique ids of the tag to retrieve
40
+     *
41
+     * @return \OCP\SystemTag\ISystemTag[] array of system tags with tag id as key
42
+     *
43
+     * @throws \InvalidArgumentException if at least one given tag ids is invalid (string instead of integer, etc.)
44
+     * @throws \OCP\SystemTag\TagNotFoundException if at least one given tag ids did no exist
45
+     * 			The message contains a json_encoded array of the ids that could not be found
46
+     *
47
+     * @since 9.0.0
48
+     */
49
+    public function getTagsByIds($tagIds);
50 50
 
51
-	/**
52
-	 * Returns the tag object matching the given attributes.
53
-	 *
54
-	 * @param string $tagName tag name
55
-	 * @param bool $userVisible whether the tag is visible by users
56
-	 * @param bool $userAssignable whether the tag is assignable by users
57
-	 *
58
-	 * @return \OCP\SystemTag\ISystemTag system tag
59
-	 *
60
-	 * @throws \OCP\SystemTag\TagNotFoundException if tag does not exist
61
-	 *
62
-	 * @since 9.0.0
63
-	 */
64
-	public function getTag($tagName, $userVisible, $userAssignable);
51
+    /**
52
+     * Returns the tag object matching the given attributes.
53
+     *
54
+     * @param string $tagName tag name
55
+     * @param bool $userVisible whether the tag is visible by users
56
+     * @param bool $userAssignable whether the tag is assignable by users
57
+     *
58
+     * @return \OCP\SystemTag\ISystemTag system tag
59
+     *
60
+     * @throws \OCP\SystemTag\TagNotFoundException if tag does not exist
61
+     *
62
+     * @since 9.0.0
63
+     */
64
+    public function getTag($tagName, $userVisible, $userAssignable);
65 65
 
66
-	/**
67
-	 * Creates the tag object using the given attributes.
68
-	 *
69
-	 * @param string $tagName tag name
70
-	 * @param bool $userVisible whether the tag is visible by users
71
-	 * @param bool $userAssignable whether the tag is assignable by users
72
-	 *
73
-	 * @return \OCP\SystemTag\ISystemTag system tag
74
-	 *
75
-	 * @throws \OCP\SystemTag\TagAlreadyExistsException if tag already exists
76
-	 *
77
-	 * @since 9.0.0
78
-	 */
79
-	public function createTag($tagName, $userVisible, $userAssignable);
66
+    /**
67
+     * Creates the tag object using the given attributes.
68
+     *
69
+     * @param string $tagName tag name
70
+     * @param bool $userVisible whether the tag is visible by users
71
+     * @param bool $userAssignable whether the tag is assignable by users
72
+     *
73
+     * @return \OCP\SystemTag\ISystemTag system tag
74
+     *
75
+     * @throws \OCP\SystemTag\TagAlreadyExistsException if tag already exists
76
+     *
77
+     * @since 9.0.0
78
+     */
79
+    public function createTag($tagName, $userVisible, $userAssignable);
80 80
 
81
-	/**
82
-	 * Returns all known tags, optionally filtered by visibility.
83
-	 *
84
-	 * @param bool|null $visibilityFilter filter by visibility if non-null
85
-	 * @param string $nameSearchPattern optional search pattern for the tag name
86
-	 *
87
-	 * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found
88
-	 *
89
-	 * @since 9.0.0
90
-	 */
91
-	public function getAllTags($visibilityFilter = null, $nameSearchPattern = null);
81
+    /**
82
+     * Returns all known tags, optionally filtered by visibility.
83
+     *
84
+     * @param bool|null $visibilityFilter filter by visibility if non-null
85
+     * @param string $nameSearchPattern optional search pattern for the tag name
86
+     *
87
+     * @return \OCP\SystemTag\ISystemTag[] array of system tags or empty array if none found
88
+     *
89
+     * @since 9.0.0
90
+     */
91
+    public function getAllTags($visibilityFilter = null, $nameSearchPattern = null);
92 92
 
93
-	/**
94
-	 * Updates the given tag
95
-	 *
96
-	 * @param string $tagId tag id
97
-	 * @param string $newName the new tag name
98
-	 * @param bool $userVisible whether the tag is visible by users
99
-	 * @param bool $userAssignable whether the tag is assignable by users
100
-	 *
101
-	 * @throws \OCP\SystemTag\TagNotFoundException if tag with the given id does not exist
102
-	 * @throws \OCP\SystemTag\TagAlreadyExistsException if there is already another tag
103
-	 * with the same attributes
104
-	 *
105
-	 * @since 9.0.0
106
-	 */
107
-	public function updateTag($tagId, $newName, $userVisible, $userAssignable);
93
+    /**
94
+     * Updates the given tag
95
+     *
96
+     * @param string $tagId tag id
97
+     * @param string $newName the new tag name
98
+     * @param bool $userVisible whether the tag is visible by users
99
+     * @param bool $userAssignable whether the tag is assignable by users
100
+     *
101
+     * @throws \OCP\SystemTag\TagNotFoundException if tag with the given id does not exist
102
+     * @throws \OCP\SystemTag\TagAlreadyExistsException if there is already another tag
103
+     * with the same attributes
104
+     *
105
+     * @since 9.0.0
106
+     */
107
+    public function updateTag($tagId, $newName, $userVisible, $userAssignable);
108 108
 
109
-	/**
110
-	 * Delete the given tags from the database and all their relationships.
111
-	 *
112
-	 * @param string|array $tagIds array of tag ids
113
-	 *
114
-	 * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist
115
-	 *
116
-	 * @since 9.0.0
117
-	 */
118
-	public function deleteTags($tagIds);
109
+    /**
110
+     * Delete the given tags from the database and all their relationships.
111
+     *
112
+     * @param string|array $tagIds array of tag ids
113
+     *
114
+     * @throws \OCP\SystemTag\TagNotFoundException if at least one tag did not exist
115
+     *
116
+     * @since 9.0.0
117
+     */
118
+    public function deleteTags($tagIds);
119 119
 
120
-	/**
121
-	 * Checks whether the given user is allowed to assign/unassign the tag with the
122
-	 * given id.
123
-	 *
124
-	 * @param ISystemTag $tag tag to check permission for
125
-	 * @param IUser $user user to check permission for
126
-	 *
127
-	 * @return true if the user is allowed to assign/unassign the tag, false otherwise
128
-	 *
129
-	 * @since 9.1.0
130
-	 */
131
-	public function canUserAssignTag(ISystemTag $tag, IUser $user);
120
+    /**
121
+     * Checks whether the given user is allowed to assign/unassign the tag with the
122
+     * given id.
123
+     *
124
+     * @param ISystemTag $tag tag to check permission for
125
+     * @param IUser $user user to check permission for
126
+     *
127
+     * @return true if the user is allowed to assign/unassign the tag, false otherwise
128
+     *
129
+     * @since 9.1.0
130
+     */
131
+    public function canUserAssignTag(ISystemTag $tag, IUser $user);
132 132
 
133
-	/**
134
-	 * Checks whether the given user is allowed to see the tag with the given id.
135
-	 *
136
-	 * @param ISystemTag $tag tag to check permission for
137
-	 * @param IUser $user user to check permission for
138
-	 *
139
-	 * @return true if the user can see the tag, false otherwise
140
-	 *
141
-	 * @since 9.1.0
142
-	 */
143
-	public function canUserSeeTag(ISystemTag $tag, IUser $userId);
133
+    /**
134
+     * Checks whether the given user is allowed to see the tag with the given id.
135
+     *
136
+     * @param ISystemTag $tag tag to check permission for
137
+     * @param IUser $user user to check permission for
138
+     *
139
+     * @return true if the user can see the tag, false otherwise
140
+     *
141
+     * @since 9.1.0
142
+     */
143
+    public function canUserSeeTag(ISystemTag $tag, IUser $userId);
144 144
 
145
-	/**
146
-	 * Set groups that can assign a given tag.
147
-	 *
148
-	 * @param ISystemTag $tag tag for group assignment
149
-	 * @param string[] $groupIds group ids of groups that can assign/unassign the tag
150
-	 *
151
-	 * @since 9.1.0
152
-	 */
153
-	public function setTagGroups(ISystemTag $tag, $groupIds);
145
+    /**
146
+     * Set groups that can assign a given tag.
147
+     *
148
+     * @param ISystemTag $tag tag for group assignment
149
+     * @param string[] $groupIds group ids of groups that can assign/unassign the tag
150
+     *
151
+     * @since 9.1.0
152
+     */
153
+    public function setTagGroups(ISystemTag $tag, $groupIds);
154 154
 
155
-	/**
156
-	 * Get groups that can assign a given tag.
157
-	 *
158
-	 * @param ISystemTag $tag tag for group assignment
159
-	 *
160
-	 * @return string[] group ids of groups that can assign/unassign the tag
161
-	 *
162
-	 * @since 9.1.0
163
-	 */
164
-	public function getTagGroups(ISystemTag $tag);
155
+    /**
156
+     * Get groups that can assign a given tag.
157
+     *
158
+     * @param ISystemTag $tag tag for group assignment
159
+     *
160
+     * @return string[] group ids of groups that can assign/unassign the tag
161
+     *
162
+     * @since 9.1.0
163
+     */
164
+    public function getTagGroups(ISystemTag $tag);
165 165
 }
Please login to merge, or discard this patch.
lib/public/Template.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,8 +100,8 @@
 block discarded – undo
100 100
 /**
101 101
  * Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
102 102
  * @param int $timestamp unix timestamp
103
- * @param boolean $dateOnly
104
- * @return \OC_L10N_String human readable interpretation of the timestamp
103
+ * @param integer $dateOnly
104
+ * @return string human readable interpretation of the timestamp
105 105
  *
106 106
  * @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead
107 107
  */
Please login to merge, or discard this patch.
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  * @deprecated 8.0.0 Use \OCP\Template::image_path() instead
51 51
  */
52 52
 function image_path( $app, $image ) {
53
-	return(\image_path( $app, $image ));
53
+    return(\image_path( $app, $image ));
54 54
 }
55 55
 
56 56
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  * @deprecated 8.0.0 Use \OCP\Template::mimetype_icon() instead
62 62
  */
63 63
 function mimetype_icon( $mimetype ) {
64
-	return(\mimetype_icon( $mimetype ));
64
+    return(\mimetype_icon( $mimetype ));
65 65
 }
66 66
 
67 67
 /**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
  * @deprecated 8.0.0 Use \OCP\Template::preview_icon() instead
72 72
  */
73 73
 function preview_icon( $path ) {
74
-	return(\preview_icon( $path ));
74
+    return(\preview_icon( $path ));
75 75
 }
76 76
 
77 77
 /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
  * @deprecated 8.0.0 Use \OCP\Template::publicPreview_icon() instead
84 84
  */
85 85
 function publicPreview_icon ( $path, $token ) {
86
-	return(\publicPreview_icon( $path, $token ));
86
+    return(\publicPreview_icon( $path, $token ));
87 87
 }
88 88
 
89 89
 /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
  * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead
95 95
  */
96 96
 function human_file_size( $bytes ) {
97
-	return(\human_file_size( $bytes ));
97
+    return(\human_file_size( $bytes ));
98 98
 }
99 99
 
100 100
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  * @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead
108 108
  */
109 109
 function relative_modified_date( $timestamp, $dateOnly = false ) {
110
-	return(\relative_modified_date($timestamp, null, $dateOnly));
110
+    return(\relative_modified_date($timestamp, null, $dateOnly));
111 111
 }
112 112
 
113 113
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
  * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead
119 119
  */
120 120
 function simple_file_size($bytes) {
121
-	return(\human_file_size($bytes));
121
+    return(\human_file_size($bytes));
122 122
 }
123 123
 
124 124
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
  * @deprecated 8.0.0 Use \OCP\Template::html_select_options() instead
132 132
  */
133 133
 function html_select_options($options, $selected, $params=array()) {
134
-	return(\html_select_options($options, $selected, $params));
134
+    return(\html_select_options($options, $selected, $params));
135 135
 }
136 136
 
137 137
 
@@ -142,90 +142,90 @@  discard block
 block discarded – undo
142 142
  * @since 8.0.0
143 143
  */
144 144
 class Template extends \OC_Template {
145
-	/**
146
-	 * Make OC_Helper::imagePath available as a simple function
147
-	 *
148
-	 * @see \OCP\IURLGenerator::imagePath
149
-	 *
150
-	 * @param string $app
151
-	 * @param string $image
152
-	 * @return string to the image
153
-	 * @since 8.0.0
154
-	 */
155
-	public static function image_path($app, $image) {
156
-		return \image_path($app, $image);
157
-	}
158
-
159
-
160
-	/**
161
-	 * Make OC_Helper::mimetypeIcon available as a simple function
162
-	 *
163
-	 * @param string $mimetype
164
-	 * @return string to the image of this file type.
165
-	 * @since 8.0.0
166
-	 */
167
-	public static function mimetype_icon($mimetype) {
168
-		return \mimetype_icon($mimetype);
169
-	}
170
-
171
-	/**
172
-	 * Make preview_icon available as a simple function
173
-	 *
174
-	 * @param string $path path to file
175
-	 * @return string to the preview of the image
176
-	 * @since 8.0.0
177
-	 */
178
-	public static function preview_icon($path) {
179
-		return \preview_icon($path);
180
-	}
181
-
182
-	/**
183
-	 * Make publicpreview_icon available as a simple function
184
-	 * Returns the path to the preview of the image.
185
-	 *
186
-	 * @param string $path of file
187
-	 * @param string $token
188
-	 * @return string link to the preview
189
-	 * @since 8.0.0
190
-	 */
191
-	public static function publicPreview_icon($path, $token) {
192
-		return \publicPreview_icon($path, $token);
193
-	}
194
-
195
-	/**
196
-	 * Make OC_Helper::humanFileSize available as a simple function
197
-	 * Example: 2048 to 2 kB.
198
-	 *
199
-	 * @param int $bytes in bytes
200
-	 * @return string size as string
201
-	 * @since 8.0.0
202
-	 */
203
-	public static function human_file_size($bytes) {
204
-		return \human_file_size($bytes);
205
-	}
206
-
207
-	/**
208
-	 * Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
209
-	 *
210
-	 * @param int $timestamp unix timestamp
211
-	 * @param boolean $dateOnly
212
-	 * @return string human readable interpretation of the timestamp
213
-	 * @since 8.0.0
214
-	 */
215
-	public static function relative_modified_date($timestamp, $dateOnly = false) {
216
-		return \relative_modified_date($timestamp, null, $dateOnly);
217
-	}
218
-
219
-	/**
220
-	 * Generate html code for an options block.
221
-	 *
222
-	 * @param array $options the options
223
-	 * @param mixed $selected which one is selected?
224
-	 * @param array $params the parameters
225
-	 * @return string html options
226
-	 * @since 8.0.0
227
-	 */
228
-	public static function html_select_options($options, $selected, $params=array()) {
229
-		return \html_select_options($options, $selected, $params);
230
-	}
145
+    /**
146
+     * Make OC_Helper::imagePath available as a simple function
147
+     *
148
+     * @see \OCP\IURLGenerator::imagePath
149
+     *
150
+     * @param string $app
151
+     * @param string $image
152
+     * @return string to the image
153
+     * @since 8.0.0
154
+     */
155
+    public static function image_path($app, $image) {
156
+        return \image_path($app, $image);
157
+    }
158
+
159
+
160
+    /**
161
+     * Make OC_Helper::mimetypeIcon available as a simple function
162
+     *
163
+     * @param string $mimetype
164
+     * @return string to the image of this file type.
165
+     * @since 8.0.0
166
+     */
167
+    public static function mimetype_icon($mimetype) {
168
+        return \mimetype_icon($mimetype);
169
+    }
170
+
171
+    /**
172
+     * Make preview_icon available as a simple function
173
+     *
174
+     * @param string $path path to file
175
+     * @return string to the preview of the image
176
+     * @since 8.0.0
177
+     */
178
+    public static function preview_icon($path) {
179
+        return \preview_icon($path);
180
+    }
181
+
182
+    /**
183
+     * Make publicpreview_icon available as a simple function
184
+     * Returns the path to the preview of the image.
185
+     *
186
+     * @param string $path of file
187
+     * @param string $token
188
+     * @return string link to the preview
189
+     * @since 8.0.0
190
+     */
191
+    public static function publicPreview_icon($path, $token) {
192
+        return \publicPreview_icon($path, $token);
193
+    }
194
+
195
+    /**
196
+     * Make OC_Helper::humanFileSize available as a simple function
197
+     * Example: 2048 to 2 kB.
198
+     *
199
+     * @param int $bytes in bytes
200
+     * @return string size as string
201
+     * @since 8.0.0
202
+     */
203
+    public static function human_file_size($bytes) {
204
+        return \human_file_size($bytes);
205
+    }
206
+
207
+    /**
208
+     * Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
209
+     *
210
+     * @param int $timestamp unix timestamp
211
+     * @param boolean $dateOnly
212
+     * @return string human readable interpretation of the timestamp
213
+     * @since 8.0.0
214
+     */
215
+    public static function relative_modified_date($timestamp, $dateOnly = false) {
216
+        return \relative_modified_date($timestamp, null, $dateOnly);
217
+    }
218
+
219
+    /**
220
+     * Generate html code for an options block.
221
+     *
222
+     * @param array $options the options
223
+     * @param mixed $selected which one is selected?
224
+     * @param array $params the parameters
225
+     * @return string html options
226
+     * @since 8.0.0
227
+     */
228
+    public static function html_select_options($options, $selected, $params=array()) {
229
+        return \html_select_options($options, $selected, $params);
230
+    }
231 231
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
  * @see \OCP\IURLGenerator::imagePath
50 50
  * @deprecated 8.0.0 Use \OCP\Template::image_path() instead
51 51
  */
52
-function image_path( $app, $image ) {
53
-	return(\image_path( $app, $image ));
52
+function image_path($app, $image) {
53
+	return(\image_path($app, $image));
54 54
 }
55 55
 
56 56
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
  * @return string to the image of this file type.
61 61
  * @deprecated 8.0.0 Use \OCP\Template::mimetype_icon() instead
62 62
  */
63
-function mimetype_icon( $mimetype ) {
64
-	return(\mimetype_icon( $mimetype ));
63
+function mimetype_icon($mimetype) {
64
+	return(\mimetype_icon($mimetype));
65 65
 }
66 66
 
67 67
 /**
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
  * @return string to the preview of the image
71 71
  * @deprecated 8.0.0 Use \OCP\Template::preview_icon() instead
72 72
  */
73
-function preview_icon( $path ) {
74
-	return(\preview_icon( $path ));
73
+function preview_icon($path) {
74
+	return(\preview_icon($path));
75 75
 }
76 76
 
77 77
 /**
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
  * @return string link to the preview
83 83
  * @deprecated 8.0.0 Use \OCP\Template::publicPreview_icon() instead
84 84
  */
85
-function publicPreview_icon ( $path, $token ) {
86
-	return(\publicPreview_icon( $path, $token ));
85
+function publicPreview_icon($path, $token) {
86
+	return(\publicPreview_icon($path, $token));
87 87
 }
88 88
 
89 89
 /**
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
  * @return string size as string
94 94
  * @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead
95 95
  */
96
-function human_file_size( $bytes ) {
97
-	return(\human_file_size( $bytes ));
96
+function human_file_size($bytes) {
97
+	return(\human_file_size($bytes));
98 98
 }
99 99
 
100 100
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
  *
107 107
  * @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead
108 108
  */
109
-function relative_modified_date( $timestamp, $dateOnly = false ) {
109
+function relative_modified_date($timestamp, $dateOnly = false) {
110 110
 	return(\relative_modified_date($timestamp, null, $dateOnly));
111 111
 }
112 112
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
  * @return string html options
131 131
  * @deprecated 8.0.0 Use \OCP\Template::html_select_options() instead
132 132
  */
133
-function html_select_options($options, $selected, $params=array()) {
133
+function html_select_options($options, $selected, $params = array()) {
134 134
 	return(\html_select_options($options, $selected, $params));
135 135
 }
136 136
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 * @return string html options
226 226
 	 * @since 8.0.0
227 227
 	 */
228
-	public static function html_select_options($options, $selected, $params=array()) {
228
+	public static function html_select_options($options, $selected, $params = array()) {
229 229
 		return \html_select_options($options, $selected, $params);
230 230
 	}
231 231
 }
Please login to merge, or discard this patch.
lib/public/Util.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -544,7 +544,7 @@
 block discarded – undo
544 544
 	 * @param array $input The array to work on
545 545
 	 * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
546 546
 	 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
547
-	 * @return array
547
+	 * @return string
548 548
 	 * @since 4.5.0
549 549
 	 */
550 550
 	public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
Please login to merge, or discard this patch.
Indentation   +648 added lines, -648 removed lines patch added patch discarded remove patch
@@ -57,654 +57,654 @@
 block discarded – undo
57 57
  * @since 4.0.0
58 58
  */
59 59
 class Util {
60
-	// consts for Logging
61
-	const DEBUG=0;
62
-	const INFO=1;
63
-	const WARN=2;
64
-	const ERROR=3;
65
-	const FATAL=4;
66
-
67
-	/** \OCP\Share\IManager */
68
-	private static $shareManager;
69
-
70
-	/**
71
-	 * get the current installed version of ownCloud
72
-	 * @return array
73
-	 * @since 4.0.0
74
-	 */
75
-	public static function getVersion() {
76
-		return(\OC_Util::getVersion());
77
-	}
60
+    // consts for Logging
61
+    const DEBUG=0;
62
+    const INFO=1;
63
+    const WARN=2;
64
+    const ERROR=3;
65
+    const FATAL=4;
66
+
67
+    /** \OCP\Share\IManager */
68
+    private static $shareManager;
69
+
70
+    /**
71
+     * get the current installed version of ownCloud
72
+     * @return array
73
+     * @since 4.0.0
74
+     */
75
+    public static function getVersion() {
76
+        return(\OC_Util::getVersion());
77
+    }
78 78
 	
79
-	/**
80
-	 * Set current update channel
81
-	 * @param string $channel
82
-	 * @since 8.1.0
83
-	 */
84
-	public static function setChannel($channel) {
85
-		\OC::$server->getConfig()->setSystemValue('updater.release.channel', $channel);
86
-	}
79
+    /**
80
+     * Set current update channel
81
+     * @param string $channel
82
+     * @since 8.1.0
83
+     */
84
+    public static function setChannel($channel) {
85
+        \OC::$server->getConfig()->setSystemValue('updater.release.channel', $channel);
86
+    }
87 87
 	
88
-	/**
89
-	 * Get current update channel
90
-	 * @return string
91
-	 * @since 8.1.0
92
-	 */
93
-	public static function getChannel() {
94
-		return \OC_Util::getChannel();
95
-	}
96
-
97
-	/**
98
-	 * send an email
99
-	 * @param string $toaddress
100
-	 * @param string $toname
101
-	 * @param string $subject
102
-	 * @param string $mailtext
103
-	 * @param string $fromaddress
104
-	 * @param string $fromname
105
-	 * @param int $html
106
-	 * @param string $altbody
107
-	 * @param string $ccaddress
108
-	 * @param string $ccname
109
-	 * @param string $bcc
110
-	 * @deprecated 8.1.0 Use \OCP\Mail\IMailer instead
111
-	 * @since 4.0.0
112
-	 */
113
-	public static function sendMail($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname,
114
-		$html = 0, $altbody = '', $ccaddress = '', $ccname = '', $bcc = '') {
115
-		$mailer = \OC::$server->getMailer();
116
-		$message = $mailer->createMessage();
117
-		$message->setTo([$toaddress => $toname]);
118
-		$message->setSubject($subject);
119
-		$message->setPlainBody($mailtext);
120
-		$message->setFrom([$fromaddress => $fromname]);
121
-		if($html === 1) {
122
-			$message->setHTMLBody($altbody);
123
-		}
124
-
125
-		if($altbody === '') {
126
-			$message->setHTMLBody($mailtext);
127
-			$message->setPlainBody('');
128
-		} else {
129
-			$message->setHtmlBody($mailtext);
130
-			$message->setPlainBody($altbody);
131
-		}
132
-
133
-		if(!empty($ccaddress)) {
134
-			if(!empty($ccname)) {
135
-				$message->setCc([$ccaddress => $ccname]);
136
-			} else {
137
-				$message->setCc([$ccaddress]);
138
-			}
139
-		}
140
-		if(!empty($bcc)) {
141
-			$message->setBcc([$bcc]);
142
-		}
143
-
144
-		$mailer->send($message);
145
-	}
146
-
147
-	/**
148
-	 * write a message in the log
149
-	 * @param string $app
150
-	 * @param string $message
151
-	 * @param int $level
152
-	 * @since 4.0.0
153
-	 */
154
-	public static function writeLog( $app, $message, $level ) {
155
-		$context = ['app' => $app];
156
-		\OC::$server->getLogger()->log($level, $message, $context);
157
-	}
158
-
159
-	/**
160
-	 * write exception into the log
161
-	 * @param string $app app name
162
-	 * @param \Exception $ex exception to log
163
-	 * @param int $level log level, defaults to \OCP\Util::FATAL
164
-	 * @since ....0.0 - parameter $level was added in 7.0.0
165
-	 * @deprecated 8.2.0 use logException of \OCP\ILogger
166
-	 */
167
-	public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) {
168
-		\OC::$server->getLogger()->logException($ex, ['app' => $app]);
169
-	}
170
-
171
-	/**
172
-	 * check if sharing is disabled for the current user
173
-	 *
174
-	 * @return boolean
175
-	 * @since 7.0.0
176
-	 * @deprecated 9.1.0 Use \OC::$server->getShareManager()->sharingDisabledForUser
177
-	 */
178
-	public static function isSharingDisabledForUser() {
179
-		if (self::$shareManager === null) {
180
-			self::$shareManager = \OC::$server->getShareManager();
181
-		}
182
-
183
-		$user = \OC::$server->getUserSession()->getUser();
184
-		if ($user !== null) {
185
-			$user = $user->getUID();
186
-		}
187
-
188
-		return self::$shareManager->sharingDisabledForUser($user);
189
-	}
190
-
191
-	/**
192
-	 * get l10n object
193
-	 * @param string $application
194
-	 * @param string|null $language
195
-	 * @return \OCP\IL10N
196
-	 * @since 6.0.0 - parameter $language was added in 8.0.0
197
-	 */
198
-	public static function getL10N($application, $language = null) {
199
-		return \OC::$server->getL10N($application, $language);
200
-	}
201
-
202
-	/**
203
-	 * add a css file
204
-	 * @param string $application
205
-	 * @param string $file
206
-	 * @since 4.0.0
207
-	 */
208
-	public static function addStyle( $application, $file = null ) {
209
-		\OC_Util::addStyle( $application, $file );
210
-	}
211
-
212
-	/**
213
-	 * add a javascript file
214
-	 * @param string $application
215
-	 * @param string $file
216
-	 * @since 4.0.0
217
-	 */
218
-	public static function addScript( $application, $file = null ) {
219
-		\OC_Util::addScript( $application, $file );
220
-	}
221
-
222
-	/**
223
-	 * Add a translation JS file
224
-	 * @param string $application application id
225
-	 * @param string $languageCode language code, defaults to the current locale
226
-	 * @since 8.0.0
227
-	 */
228
-	public static function addTranslations($application, $languageCode = null) {
229
-		\OC_Util::addTranslations($application, $languageCode);
230
-	}
231
-
232
-	/**
233
-	 * Add a custom element to the header
234
-	 * If $text is null then the element will be written as empty element.
235
-	 * So use "" to get a closing tag.
236
-	 * @param string $tag tag name of the element
237
-	 * @param array $attributes array of attributes for the element
238
-	 * @param string $text the text content for the element
239
-	 * @since 4.0.0
240
-	 */
241
-	public static function addHeader($tag, $attributes, $text=null) {
242
-		\OC_Util::addHeader($tag, $attributes, $text);
243
-	}
244
-
245
-	/**
246
-	 * formats a timestamp in the "right" way
247
-	 * @param int $timestamp $timestamp
248
-	 * @param bool $dateOnly option to omit time from the result
249
-	 * @param DateTimeZone|string $timeZone where the given timestamp shall be converted to
250
-	 * @return string timestamp
251
-	 *
252
-	 * @deprecated 8.0.0 Use \OC::$server->query('DateTimeFormatter') instead
253
-	 * @since 4.0.0
254
-	 */
255
-	public static function formatDate($timestamp, $dateOnly=false, $timeZone = null) {
256
-		return(\OC_Util::formatDate($timestamp, $dateOnly, $timeZone));
257
-	}
258
-
259
-	/**
260
-	 * check if some encrypted files are stored
261
-	 * @return bool
262
-	 *
263
-	 * @deprecated 8.1.0 No longer required
264
-	 * @since 6.0.0
265
-	 */
266
-	public static function encryptedFiles() {
267
-		return false;
268
-	}
269
-
270
-	/**
271
-	 * Creates an absolute url to the given app and file.
272
-	 * @param string $app app
273
-	 * @param string $file file
274
-	 * @param array $args array with param=>value, will be appended to the returned url
275
-	 * 	The value of $args will be urlencoded
276
-	 * @return string the url
277
-	 * @since 4.0.0 - parameter $args was added in 4.5.0
278
-	 */
279
-	public static function linkToAbsolute( $app, $file, $args = array() ) {
280
-		$urlGenerator = \OC::$server->getURLGenerator();
281
-		return $urlGenerator->getAbsoluteURL(
282
-			$urlGenerator->linkTo($app, $file, $args)
283
-		);
284
-	}
285
-
286
-	/**
287
-	 * Creates an absolute url for remote use.
288
-	 * @param string $service id
289
-	 * @return string the url
290
-	 * @since 4.0.0
291
-	 */
292
-	public static function linkToRemote( $service ) {
293
-		$urlGenerator = \OC::$server->getURLGenerator();
294
-		$remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service;
295
-		return $urlGenerator->getAbsoluteURL(
296
-			$remoteBase . (($service[strlen($service) - 1] != '/') ? '/' : '')
297
-		);
298
-	}
299
-
300
-	/**
301
-	 * Creates an absolute url for public use
302
-	 * @param string $service id
303
-	 * @return string the url
304
-	 * @since 4.5.0
305
-	 */
306
-	public static function linkToPublic($service) {
307
-		return \OC_Helper::linkToPublic($service);
308
-	}
309
-
310
-	/**
311
-	 * Creates an url using a defined route
312
-	 * @param string $route
313
-	 * @param array $parameters
314
-	 * @internal param array $args with param=>value, will be appended to the returned url
315
-	 * @return string the url
316
-	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
317
-	 * @since 5.0.0
318
-	 */
319
-	public static function linkToRoute( $route, $parameters = array() ) {
320
-		return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
321
-	}
322
-
323
-	/**
324
-	 * Creates an url to the given app and file
325
-	 * @param string $app app
326
-	 * @param string $file file
327
-	 * @param array $args array with param=>value, will be appended to the returned url
328
-	 * 	The value of $args will be urlencoded
329
-	 * @return string the url
330
-	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
331
-	 * @since 4.0.0 - parameter $args was added in 4.5.0
332
-	 */
333
-	public static function linkTo( $app, $file, $args = array() ) {
334
-		return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
335
-	}
336
-
337
-	/**
338
-	 * Returns the server host, even if the website uses one or more reverse proxy
339
-	 * @return string the server host
340
-	 * @deprecated 8.1.0 Use \OCP\IRequest::getServerHost
341
-	 * @since 4.0.0
342
-	 */
343
-	public static function getServerHost() {
344
-		return \OC::$server->getRequest()->getServerHost();
345
-	}
346
-
347
-	/**
348
-	 * Returns the server host name without an eventual port number
349
-	 * @return string the server hostname
350
-	 * @since 5.0.0
351
-	 */
352
-	public static function getServerHostName() {
353
-		$host_name = self::getServerHost();
354
-		// strip away port number (if existing)
355
-		$colon_pos = strpos($host_name, ':');
356
-		if ($colon_pos != FALSE) {
357
-			$host_name = substr($host_name, 0, $colon_pos);
358
-		}
359
-		return $host_name;
360
-	}
361
-
362
-	/**
363
-	 * Returns the default email address
364
-	 * @param string $user_part the user part of the address
365
-	 * @return string the default email address
366
-	 *
367
-	 * Assembles a default email address (using the server hostname
368
-	 * and the given user part, and returns it
369
-	 * Example: when given lostpassword-noreply as $user_part param,
370
-	 *     and is currently accessed via http(s)://example.com/,
371
-	 *     it would return '[email protected]'
372
-	 *
373
-	 * If the configuration value 'mail_from_address' is set in
374
-	 * config.php, this value will override the $user_part that
375
-	 * is passed to this function
376
-	 * @since 5.0.0
377
-	 */
378
-	public static function getDefaultEmailAddress($user_part) {
379
-		$config = \OC::$server->getConfig();
380
-		$user_part = $config->getSystemValue('mail_from_address', $user_part);
381
-		$host_name = self::getServerHostName();
382
-		$host_name = $config->getSystemValue('mail_domain', $host_name);
383
-		$defaultEmailAddress = $user_part.'@'.$host_name;
384
-
385
-		$mailer = \OC::$server->getMailer();
386
-		if ($mailer->validateMailAddress($defaultEmailAddress)) {
387
-			return $defaultEmailAddress;
388
-		}
389
-
390
-		// in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain'
391
-		return $user_part.'@localhost.localdomain';
392
-	}
393
-
394
-	/**
395
-	 * Returns the server protocol. It respects reverse proxy servers and load balancers
396
-	 * @return string the server protocol
397
-	 * @deprecated 8.1.0 Use \OCP\IRequest::getServerProtocol
398
-	 * @since 4.5.0
399
-	 */
400
-	public static function getServerProtocol() {
401
-		return \OC::$server->getRequest()->getServerProtocol();
402
-	}
403
-
404
-	/**
405
-	 * Returns the request uri, even if the website uses one or more reverse proxies
406
-	 * @return string the request uri
407
-	 * @deprecated 8.1.0 Use \OCP\IRequest::getRequestUri
408
-	 * @since 5.0.0
409
-	 */
410
-	public static function getRequestUri() {
411
-		return \OC::$server->getRequest()->getRequestUri();
412
-	}
413
-
414
-	/**
415
-	 * Returns the script name, even if the website uses one or more reverse proxies
416
-	 * @return string the script name
417
-	 * @deprecated 8.1.0 Use \OCP\IRequest::getScriptName
418
-	 * @since 5.0.0
419
-	 */
420
-	public static function getScriptName() {
421
-		return \OC::$server->getRequest()->getScriptName();
422
-	}
423
-
424
-	/**
425
-	 * Creates path to an image
426
-	 * @param string $app app
427
-	 * @param string $image image name
428
-	 * @return string the url
429
-	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image)
430
-	 * @since 4.0.0
431
-	 */
432
-	public static function imagePath( $app, $image ) {
433
-		return \OC::$server->getURLGenerator()->imagePath($app, $image);
434
-	}
435
-
436
-	/**
437
-	 * Make a human file size (2048 to 2 kB)
438
-	 * @param int $bytes file size in bytes
439
-	 * @return string a human readable file size
440
-	 * @since 4.0.0
441
-	 */
442
-	public static function humanFileSize( $bytes ) {
443
-		return(\OC_Helper::humanFileSize( $bytes ));
444
-	}
445
-
446
-	/**
447
-	 * Make a computer file size (2 kB to 2048)
448
-	 * @param string $str file size in a fancy format
449
-	 * @return int a file size in bytes
450
-	 *
451
-	 * Inspired by: http://www.php.net/manual/en/function.filesize.php#92418
452
-	 * @since 4.0.0
453
-	 */
454
-	public static function computerFileSize( $str ) {
455
-		return(\OC_Helper::computerFileSize( $str ));
456
-	}
457
-
458
-	/**
459
-	 * connects a function to a hook
460
-	 *
461
-	 * @param string $signalClass class name of emitter
462
-	 * @param string $signalName name of signal
463
-	 * @param string|object $slotClass class name of slot
464
-	 * @param string $slotName name of slot
465
-	 * @return bool
466
-	 *
467
-	 * This function makes it very easy to connect to use hooks.
468
-	 *
469
-	 * TODO: write example
470
-	 * @since 4.0.0
471
-	 */
472
-	static public function connectHook($signalClass, $signalName, $slotClass, $slotName ) {
473
-		return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName ));
474
-	}
475
-
476
-	/**
477
-	 * Emits a signal. To get data from the slot use references!
478
-	 * @param string $signalclass class name of emitter
479
-	 * @param string $signalname name of signal
480
-	 * @param array $params default: array() array with additional data
481
-	 * @return bool true if slots exists or false if not
482
-	 *
483
-	 * TODO: write example
484
-	 * @since 4.0.0
485
-	 */
486
-	static public function emitHook( $signalclass, $signalname, $params = array()) {
487
-		return(\OC_Hook::emit( $signalclass, $signalname, $params ));
488
-	}
489
-
490
-	/**
491
-	 * Cached encrypted CSRF token. Some static unit-tests of ownCloud compare
492
-	 * multiple OC_Template elements which invoke `callRegister`. If the value
493
-	 * would not be cached these unit-tests would fail.
494
-	 * @var string
495
-	 */
496
-	private static $token = '';
497
-
498
-	/**
499
-	 * Register an get/post call. This is important to prevent CSRF attacks
500
-	 * @since 4.5.0
501
-	 */
502
-	public static function callRegister() {
503
-		if(self::$token === '') {
504
-			self::$token = \OC::$server->getCsrfTokenManager()->getToken()->getEncryptedValue();
505
-		}
506
-		return self::$token;
507
-	}
508
-
509
-	/**
510
-	 * Check an ajax get/post call if the request token is valid. exit if not.
511
-	 * @since 4.5.0
512
-	 * @deprecated 9.0.0 Use annotations based on the app framework.
513
-	 */
514
-	public static function callCheck() {
515
-		if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
516
-			header('Location: '.\OC::$WEBROOT);
517
-			exit();
518
-		}
519
-
520
-		if (!(\OC::$server->getRequest()->passesCSRFCheck())) {
521
-			exit();
522
-		}
523
-	}
524
-
525
-	/**
526
-	 * Used to sanitize HTML
527
-	 *
528
-	 * This function is used to sanitize HTML and should be applied on any
529
-	 * string or array of strings before displaying it on a web page.
530
-	 *
531
-	 * @param string|array $value
532
-	 * @return string|array an array of sanitized strings or a single sanitized string, depends on the input parameter.
533
-	 * @since 4.5.0
534
-	 */
535
-	public static function sanitizeHTML($value) {
536
-		return \OC_Util::sanitizeHTML($value);
537
-	}
538
-
539
-	/**
540
-	 * Public function to encode url parameters
541
-	 *
542
-	 * This function is used to encode path to file before output.
543
-	 * Encoding is done according to RFC 3986 with one exception:
544
-	 * Character '/' is preserved as is.
545
-	 *
546
-	 * @param string $component part of URI to encode
547
-	 * @return string
548
-	 * @since 6.0.0
549
-	 */
550
-	public static function encodePath($component) {
551
-		return(\OC_Util::encodePath($component));
552
-	}
553
-
554
-	/**
555
-	 * Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
556
-	 *
557
-	 * @param array $input The array to work on
558
-	 * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
559
-	 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
560
-	 * @return array
561
-	 * @since 4.5.0
562
-	 */
563
-	public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
564
-		return(\OC_Helper::mb_array_change_key_case($input, $case, $encoding));
565
-	}
566
-
567
-	/**
568
-	 * replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
569
-	 *
570
-	 * @param string $string The input string. Opposite to the PHP build-in function does not accept an array.
571
-	 * @param string $replacement The replacement string.
572
-	 * @param int $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
573
-	 * @param int $length Length of the part to be replaced
574
-	 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
575
-	 * @return string
576
-	 * @since 4.5.0
577
-	 * @deprecated 8.2.0 Use substr_replace() instead.
578
-	 */
579
-	public static function mb_substr_replace($string, $replacement, $start, $length = null, $encoding = 'UTF-8') {
580
-		return substr_replace($string, $replacement, $start, $length);
581
-	}
582
-
583
-	/**
584
-	 * Replace all occurrences of the search string with the replacement string
585
-	 *
586
-	 * @param string $search The value being searched for, otherwise known as the needle. String.
587
-	 * @param string $replace The replacement string.
588
-	 * @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
589
-	 * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
590
-	 * @param int $count If passed, this will be set to the number of replacements performed.
591
-	 * @return string
592
-	 * @since 4.5.0
593
-	 * @deprecated 8.2.0 Use str_replace() instead.
594
-	 */
595
-	public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) {
596
-		return str_replace($search, $replace, $subject, $count);
597
-	}
598
-
599
-	/**
600
-	 * performs a search in a nested array
601
-	 *
602
-	 * @param array $haystack the array to be searched
603
-	 * @param string $needle the search string
604
-	 * @param int $index optional, only search this key name
605
-	 * @return mixed the key of the matching field, otherwise false
606
-	 * @since 4.5.0
607
-	 */
608
-	public static function recursiveArraySearch($haystack, $needle, $index = null) {
609
-		return(\OC_Helper::recursiveArraySearch($haystack, $needle, $index));
610
-	}
611
-
612
-	/**
613
-	 * calculates the maximum upload size respecting system settings, free space and user quota
614
-	 *
615
-	 * @param string $dir the current folder where the user currently operates
616
-	 * @param int $free the number of bytes free on the storage holding $dir, if not set this will be received from the storage directly
617
-	 * @return int number of bytes representing
618
-	 * @since 5.0.0
619
-	 */
620
-	public static function maxUploadFilesize($dir, $free = null) {
621
-		return \OC_Helper::maxUploadFilesize($dir, $free);
622
-	}
623
-
624
-	/**
625
-	 * Calculate free space left within user quota
626
-	 * @param string $dir the current folder where the user currently operates
627
-	 * @return int number of bytes representing
628
-	 * @since 7.0.0
629
-	 */
630
-	public static function freeSpace($dir) {
631
-		return \OC_Helper::freeSpace($dir);
632
-	}
633
-
634
-	/**
635
-	 * Calculate PHP upload limit
636
-	 *
637
-	 * @return int number of bytes representing
638
-	 * @since 7.0.0
639
-	 */
640
-	public static function uploadLimit() {
641
-		return \OC_Helper::uploadLimit();
642
-	}
643
-
644
-	/**
645
-	 * Returns whether the given file name is valid
646
-	 * @param string $file file name to check
647
-	 * @return bool true if the file name is valid, false otherwise
648
-	 * @deprecated 8.1.0 use \OC\Files\View::verifyPath()
649
-	 * @since 7.0.0
650
-	 */
651
-	public static function isValidFileName($file) {
652
-		return \OC_Util::isValidFileName($file);
653
-	}
654
-
655
-	/**
656
-	 * Generates a cryptographic secure pseudo-random string
657
-	 * @param int $length of the random string
658
-	 * @return string
659
-	 * @deprecated 8.0.0 Use \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); instead
660
-	 * @since 7.0.0
661
-	 */
662
-	public static function generateRandomBytes($length = 30) {
663
-		return \OC::$server->getSecureRandom()->generate($length, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
664
-	}
665
-
666
-	/**
667
-	 * Compare two strings to provide a natural sort
668
-	 * @param string $a first string to compare
669
-	 * @param string $b second string to compare
670
-	 * @return -1 if $b comes before $a, 1 if $a comes before $b
671
-	 * or 0 if the strings are identical
672
-	 * @since 7.0.0
673
-	 */
674
-	public static function naturalSortCompare($a, $b) {
675
-		return \OC\NaturalSort::getInstance()->compare($a, $b);
676
-	}
677
-
678
-	/**
679
-	 * check if a password is required for each public link
680
-	 * @return boolean
681
-	 * @since 7.0.0
682
-	 */
683
-	public static function isPublicLinkPasswordRequired() {
684
-		return \OC_Util::isPublicLinkPasswordRequired();
685
-	}
686
-
687
-	/**
688
-	 * check if share API enforces a default expire date
689
-	 * @return boolean
690
-	 * @since 8.0.0
691
-	 */
692
-	public static function isDefaultExpireDateEnforced() {
693
-		return \OC_Util::isDefaultExpireDateEnforced();
694
-	}
695
-
696
-	protected static $needUpgradeCache = null;
697
-
698
-	/**
699
-	 * Checks whether the current version needs upgrade.
700
-	 *
701
-	 * @return bool true if upgrade is needed, false otherwise
702
-	 * @since 7.0.0
703
-	 */
704
-	public static function needUpgrade() {
705
-		if (!isset(self::$needUpgradeCache)) {
706
-			self::$needUpgradeCache=\OC_Util::needUpgrade(\OC::$server->getSystemConfig());
707
-		}		
708
-		return self::$needUpgradeCache;
709
-	}
88
+    /**
89
+     * Get current update channel
90
+     * @return string
91
+     * @since 8.1.0
92
+     */
93
+    public static function getChannel() {
94
+        return \OC_Util::getChannel();
95
+    }
96
+
97
+    /**
98
+     * send an email
99
+     * @param string $toaddress
100
+     * @param string $toname
101
+     * @param string $subject
102
+     * @param string $mailtext
103
+     * @param string $fromaddress
104
+     * @param string $fromname
105
+     * @param int $html
106
+     * @param string $altbody
107
+     * @param string $ccaddress
108
+     * @param string $ccname
109
+     * @param string $bcc
110
+     * @deprecated 8.1.0 Use \OCP\Mail\IMailer instead
111
+     * @since 4.0.0
112
+     */
113
+    public static function sendMail($toaddress, $toname, $subject, $mailtext, $fromaddress, $fromname,
114
+        $html = 0, $altbody = '', $ccaddress = '', $ccname = '', $bcc = '') {
115
+        $mailer = \OC::$server->getMailer();
116
+        $message = $mailer->createMessage();
117
+        $message->setTo([$toaddress => $toname]);
118
+        $message->setSubject($subject);
119
+        $message->setPlainBody($mailtext);
120
+        $message->setFrom([$fromaddress => $fromname]);
121
+        if($html === 1) {
122
+            $message->setHTMLBody($altbody);
123
+        }
124
+
125
+        if($altbody === '') {
126
+            $message->setHTMLBody($mailtext);
127
+            $message->setPlainBody('');
128
+        } else {
129
+            $message->setHtmlBody($mailtext);
130
+            $message->setPlainBody($altbody);
131
+        }
132
+
133
+        if(!empty($ccaddress)) {
134
+            if(!empty($ccname)) {
135
+                $message->setCc([$ccaddress => $ccname]);
136
+            } else {
137
+                $message->setCc([$ccaddress]);
138
+            }
139
+        }
140
+        if(!empty($bcc)) {
141
+            $message->setBcc([$bcc]);
142
+        }
143
+
144
+        $mailer->send($message);
145
+    }
146
+
147
+    /**
148
+     * write a message in the log
149
+     * @param string $app
150
+     * @param string $message
151
+     * @param int $level
152
+     * @since 4.0.0
153
+     */
154
+    public static function writeLog( $app, $message, $level ) {
155
+        $context = ['app' => $app];
156
+        \OC::$server->getLogger()->log($level, $message, $context);
157
+    }
158
+
159
+    /**
160
+     * write exception into the log
161
+     * @param string $app app name
162
+     * @param \Exception $ex exception to log
163
+     * @param int $level log level, defaults to \OCP\Util::FATAL
164
+     * @since ....0.0 - parameter $level was added in 7.0.0
165
+     * @deprecated 8.2.0 use logException of \OCP\ILogger
166
+     */
167
+    public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) {
168
+        \OC::$server->getLogger()->logException($ex, ['app' => $app]);
169
+    }
170
+
171
+    /**
172
+     * check if sharing is disabled for the current user
173
+     *
174
+     * @return boolean
175
+     * @since 7.0.0
176
+     * @deprecated 9.1.0 Use \OC::$server->getShareManager()->sharingDisabledForUser
177
+     */
178
+    public static function isSharingDisabledForUser() {
179
+        if (self::$shareManager === null) {
180
+            self::$shareManager = \OC::$server->getShareManager();
181
+        }
182
+
183
+        $user = \OC::$server->getUserSession()->getUser();
184
+        if ($user !== null) {
185
+            $user = $user->getUID();
186
+        }
187
+
188
+        return self::$shareManager->sharingDisabledForUser($user);
189
+    }
190
+
191
+    /**
192
+     * get l10n object
193
+     * @param string $application
194
+     * @param string|null $language
195
+     * @return \OCP\IL10N
196
+     * @since 6.0.0 - parameter $language was added in 8.0.0
197
+     */
198
+    public static function getL10N($application, $language = null) {
199
+        return \OC::$server->getL10N($application, $language);
200
+    }
201
+
202
+    /**
203
+     * add a css file
204
+     * @param string $application
205
+     * @param string $file
206
+     * @since 4.0.0
207
+     */
208
+    public static function addStyle( $application, $file = null ) {
209
+        \OC_Util::addStyle( $application, $file );
210
+    }
211
+
212
+    /**
213
+     * add a javascript file
214
+     * @param string $application
215
+     * @param string $file
216
+     * @since 4.0.0
217
+     */
218
+    public static function addScript( $application, $file = null ) {
219
+        \OC_Util::addScript( $application, $file );
220
+    }
221
+
222
+    /**
223
+     * Add a translation JS file
224
+     * @param string $application application id
225
+     * @param string $languageCode language code, defaults to the current locale
226
+     * @since 8.0.0
227
+     */
228
+    public static function addTranslations($application, $languageCode = null) {
229
+        \OC_Util::addTranslations($application, $languageCode);
230
+    }
231
+
232
+    /**
233
+     * Add a custom element to the header
234
+     * If $text is null then the element will be written as empty element.
235
+     * So use "" to get a closing tag.
236
+     * @param string $tag tag name of the element
237
+     * @param array $attributes array of attributes for the element
238
+     * @param string $text the text content for the element
239
+     * @since 4.0.0
240
+     */
241
+    public static function addHeader($tag, $attributes, $text=null) {
242
+        \OC_Util::addHeader($tag, $attributes, $text);
243
+    }
244
+
245
+    /**
246
+     * formats a timestamp in the "right" way
247
+     * @param int $timestamp $timestamp
248
+     * @param bool $dateOnly option to omit time from the result
249
+     * @param DateTimeZone|string $timeZone where the given timestamp shall be converted to
250
+     * @return string timestamp
251
+     *
252
+     * @deprecated 8.0.0 Use \OC::$server->query('DateTimeFormatter') instead
253
+     * @since 4.0.0
254
+     */
255
+    public static function formatDate($timestamp, $dateOnly=false, $timeZone = null) {
256
+        return(\OC_Util::formatDate($timestamp, $dateOnly, $timeZone));
257
+    }
258
+
259
+    /**
260
+     * check if some encrypted files are stored
261
+     * @return bool
262
+     *
263
+     * @deprecated 8.1.0 No longer required
264
+     * @since 6.0.0
265
+     */
266
+    public static function encryptedFiles() {
267
+        return false;
268
+    }
269
+
270
+    /**
271
+     * Creates an absolute url to the given app and file.
272
+     * @param string $app app
273
+     * @param string $file file
274
+     * @param array $args array with param=>value, will be appended to the returned url
275
+     * 	The value of $args will be urlencoded
276
+     * @return string the url
277
+     * @since 4.0.0 - parameter $args was added in 4.5.0
278
+     */
279
+    public static function linkToAbsolute( $app, $file, $args = array() ) {
280
+        $urlGenerator = \OC::$server->getURLGenerator();
281
+        return $urlGenerator->getAbsoluteURL(
282
+            $urlGenerator->linkTo($app, $file, $args)
283
+        );
284
+    }
285
+
286
+    /**
287
+     * Creates an absolute url for remote use.
288
+     * @param string $service id
289
+     * @return string the url
290
+     * @since 4.0.0
291
+     */
292
+    public static function linkToRemote( $service ) {
293
+        $urlGenerator = \OC::$server->getURLGenerator();
294
+        $remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service;
295
+        return $urlGenerator->getAbsoluteURL(
296
+            $remoteBase . (($service[strlen($service) - 1] != '/') ? '/' : '')
297
+        );
298
+    }
299
+
300
+    /**
301
+     * Creates an absolute url for public use
302
+     * @param string $service id
303
+     * @return string the url
304
+     * @since 4.5.0
305
+     */
306
+    public static function linkToPublic($service) {
307
+        return \OC_Helper::linkToPublic($service);
308
+    }
309
+
310
+    /**
311
+     * Creates an url using a defined route
312
+     * @param string $route
313
+     * @param array $parameters
314
+     * @internal param array $args with param=>value, will be appended to the returned url
315
+     * @return string the url
316
+     * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
317
+     * @since 5.0.0
318
+     */
319
+    public static function linkToRoute( $route, $parameters = array() ) {
320
+        return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
321
+    }
322
+
323
+    /**
324
+     * Creates an url to the given app and file
325
+     * @param string $app app
326
+     * @param string $file file
327
+     * @param array $args array with param=>value, will be appended to the returned url
328
+     * 	The value of $args will be urlencoded
329
+     * @return string the url
330
+     * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
331
+     * @since 4.0.0 - parameter $args was added in 4.5.0
332
+     */
333
+    public static function linkTo( $app, $file, $args = array() ) {
334
+        return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
335
+    }
336
+
337
+    /**
338
+     * Returns the server host, even if the website uses one or more reverse proxy
339
+     * @return string the server host
340
+     * @deprecated 8.1.0 Use \OCP\IRequest::getServerHost
341
+     * @since 4.0.0
342
+     */
343
+    public static function getServerHost() {
344
+        return \OC::$server->getRequest()->getServerHost();
345
+    }
346
+
347
+    /**
348
+     * Returns the server host name without an eventual port number
349
+     * @return string the server hostname
350
+     * @since 5.0.0
351
+     */
352
+    public static function getServerHostName() {
353
+        $host_name = self::getServerHost();
354
+        // strip away port number (if existing)
355
+        $colon_pos = strpos($host_name, ':');
356
+        if ($colon_pos != FALSE) {
357
+            $host_name = substr($host_name, 0, $colon_pos);
358
+        }
359
+        return $host_name;
360
+    }
361
+
362
+    /**
363
+     * Returns the default email address
364
+     * @param string $user_part the user part of the address
365
+     * @return string the default email address
366
+     *
367
+     * Assembles a default email address (using the server hostname
368
+     * and the given user part, and returns it
369
+     * Example: when given lostpassword-noreply as $user_part param,
370
+     *     and is currently accessed via http(s)://example.com/,
371
+     *     it would return '[email protected]'
372
+     *
373
+     * If the configuration value 'mail_from_address' is set in
374
+     * config.php, this value will override the $user_part that
375
+     * is passed to this function
376
+     * @since 5.0.0
377
+     */
378
+    public static function getDefaultEmailAddress($user_part) {
379
+        $config = \OC::$server->getConfig();
380
+        $user_part = $config->getSystemValue('mail_from_address', $user_part);
381
+        $host_name = self::getServerHostName();
382
+        $host_name = $config->getSystemValue('mail_domain', $host_name);
383
+        $defaultEmailAddress = $user_part.'@'.$host_name;
384
+
385
+        $mailer = \OC::$server->getMailer();
386
+        if ($mailer->validateMailAddress($defaultEmailAddress)) {
387
+            return $defaultEmailAddress;
388
+        }
389
+
390
+        // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain'
391
+        return $user_part.'@localhost.localdomain';
392
+    }
393
+
394
+    /**
395
+     * Returns the server protocol. It respects reverse proxy servers and load balancers
396
+     * @return string the server protocol
397
+     * @deprecated 8.1.0 Use \OCP\IRequest::getServerProtocol
398
+     * @since 4.5.0
399
+     */
400
+    public static function getServerProtocol() {
401
+        return \OC::$server->getRequest()->getServerProtocol();
402
+    }
403
+
404
+    /**
405
+     * Returns the request uri, even if the website uses one or more reverse proxies
406
+     * @return string the request uri
407
+     * @deprecated 8.1.0 Use \OCP\IRequest::getRequestUri
408
+     * @since 5.0.0
409
+     */
410
+    public static function getRequestUri() {
411
+        return \OC::$server->getRequest()->getRequestUri();
412
+    }
413
+
414
+    /**
415
+     * Returns the script name, even if the website uses one or more reverse proxies
416
+     * @return string the script name
417
+     * @deprecated 8.1.0 Use \OCP\IRequest::getScriptName
418
+     * @since 5.0.0
419
+     */
420
+    public static function getScriptName() {
421
+        return \OC::$server->getRequest()->getScriptName();
422
+    }
423
+
424
+    /**
425
+     * Creates path to an image
426
+     * @param string $app app
427
+     * @param string $image image name
428
+     * @return string the url
429
+     * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image)
430
+     * @since 4.0.0
431
+     */
432
+    public static function imagePath( $app, $image ) {
433
+        return \OC::$server->getURLGenerator()->imagePath($app, $image);
434
+    }
435
+
436
+    /**
437
+     * Make a human file size (2048 to 2 kB)
438
+     * @param int $bytes file size in bytes
439
+     * @return string a human readable file size
440
+     * @since 4.0.0
441
+     */
442
+    public static function humanFileSize( $bytes ) {
443
+        return(\OC_Helper::humanFileSize( $bytes ));
444
+    }
445
+
446
+    /**
447
+     * Make a computer file size (2 kB to 2048)
448
+     * @param string $str file size in a fancy format
449
+     * @return int a file size in bytes
450
+     *
451
+     * Inspired by: http://www.php.net/manual/en/function.filesize.php#92418
452
+     * @since 4.0.0
453
+     */
454
+    public static function computerFileSize( $str ) {
455
+        return(\OC_Helper::computerFileSize( $str ));
456
+    }
457
+
458
+    /**
459
+     * connects a function to a hook
460
+     *
461
+     * @param string $signalClass class name of emitter
462
+     * @param string $signalName name of signal
463
+     * @param string|object $slotClass class name of slot
464
+     * @param string $slotName name of slot
465
+     * @return bool
466
+     *
467
+     * This function makes it very easy to connect to use hooks.
468
+     *
469
+     * TODO: write example
470
+     * @since 4.0.0
471
+     */
472
+    static public function connectHook($signalClass, $signalName, $slotClass, $slotName ) {
473
+        return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName ));
474
+    }
475
+
476
+    /**
477
+     * Emits a signal. To get data from the slot use references!
478
+     * @param string $signalclass class name of emitter
479
+     * @param string $signalname name of signal
480
+     * @param array $params default: array() array with additional data
481
+     * @return bool true if slots exists or false if not
482
+     *
483
+     * TODO: write example
484
+     * @since 4.0.0
485
+     */
486
+    static public function emitHook( $signalclass, $signalname, $params = array()) {
487
+        return(\OC_Hook::emit( $signalclass, $signalname, $params ));
488
+    }
489
+
490
+    /**
491
+     * Cached encrypted CSRF token. Some static unit-tests of ownCloud compare
492
+     * multiple OC_Template elements which invoke `callRegister`. If the value
493
+     * would not be cached these unit-tests would fail.
494
+     * @var string
495
+     */
496
+    private static $token = '';
497
+
498
+    /**
499
+     * Register an get/post call. This is important to prevent CSRF attacks
500
+     * @since 4.5.0
501
+     */
502
+    public static function callRegister() {
503
+        if(self::$token === '') {
504
+            self::$token = \OC::$server->getCsrfTokenManager()->getToken()->getEncryptedValue();
505
+        }
506
+        return self::$token;
507
+    }
508
+
509
+    /**
510
+     * Check an ajax get/post call if the request token is valid. exit if not.
511
+     * @since 4.5.0
512
+     * @deprecated 9.0.0 Use annotations based on the app framework.
513
+     */
514
+    public static function callCheck() {
515
+        if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
516
+            header('Location: '.\OC::$WEBROOT);
517
+            exit();
518
+        }
519
+
520
+        if (!(\OC::$server->getRequest()->passesCSRFCheck())) {
521
+            exit();
522
+        }
523
+    }
524
+
525
+    /**
526
+     * Used to sanitize HTML
527
+     *
528
+     * This function is used to sanitize HTML and should be applied on any
529
+     * string or array of strings before displaying it on a web page.
530
+     *
531
+     * @param string|array $value
532
+     * @return string|array an array of sanitized strings or a single sanitized string, depends on the input parameter.
533
+     * @since 4.5.0
534
+     */
535
+    public static function sanitizeHTML($value) {
536
+        return \OC_Util::sanitizeHTML($value);
537
+    }
538
+
539
+    /**
540
+     * Public function to encode url parameters
541
+     *
542
+     * This function is used to encode path to file before output.
543
+     * Encoding is done according to RFC 3986 with one exception:
544
+     * Character '/' is preserved as is.
545
+     *
546
+     * @param string $component part of URI to encode
547
+     * @return string
548
+     * @since 6.0.0
549
+     */
550
+    public static function encodePath($component) {
551
+        return(\OC_Util::encodePath($component));
552
+    }
553
+
554
+    /**
555
+     * Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.
556
+     *
557
+     * @param array $input The array to work on
558
+     * @param int $case Either MB_CASE_UPPER or MB_CASE_LOWER (default)
559
+     * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
560
+     * @return array
561
+     * @since 4.5.0
562
+     */
563
+    public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
564
+        return(\OC_Helper::mb_array_change_key_case($input, $case, $encoding));
565
+    }
566
+
567
+    /**
568
+     * replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement.
569
+     *
570
+     * @param string $string The input string. Opposite to the PHP build-in function does not accept an array.
571
+     * @param string $replacement The replacement string.
572
+     * @param int $start If start is positive, the replacing will begin at the start'th offset into string. If start is negative, the replacing will begin at the start'th character from the end of string.
573
+     * @param int $length Length of the part to be replaced
574
+     * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
575
+     * @return string
576
+     * @since 4.5.0
577
+     * @deprecated 8.2.0 Use substr_replace() instead.
578
+     */
579
+    public static function mb_substr_replace($string, $replacement, $start, $length = null, $encoding = 'UTF-8') {
580
+        return substr_replace($string, $replacement, $start, $length);
581
+    }
582
+
583
+    /**
584
+     * Replace all occurrences of the search string with the replacement string
585
+     *
586
+     * @param string $search The value being searched for, otherwise known as the needle. String.
587
+     * @param string $replace The replacement string.
588
+     * @param string $subject The string or array being searched and replaced on, otherwise known as the haystack.
589
+     * @param string $encoding The encoding parameter is the character encoding. Defaults to UTF-8
590
+     * @param int $count If passed, this will be set to the number of replacements performed.
591
+     * @return string
592
+     * @since 4.5.0
593
+     * @deprecated 8.2.0 Use str_replace() instead.
594
+     */
595
+    public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) {
596
+        return str_replace($search, $replace, $subject, $count);
597
+    }
598
+
599
+    /**
600
+     * performs a search in a nested array
601
+     *
602
+     * @param array $haystack the array to be searched
603
+     * @param string $needle the search string
604
+     * @param int $index optional, only search this key name
605
+     * @return mixed the key of the matching field, otherwise false
606
+     * @since 4.5.0
607
+     */
608
+    public static function recursiveArraySearch($haystack, $needle, $index = null) {
609
+        return(\OC_Helper::recursiveArraySearch($haystack, $needle, $index));
610
+    }
611
+
612
+    /**
613
+     * calculates the maximum upload size respecting system settings, free space and user quota
614
+     *
615
+     * @param string $dir the current folder where the user currently operates
616
+     * @param int $free the number of bytes free on the storage holding $dir, if not set this will be received from the storage directly
617
+     * @return int number of bytes representing
618
+     * @since 5.0.0
619
+     */
620
+    public static function maxUploadFilesize($dir, $free = null) {
621
+        return \OC_Helper::maxUploadFilesize($dir, $free);
622
+    }
623
+
624
+    /**
625
+     * Calculate free space left within user quota
626
+     * @param string $dir the current folder where the user currently operates
627
+     * @return int number of bytes representing
628
+     * @since 7.0.0
629
+     */
630
+    public static function freeSpace($dir) {
631
+        return \OC_Helper::freeSpace($dir);
632
+    }
633
+
634
+    /**
635
+     * Calculate PHP upload limit
636
+     *
637
+     * @return int number of bytes representing
638
+     * @since 7.0.0
639
+     */
640
+    public static function uploadLimit() {
641
+        return \OC_Helper::uploadLimit();
642
+    }
643
+
644
+    /**
645
+     * Returns whether the given file name is valid
646
+     * @param string $file file name to check
647
+     * @return bool true if the file name is valid, false otherwise
648
+     * @deprecated 8.1.0 use \OC\Files\View::verifyPath()
649
+     * @since 7.0.0
650
+     */
651
+    public static function isValidFileName($file) {
652
+        return \OC_Util::isValidFileName($file);
653
+    }
654
+
655
+    /**
656
+     * Generates a cryptographic secure pseudo-random string
657
+     * @param int $length of the random string
658
+     * @return string
659
+     * @deprecated 8.0.0 Use \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate($length); instead
660
+     * @since 7.0.0
661
+     */
662
+    public static function generateRandomBytes($length = 30) {
663
+        return \OC::$server->getSecureRandom()->generate($length, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
664
+    }
665
+
666
+    /**
667
+     * Compare two strings to provide a natural sort
668
+     * @param string $a first string to compare
669
+     * @param string $b second string to compare
670
+     * @return -1 if $b comes before $a, 1 if $a comes before $b
671
+     * or 0 if the strings are identical
672
+     * @since 7.0.0
673
+     */
674
+    public static function naturalSortCompare($a, $b) {
675
+        return \OC\NaturalSort::getInstance()->compare($a, $b);
676
+    }
677
+
678
+    /**
679
+     * check if a password is required for each public link
680
+     * @return boolean
681
+     * @since 7.0.0
682
+     */
683
+    public static function isPublicLinkPasswordRequired() {
684
+        return \OC_Util::isPublicLinkPasswordRequired();
685
+    }
686
+
687
+    /**
688
+     * check if share API enforces a default expire date
689
+     * @return boolean
690
+     * @since 8.0.0
691
+     */
692
+    public static function isDefaultExpireDateEnforced() {
693
+        return \OC_Util::isDefaultExpireDateEnforced();
694
+    }
695
+
696
+    protected static $needUpgradeCache = null;
697
+
698
+    /**
699
+     * Checks whether the current version needs upgrade.
700
+     *
701
+     * @return bool true if upgrade is needed, false otherwise
702
+     * @since 7.0.0
703
+     */
704
+    public static function needUpgrade() {
705
+        if (!isset(self::$needUpgradeCache)) {
706
+            self::$needUpgradeCache=\OC_Util::needUpgrade(\OC::$server->getSystemConfig());
707
+        }		
708
+        return self::$needUpgradeCache;
709
+    }
710 710
 }
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
  */
59 59
 class Util {
60 60
 	// consts for Logging
61
-	const DEBUG=0;
62
-	const INFO=1;
63
-	const WARN=2;
64
-	const ERROR=3;
65
-	const FATAL=4;
61
+	const DEBUG = 0;
62
+	const INFO = 1;
63
+	const WARN = 2;
64
+	const ERROR = 3;
65
+	const FATAL = 4;
66 66
 
67 67
 	/** \OCP\Share\IManager */
68 68
 	private static $shareManager;
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 		$message->setSubject($subject);
119 119
 		$message->setPlainBody($mailtext);
120 120
 		$message->setFrom([$fromaddress => $fromname]);
121
-		if($html === 1) {
121
+		if ($html === 1) {
122 122
 			$message->setHTMLBody($altbody);
123 123
 		}
124 124
 
125
-		if($altbody === '') {
125
+		if ($altbody === '') {
126 126
 			$message->setHTMLBody($mailtext);
127 127
 			$message->setPlainBody('');
128 128
 		} else {
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 			$message->setPlainBody($altbody);
131 131
 		}
132 132
 
133
-		if(!empty($ccaddress)) {
134
-			if(!empty($ccname)) {
133
+		if (!empty($ccaddress)) {
134
+			if (!empty($ccname)) {
135 135
 				$message->setCc([$ccaddress => $ccname]);
136 136
 			} else {
137 137
 				$message->setCc([$ccaddress]);
138 138
 			}
139 139
 		}
140
-		if(!empty($bcc)) {
140
+		if (!empty($bcc)) {
141 141
 			$message->setBcc([$bcc]);
142 142
 		}
143 143
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @param int $level
152 152
 	 * @since 4.0.0
153 153
 	 */
154
-	public static function writeLog( $app, $message, $level ) {
154
+	public static function writeLog($app, $message, $level) {
155 155
 		$context = ['app' => $app];
156 156
 		\OC::$server->getLogger()->log($level, $message, $context);
157 157
 	}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @since ....0.0 - parameter $level was added in 7.0.0
165 165
 	 * @deprecated 8.2.0 use logException of \OCP\ILogger
166 166
 	 */
167
-	public static function logException( $app, \Exception $ex, $level = \OCP\Util::FATAL ) {
167
+	public static function logException($app, \Exception $ex, $level = \OCP\Util::FATAL) {
168 168
 		\OC::$server->getLogger()->logException($ex, ['app' => $app]);
169 169
 	}
170 170
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	 * @param string $file
206 206
 	 * @since 4.0.0
207 207
 	 */
208
-	public static function addStyle( $application, $file = null ) {
209
-		\OC_Util::addStyle( $application, $file );
208
+	public static function addStyle($application, $file = null) {
209
+		\OC_Util::addStyle($application, $file);
210 210
 	}
211 211
 
212 212
 	/**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 * @param string $file
216 216
 	 * @since 4.0.0
217 217
 	 */
218
-	public static function addScript( $application, $file = null ) {
219
-		\OC_Util::addScript( $application, $file );
218
+	public static function addScript($application, $file = null) {
219
+		\OC_Util::addScript($application, $file);
220 220
 	}
221 221
 
222 222
 	/**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 	 * @param string $text the text content for the element
239 239
 	 * @since 4.0.0
240 240
 	 */
241
-	public static function addHeader($tag, $attributes, $text=null) {
241
+	public static function addHeader($tag, $attributes, $text = null) {
242 242
 		\OC_Util::addHeader($tag, $attributes, $text);
243 243
 	}
244 244
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 * @deprecated 8.0.0 Use \OC::$server->query('DateTimeFormatter') instead
253 253
 	 * @since 4.0.0
254 254
 	 */
255
-	public static function formatDate($timestamp, $dateOnly=false, $timeZone = null) {
255
+	public static function formatDate($timestamp, $dateOnly = false, $timeZone = null) {
256 256
 		return(\OC_Util::formatDate($timestamp, $dateOnly, $timeZone));
257 257
 	}
258 258
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 * @return string the url
277 277
 	 * @since 4.0.0 - parameter $args was added in 4.5.0
278 278
 	 */
279
-	public static function linkToAbsolute( $app, $file, $args = array() ) {
279
+	public static function linkToAbsolute($app, $file, $args = array()) {
280 280
 		$urlGenerator = \OC::$server->getURLGenerator();
281 281
 		return $urlGenerator->getAbsoluteURL(
282 282
 			$urlGenerator->linkTo($app, $file, $args)
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
 	 * @return string the url
290 290
 	 * @since 4.0.0
291 291
 	 */
292
-	public static function linkToRemote( $service ) {
292
+	public static function linkToRemote($service) {
293 293
 		$urlGenerator = \OC::$server->getURLGenerator();
294
-		$remoteBase = $urlGenerator->linkTo('', 'remote.php') . '/' . $service;
294
+		$remoteBase = $urlGenerator->linkTo('', 'remote.php').'/'.$service;
295 295
 		return $urlGenerator->getAbsoluteURL(
296
-			$remoteBase . (($service[strlen($service) - 1] != '/') ? '/' : '')
296
+			$remoteBase.(($service[strlen($service) - 1] != '/') ? '/' : '')
297 297
 		);
298 298
 	}
299 299
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkToRoute($route, $parameters)
317 317
 	 * @since 5.0.0
318 318
 	 */
319
-	public static function linkToRoute( $route, $parameters = array() ) {
319
+	public static function linkToRoute($route, $parameters = array()) {
320 320
 		return \OC::$server->getURLGenerator()->linkToRoute($route, $parameters);
321 321
 	}
322 322
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->linkTo($app, $file, $args)
331 331
 	 * @since 4.0.0 - parameter $args was added in 4.5.0
332 332
 	 */
333
-	public static function linkTo( $app, $file, $args = array() ) {
333
+	public static function linkTo($app, $file, $args = array()) {
334 334
 		return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
335 335
 	}
336 336
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 	 * @deprecated 8.1.0 Use \OC::$server->getURLGenerator()->imagePath($app, $image)
430 430
 	 * @since 4.0.0
431 431
 	 */
432
-	public static function imagePath( $app, $image ) {
432
+	public static function imagePath($app, $image) {
433 433
 		return \OC::$server->getURLGenerator()->imagePath($app, $image);
434 434
 	}
435 435
 
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
 	 * @return string a human readable file size
440 440
 	 * @since 4.0.0
441 441
 	 */
442
-	public static function humanFileSize( $bytes ) {
443
-		return(\OC_Helper::humanFileSize( $bytes ));
442
+	public static function humanFileSize($bytes) {
443
+		return(\OC_Helper::humanFileSize($bytes));
444 444
 	}
445 445
 
446 446
 	/**
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
 	 * Inspired by: http://www.php.net/manual/en/function.filesize.php#92418
452 452
 	 * @since 4.0.0
453 453
 	 */
454
-	public static function computerFileSize( $str ) {
455
-		return(\OC_Helper::computerFileSize( $str ));
454
+	public static function computerFileSize($str) {
455
+		return(\OC_Helper::computerFileSize($str));
456 456
 	}
457 457
 
458 458
 	/**
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
 	 * TODO: write example
470 470
 	 * @since 4.0.0
471 471
 	 */
472
-	static public function connectHook($signalClass, $signalName, $slotClass, $slotName ) {
473
-		return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName ));
472
+	static public function connectHook($signalClass, $signalName, $slotClass, $slotName) {
473
+		return(\OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName));
474 474
 	}
475 475
 
476 476
 	/**
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 	 * TODO: write example
484 484
 	 * @since 4.0.0
485 485
 	 */
486
-	static public function emitHook( $signalclass, $signalname, $params = array()) {
487
-		return(\OC_Hook::emit( $signalclass, $signalname, $params ));
486
+	static public function emitHook($signalclass, $signalname, $params = array()) {
487
+		return(\OC_Hook::emit($signalclass, $signalname, $params));
488 488
 	}
489 489
 
490 490
 	/**
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	 * @since 4.5.0
501 501
 	 */
502 502
 	public static function callRegister() {
503
-		if(self::$token === '') {
503
+		if (self::$token === '') {
504 504
 			self::$token = \OC::$server->getCsrfTokenManager()->getToken()->getEncryptedValue();
505 505
 		}
506 506
 		return self::$token;
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 	 * @deprecated 9.0.0 Use annotations based on the app framework.
513 513
 	 */
514 514
 	public static function callCheck() {
515
-		if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
515
+		if (!\OC::$server->getRequest()->passesStrictCookieCheck()) {
516 516
 			header('Location: '.\OC::$WEBROOT);
517 517
 			exit();
518 518
 		}
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 	 */
704 704
 	public static function needUpgrade() {
705 705
 		if (!isset(self::$needUpgradeCache)) {
706
-			self::$needUpgradeCache=\OC_Util::needUpgrade(\OC::$server->getSystemConfig());
706
+			self::$needUpgradeCache = \OC_Util::needUpgrade(\OC::$server->getSystemConfig());
707 707
 		}		
708 708
 		return self::$needUpgradeCache;
709 709
 	}
Please login to merge, or discard this patch.