Passed
Push — master ( f0dd71...c56a27 )
by Christoph
11:49 queued 12s
created
apps/dav/lib/DAV/SystemPrincipalBackend.php 1 patch
Indentation   +161 added lines, -161 removed lines patch added patch discarded remove patch
@@ -27,165 +27,165 @@
 block discarded – undo
27 27
 
28 28
 class SystemPrincipalBackend extends AbstractBackend {
29 29
 
30
-	/**
31
-	 * Returns a list of principals based on a prefix.
32
-	 *
33
-	 * This prefix will often contain something like 'principals'. You are only
34
-	 * expected to return principals that are in this base path.
35
-	 *
36
-	 * You are expected to return at least a 'uri' for every user, you can
37
-	 * return any additional properties if you wish so. Common properties are:
38
-	 *   {DAV:}displayname
39
-	 *   {http://sabredav.org/ns}email-address - This is a custom SabreDAV
40
-	 *     field that's actually injected in a number of other properties. If
41
-	 *     you have an email address, use this property.
42
-	 *
43
-	 * @param string $prefixPath
44
-	 * @return array
45
-	 */
46
-	function getPrincipalsByPrefix($prefixPath) {
47
-		$principals = [];
48
-
49
-		if ($prefixPath === 'principals/system') {
50
-			$principals[] = [
51
-				'uri' => 'principals/system/system',
52
-				'{DAV:}displayname' => 'system',
53
-			];
54
-			$principals[] = [
55
-				'uri' => 'principals/system/public',
56
-				'{DAV:}displayname' => 'public',
57
-			];
58
-		}
59
-
60
-		return $principals;
61
-	}
62
-
63
-	/**
64
-	 * Returns a specific principal, specified by it's path.
65
-	 * The returned structure should be the exact same as from
66
-	 * getPrincipalsByPrefix.
67
-	 *
68
-	 * @param string $path
69
-	 * @return array
70
-	 */
71
-	function getPrincipalByPath($path) {
72
-
73
-		if ($path === 'principals/system/system') {
74
-			$principal = [
75
-				'uri' => 'principals/system/system',
76
-				'{DAV:}displayname' => 'system',
77
-			];
78
-			return $principal;
79
-		}
80
-		if ($path === 'principals/system/public') {
81
-			$principal = [
82
-				'uri' => 'principals/system/public',
83
-				'{DAV:}displayname' => 'public',
84
-			];
85
-			return $principal;
86
-		}
87
-
88
-		return null;
89
-	}
90
-
91
-	/**
92
-	 * Updates one ore more webdav properties on a principal.
93
-	 *
94
-	 * The list of mutations is stored in a Sabre\DAV\PropPatch object.
95
-	 * To do the actual updates, you must tell this object which properties
96
-	 * you're going to process with the handle() method.
97
-	 *
98
-	 * Calling the handle method is like telling the PropPatch object "I
99
-	 * promise I can handle updating this property".
100
-	 *
101
-	 * Read the PropPatch documentation for more info and examples.
102
-	 *
103
-	 * @param string $path
104
-	 * @param \Sabre\DAV\PropPatch $propPatch
105
-	 * @return void
106
-	 */
107
-	function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch) {
108
-	}
109
-
110
-	/**
111
-	 * This method is used to search for principals matching a set of
112
-	 * properties.
113
-	 *
114
-	 * This search is specifically used by RFC3744's principal-property-search
115
-	 * REPORT.
116
-	 *
117
-	 * The actual search should be a unicode-non-case-sensitive search. The
118
-	 * keys in searchProperties are the WebDAV property names, while the values
119
-	 * are the property values to search on.
120
-	 *
121
-	 * By default, if multiple properties are submitted to this method, the
122
-	 * various properties should be combined with 'AND'. If $test is set to
123
-	 * 'anyof', it should be combined using 'OR'.
124
-	 *
125
-	 * This method should simply return an array with full principal uri's.
126
-	 *
127
-	 * If somebody attempted to search on a property the backend does not
128
-	 * support, you should simply return 0 results.
129
-	 *
130
-	 * You can also just return 0 results if you choose to not support
131
-	 * searching at all, but keep in mind that this may stop certain features
132
-	 * from working.
133
-	 *
134
-	 * @param string $prefixPath
135
-	 * @param array $searchProperties
136
-	 * @param string $test
137
-	 * @return array
138
-	 */
139
-	function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') {
140
-		return [];
141
-	}
142
-
143
-	/**
144
-	 * Returns the list of members for a group-principal
145
-	 *
146
-	 * @param string $principal
147
-	 * @return array
148
-	 */
149
-	function getGroupMemberSet($principal) {
150
-		// TODO: for now the group principal has only one member, the user itself
151
-		$principal = $this->getPrincipalByPath($principal);
152
-		if (!$principal) {
153
-			throw new \Sabre\DAV\Exception('Principal not found');
154
-		}
155
-
156
-		return [$principal['uri']];
157
-	}
158
-
159
-	/**
160
-	 * Returns the list of groups a principal is a member of
161
-	 *
162
-	 * @param string $principal
163
-	 * @return array
164
-	 */
165
-	function getGroupMembership($principal) {
166
-		list($prefix, ) = \Sabre\Uri\split($principal);
167
-
168
-		if ($prefix === 'principals/system') {
169
-			$principal = $this->getPrincipalByPath($principal);
170
-			if (!$principal) {
171
-				throw new \Sabre\DAV\Exception('Principal not found');
172
-			}
173
-
174
-			return [];
175
-		}
176
-		return [];
177
-	}
178
-
179
-	/**
180
-	 * Updates the list of group members for a group principal.
181
-	 *
182
-	 * The principals should be passed as a list of uri's.
183
-	 *
184
-	 * @param string $principal
185
-	 * @param array $members
186
-	 * @return void
187
-	 */
188
-	function setGroupMemberSet($principal, array $members) {
189
-		throw new \Sabre\DAV\Exception('Setting members of the group is not supported yet');
190
-	}
30
+    /**
31
+     * Returns a list of principals based on a prefix.
32
+     *
33
+     * This prefix will often contain something like 'principals'. You are only
34
+     * expected to return principals that are in this base path.
35
+     *
36
+     * You are expected to return at least a 'uri' for every user, you can
37
+     * return any additional properties if you wish so. Common properties are:
38
+     *   {DAV:}displayname
39
+     *   {http://sabredav.org/ns}email-address - This is a custom SabreDAV
40
+     *     field that's actually injected in a number of other properties. If
41
+     *     you have an email address, use this property.
42
+     *
43
+     * @param string $prefixPath
44
+     * @return array
45
+     */
46
+    function getPrincipalsByPrefix($prefixPath) {
47
+        $principals = [];
48
+
49
+        if ($prefixPath === 'principals/system') {
50
+            $principals[] = [
51
+                'uri' => 'principals/system/system',
52
+                '{DAV:}displayname' => 'system',
53
+            ];
54
+            $principals[] = [
55
+                'uri' => 'principals/system/public',
56
+                '{DAV:}displayname' => 'public',
57
+            ];
58
+        }
59
+
60
+        return $principals;
61
+    }
62
+
63
+    /**
64
+     * Returns a specific principal, specified by it's path.
65
+     * The returned structure should be the exact same as from
66
+     * getPrincipalsByPrefix.
67
+     *
68
+     * @param string $path
69
+     * @return array
70
+     */
71
+    function getPrincipalByPath($path) {
72
+
73
+        if ($path === 'principals/system/system') {
74
+            $principal = [
75
+                'uri' => 'principals/system/system',
76
+                '{DAV:}displayname' => 'system',
77
+            ];
78
+            return $principal;
79
+        }
80
+        if ($path === 'principals/system/public') {
81
+            $principal = [
82
+                'uri' => 'principals/system/public',
83
+                '{DAV:}displayname' => 'public',
84
+            ];
85
+            return $principal;
86
+        }
87
+
88
+        return null;
89
+    }
90
+
91
+    /**
92
+     * Updates one ore more webdav properties on a principal.
93
+     *
94
+     * The list of mutations is stored in a Sabre\DAV\PropPatch object.
95
+     * To do the actual updates, you must tell this object which properties
96
+     * you're going to process with the handle() method.
97
+     *
98
+     * Calling the handle method is like telling the PropPatch object "I
99
+     * promise I can handle updating this property".
100
+     *
101
+     * Read the PropPatch documentation for more info and examples.
102
+     *
103
+     * @param string $path
104
+     * @param \Sabre\DAV\PropPatch $propPatch
105
+     * @return void
106
+     */
107
+    function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch) {
108
+    }
109
+
110
+    /**
111
+     * This method is used to search for principals matching a set of
112
+     * properties.
113
+     *
114
+     * This search is specifically used by RFC3744's principal-property-search
115
+     * REPORT.
116
+     *
117
+     * The actual search should be a unicode-non-case-sensitive search. The
118
+     * keys in searchProperties are the WebDAV property names, while the values
119
+     * are the property values to search on.
120
+     *
121
+     * By default, if multiple properties are submitted to this method, the
122
+     * various properties should be combined with 'AND'. If $test is set to
123
+     * 'anyof', it should be combined using 'OR'.
124
+     *
125
+     * This method should simply return an array with full principal uri's.
126
+     *
127
+     * If somebody attempted to search on a property the backend does not
128
+     * support, you should simply return 0 results.
129
+     *
130
+     * You can also just return 0 results if you choose to not support
131
+     * searching at all, but keep in mind that this may stop certain features
132
+     * from working.
133
+     *
134
+     * @param string $prefixPath
135
+     * @param array $searchProperties
136
+     * @param string $test
137
+     * @return array
138
+     */
139
+    function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') {
140
+        return [];
141
+    }
142
+
143
+    /**
144
+     * Returns the list of members for a group-principal
145
+     *
146
+     * @param string $principal
147
+     * @return array
148
+     */
149
+    function getGroupMemberSet($principal) {
150
+        // TODO: for now the group principal has only one member, the user itself
151
+        $principal = $this->getPrincipalByPath($principal);
152
+        if (!$principal) {
153
+            throw new \Sabre\DAV\Exception('Principal not found');
154
+        }
155
+
156
+        return [$principal['uri']];
157
+    }
158
+
159
+    /**
160
+     * Returns the list of groups a principal is a member of
161
+     *
162
+     * @param string $principal
163
+     * @return array
164
+     */
165
+    function getGroupMembership($principal) {
166
+        list($prefix, ) = \Sabre\Uri\split($principal);
167
+
168
+        if ($prefix === 'principals/system') {
169
+            $principal = $this->getPrincipalByPath($principal);
170
+            if (!$principal) {
171
+                throw new \Sabre\DAV\Exception('Principal not found');
172
+            }
173
+
174
+            return [];
175
+        }
176
+        return [];
177
+    }
178
+
179
+    /**
180
+     * Updates the list of group members for a group principal.
181
+     *
182
+     * The principals should be passed as a list of uri's.
183
+     *
184
+     * @param string $principal
185
+     * @param array $members
186
+     * @return void
187
+     */
188
+    function setGroupMemberSet($principal, array $members) {
189
+        throw new \Sabre\DAV\Exception('Setting members of the group is not supported yet');
190
+    }
191 191
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Command/Expire.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,35 +30,35 @@
 block discarded – undo
