Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
lib/public/appframework/iappcontainer.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -38,61 +38,61 @@
 block discarded – undo
38 38
  */
39 39
 interface IAppContainer extends IContainer {
40 40
 
41
-	/**
42
-	 * used to return the appname of the set application
43
-	 * @return string the name of your application
44
-	 * @since 6.0.0
45
-	 */
46
-	function getAppName();
41
+    /**
42
+     * used to return the appname of the set application
43
+     * @return string the name of your application
44
+     * @since 6.0.0
45
+     */
46
+    function getAppName();
47 47
 
48
-	/**
49
-	 * @deprecated 8.0.0 implements only deprecated methods
50
-	 * @return IApi
51
-	 * @since 6.0.0
52
-	 */
53
-	function getCoreApi();
48
+    /**
49
+     * @deprecated 8.0.0 implements only deprecated methods
50
+     * @return IApi
51
+     * @since 6.0.0
52
+     */
53
+    function getCoreApi();
54 54
 
55
-	/**
56
-	 * @return \OCP\IServerContainer
57
-	 * @since 6.0.0
58
-	 */
59
-	function getServer();
55
+    /**
56
+     * @return \OCP\IServerContainer
57
+     * @since 6.0.0
58
+     */
59
+    function getServer();
60 60
 
61
-	/**
62
-	 * @param string $middleWare
63
-	 * @return boolean
64
-	 * @since 6.0.0
65
-	 */
66
-	function registerMiddleWare($middleWare);
61
+    /**
62
+     * @param string $middleWare
63
+     * @return boolean
64
+     * @since 6.0.0
65
+     */
66
+    function registerMiddleWare($middleWare);
67 67
 
68
-	/**
69
-	 * @deprecated 8.0.0 use IUserSession->isLoggedIn()
70
-	 * @return boolean
71
-	 * @since 6.0.0
72
-	 */
73
-	function isLoggedIn();
68
+    /**
69
+     * @deprecated 8.0.0 use IUserSession->isLoggedIn()
70
+     * @return boolean
71
+     * @since 6.0.0
72
+     */
73
+    function isLoggedIn();
74 74
 
75
-	/**
76
-	 * @deprecated 8.0.0 use IGroupManager->isAdmin($userId)
77
-	 * @return boolean
78
-	 * @since 6.0.0
79
-	 */
80
-	function isAdminUser();
75
+    /**
76
+     * @deprecated 8.0.0 use IGroupManager->isAdmin($userId)
77
+     * @return boolean
78
+     * @since 6.0.0
79
+     */
80
+    function isAdminUser();
81 81
 
82
-	/**
83
-	 * @deprecated 8.0.0 use the ILogger instead
84
-	 * @param string $message
85
-	 * @param string $level
86
-	 * @return mixed
87
-	 * @since 6.0.0
88
-	 */
89
-	function log($message, $level);
82
+    /**
83
+     * @deprecated 8.0.0 use the ILogger instead
84
+     * @param string $message
85
+     * @param string $level
86
+     * @return mixed
87
+     * @since 6.0.0
88
+     */
89
+    function log($message, $level);
90 90
 
91
-	/**
92
-	 * Register a capability
93
-	 *
94
-	 * @param string $serviceName e.g. 'OCA\Files\Capabilities'
95
-	 * @since 8.2.0
96
-	 */
97
-	 public function registerCapability($serviceName);
91
+    /**
92
+     * Register a capability
93
+     *
94
+     * @param string $serviceName e.g. 'OCA\Files\Capabilities'
95
+     * @since 8.2.0
96
+     */
97
+        public function registerCapability($serviceName);
98 98
 }
Please login to merge, or discard this patch.
lib/public/appframework/db/doesnotexistexception.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@
 block discarded – undo
32 32
  */
