Passed
Push — master ( 02306d...9f9b89 )
by Morris
14:24 queued 10s
created
lib/public/AppFramework/ApiController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * defaults to 'Authorization, Content-Type, Accept'
56 56
      * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS
57 57
      * request should be cached, defaults to 1728000 seconds
58
-	 * @since 7.0.0
58
+     * @since 7.0.0
59 59
      */
60 60
     public function __construct($appName,
61 61
                                 IRequest $request,
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @NoAdminRequired
77 77
      * @NoCSRFRequired
78 78
      * @PublicPage
79
-	 * @since 7.0.0
79
+     * @since 7.0.0
80 80
      */
81 81
     public function preflightedCors() {
82 82
         if(isset($this->request->server['HTTP_ORIGIN'])) {
Please login to merge, or discard this patch.
lib/public/AppFramework/Db/Entity.php 1 patch
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.
lib/public/Share/IProviderFactory.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,32 +33,32 @@
 block discarded – undo
33 33
  */
34 34
 interface IProviderFactory {
35 35
 
36
-	/**
37
-	 * IProviderFactory constructor.
38
-	 * @param IServerContainer $serverContainer
39
-	 * @since 9.0.0
40
-	 */
41
-	public function __construct(IServerContainer $serverContainer);
36
+    /**
37
+     * IProviderFactory constructor.
38
+     * @param IServerContainer $serverContainer
39
+     * @since 9.0.0
40
+     */
41
+    public function __construct(IServerContainer $serverContainer);
42 42
 
43
-	/**
44
-	 * @param string $id
45
-	 * @return IShareProvider
46
-	 * @throws ProviderException
47
-	 * @since 9.0.0
48
-	 */
49
-	public function getProvider($id);
43
+    /**
44
+     * @param string $id
45
+     * @return IShareProvider
46
+     * @throws ProviderException
47
+     * @since 9.0.0
48
+     */
49
+    public function getProvider($id);
50 50
 
51
-	/**
52
-	 * @param int $shareType
53
-	 * @return IShareProvider
54
-	 * @throws ProviderException
55
-	 * @since 9.0.0
56
-	 */
57
-	public function getProviderForType($shareType);
51
+    /**
52
+     * @param int $shareType
53
+     * @return IShareProvider
54
+     * @throws ProviderException
55
+     * @since 9.0.0
56
+     */
57
+    public function getProviderForType($shareType);
58 58
 
59
-	/**
60
-	 * @return IShareProvider[]
61
-	 * @since 11.0.0
62
-	 */
63
-	public function getAllProviders();
59
+    /**
60
+     * @return IShareProvider[]
61
+     * @since 11.0.0
62
+     */
63
+    public function getAllProviders();
64 64
 }
Please login to merge, or discard this patch.
lib/public/SabrePluginEvent.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -33,65 +33,65 @@
 block discarded – undo
33 33
  */
34 34
 class SabrePluginEvent extends Event {
35 35
 
36
-	/** @var int */
37
-	protected $statusCode;
36
+    /** @var int */
37
+    protected $statusCode;
38 38
 
39
-	/** @var string */
40
-	protected $message;
39
+    /** @var string */
40
+    protected $message;
41 41
 
42
-	/** @var Server */
43
-	protected $server;
42
+    /** @var Server */
43
+    protected $server;
44 44
 
45
-	/**
46
-	 * @since 8.2.0
47
-	 */
48
-	public function __construct($server = null) {
49
-		$this->message = '';
50
-		$this->statusCode = Http::STATUS_OK;
51
-		$this->server = $server;
52
-	}
45
+    /**
46
+     * @since 8.2.0
47
+     */
48
+    public function __construct($server = null) {
49
+        $this->message = '';
50
+        $this->statusCode = Http::STATUS_OK;
51
+        $this->server = $server;
52
+    }
53 53
 
54
-	/**
55
-	 * @param int $statusCode
56
-	 * @return self
57
-	 * @since 8.2.0
58
-	 */
59
-	public function setStatusCode($statusCode) {
60
-		$this->statusCode = (int) $statusCode;
61
-		return $this;
62
-	}
54
+    /**
55
+     * @param int $statusCode
56
+     * @return self
57
+     * @since 8.2.0
58
+     */
59
+    public function setStatusCode($statusCode) {
60
+        $this->statusCode = (int) $statusCode;
61
+        return $this;
62
+    }
63 63
 
64
-	/**
65
-	 * @param string $message
66
-	 * @return self
67
-	 * @since 8.2.0
68
-	 */
69
-	public function setMessage($message) {
70
-		$this->message = (string) $message;
71
-		return $this;
72
-	}
64
+    /**
65
+     * @param string $message
66
+     * @return self
67
+     * @since 8.2.0
68
+     */
69
+    public function setMessage($message) {
70
+        $this->message = (string) $message;
71
+        return $this;
72
+    }
73 73
 
74
-	/**
75
-	 * @return int
76
-	 * @since 8.2.0
77
-	 */
78
-	public function getStatusCode() {
79
-		return $this->statusCode;
80
-	}
74
+    /**
75
+     * @return int
76
+     * @since 8.2.0
77
+     */
78
+    public function getStatusCode() {
79
+        return $this->statusCode;
80
+    }
81 81
 
82
-	/**
83
-	 * @return string
84
-	 * @since 8.2.0
85
-	 */
86
-	public function getMessage() {
87
-		return $this->message;
88
-	}
82
+    /**
83
+     * @return string
84
+     * @since 8.2.0
85
+     */
86
+    public function getMessage() {
87
+        return $this->message;
88
+    }
89 89
 
90
-	/**
91
-	 * @return null|Server
92
-	 * @since 9.0.0
93
-	 */
94
-	public function getServer() {
95
-		return $this->server;
96
-	}
90
+    /**
91
+     * @return null|Server
92
+     * @since 9.0.0
93
+     */
94
+    public function getServer() {
95
+        return $this->server;
96
+    }
97 97
 }
Please login to merge, or discard this patch.
lib/public/RichObjectStrings/IValidator.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
  */
30 30
 interface IValidator {
31 31
 
32
-	/**
33
-	 * @param string $subject
34
-	 * @param array[] $parameters
35
-	 * @throws InvalidObjectExeption
36
-	 * @since 11.0.0
37
-	 */
38
-	public function validate($subject, array $parameters);
32
+    /**
33
+     * @param string $subject
34
+     * @param array[] $parameters
35
+     * @throws InvalidObjectExeption
36
+     * @since 11.0.0
37
+     */
38
+    public function validate($subject, array $parameters);
39 39
 }
Please login to merge, or discard this patch.
lib/public/DB/QueryBuilder/IQueryFunction.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
  * @since 8.2.0
27 27
  */
28 28
 interface IQueryFunction {
29
-	/**
30
-	 * @return string
31
-	 * @since 8.2.0
32
-	 */
33
-	public function __toString();
29
+    /**
30
+     * @return string
31
+     * @since 8.2.0
32
+     */
33
+    public function __toString();
34 34
 }
Please login to merge, or discard this patch.
lib/public/DB/QueryBuilder/ILiteral.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
  * @since 8.2.0
27 27
  */
28 28
 interface ILiteral {
29
-	/**
30
-	 * @return string
31
-	 * @since 8.2.0
32
-	 */
33
-	public function __toString();
29
+    /**
30
+     * @return string
31
+     * @since 8.2.0
32
+     */
33
+    public function __toString();
34 34
 }
Please login to merge, or discard this patch.
lib/public/DB/QueryBuilder/ICompositeExpression.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -28,39 +28,39 @@
 block discarded – undo
28 28
  * @since 8.2.0
29 29
  */
30 30
 interface ICompositeExpression {
31
-	/**
32
-	 * Adds multiple parts to composite expression.
33
-	 *
34
-	 * @param array $parts
35
-	 *
36
-	 * @return ICompositeExpression
37
-	 * @since 8.2.0
38
-	 */
39
-	public function addMultiple(array $parts = array());
31
+    /**
32
+     * Adds multiple parts to composite expression.
33
+     *
34
+     * @param array $parts
35
+     *
36
+     * @return ICompositeExpression
37
+     * @since 8.2.0
38
+     */
39
+    public function addMultiple(array $parts = array());
40 40
 
41
-	/**
42
-	 * Adds an expression to composite expression.
43
-	 *
44
-	 * @param mixed $part
45
-	 *
46
-	 * @return ICompositeExpression
47
-	 * @since 8.2.0
48
-	 */
49
-	public function add($part);
41
+    /**
42
+     * Adds an expression to composite expression.
43
+     *
44
+     * @param mixed $part
45
+     *
46
+     * @return ICompositeExpression
47
+     * @since 8.2.0
48
+     */
49
+    public function add($part);
50 50
 
51
-	/**
52
-	 * Retrieves the amount of expressions on composite expression.
53
-	 *
54
-	 * @return integer
55
-	 * @since 8.2.0
56
-	 */
57
-	public function count();
51
+    /**
52
+     * Retrieves the amount of expressions on composite expression.
53
+     *
54
+     * @return integer
55
+     * @since 8.2.0
56
+     */
57
+    public function count();
58 58
 
59
-	/**
60
-	 * Returns the type of this composite expression (AND/OR).
61
-	 *
62
-	 * @return string
63
-	 * @since 8.2.0
64
-	 */
65
-	public function getType();
59
+    /**
60
+     * Returns the type of this composite expression (AND/OR).
61
+     *
62
+     * @return string
63
+     * @since 8.2.0
64
+     */
65
+    public function getType();
66 66
 }
Please login to merge, or discard this patch.
lib/public/DB/QueryBuilder/IParameter.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
  * @since 8.2.0
27 27
  */
28 28
 interface IParameter {
29
-	/**
30
-	 * @return string
31
-	 * @since 8.2.0
32
-	 */
33
-	public function __toString();
29
+    /**
30
+     * @return string
31
+     * @since 8.2.0
32
+     */
33
+    public function __toString();
34 34
 }
Please login to merge, or discard this patch.