30 30
 use OCP\Command\ICommand;
31 31
 
32 32
 class Expire implements ICommand {
33
-	use FileAccess;
33
+    use FileAccess;
34 34
 
35
-	/**
36
-	 * @var string
37
-	 */
38
-	private $fileName;
35
+    /**
36
+     * @var string
37
+     */
38
+    private $fileName;
39 39
 
40
-	/**
41
-	 * @var string
42
-	 */
43
-	private $user;
40
+    /**
41
+     * @var string
42
+     */
43
+    private $user;
44 44
 
45
-	/**
46
-	 * @param string $user
47
-	 * @param string $fileName
48
-	 */
49
-	function __construct($user, $fileName) {
50
-		$this->user = $user;
51
-		$this->fileName = $fileName;
52
-	}
45
+    /**
46
+     * @param string $user
47
+     * @param string $fileName
48
+     */
49
+    function __construct($user, $fileName) {
50
+        $this->user = $user;
51
+        $this->fileName = $fileName;
52
+    }
53 53
 
54 54
 
55
-	public function handle() {
56
-		$userManager = \OC::$server->getUserManager();
57
-		if (!$userManager->userExists($this->user)) {
58
-			// User has been deleted already
59
-			return;
60
-		}
55
+    public function handle() {
56
+        $userManager = \OC::$server->getUserManager();
57
+        if (!$userManager->userExists($this->user)) {
58
+            // User has been deleted already
59
+            return;
60
+        }
61 61
 
62
-		Storage::expire($this->fileName, $this->user);
63
-	}
62
+        Storage::expire($this->fileName, $this->user);
63
+    }
64 64
 }