33 33
 class DoesNotExistException extends \Exception {
34 34
 
35
-	/**
36
-	 * Constructor
37
-	 * @param string $msg the error message
38
-	 * @since 7.0.0
39
-	 */
40
-	public function __construct($msg){
41
-		parent::__construct($msg);
42
-	}
35
+    /**
36
+     * Constructor
37
+     * @param string $msg the error message
38
+     * @since 7.0.0
39
+     */
40
+    public function __construct($msg){
41
+        parent::__construct($msg);
42
+    }
43 43
 
44 44
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	 * @param string $msg the error message
38 38
 	 * @since 7.0.0
39 39
 	 */
40
-	public function __construct($msg){
40
+	public function __construct($msg) {
41 41
 		parent::__construct($msg);
42 42
 	}
43 43
 
Please login to merge, or discard this patch.
lib/public/appframework/db/multipleobjectsreturnedexception.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@
 block discarded – undo
32 32
  */
33 33
 class MultipleObjectsReturnedException extends \Exception {
34 34
 
35
-	/**
36
-	 * Constructor
37
-	 * @param string $msg the error message
38
-	 * @since 7.0.0
39
-	 */
40
-	public function __construct($msg){
41
-		parent::__construct($msg);
42
-	}
35
+    /**
36
+     * Constructor
37
+     * @param string $msg the error message
38
+     * @since 7.0.0
39
+     */
40
+    public function __construct($msg){
41
+        parent::__construct($msg);
42
+    }
43 43
 
44 44
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	 * @param string $msg the error message
38 38
 	 * @since 7.0.0
39 39
 	 */
40
-	public function __construct($msg){
40
+	public function __construct($msg) {
41 41
 		parent::__construct($msg);
42 42
 	}
43 43
 
Please login to merge, or discard this patch.
lib/public/appframework/db/entity.php 2 patches
Indentation   +205 added lines, -205 removed lines patch added patch discarded remove patch
@@ -31,224 +31,224 @@
 block discarded – undo
31 31
  */
32 32
 abstract class Entity {
33 33
 
34
-	public $id;
34
+    public $id;
35 35
 
36
-	private $_updatedFields = array();
37
-	private $_fieldTypes = array('id' => 'integer');
36
+    private $_updatedFields = array();
37
+    private $_fieldTypes = array('id' => 'integer');
38 38
 
39 39
 
40
-	/**
41
-	 * Simple alternative constructor for building entities from a request
42
-	 * @param array $params the array which was obtained via $this->params('key')
43
-	 * in the controller
44
-	 * @return Entity
45
-	 * @since 7.0.0
46
-	 */
47
-	public static function fromParams(array $params) {
48
-		$instance = new static();
40
+    /**
41
+     * Simple alternative constructor for building entities from a request
42
+     * @param array $params the array which was obtained via $this->params('key')
43
+     * in the controller
44
+     * @return Entity
45
+     * @since 7.0.0
46
+     */
47
+    public static function fromParams(array $params) {
48
+        $instance = new static();
49 49
 
50
-		foreach($params as $key => $value) {
51
-			$method = 'set' . ucfirst($key);
52
-			$instance->$method($value);
53
-		}
50
+        foreach($params as $key => $value) {
51
+            $method = 'set' . ucfirst($key);
52
+            $instance->$method($value);
53
+        }
54 54
 
55
-		return $instance;
56
-	}
55
+        return $instance;
56
+    }
57 57
 
58 58
 
59
-	/**
60
-	 * Maps the keys of the row array to the attributes
61
-	 * @param array $row the row to map onto the entity
62
-	 * @since 7.0.0
63
-	 */
64
-	public static function fromRow(array $row){
65
-		$instance = new static();
59
+    /**
60
+     * Maps the keys of the row array to the attributes
61
+     * @param array $row the row to map onto the entity
62
+     * @since 7.0.0
63
+     */
64
+    public static function fromRow(array $row){
65
+        $instance = new static();
66 66
 
67
-		foreach($row as $key => $value){
68
-			$prop = ucfirst($instance->columnToProperty($key));
69
-			$setter = 'set' . $prop;
70
-			$instance->$setter($value);
71
-		}
67
+        foreach($row as $key => $value){
68
+            $prop = ucfirst($instance->columnToProperty($key));
69
+            $setter = 'set' . $prop;
70
+            $instance->$setter($value);
71
+        }
72 72
 
73
-		$instance->resetUpdatedFields();
73
+        $instance->resetUpdatedFields();
74 74
 
75
-		return $instance;
76
-	}
75
+        return $instance;
76
+    }
77 77
 
78 78
 
79
-	/**
80
-	 * @return array with attribute and type
81
-	 * @since 7.0.0
82
-	 */
83
-	public function getFieldTypes() {
84
-		return $this->_fieldTypes;
85
-	}
79
+    /**
80
+     * @return array with attribute and type
81
+     * @since 7.0.0
82
+     */
83
+    public function getFieldTypes() {
84
+        return $this->_fieldTypes;
85
+    }
86 86
 
87 87
 	
88
-	/**
89
-	 * Marks the entity as clean needed for setting the id after the insertion
90
-	 * @since 7.0.0
91
-	 */
92
-	public function resetUpdatedFields(){
93
-		$this->_updatedFields = array();
94
-	}
95
-
96
-	/**
97
-	 * Generic setter for properties
98
-	 * @since 7.0.0
99
-	 */
100
-	protected function setter($name, $args) {
101
-		// setters should only work for existing attributes
102
-		if(property_exists($this, $name)){
103
-			if($this->$name === $args[0]) {
104
-				return;
105
-			}
106
-			$this->markFieldUpdated($name);
107
-
108
-			// if type definition exists, cast to correct type
109
-			if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
110
-				settype($args[0], $this->_fieldTypes[$name]);
111
-			}
112
-			$this->$name = $args[0];
113
-
114
-		} else {
115
-			throw new \BadFunctionCallException($name . 
116
-				' is not a valid attribute');
117
-		}
118
-	}
119
-
120
-	/**
121
-	 * Generic getter for properties
122
-	 * @since 7.0.0
123
-	 */
124
-	protected function getter($name) {
125
-		// getters should only work for existing attributes
126
-		if(property_exists($this, $name)){
127
-			return $this->$name;
128
-		} else {
129
-			throw new \BadFunctionCallException($name . 
130
-				' is not a valid attribute');
131
-		}
132
-	}
133
-
134
-
135
-	/**
136
-	 * Each time a setter is called, push the part after set
137
-	 * into an array: for instance setId will save Id in the 
138
-	 * updated fields array so it can be easily used to create the
139
-	 * getter method
140
-	 * @since 7.0.0
141
-	 */
142
-	public function __call($methodName, $args){
143
-		$attr = lcfirst( substr($methodName, 3) );
144
-
145
-		if(strpos($methodName, 'set') === 0){
146
-			$this->setter($attr, $args);
147
-		} elseif(strpos($methodName, 'get') === 0) {
148
-			return $this->getter($attr);
149
-		} else {
150
-			throw new \BadFunctionCallException($methodName . 
151
-					' does not exist');
152
-		}
153
-
154
-	}
155
-
156
-
157
-	/**
158
-	 * Mark am attribute as updated
159
-	 * @param string $attribute the name of the attribute
160
-	 * @since 7.0.0
161
-	 */
162
-	protected function markFieldUpdated($attribute){
163
-		$this->_updatedFields[$attribute] = true;
164
-	}
165
-
166
-
167
-	/**
168
-	 * Transform a database columnname to a property 
169
-	 * @param string $columnName the name of the column
170
-	 * @return string the property name
171
-	 * @since 7.0.0
172
-	 */
173
-	public function columnToProperty($columnName){
174
-		$parts = explode('_', $columnName);
175
-		$property = null;
176
-
177
-		foreach($parts as $part){
178
-			if($property === null){
179
-				$property = $part;
180
-			} else {
181
-				$property .= ucfirst($part);
182
-			}
183
-		}
184
-
185
-		return $property;
186
-	}
187
-
188
-
189
-	/**
190
-	 * Transform a property to a database column name
191
-	 * @param string $property the name of the property
192
-	 * @return string the column name
193
-	 * @since 7.0.0
194
-	 */
195
-	public function propertyToColumn($property){
196
-		$parts = preg_split('/(?=[A-Z])/', $property);
197
-		$column = null;
198
-
199
-		foreach($parts as $part){
200
-			if($column === null){
201
-				$column = $part;
202
-			} else {
203
-				$column .= '_' . lcfirst($part);
204
-			}
205
-		}
206
-
207
-		return $column;
208
-	}
209
-
210
-
211
-	/**
212
-	 * @return array array of updated fields for update query
213
-	 * @since 7.0.0
214
-	 */
215
-	public function getUpdatedFields(){
216
-		return $this->_updatedFields;
217
-	}
218
-
219
-
220
-	/**
221
-	 * Adds type information for a field so that its automatically casted to
222
-	 * that value once its being returned from the database
223
-	 * @param string $fieldName the name of the attribute
224
-	 * @param string $type the type which will be used to call settype()
225
-	 * @since 7.0.0
226
-	 */
227
-	protected function addType($fieldName, $type){
228
-		$this->_fieldTypes[$fieldName] = $type;
229
-	}
230
-
231
-
232
-	/**
233
-	 * Slugify the value of a given attribute
234
-	 * Warning: This doesn't result in a unique value
235
-	 * @param string $attributeName the name of the attribute, which value should be slugified
236
-	 * @return string slugified value
237
-	 * @since 7.0.0
238
-	 */
239
-	public function slugify($attributeName){
240
-		// toSlug should only work for existing attributes
241
-		if(property_exists($this, $attributeName)){
242
-			$value = $this->$attributeName;
243
-			// replace everything except alphanumeric with a single '-'
244
-			$value = preg_replace('/[^A-Za-z0-9]+/', '-', $value);
245
-			$value = strtolower($value);
246
-			// trim '-'
247
-			return trim($value, '-');
248
-		} else {
249
-			throw new \BadFunctionCallException($attributeName .
250
-				' is not a valid attribute');
251
-		}
252
-	}
88
+    /**
89
+     * Marks the entity as clean needed for setting the id after the insertion
90
+     * @since 7.0.0
91
+     */
92
+    public function resetUpdatedFields(){
93
+        $this->_updatedFields = array();
94
+    }
95
+
96
+    /**
97
+     * Generic setter for properties
98
+     * @since 7.0.0
99
+     */
100
+    protected function setter($name, $args) {
101
+        // setters should only work for existing attributes
102
+        if(property_exists($this, $name)){
103
+            if($this->$name === $args[0]) {
104
+                return;
105
+            }
106
+            $this->markFieldUpdated($name);
107
+
108
+            // if type definition exists, cast to correct type
109
+            if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
110
+                settype($args[0], $this->_fieldTypes[$name]);
111
+            }
112
+            $this->$name = $args[0];
113
+
114
+        } else {
115
+            throw new \BadFunctionCallException($name . 
116
+                ' is not a valid attribute');
117
+        }
118
+    }
119
+
120
+    /**
121
+     * Generic getter for properties
122
+     * @since 7.0.0
123
+     */
124
+    protected function getter($name) {
125
+        // getters should only work for existing attributes
126
+        if(property_exists($this, $name)){
127
+            return $this->$name;
128
+        } else {
129
+            throw new \BadFunctionCallException($name . 
130
+                ' is not a valid attribute');
131
+        }
132
+    }
133
+
134
+
135
+    /**
136
+     * Each time a setter is called, push the part after set
137
+     * into an array: for instance setId will save Id in the 
138
+     * updated fields array so it can be easily used to create the
139
+     * getter method
140
+     * @since 7.0.0
141
+     */
142
+    public function __call($methodName, $args){
143
+        $attr = lcfirst( substr($methodName, 3) );
144
+
145
+        if(strpos($methodName, 'set') === 0){
146
+            $this->setter($attr, $args);
147
+        } elseif(strpos($methodName, 'get') === 0) {
148
+            return $this->getter($attr);
149
+        } else {
150
+            throw new \BadFunctionCallException($methodName . 
151
+                    ' does not exist');
152
+        }
153
+
154
+    }
155
+
156
+
157
+    /**
158
+     * Mark am attribute as updated
159
+     * @param string $attribute the name of the attribute
160
+     * @since 7.0.0
161
+     */
162
+    protected function markFieldUpdated($attribute){
163
+        $this->_updatedFields[$attribute] = true;
164
+    }
165
+
166
+
167
+    /**
168
+     * Transform a database columnname to a property 
169
+     * @param string $columnName the name of the column
170
+     * @return string the property name
171
+     * @since 7.0.0
172
+     */
173
+    public function columnToProperty($columnName){
174
+        $parts = explode('_', $columnName);
175
+        $property = null;
176
+
177
+        foreach($parts as $part){
178
+            if($property === null){
179
+                $property = $part;
180
+            } else {
181
+                $property .= ucfirst($part);
182
+            }
183
+        }
184
+
185
+        return $property;
186
+    }
187
+
188
+
189
+    /**
190
+     * Transform a property to a database column name
191
+     * @param string $property the name of the property
192
+     * @return string the column name
193
+     * @since 7.0.0
194
+     */
195
+    public function propertyToColumn($property){
196
+        $parts = preg_split('/(?=[A-Z])/', $property);
197
+        $column = null;
198
+
199
+        foreach($parts as $part){
200
+            if($column === null){
201
+                $column = $part;
202
+            } else {
203
+                $column .= '_' . lcfirst($part);
204
+            }
205
+        }
206
+
207
+        return $column;
208
+    }
209
+
210
+
211
+    /**
212
+     * @return array array of updated fields for update query
213
+     * @since 7.0.0
214
+     */
215
+    public function getUpdatedFields(){
216
+        return $this->_updatedFields;
217
+    }
218
+
219
+
220
+    /**
221
+     * Adds type information for a field so that its automatically casted to
222
+     * that value once its being returned from the database
223
+     * @param string $fieldName the name of the attribute
224
+     * @param string $type the type which will be used to call settype()
225
+     * @since 7.0.0
226
+     */
227
+    protected function addType($fieldName, $type){
228
+        $this->_fieldTypes[$fieldName] = $type;
229
+    }
230
+
231
+
232
+    /**
233
+     * Slugify the value of a given attribute
234
+     * Warning: This doesn't result in a unique value
235
+     * @param string $attributeName the name of the attribute, which value should be slugified
236
+     * @return string slugified value
237
+     * @since 7.0.0
238
+     */
239
+    public function slugify($attributeName){
240
+        // toSlug should only work for existing attributes
241
+        if(property_exists($this, $attributeName)){
242
+            $value = $this->$attributeName;
243
+            // replace everything except alphanumeric with a single '-'
244
+            $value = preg_replace('/[^A-Za-z0-9]+/', '-', $value);
245
+            $value = strtolower($value);
246
+            // trim '-'
247
+            return trim($value, '-');
248
+        } else {
249
+            throw new \BadFunctionCallException($attributeName .
250
+                ' is not a valid attribute');
251
+        }
252
+    }
253 253
 
254 254
 }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	public static function fromParams(array $params) {
48 48
 		$instance = new static();
49 49
 
50
-		foreach($params as $key => $value) {
51
-			$method = 'set' . ucfirst($key);
50
+		foreach ($params as $key => $value) {
51
+			$method = 'set'.ucfirst($key);
52 52
 			$instance->$method($value);
53 53
 		}
54 54
 
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 	 * @param array $row the row to map onto the entity
62 62
 	 * @since 7.0.0
63 63
 	 */
64
-	public static function fromRow(array $row){
64
+	public static function fromRow(array $row) {
65 65
 		$instance = new static();
66 66
 
67
-		foreach($row as $key => $value){
67
+		foreach ($row as $key => $value) {
68 68
 			$prop = ucfirst($instance->columnToProperty($key));
69
-			$setter = 'set' . $prop;
69
+			$setter = 'set'.$prop;
70 70
 			$instance->$setter($value);
71 71
 		}
72 72
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * Marks the entity as clean needed for setting the id after the insertion
90 90
 	 * @since 7.0.0
91 91
 	 */
92
-	public function resetUpdatedFields(){
92
+	public function resetUpdatedFields() {
93 93
 		$this->_updatedFields = array();
94 94
 	}
95 95
 
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	protected function setter($name, $args) {
101 101
 		// setters should only work for existing attributes
102
-		if(property_exists($this, $name)){
103
-			if($this->$name === $args[0]) {
102
+		if (property_exists($this, $name)) {
103
+			if ($this->$name === $args[0]) {
104 104
 				return;
105 105
 			}
106 106
 			$this->markFieldUpdated($name);
107 107
 
108 108
 			// if type definition exists, cast to correct type
109
-			if($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
109
+			if ($args[0] !== null && array_key_exists($name, $this->_fieldTypes)) {
110 110
 				settype($args[0], $this->_fieldTypes[$name]);
111 111
 			}
112 112
 			$this->$name = $args[0];
113 113
 
114 114
 		} else {
115
-			throw new \BadFunctionCallException($name . 
115
+			throw new \BadFunctionCallException($name. 
116 116
 				' is not a valid attribute');
117 117
 		}
118 118
 	}
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	protected function getter($name) {
125 125
 		// getters should only work for existing attributes
126
-		if(property_exists($this, $name)){
126
+		if (property_exists($this, $name)) {
127 127
 			return $this->$name;
128 128
 		} else {
129
-			throw new \BadFunctionCallException($name . 
129
+			throw new \BadFunctionCallException($name. 
130 130
 				' is not a valid attribute');
131 131
 		}
132 132
 	}
@@ -139,15 +139,15 @@  discard block
 block discarded – undo
139 139
 	 * getter method
140 140
 	 * @since 7.0.0
141 141
 	 */
142
-	public function __call($methodName, $args){
143
-		$attr = lcfirst( substr($methodName, 3) );
142
+	public function __call($methodName, $args) {
143
+		$attr = lcfirst(substr($methodName, 3));
144 144
 
145
-		if(strpos($methodName, 'set') === 0){
145
+		if (strpos($methodName, 'set') === 0) {
146 146
 			$this->setter($attr, $args);
147
-		} elseif(strpos($methodName, 'get') === 0) {
147
+		} elseif (strpos($methodName, 'get') === 0) {
148 148
 			return $this->getter($attr);
149 149
 		} else {
150
-			throw new \BadFunctionCallException($methodName . 
150
+			throw new \BadFunctionCallException($methodName. 
151 151
 					' does not exist');
152 152
 		}
153 153
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * @param string $attribute the name of the attribute
160 160
 	 * @since 7.0.0
161 161
 	 */
162
-	protected function markFieldUpdated($attribute){
162
+	protected function markFieldUpdated($attribute) {
163 163
 		$this->_updatedFields[$attribute] = true;
164 164
 	}
165 165
 
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 	 * @return string the property name
171 171
 	 * @since 7.0.0
172 172
 	 */
173
-	public function columnToProperty($columnName){
173
+	public function columnToProperty($columnName) {
174 174
 		$parts = explode('_', $columnName);
175 175
 		$property = null;
176 176
 
177
-		foreach($parts as $part){
178
-			if($property === null){
177
+		foreach ($parts as $part) {
178
+			if ($property === null) {
179 179
 				$property = $part;
180 180
 			} else {
181 181
 				$property .= ucfirst($part);
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
 	 * @return string the column name
193 193
 	 * @since 7.0.0
194 194
 	 */
195
-	public function propertyToColumn($property){
195
+	public function propertyToColumn($property) {
196 196
 		$parts = preg_split('/(?=[A-Z])/', $property);
197 197
 		$column = null;
198 198
 
199
-		foreach($parts as $part){
200
-			if($column === null){
199
+		foreach ($parts as $part) {
200
+			if ($column === null) {
201 201
 				$column = $part;
202 202
 			} else {
203
-				$column .= '_' . lcfirst($part);
203
+				$column .= '_'.lcfirst($part);
204 204
 			}
205 205
 		}
206 206
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	 * @return array array of updated fields for update query
213 213
 	 * @since 7.0.0
214 214
 	 */
215
-	public function getUpdatedFields(){
215
+	public function getUpdatedFields() {
216 216
 		return $this->_updatedFields;
217 217
 	}
218 218
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 * @param string $type the type which will be used to call settype()
225 225
 	 * @since 7.0.0
226 226
 	 */
227
-	protected function addType($fieldName, $type){
227
+	protected function addType($fieldName, $type) {
228 228
 		$this->_fieldTypes[$fieldName] = $type;
229 229
 	}
230 230
 
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 	 * @return string slugified value
237 237
 	 * @since 7.0.0
238 238
 	 */
239
-	public function slugify($attributeName){
239
+	public function slugify($attributeName) {
240 240
 		// toSlug should only work for existing attributes
241
-		if(property_exists($this, $attributeName)){
241
+		if (property_exists($this, $attributeName)) {
242 242
 			$value = $this->$attributeName;
243 243
 			// replace everything except alphanumeric with a single '-'
244 244
 			$value = preg_replace('/[^A-Za-z0-9]+/', '-', $value);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			// trim '-'
247 247
 			return trim($value, '-');
248 248
 		} else {
249
-			throw new \BadFunctionCallException($attributeName .
249
+			throw new \BadFunctionCallException($attributeName.
250 250
 				' is not a valid attribute');
251 251
 		}
252 252
 	}
Please login to merge, or discard this patch.
lib/public/appframework/http/response.php 2 patches
Indentation   +280 added lines, -280 removed lines patch added patch discarded remove patch
@@ -42,286 +42,286 @@
 block discarded – undo
42 42
  */
43 43
 class Response {
44 44
 
45
-	/**
46
-	 * Headers - defaults to ['Cache-Control' => 'no-cache, must-revalidate']
47
-	 * @var array
48
-	 */
49
-	private $headers = array(
50
-		'Cache-Control' => 'no-cache, must-revalidate'
51
-	);
52
-
53
-
54
-	/**
55
-	 * Cookies that will be need to be constructed as header
56
-	 * @var array
57
-	 */
58
-	private $cookies = array();
59
-
60
-
61
-	/**
62
-	 * HTTP status code - defaults to STATUS OK
63
-	 * @var int
64
-	 */
65
-	private $status = Http::STATUS_OK;
66
-
67
-
68
-	/**
69
-	 * Last modified date
70
-	 * @var \DateTime
71
-	 */
72
-	private $lastModified;
73
-
74
-
75
-	/**
76
-	 * ETag
77
-	 * @var string
78
-	 */
79
-	private $ETag;
80
-
81
-	/** @var ContentSecurityPolicy|null Used Content-Security-Policy */
82
-	private $contentSecurityPolicy = null;
83
-
84
-
85
-	/**
86
-	 * Caches the response
87
-	 * @param int $cacheSeconds the amount of seconds that should be cached
88
-	 * if 0 then caching will be disabled
89
-	 * @return $this
90
-	 * @since 6.0.0 - return value was added in 7.0.0
91
-	 */
92
-	public function cacheFor($cacheSeconds) {
93
-
94
-		if($cacheSeconds > 0) {
95
-			$this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds .
96
-				', must-revalidate');
97
-		} else {
98
-			$this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
99
-		}
100
-
101
-		return $this;
102
-	}
103
-
104
-	/**
105
-	 * Adds a new cookie to the response
106
-	 * @param string $name The name of the cookie
107
-	 * @param string $value The value of the cookie
108
-	 * @param \DateTime|null $expireDate Date on that the cookie should expire, if set
109
-	 * 									to null cookie will be considered as session
110
-	 * 									cookie.
111
-	 * @return $this
112
-	 * @since 8.0.0
113
-	 */
114
-	public function addCookie($name, $value, \DateTime $expireDate = null) {
115
-		$this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate);
116
-		return $this;
117
-	}
118
-
119
-
120
-	/**
121
-	 * Set the specified cookies
122
-	 * @param array $cookies array('foo' => array('value' => 'bar', 'expire' => null))
123
-	 * @return $this
124
-	 * @since 8.0.0
125
-	 */
126
-	public function setCookies(array $cookies) {
127
-		$this->cookies = $cookies;
128
-		return $this;
129
-	}
130
-
131
-
132
-	/**
133
-	 * Invalidates the specified cookie
134
-	 * @param string $name
135
-	 * @return $this
136
-	 * @since 8.0.0
137
-	 */
138
-	public function invalidateCookie($name) {
139
-		$this->addCookie($name, 'expired', new \DateTime('1971-01-01 00:00'));
140
-		return $this;
141
-	}
142
-
143
-	/**
144
-	 * Invalidates the specified cookies
145
-	 * @param array $cookieNames array('foo', 'bar')
146
-	 * @return $this
147
-	 * @since 8.0.0
148
-	 */
149
-	public function invalidateCookies(array $cookieNames) {
150
-		foreach($cookieNames as $cookieName) {
151
-			$this->invalidateCookie($cookieName);
152
-		}
153
-		return $this;
154
-	}
155
-
156
-	/**
157
-	 * Returns the cookies
158
-	 * @return array
159
-	 * @since 8.0.0
160
-	 */
161
-	public function getCookies() {
162
-		return $this->cookies;
163
-	}
164
-
165
-	/**
166
-	 * Adds a new header to the response that will be called before the render
167
-	 * function
168
-	 * @param string $name The name of the HTTP header
169
-	 * @param string $value The value, null will delete it
170
-	 * @return $this
171
-	 * @since 6.0.0 - return value was added in 7.0.0
172
-	 */
173
-	public function addHeader($name, $value) {
174
-		$name = trim($name);  // always remove leading and trailing whitespace
175
-		                      // to be able to reliably check for security
176
-		                      // headers
177
-
178
-		if(is_null($value)) {
179
-			unset($this->headers[$name]);
180
-		} else {
181
-			$this->headers[$name] = $value;
182
-		}
183
-
184
-		return $this;
185
-	}
186
-
187
-
188
-	/**
189
-	 * Set the headers
190
-	 * @param array $headers value header pairs
191
-	 * @return $this
192
-	 * @since 8.0.0
193
-	 */
194
-	public function setHeaders(array $headers) {
195
-		$this->headers = $headers;
196
-
197
-		return $this;
198
-	}
199
-
200
-
201
-	/**
202
-	 * Returns the set headers
203
-	 * @return array the headers
204
-	 * @since 6.0.0
205
-	 */
206
-	public function getHeaders() {
207
-		$mergeWith = [];
208
-
209
-		if($this->lastModified) {
210
-			$mergeWith['Last-Modified'] =
211
-				$this->lastModified->format(\DateTime::RFC2822);
212
-		}
213
-
214
-		// Build Content-Security-Policy and use default if none has been specified
215
-		if(is_null($this->contentSecurityPolicy)) {
216
-			$this->setContentSecurityPolicy(new ContentSecurityPolicy());
217
-		}
218
-		$this->headers['Content-Security-Policy'] = $this->contentSecurityPolicy->buildPolicy();
219
-
220
-		if($this->ETag) {
221
-			$mergeWith['ETag'] = '"' . $this->ETag . '"';
222
-		}
223
-
224
-		return array_merge($mergeWith, $this->headers);
225
-	}
226
-
227
-
228
-	/**
229
-	 * By default renders no output
230
-	 * @return null
231
-	 * @since 6.0.0
232
-	 */
233
-	public function render() {
234
-		return null;
235
-	}
236
-
237
-
238
-	/**
239
-	 * Set response status
240
-	 * @param int $status a HTTP status code, see also the STATUS constants
241
-	 * @return Response Reference to this object
242
-	 * @since 6.0.0 - return value was added in 7.0.0
243
-	 */
244
-	public function setStatus($status) {
245
-		$this->status = $status;
246
-
247
-		return $this;
248
-	}
249
-
250
-	/**
251
-	 * Set a Content-Security-Policy
252
-	 * @param ContentSecurityPolicy $csp Policy to set for the response object
253
-	 * @return $this
254
-	 * @since 8.1.0
255
-	 */
256
-	public function setContentSecurityPolicy(ContentSecurityPolicy $csp) {
257
-		$this->contentSecurityPolicy = $csp;
258
-		return $this;
259
-	}
260
-
261
-	/**
262
-	 * Get the currently used Content-Security-Policy
263
-	 * @return ContentSecurityPolicy|null Used Content-Security-Policy or null if
264
-	 *                                    none specified.
265
-	 * @since 8.1.0
266
-	 */
267
-	public function getContentSecurityPolicy() {
268
-		return $this->contentSecurityPolicy;
269
-	}
270
-
271
-
272
-	/**
273
-	 * Get response status
274
-	 * @since 6.0.0
275
-	 */
276
-	public function getStatus() {
277
-		return $this->status;
278
-	}
279
-
280
-
281
-	/**
282
-	 * Get the ETag
283
-	 * @return string the etag
284
-	 * @since 6.0.0
285
-	 */
286
-	public function getETag() {
287
-		return $this->ETag;
288
-	}
289
-
290
-
291
-	/**
292
-	 * Get "last modified" date
293
-	 * @return \DateTime RFC2822 formatted last modified date
294
-	 * @since 6.0.0
295
-	 */
296
-	public function getLastModified() {
297
-		return $this->lastModified;
298
-	}
299
-
300
-
301
-	/**
302
-	 * Set the ETag
303
-	 * @param string $ETag
304
-	 * @return Response Reference to this object
305
-	 * @since 6.0.0 - return value was added in 7.0.0
306
-	 */
307
-	public function setETag($ETag) {
308
-		$this->ETag = $ETag;
309
-
310
-		return $this;
311
-	}
312
-
313
-
314
-	/**
315
-	 * Set "last modified" date
316
-	 * @param \DateTime $lastModified
317
-	 * @return Response Reference to this object
318
-	 * @since 6.0.0 - return value was added in 7.0.0
319
-	 */
320
-	public function setLastModified($lastModified) {
321
-		$this->lastModified = $lastModified;
322
-
323
-		return $this;
324
-	}
45
+    /**
46
+     * Headers - defaults to ['Cache-Control' => 'no-cache, must-revalidate']
47
+     * @var array
48
+     */
49
+    private $headers = array(
50
+        'Cache-Control' => 'no-cache, must-revalidate'
51
+    );
52
+
53
+
54
+    /**
55
+     * Cookies that will be need to be constructed as header
56
+     * @var array
57
+     */
58
+    private $cookies = array();
59
+
60
+
61
+    /**
62
+     * HTTP status code - defaults to STATUS OK
63
+     * @var int
64
+     */
65
+    private $status = Http::STATUS_OK;
66
+
67
+
68
+    /**
69
+     * Last modified date
70
+     * @var \DateTime
71
+     */
72
+    private $lastModified;
73
+
74
+
75
+    /**
76
+     * ETag
77
+     * @var string
78
+     */
79
+    private $ETag;
80
+
81
+    /** @var ContentSecurityPolicy|null Used Content-Security-Policy */
82
+    private $contentSecurityPolicy = null;
83
+
84
+
85
+    /**
86
+     * Caches the response
87
+     * @param int $cacheSeconds the amount of seconds that should be cached
88
+     * if 0 then caching will be disabled
89
+     * @return $this
90
+     * @since 6.0.0 - return value was added in 7.0.0
91
+     */
92
+    public function cacheFor($cacheSeconds) {
93
+
94
+        if($cacheSeconds > 0) {
95
+            $this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds .
96
+                ', must-revalidate');
97
+        } else {
98
+            $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
99
+        }
100
+
101
+        return $this;
102
+    }
103
+
104
+    /**
105
+     * Adds a new cookie to the response
106
+     * @param string $name The name of the cookie
107
+     * @param string $value The value of the cookie
108
+     * @param \DateTime|null $expireDate Date on that the cookie should expire, if set
109
+     * 									to null cookie will be considered as session
110
+     * 									cookie.
111
+     * @return $this
112
+     * @since 8.0.0
113
+     */
114
+    public function addCookie($name, $value, \DateTime $expireDate = null) {
115
+        $this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate);
116
+        return $this;
117
+    }
118
+
119
+
120
+    /**
121
+     * Set the specified cookies
122
+     * @param array $cookies array('foo' => array('value' => 'bar', 'expire' => null))
123
+     * @return $this
124
+     * @since 8.0.0
125
+     */
126
+    public function setCookies(array $cookies) {
127
+        $this->cookies = $cookies;
128
+        return $this;
129
+    }
130
+
131
+
132
+    /**
133
+     * Invalidates the specified cookie
134
+     * @param string $name
135
+     * @return $this
136
+     * @since 8.0.0
137
+     */
138
+    public function invalidateCookie($name) {
139
+        $this->addCookie($name, 'expired', new \DateTime('1971-01-01 00:00'));
140
+        return $this;
141
+    }
142
+
143
+    /**
144
+     * Invalidates the specified cookies
145
+     * @param array $cookieNames array('foo', 'bar')
146
+     * @return $this
147
+     * @since 8.0.0
148
+     */
149
+    public function invalidateCookies(array $cookieNames) {
150
+        foreach($cookieNames as $cookieName) {
151
+            $this->invalidateCookie($cookieName);
152
+        }
153
+        return $this;
154
+    }
155
+
156
+    /**
157
+     * Returns the cookies
158
+     * @return array
159
+     * @since 8.0.0
160
+     */
161
+    public function getCookies() {
162
+        return $this->cookies;
163
+    }
164
+
165
+    /**
166
+     * Adds a new header to the response that will be called before the render
167
+     * function
168
+     * @param string $name The name of the HTTP header
169
+     * @param string $value The value, null will delete it
170
+     * @return $this
171
+     * @since 6.0.0 - return value was added in 7.0.0
172
+     */
173
+    public function addHeader($name, $value) {
174
+        $name = trim($name);  // always remove leading and trailing whitespace
175
+                                // to be able to reliably check for security
176
+                                // headers
177
+
178
+        if(is_null($value)) {
179
+            unset($this->headers[$name]);
180
+        } else {
181
+            $this->headers[$name] = $value;
182
+        }
183
+
184
+        return $this;
185
+    }
186
+
187
+
188
+    /**
189
+     * Set the headers
190
+     * @param array $headers value header pairs
191
+     * @return $this
192
+     * @since 8.0.0
193
+     */
194
+    public function setHeaders(array $headers) {
195
+        $this->headers = $headers;
196
+
197
+        return $this;
198
+    }
199
+
200
+
201
+    /**
202
+     * Returns the set headers
203
+     * @return array the headers
204
+     * @since 6.0.0
205
+     */
206
+    public function getHeaders() {
207
+        $mergeWith = [];
208
+
209
+        if($this->lastModified) {
210
+            $mergeWith['Last-Modified'] =
211
+                $this->lastModified->format(\DateTime::RFC2822);
212
+        }
213
+
214
+        // Build Content-Security-Policy and use default if none has been specified
215
+        if(is_null($this->contentSecurityPolicy)) {
216
+            $this->setContentSecurityPolicy(new ContentSecurityPolicy());
217
+        }
218
+        $this->headers['Content-Security-Policy'] = $this->contentSecurityPolicy->buildPolicy();
219
+
220
+        if($this->ETag) {
221
+            $mergeWith['ETag'] = '"' . $this->ETag . '"';
222
+        }
223
+
224
+        return array_merge($mergeWith, $this->headers);
225
+    }
226
+
227
+
228
+    /**
229
+     * By default renders no output
230
+     * @return null
231
+     * @since 6.0.0
232
+     */
233
+    public function render() {
234
+        return null;
235
+    }
236
+
237
+
238
+    /**
239
+     * Set response status
240
+     * @param int $status a HTTP status code, see also the STATUS constants
241
+     * @return Response Reference to this object
242
+     * @since 6.0.0 - return value was added in 7.0.0
243
+     */
244
+    public function setStatus($status) {
245
+        $this->status = $status;
246
+
247
+        return $this;
248
+    }
249
+
250
+    /**
251
+     * Set a Content-Security-Policy
252
+     * @param ContentSecurityPolicy $csp Policy to set for the response object
253
+     * @return $this
254
+     * @since 8.1.0
255
+     */
256
+    public function setContentSecurityPolicy(ContentSecurityPolicy $csp) {
257
+        $this->contentSecurityPolicy = $csp;
258
+        return $this;
259
+    }
260
+
261
+    /**
262
+     * Get the currently used Content-Security-Policy
263
+     * @return ContentSecurityPolicy|null Used Content-Security-Policy or null if
264
+     *                                    none specified.
265
+     * @since 8.1.0
266
+     */
267
+    public function getContentSecurityPolicy() {
268
+        return $this->contentSecurityPolicy;
269
+    }
270
+
271
+
272
+    /**
273
+     * Get response status
274
+     * @since 6.0.0
275
+     */
276
+    public function getStatus() {
277
+        return $this->status;
278
+    }
279
+
280
+
281
+    /**
282
+     * Get the ETag
283
+     * @return string the etag
284
+     * @since 6.0.0
285
+     */
286
+    public function getETag() {
287
+        return $this->ETag;
288
+    }
289
+
290
+
291
+    /**
292
+     * Get "last modified" date
293
+     * @return \DateTime RFC2822 formatted last modified date
294
+     * @since 6.0.0
295
+     */
296
+    public function getLastModified() {
297
+        return $this->lastModified;
298
+    }
299
+
300
+
301
+    /**
302
+     * Set the ETag
303
+     * @param string $ETag
304
+     * @return Response Reference to this object
305
+     * @since 6.0.0 - return value was added in 7.0.0
306
+     */
307
+    public function setETag($ETag) {
308
+        $this->ETag = $ETag;
309
+
310
+        return $this;
311
+    }
312
+
313
+
314
+    /**
315
+     * Set "last modified" date
316
+     * @param \DateTime $lastModified
317
+     * @return Response Reference to this object
318
+     * @since 6.0.0 - return value was added in 7.0.0
319
+     */
320
+    public function setLastModified($lastModified) {
321
+        $this->lastModified = $lastModified;
322
+
323
+        return $this;
324
+    }
325 325
 
326 326
 
327 327
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function cacheFor($cacheSeconds) {
93 93
 
94
-		if($cacheSeconds > 0) {
95
-			$this->addHeader('Cache-Control', 'max-age=' . $cacheSeconds .
94
+		if ($cacheSeconds > 0) {
95
+			$this->addHeader('Cache-Control', 'max-age='.$cacheSeconds.
96 96
 				', must-revalidate');
97 97
 		} else {
98 98
 			$this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * @since 8.0.0
148 148
 	 */
149 149
 	public function invalidateCookies(array $cookieNames) {
150
-		foreach($cookieNames as $cookieName) {
150
+		foreach ($cookieNames as $cookieName) {
151 151
 			$this->invalidateCookie($cookieName);
152 152
 		}
153 153
 		return $this;
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	 * @since 6.0.0 - return value was added in 7.0.0
172 172
 	 */
173 173
 	public function addHeader($name, $value) {
174
-		$name = trim($name);  // always remove leading and trailing whitespace
174
+		$name = trim($name); // always remove leading and trailing whitespace
175 175
 		                      // to be able to reliably check for security
176 176
 		                      // headers
177 177
 
178
-		if(is_null($value)) {
178
+		if (is_null($value)) {
179 179
 			unset($this->headers[$name]);
180 180
 		} else {
181 181
 			$this->headers[$name] = $value;
@@ -206,19 +206,19 @@  discard block
 block discarded – undo
206 206
 	public function getHeaders() {
207 207
 		$mergeWith = [];
208 208
 
209
-		if($this->lastModified) {
209
+		if ($this->lastModified) {
210 210
 			$mergeWith['Last-Modified'] =
211 211
 				$this->lastModified->format(\DateTime::RFC2822);
212 212
 		}
213 213
 
214 214
 		// Build Content-Security-Policy and use default if none has been specified
215
-		if(is_null($this->contentSecurityPolicy)) {
215
+		if (is_null($this->contentSecurityPolicy)) {
216 216
 			$this->setContentSecurityPolicy(new ContentSecurityPolicy());
217 217
 		}
218 218
 		$this->headers['Content-Security-Policy'] = $this->contentSecurityPolicy->buildPolicy();
219 219
 
220
-		if($this->ETag) {
221
-			$mergeWith['ETag'] = '"' . $this->ETag . '"';
220
+		if ($this->ETag) {
221
+			$mergeWith['ETag'] = '"'.$this->ETag.'"';
222 222
 		}
223 223
 
224 224
 		return array_merge($mergeWith, $this->headers);
Please login to merge, or discard this patch.
lib/public/appframework/http/datadownloadresponse.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -29,36 +29,36 @@
 block discarded – undo
29 29
  * @since 8.0.0
30 30
  */
31 31
 class DataDownloadResponse extends DownloadResponse {
32
-	/**
33
-	 * @var string
34
-	 */
35
-	private $data;
32
+    /**
33
+     * @var string
34
+     */
35
+    private $data;
36 36
 
37
-	/**
38
-	 * Creates a response that prompts the user to download the text
39
-	 * @param string $data text to be downloaded
40
-	 * @param string $filename the name that the downloaded file should have
41
-	 * @param string $contentType the mimetype that the downloaded file should have
42
-	 * @since 8.0.0
43
-	 */
44
-	public function __construct($data, $filename, $contentType) {
45
-		$this->data = $data;
46
-		parent::__construct($filename, $contentType);
47
-	}
37
+    /**
38
+     * Creates a response that prompts the user to download the text
39
+     * @param string $data text to be downloaded
40
+     * @param string $filename the name that the downloaded file should have
41
+     * @param string $contentType the mimetype that the downloaded file should have
42
+     * @since 8.0.0
43
+     */
44
+    public function __construct($data, $filename, $contentType) {
45
+        $this->data = $data;
46
+        parent::__construct($filename, $contentType);
47
+    }
48 48
 
49
-	/**
50
-	 * @param string $data
51
-	 * @since 8.0.0
52
-	 */
53
-	public function setData($data) {
54
-		$this->data = $data;
55
-	}
49
+    /**
50
+     * @param string $data
51
+     * @since 8.0.0
52
+     */
53
+    public function setData($data) {
54
+        $this->data = $data;
55
+    }
56 56
 
57
-	/**
58
-	 * @return string
59
-	 * @since 8.0.0
60
-	 */
61
-	public function render() {
62
-		return $this->data;
63
-	}
57
+    /**
58
+     * @return string
59
+     * @since 8.0.0
60
+     */
61
+    public function render() {
62
+        return $this->data;
63
+    }
64 64
 }
Please login to merge, or discard this patch.
lib/public/appframework/http/icallbackresponse.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
  */
34 34
 interface ICallbackResponse {
35 35
 
36
-	/**
37
-	 * Outputs the content that should be printed
38
-	 *
39
-	 * @param IOutput $output a small wrapper that handles output
40
-	 * @since 8.1.0
41
-	 */
42
-	function callback(IOutput $output);
36
+    /**
37
+     * Outputs the content that should be printed
38
+     *
39
+     * @param IOutput $output a small wrapper that handles output
40
+     * @since 8.1.0
41
+     */
42
+    function callback(IOutput $output);
43 43
 
44 44
 }
Please login to merge, or discard this patch.
lib/public/appframework/http/downloadresponse.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,22 +32,22 @@
 block discarded – undo
32 32
  */
33 33
 class DownloadResponse extends \OCP\AppFramework\Http\Response {
34 34
 
35
-	private $filename;
36
-	private $contentType;
37
-
38
-	/**
39
-	 * Creates a response that prompts the user to download the file
40
-	 * @param string $filename the name that the downloaded file should have
41
-	 * @param string $contentType the mimetype that the downloaded file should have
42
-	 * @since 7.0.0
43
-	 */
44
-	public function __construct($filename, $contentType) {
45
-		$this->filename = $filename;
46
-		$this->contentType = $contentType;
47
-
48
-		$this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
49
-		$this->addHeader('Content-Type', $contentType);
50
-	}
35
+    private $filename;
36
+    private $contentType;
37
+
38
+    /**
39
+     * Creates a response that prompts the user to download the file
40
+     * @param string $filename the name that the downloaded file should have
41
+     * @param string $contentType the mimetype that the downloaded file should have
42
+     * @since 7.0.0
43
+     */
44
+    public function __construct($filename, $contentType) {
45
+        $this->filename = $filename;
46
+        $this->contentType = $contentType;
47
+
48
+        $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
49
+        $this->addHeader('Content-Type', $contentType);
50
+    }
51 51
 
52 52
 
53 53
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 		$this->filename = $filename;
46 46
 		$this->contentType = $contentType;
47 47
 
48
-		$this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
48
+		$this->addHeader('Content-Disposition', 'attachment; filename="'.$filename.'"');
49 49
 		$this->addHeader('Content-Type', $contentType);
50 50
 	}
51 51
 
Please login to merge, or discard this patch.
lib/public/appframework/http/ioutput.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -31,48 +31,48 @@
 block discarded – undo
31 31
  */
32 32
 interface IOutput {
33 33
 
34
-	/**
35
-	 * @param string $out
36
-	 * @since 8.1.0
37
-	 */
38
-	public function setOutput($out);
34
+    /**
35
+     * @param string $out
36
+     * @since 8.1.0
37
+     */
38
+    public function setOutput($out);
39 39
 
40
-	/**
41
-	 * @param string $path
42
-	 *
43
-	 * @return bool false if an error occured
44
-	 * @since 8.1.0
45
-	 */
46
-	public function setReadfile($path);
40
+    /**
41
+     * @param string $path
42
+     *
43
+     * @return bool false if an error occured
44
+     * @since 8.1.0
45
+     */
46
+    public function setReadfile($path);
47 47
 
48
-	/**
49
-	 * @param string $header
50
-	 * @since 8.1.0
51
-	 */
52
-	public function setHeader($header);
48
+    /**
49
+     * @param string $header
50
+     * @since 8.1.0
51
+     */
52
+    public function setHeader($header);
53 53
 
54
-	/**
55
-	 * @return int returns the current http response code
56
-	 * @since 8.1.0
57
-	 */
58
-	public function getHttpResponseCode();
54
+    /**
55
+     * @return int returns the current http response code
56
+     * @since 8.1.0
57
+     */
58
+    public function getHttpResponseCode();
59 59
 
60
-	/**
61
-	 * @param int $code sets the http status code
62
-	 * @since 8.1.0
63
-	 */
64
-	public function setHttpResponseCode($code);
60
+    /**
61
+     * @param int $code sets the http status code
62
+     * @since 8.1.0
63
+     */
64
+    public function setHttpResponseCode($code);
65 65
 
66
-	/**
67
-	 * @param string $name
68
-	 * @param string $value
69
-	 * @param int $expire
70
-	 * @param string $path
71
-	 * @param string $domain
72
-	 * @param bool $secure
73
-	 * @param bool $httpOnly
74
-	 * @since 8.1.0
75
-	 */
76
-	public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
66
+    /**
67
+     * @param string $name
68
+     * @param string $value
69
+     * @param int $expire
70
+     * @param string $path
71
+     * @param string $domain
72
+     * @param bool $secure
73
+     * @param bool $httpOnly
74
+     * @since 8.1.0
75
+     */
76
+    public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
77 77
 
78 78
 }
Please login to merge, or discard this patch.