Please login to merge, or discard this patch.
lib/private/Calendar/Manager.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -27,114 +27,114 @@
 block discarded – undo
27 27
 
28 28
 class Manager implements \OCP\Calendar\IManager {
29 29
 
30
-	/**
31
-	 * @var ICalendar[] holds all registered calendars
32
-	 */
33
-	private $calendars=[];
30
+    /**
31
+     * @var ICalendar[] holds all registered calendars
32
+     */
33
+    private $calendars=[];
34 34
 
35
-	/**
36
-	 * @var \Closure[] to call to load/register calendar providers
37
-	 */
38
-	private $calendarLoaders=[];
35
+    /**
36
+     * @var \Closure[] to call to load/register calendar providers
37
+     */
38
+    private $calendarLoaders=[];
39 39
 
40
-	/**
41
-	 * This function is used to search and find objects within the user's calendars.
42
-	 * In case $pattern is empty all events/journals/todos will be returned.
43
-	 *
44
-	 * @param string $pattern which should match within the $searchProperties
45
-	 * @param array $searchProperties defines the properties within the query pattern should match
46
-	 * @param array $options - optional parameters:
47
-	 * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
48
-	 * @param integer|null $limit - limit number of search results
49
-	 * @param integer|null $offset - offset for paging of search results
50
-	 * @return array an array of events/journals/todos which are arrays of arrays of key-value-pairs
51
-	 * @since 13.0.0
52
-	 */
53
-	public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null) {
54
-		$this->loadCalendars();
55
-		$result = [];
56
-		foreach($this->calendars as $calendar) {
57
-			$r = $calendar->search($pattern, $searchProperties, $options, $limit, $offset);
58
-			foreach($r as $o) {
59
-				$o['calendar-key'] = $calendar->getKey();
60
-				$result[] = $o;
61
-			}
62
-		}
40
+    /**
41
+     * This function is used to search and find objects within the user's calendars.
42
+     * In case $pattern is empty all events/journals/todos will be returned.
43
+     *
44
+     * @param string $pattern which should match within the $searchProperties
45
+     * @param array $searchProperties defines the properties within the query pattern should match
46
+     * @param array $options - optional parameters:
47
+     * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
48
+     * @param integer|null $limit - limit number of search results
49
+     * @param integer|null $offset - offset for paging of search results
50
+     * @return array an array of events/journals/todos which are arrays of arrays of key-value-pairs
51
+     * @since 13.0.0
52
+     */
53
+    public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null) {
54
+        $this->loadCalendars();
55
+        $result = [];
56
+        foreach($this->calendars as $calendar) {
57
+            $r = $calendar->search($pattern, $searchProperties, $options, $limit, $offset);
58
+            foreach($r as $o) {
59
+                $o['calendar-key'] = $calendar->getKey();
60
+                $result[] = $o;
61
+            }
62
+        }
63 63
 
64
-		return $result;
65
-	}
64
+        return $result;
65
+    }
66 66
 
67
-	/**
68
-	 * Check if calendars are available
69
-	 *
70
-	 * @return bool true if enabled, false if not
71
-	 * @since 13.0.0
72
-	 */
73
-	public function isEnabled() {
74
-		return !empty($this->calendars) || !empty($this->calendarLoaders);
75
-	}
67
+    /**
68
+     * Check if calendars are available
69
+     *
70
+     * @return bool true if enabled, false if not
71
+     * @since 13.0.0
72
+     */
73
+    public function isEnabled() {
74
+        return !empty($this->calendars) || !empty($this->calendarLoaders);
75
+    }
76 76
 
77
-	/**
78
-	 * Registers a calendar
79
-	 *
80
-	 * @param ICalendar $calendar
81
-	 * @return void
82
-	 * @since 13.0.0
83
-	 */
84
-	public function registerCalendar(ICalendar $calendar) {
85
-		$this->calendars[$calendar->getKey()] = $calendar;
86
-	}
77
+    /**
78
+     * Registers a calendar
79
+     *
80
+     * @param ICalendar $calendar
81
+     * @return void
82
+     * @since 13.0.0
83
+     */
84
+    public function registerCalendar(ICalendar $calendar) {
85
+        $this->calendars[$calendar->getKey()] = $calendar;
86
+    }
87 87
 
88
-	/**
89
-	 * Unregisters a calendar
90
-	 *
91
-	 * @param ICalendar $calendar
92
-	 * @return void
93
-	 * @since 13.0.0
94
-	 */
95
-	public function unregisterCalendar(ICalendar $calendar) {
96
-		unset($this->calendars[$calendar->getKey()]);
97
-	}
88
+    /**
89
+     * Unregisters a calendar
90
+     *
91
+     * @param ICalendar $calendar
92
+     * @return void
93
+     * @since 13.0.0
94
+     */
95
+    public function unregisterCalendar(ICalendar $calendar) {
96
+        unset($this->calendars[$calendar->getKey()]);
97
+    }
98 98
 
99
-	/**
100
-	 * In order to improve lazy loading a closure can be registered which will be called in case
101
-	 * calendars are actually requested
102
-	 *
103
-	 * @param \Closure $callable
104
-	 * @return void
105
-	 * @since 13.0.0
106
-	 */
107
-	public function register(\Closure $callable) {
108
-		$this->calendarLoaders[] = $callable;
109
-	}
99
+    /**
100
+     * In order to improve lazy loading a closure can be registered which will be called in case
101
+     * calendars are actually requested
102
+     *
103
+     * @param \Closure $callable
104
+     * @return void
105
+     * @since 13.0.0
106
+     */
107
+    public function register(\Closure $callable) {
108
+        $this->calendarLoaders[] = $callable;
109
+    }
110 110
 
111
-	/**
112
-	 * @return ICalendar[]
113
-	 * @since 13.0.0
114
-	 */
115
-	public function getCalendars() {
116
-		$this->loadCalendars();
111
+    /**
112
+     * @return ICalendar[]
113
+     * @since 13.0.0
114
+     */
115
+    public function getCalendars() {
116
+        $this->loadCalendars();
117 117
 
118
-		return array_values($this->calendars);
119
-	}
118
+        return array_values($this->calendars);
119
+    }
120 120
 
121
-	/**
122
-	 * removes all registered calendar instances
123
-	 * @return void
124
-	 * @since 13.0.0
125
-	 */
126
-	public function clear() {
127
-		$this->calendars = [];
128
-		$this->calendarLoaders = [];
129
-	}
121
+    /**
122
+     * removes all registered calendar instances
123
+     * @return void
124
+     * @since 13.0.0
125
+     */
126
+    public function clear() {
127
+        $this->calendars = [];
128
+        $this->calendarLoaders = [];
129
+    }
130 130
 
131
-	/**
132
-	 * loads all calendars
133
-	 */
134
-	private function loadCalendars() {
135
-		foreach($this->calendarLoaders as $callable) {
136
-			$callable($this);
137
-		}
138
-		$this->calendarLoaders = [];
139
-	}
131
+    /**
132
+     * loads all calendars
133
+     */
134
+    private function loadCalendars() {
135
+        foreach($this->calendarLoaders as $callable) {
136
+            $callable($this);
137
+        }
138
+        $this->calendarLoaders = [];
139
+    }
140 140
 }
Please login to merge, or discard this patch.
lib/public/Calendar/IManager.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -55,67 +55,67 @@
 block discarded – undo
55 55
  */
56 56
 interface IManager {
57 57
 
58
-	/**
59
-	 * This function is used to search and find objects within the user's calendars.
60
-	 * In case $pattern is empty all events/journals/todos will be returned.
61
-	 *
62
-	 * @param string $pattern which should match within the $searchProperties
63
-	 * @param array $searchProperties defines the properties within the query pattern should match
64
-	 * @param array $options - optional parameters:
65
-	 * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
66
-	 * @param integer|null $limit - limit number of search results
67
-	 * @param integer|null $offset - offset for paging of search results
68
-	 * @return array an array of events/journals/todos which are arrays of arrays of key-value-pairs
69
-	 * @since 13.0.0
70
-	 */
71
-	public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null);
58
+    /**
59
+     * This function is used to search and find objects within the user's calendars.
60
+     * In case $pattern is empty all events/journals/todos will be returned.
61
+     *
62
+     * @param string $pattern which should match within the $searchProperties
63
+     * @param array $searchProperties defines the properties within the query pattern should match
64
+     * @param array $options - optional parameters:
65
+     * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
66
+     * @param integer|null $limit - limit number of search results
67
+     * @param integer|null $offset - offset for paging of search results
68
+     * @return array an array of events/journals/todos which are arrays of arrays of key-value-pairs
69
+     * @since 13.0.0
70
+     */
71
+    public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null);
72 72
 
73
-	/**
74
-	 * Check if calendars are available
75
-	 *
76
-	 * @return bool true if enabled, false if not
77
-	 * @since 13.0.0
78
-	 */
79
-	public function isEnabled();
73
+    /**
74
+     * Check if calendars are available
75
+     *
76
+     * @return bool true if enabled, false if not
77
+     * @since 13.0.0
78
+     */
79
+    public function isEnabled();
80 80
 
81
-	/**
82
-	 * Registers a calendar
83
-	 *
84
-	 * @param ICalendar $calendar
85
-	 * @return void
86
-	 * @since 13.0.0
87
-	 */
88
-	public function registerCalendar(ICalendar $calendar);
81
+    /**
82
+     * Registers a calendar
83
+     *
84
+     * @param ICalendar $calendar
85
+     * @return void
86
+     * @since 13.0.0
87
+     */
88
+    public function registerCalendar(ICalendar $calendar);
89 89
 
90
-	/**
91
-	 * Unregisters a calendar
92
-	 *
93
-	 * @param ICalendar $calendar
94
-	 * @return void
95
-	 * @since 13.0.0
96
-	 */
97
-	public function unregisterCalendar(ICalendar $calendar);
90
+    /**
91
+     * Unregisters a calendar
92
+     *
93
+     * @param ICalendar $calendar
94
+     * @return void
95
+     * @since 13.0.0
96
+     */
97
+    public function unregisterCalendar(ICalendar $calendar);
98 98
 
99
-	/**
100
-	 * In order to improve lazy loading a closure can be registered which will be called in case
101
-	 * calendars are actually requested
102
-	 *
103
-	 * @param \Closure $callable
104
-	 * @return void
105
-	 * @since 13.0.0
106
-	 */
107
-	public function register(\Closure $callable);
99
+    /**
100
+     * In order to improve lazy loading a closure can be registered which will be called in case
101
+     * calendars are actually requested
102
+     *
103
+     * @param \Closure $callable
104
+     * @return void
105
+     * @since 13.0.0
106
+     */
107
+    public function register(\Closure $callable);
108 108
 
109
-	/**
110
-	 * @return ICalendar[]
111
-	 * @since 13.0.0
112
-	 */
113
-	public function getCalendars();
109
+    /**
110
+     * @return ICalendar[]
111
+     * @since 13.0.0
112
+     */
113
+    public function getCalendars();
114 114
 
115
-	/**
116
-	 * removes all registered calendar instances
117
-	 * @return void
118
-	 * @since 13.0.0
119
-	 */
120
-	public function clear();
115
+    /**
116
+     * removes all registered calendar instances
117
+     * @return void
118
+     * @since 13.0.0
119
+     */
120
+    public function clear();
121 121
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalendarImpl.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -28,92 +28,92 @@
 block discarded – undo
28 28
 
29 29
 class CalendarImpl implements ICalendar {
30 30
 
31
-	/** @var CalDavBackend */
32
-	private $backend;
31
+    /** @var CalDavBackend */
32
+    private $backend;
33 33
 
34
-	/** @var Calendar */
35
-	private $calendar;
34
+    /** @var Calendar */
35
+    private $calendar;
36 36
 
37
-	/** @var array */
38
-	private $calendarInfo;
37
+    /** @var array */
38
+    private $calendarInfo;
39 39
 
40
-	/**
41
-	 * CalendarImpl constructor.
42
-	 *
43
-	 * @param Calendar $calendar
44
-	 * @param array $calendarInfo
45
-	 * @param CalDavBackend $backend
46
-	 */
47
-	public function __construct(Calendar $calendar, array $calendarInfo,
48
-								CalDavBackend $backend) {
49
-		$this->calendar = $calendar;
50
-		$this->calendarInfo = $calendarInfo;
51
-		$this->backend = $backend;
52
-	}
40
+    /**
41
+     * CalendarImpl constructor.
42
+     *
43
+     * @param Calendar $calendar
44
+     * @param array $calendarInfo
45
+     * @param CalDavBackend $backend
46
+     */
47
+    public function __construct(Calendar $calendar, array $calendarInfo,
48
+                                CalDavBackend $backend) {
49
+        $this->calendar = $calendar;
50
+        $this->calendarInfo = $calendarInfo;
51
+        $this->backend = $backend;
52
+    }
53 53
 	
54
-	/**
55
-	 * @return string defining the technical unique key
56
-	 * @since 13.0.0
57
-	 */
58
-	public function getKey() {
59
-		return $this->calendarInfo['id'];
60
-	}
54
+    /**
55
+     * @return string defining the technical unique key
56
+     * @since 13.0.0
57
+     */
58
+    public function getKey() {
59
+        return $this->calendarInfo['id'];
60
+    }
61 61
 
62
-	/**
63
-	 * In comparison to getKey() this function returns a human readable (maybe translated) name
64
-	 * @return null|string
65
-	 * @since 13.0.0
66
-	 */
67
-	public function getDisplayName() {
68
-		return $this->calendarInfo['{DAV:}displayname'];
69
-	}
62
+    /**
63
+     * In comparison to getKey() this function returns a human readable (maybe translated) name
64
+     * @return null|string
65
+     * @since 13.0.0
66
+     */
67
+    public function getDisplayName() {
68
+        return $this->calendarInfo['{DAV:}displayname'];
69
+    }
70 70
 
71
-	/**
72
-	 * Calendar color
73
-	 * @return null|string
74
-	 * @since 13.0.0
75
-	 */
76
-	public function getDisplayColor() {
77
-		return $this->calendarInfo['{http://apple.com/ns/ical/}calendar-color'];
78
-	}
71
+    /**
72
+     * Calendar color
73
+     * @return null|string
74
+     * @since 13.0.0
75
+     */
76
+    public function getDisplayColor() {
77
+        return $this->calendarInfo['{http://apple.com/ns/ical/}calendar-color'];
78
+    }
79 79
 
80
-	/**
81
-	 * @param string $pattern which should match within the $searchProperties
82
-	 * @param array $searchProperties defines the properties within the query pattern should match
83
-	 * @param array $options - optional parameters:
84
-	 * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
85
-	 * @param integer|null $limit - limit number of search results
86
-	 * @param integer|null $offset - offset for paging of search results
87
-	 * @return array an array of events/journals/todos which are arrays of key-value-pairs
88
-	 * @since 13.0.0
89
-	 */
90
-	public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null) {
91
-		return $this->backend->search($this->calendarInfo, $pattern,
92
-			$searchProperties, $options, $limit, $offset);
93
-	}
80
+    /**
81
+     * @param string $pattern which should match within the $searchProperties
82
+     * @param array $searchProperties defines the properties within the query pattern should match
83
+     * @param array $options - optional parameters:
84
+     * 	['timerange' => ['start' => new DateTime(...), 'end' => new DateTime(...)]]
85
+     * @param integer|null $limit - limit number of search results
86
+     * @param integer|null $offset - offset for paging of search results
87
+     * @return array an array of events/journals/todos which are arrays of key-value-pairs
88
+     * @since 13.0.0
89
+     */
90
+    public function search($pattern, array $searchProperties=[], array $options=[], $limit=null, $offset=null) {
91
+        return $this->backend->search($this->calendarInfo, $pattern,
92
+            $searchProperties, $options, $limit, $offset);
93
+    }
94 94
 
95
-	/**
96
-	 * @return integer build up using \OCP\Constants
97
-	 * @since 13.0.0
98
-	 */
99
-	public function getPermissions() {
100
-		$permissions = $this->calendar->getACL();
101
-		$result = 0;
102
-		foreach ($permissions as $permission) {
103
-			switch($permission['privilege']) {
104
-				case '{DAV:}read':
105
-					$result |= Constants::PERMISSION_READ;
106
-					break;
107
-				case '{DAV:}write':
108
-					$result |= Constants::PERMISSION_CREATE;
109
-					$result |= Constants::PERMISSION_UPDATE;
110
-					break;
111
-				case '{DAV:}all':
112
-					$result |= Constants::PERMISSION_ALL;
113
-					break;
114
-			}
115
-		}
95
+    /**
96
+     * @return integer build up using \OCP\Constants
97
+     * @since 13.0.0
98
+     */
99
+    public function getPermissions() {
100
+        $permissions = $this->calendar->getACL();
101
+        $result = 0;
102
+        foreach ($permissions as $permission) {
103
+            switch($permission['privilege']) {
104
+                case '{DAV:}read':
105
+                    $result |= Constants::PERMISSION_READ;
106
+                    break;
107
+                case '{DAV:}write':
108
+                    $result |= Constants::PERMISSION_CREATE;
109
+                    $result |= Constants::PERMISSION_UPDATE;
110
+                    break;
111
+                case '{DAV:}all':
112
+                    $result |= Constants::PERMISSION_ALL;
113
+                    break;
114
+            }
115
+        }
116 116
 
117
-		return $result;
118
-	}
117
+        return $result;
118
+    }
119 119
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/PublicCalendarRoot.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -30,49 +30,49 @@
 block discarded – undo
30 30
 
31 31
 class PublicCalendarRoot extends Collection {
32 32
 
33
-	/** @var CalDavBackend */
34
-	protected $caldavBackend;
33
+    /** @var CalDavBackend */
34
+    protected $caldavBackend;
35 35
 
36
-	/** @var \OCP\IL10N */
37
-	protected $l10n;
36
+    /** @var \OCP\IL10N */
37
+    protected $l10n;
38 38
 
39
-	/** @var \OCP\IConfig */
40
-	protected $config;
39
+    /** @var \OCP\IConfig */
40
+    protected $config;
41 41
 
42
-	/**
43
-	 * PublicCalendarRoot constructor.
44
-	 *
45
-	 * @param CalDavBackend $caldavBackend
46
-	 * @param IL10N $l10n
47
-	 * @param IConfig $config
48
-	 */
49
-	function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
50
-						 IConfig $config) {
51
-		$this->caldavBackend = $caldavBackend;
52
-		$this->l10n = $l10n;
53
-		$this->config = $config;
42
+    /**
43
+     * PublicCalendarRoot constructor.
44
+     *
45
+     * @param CalDavBackend $caldavBackend
46
+     * @param IL10N $l10n
47
+     * @param IConfig $config
48
+     */
49
+    function __construct(CalDavBackend $caldavBackend, IL10N $l10n,
50
+                            IConfig $config) {
51
+        $this->caldavBackend = $caldavBackend;
52
+        $this->l10n = $l10n;
53
+        $this->config = $config;
54 54
 
55
-	}
55
+    }
56 56
 
57
-	/**
58
-	 * @inheritdoc
59
-	 */
60
-	function getName() {
61
-		return 'public-calendars';
62
-	}
57
+    /**
58
+     * @inheritdoc
59
+     */
60
+    function getName() {
61
+        return 'public-calendars';
62
+    }
63 63
 
64
-	/**
65
-	 * @inheritdoc
66
-	 */
67
-	function getChild($name) {
68
-		$calendar = $this->caldavBackend->getPublicCalendar($name);
69
-		return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
70
-	}
64
+    /**
65
+     * @inheritdoc
66
+     */
67
+    function getChild($name) {
68
+        $calendar = $this->caldavBackend->getPublicCalendar($name);
69
+        return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
70
+    }
71 71
 
72
-	/**
73
-	 * @inheritdoc
74
-	 */
75
-	function getChildren() {
76
-		return [];
77
-	}
72
+    /**
73
+     * @inheritdoc
74
+     */
75
+    function getChildren() {
76
+        return [];
77
+    }
78 78
 }
Please login to merge, or discard this patch.
lib/public/Support/CrashReport/IReporter.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
  */
31 31
 interface IReporter {
32 32
 
33
-	/**
34
-	 * Report an (unhandled) exception
35
-	 *
36
-	 * @since 13.0.0
37
-	 * @param Exception|Throwable $exception
38
-	 * @param array $context
39
-	 */
40
-	public function report($exception, array $context = []);
33
+    /**
34
+     * Report an (unhandled) exception
35
+     *
36
+     * @since 13.0.0
37
+     * @param Exception|Throwable $exception
38
+     * @param array $context
39
+     */
40
+    public function report($exception, array $context = []);
41 41
 }
Please login to merge, or discard this patch.
lib/public/Defaults.php 1 patch
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -40,186 +40,186 @@
 block discarded – undo
40 40
  */
41 41
 class Defaults {
42 42
 
43
-	/**
44
-	 * \OC_Defaults instance to retrieve the defaults
45
-	 * @since 6.0.0
46
-	 */
47
-	private $defaults;
48
-
49
-	/**
50
-	 * creates a \OC_Defaults instance which is used in all methods to retrieve the
51
-	 * actual defaults
52
-	 * @since 6.0.0
53
-	 */
54
-	public function __construct(\OC_Defaults $defaults = null) {
55
-		if ($defaults === null) {
56
-			$defaults = \OC::$server->getThemingDefaults();
57
-		}
58
-		$this->defaults = $defaults;
59
-	}
60
-
61
-	/**
62
-	 * get base URL for the organisation behind your ownCloud instance
63
-	 * @return string
64
-	 * @since 6.0.0
65
-	 */
66
-	public function getBaseUrl() {
67
-		return $this->defaults->getBaseUrl();
68
-	}
69
-
70
-	/**
71
-	 * link to the desktop sync client
72
-	 * @return string
73
-	 * @since 6.0.0
74
-	 */
75
-	public function getSyncClientUrl() {
76
-		return $this->defaults->getSyncClientUrl();
77
-	}
78
-
79
-	/**
80
-	 * link to the iOS client
81
-	 * @return string
82
-	 * @since 8.0.0
83
-	 */
84
-	public function getiOSClientUrl() {
85
-		return $this->defaults->getiOSClientUrl();
86
-	}
87
-
88
-	/**
89
-	 * link to the Android client
90
-	 * @return string
91
-	 * @since 8.0.0
92
-	 */
93
-	public function getAndroidClientUrl() {
94
-		return $this->defaults->getAndroidClientUrl();
95
-	}
96
-
97
-	/**
98
-	 * base URL to the documentation of your ownCloud instance
99
-	 * @return string
100
-	 * @since 6.0.0
101
-	 */
102
-	public function getDocBaseUrl() {
103
-		return $this->defaults->getDocBaseUrl();
104
-	}
105
-
106
-	/**
107
-	 * name of your ownCloud instance
108
-	 * @return string
109
-	 * @since 6.0.0
110
-	 */
111
-	public function getName() {
112
-		return $this->defaults->getName();
113
-	}
114
-
115
-	/**
116
-	 * name of your ownCloud instance containing HTML styles
117
-	 * @return string
118
-	 * @since 8.0.0
119
-	 */
120
-	public function getHTMLName() {
121
-		return $this->defaults->getHTMLName();
122
-	}
123
-
124
-	/**
125
-	 * Entity behind your onwCloud instance
126
-	 * @return string
127
-	 * @since 6.0.0
128
-	 */
129
-	public function getEntity() {
130
-		return $this->defaults->getEntity();
131
-	}
132
-
133
-	/**
134
-	 * ownCloud slogan
135
-	 * @return string
136
-	 * @since 6.0.0
137
-	 */
138
-	public function getSlogan() {
139
-		return $this->defaults->getSlogan();
140
-	}
141
-
142
-	/**
143
-	 * logo claim
144
-	 * @return string
145
-	 * @since 6.0.0
146
-	 * @deprecated 13.0.0
147
-	 */
148
-	public function getLogoClaim() {
149
-		return '';
150
-	}
151
-
152
-	/**
153
-	 * footer, short version
154
-	 * @return string
155
-	 * @since 6.0.0
156
-	 */
157
-	public function getShortFooter() {
158
-		return $this->defaults->getShortFooter();
159
-	}
160
-
161
-	/**
162
-	 * footer, long version
163
-	 * @return string
164
-	 * @since 6.0.0
165
-	 */
166
-	public function getLongFooter() {
167
-		return $this->defaults->getLongFooter();
168
-	}
169
-
170
-	/**
171
-	 * Returns the AppId for the App Store for the iOS Client
172
-	 * @return string AppId
173
-	 * @since 8.0.0
174
-	 */
175
-	public function getiTunesAppId() {
176
-		return $this->defaults->getiTunesAppId();
177
-	}
178
-
179
-	/**
180
-	 * Themed logo url
181
-	 *
182
-	 * @param bool $useSvg Whether to point to the SVG image or a fallback
183
-	 * @return string
184
-	 * @since 12.0.0
185
-	 */
186
-	public function getLogo($useSvg = true) {
187
-		return $this->defaults->getLogo($useSvg);
188
-	}
189
-
190
-	/**
191
-	 * Returns primary color
192
-	 * @return string
193
-	 * @since 12.0.0
194
-	 */
195
-	public function getColorPrimary() {
196
-		return $this->defaults->getColorPrimary();
197
-	}
198
-
199
-	/**
200
-	 * @param string $key
201
-	 * @return string URL to doc with key
202
-	 * @since 12.0.0
203
-	 */
204
-	public function buildDocLinkToKey($key) {
205
-		return $this->defaults->buildDocLinkToKey($key);
206
-	}
207
-
208
-	/**
209
-	 * Returns the title
210
-	 * @return string title
211
-	 * @since 12.0.0
212
-	 */
213
-	public function getTitle() {
214
-		return $this->defaults->getTitle();
215
-	}
216
-
217
-	/**
218
-	 * Returns primary color
219
-	 * @return string
220
-	 * @since 13.0.0
221
-	 */
222
-	public function getTextColorPrimary() {
223
-		return $this->defaults->getTextColorPrimary();
224
-	}
43
+    /**
44
+     * \OC_Defaults instance to retrieve the defaults
45
+     * @since 6.0.0
46
+     */
47
+    private $defaults;
48
+
49
+    /**
50
+     * creates a \OC_Defaults instance which is used in all methods to retrieve the
51
+     * actual defaults
52
+     * @since 6.0.0
53
+     */
54
+    public function __construct(\OC_Defaults $defaults = null) {
55
+        if ($defaults === null) {
56
+            $defaults = \OC::$server->getThemingDefaults();
57
+        }
58
+        $this->defaults = $defaults;
59
+    }
60
+
61
+    /**
62
+     * get base URL for the organisation behind your ownCloud instance
63
+     * @return string
64
+     * @since 6.0.0
65
+     */
66
+    public function getBaseUrl() {
67
+        return $this->defaults->getBaseUrl();
68
+    }
69
+
70
+    /**
71
+     * link to the desktop sync client
72
+     * @return string
73
+     * @since 6.0.0
74
+     */
75
+    public function getSyncClientUrl() {
76
+        return $this->defaults->getSyncClientUrl();
77
+    }
78
+
79
+    /**
80
+     * link to the iOS client
81
+     * @return string
82
+     * @since 8.0.0
83
+     */
84
+    public function getiOSClientUrl() {
85
+        return $this->defaults->getiOSClientUrl();
86
+    }
87
+
88
+    /**
89
+     * link to the Android client
90
+     * @return string
91
+     * @since 8.0.0
92
+     */
93
+    public function getAndroidClientUrl() {
94
+        return $this->defaults->getAndroidClientUrl();
95
+    }
96
+
97
+    /**
98
+     * base URL to the documentation of your ownCloud instance
99
+     * @return string
100
+     * @since 6.0.0
101
+     */
102
+    public function getDocBaseUrl() {
103
+        return $this->defaults->getDocBaseUrl();
104
+    }
105
+
106
+    /**
107
+     * name of your ownCloud instance
108
+     * @return string
109
+     * @since 6.0.0
110
+     */
111
+    public function getName() {
112
+        return $this->defaults->getName();
113
+    }
114
+
115
+    /**
116
+     * name of your ownCloud instance containing HTML styles
117
+     * @return string
118
+     * @since 8.0.0
119
+     */
120
+    public function getHTMLName() {
121
+        return $this->defaults->getHTMLName();
122
+    }
123
+
124
+    /**
125
+     * Entity behind your onwCloud instance
126
+     * @return string
127
+     * @since 6.0.0
128
+     */
129
+    public function getEntity() {
130
+        return $this->defaults->getEntity();
131
+    }
132
+
133
+    /**
134
+     * ownCloud slogan
135
+     * @return string
136
+     * @since 6.0.0
137
+     */
138
+    public function getSlogan() {
139
+        return $this->defaults->getSlogan();
140
+    }
141
+
142
+    /**
143
+     * logo claim
144
+     * @return string
145
+     * @since 6.0.0
146
+     * @deprecated 13.0.0
147
+     */
148
+    public function getLogoClaim() {
149
+        return '';
150
+    }
151
+
152
+    /**
153
+     * footer, short version
154
+     * @return string
155
+     * @since 6.0.0
156
+     */
157
+    public function getShortFooter() {
158
+        return $this->defaults->getShortFooter();
159
+    }
160
+
161
+    /**
162
+     * footer, long version
163
+     * @return string
164
+     * @since 6.0.0
165
+     */
166
+    public function getLongFooter() {
167
+        return $this->defaults->getLongFooter();
168
+    }
169
+
170
+    /**
171
+     * Returns the AppId for the App Store for the iOS Client
172
+     * @return string AppId
173
+     * @since 8.0.0
174
+     */
175
+    public function getiTunesAppId() {
176
+        return $this->defaults->getiTunesAppId();
177
+    }
178
+
179
+    /**
180
+     * Themed logo url
181
+     *
182
+     * @param bool $useSvg Whether to point to the SVG image or a fallback
183
+     * @return string
184
+     * @since 12.0.0
185
+     */
186
+    public function getLogo($useSvg = true) {
187
+        return $this->defaults->getLogo($useSvg);
188
+    }
189
+
190
+    /**
191
+     * Returns primary color
192
+     * @return string
193
+     * @since 12.0.0
194
+     */
195
+    public function getColorPrimary() {
196
+        return $this->defaults->getColorPrimary();
197
+    }
198
+
199
+    /**
200
+     * @param string $key
201
+     * @return string URL to doc with key
202
+     * @since 12.0.0
203
+     */
204
+    public function buildDocLinkToKey($key) {
205
+        return $this->defaults->buildDocLinkToKey($key);
206
+    }
207
+
208
+    /**
209
+     * Returns the title
210
+     * @return string title
211
+     * @since 12.0.0
212
+     */
213
+    public function getTitle() {
214
+        return $this->defaults->getTitle();
215
+    }
216
+
217
+    /**
218
+     * Returns primary color
219
+     * @return string
220
+     * @since 13.0.0
221
+     */
222
+    public function getTextColorPrimary() {
223
+        return $this->defaults->getTextColorPrimary();
224
+    }
225 225
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalendarManager.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -29,49 +29,49 @@
 block discarded – undo
29 29
 
30 30
 class CalendarManager {
31 31
 
32
-	/** @var CalDavBackend */
33
-	private $backend;
32
+    /** @var CalDavBackend */
33
+    private $backend;
34 34
 
35
-	/** @var IL10N */
36
-	private $l10n;
35
+    /** @var IL10N */
36
+    private $l10n;
37 37
 
38
-	/** @var IConfig */
39
-	private $config;
38
+    /** @var IConfig */
39
+    private $config;
40 40
 
41
-	/**
42
-	 * CalendarManager constructor.
43
-	 *
44
-	 * @param CalDavBackend $backend
45
-	 * @param IL10N $l10n
46
-	 * @param IConfig $config
47
-	 */
48
-	public function __construct(CalDavBackend $backend, IL10N $l10n, IConfig $config) {
49
-		$this->backend = $backend;
50
-		$this->l10n = $l10n;
51
-		$this->config = $config;
52
-	}
41
+    /**
42
+     * CalendarManager constructor.
43
+     *
44
+     * @param CalDavBackend $backend
45
+     * @param IL10N $l10n
46
+     * @param IConfig $config
47
+     */
48
+    public function __construct(CalDavBackend $backend, IL10N $l10n, IConfig $config) {
49
+        $this->backend = $backend;
50
+        $this->l10n = $l10n;
51
+        $this->config = $config;
52
+    }
53 53
 
54
-	/**
55
-	 * @param IManager $cm
56
-	 * @param string $userId
57
-	 */
58
-	public function setupCalendarProvider(IManager $cm, $userId) {
59
-		$calendars = $this->backend->getCalendarsForUser("principals/users/$userId");
60
-		$this->register($cm, $calendars);
61
-	}
54
+    /**
55
+     * @param IManager $cm
56
+     * @param string $userId
57
+     */
58
+    public function setupCalendarProvider(IManager $cm, $userId) {
59
+        $calendars = $this->backend->getCalendarsForUser("principals/users/$userId");
60
+        $this->register($cm, $calendars);
61
+    }
62 62
 
63
-	/**
64
-	 * @param IManager $cm
65
-	 * @param array $calendars
66
-	 */
67
-	private function register(IManager $cm, array $calendars) {
68
-		foreach($calendars as $calendarInfo) {
69
-			$calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config);
70
-			$cm->registerCalendar(new CalendarImpl(
71
-				$calendar,
72
-				$calendarInfo,
73
-				$this->backend
74
-			));
75
-		}
76
-	}
63
+    /**
64
+     * @param IManager $cm
65
+     * @param array $calendars
66
+     */
67
+    private function register(IManager $cm, array $calendars) {
68
+        foreach($calendars as $calendarInfo) {
69
+            $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config);
70
+            $cm->registerCalendar(new CalendarImpl(
71
+                $calendar,
72
+                $calendarInfo,
73
+                $this->backend
74
+            ));
75
+        }
76
+    }
77 77
 }
Please login to merge, or discard this patch.