Passed
Push — master ( 480649...8ad1bf )
by Joas
11:47 queued 10s
created
core/Command/Background/Cron.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 namespace OC\Core\Command\Background;
27 27
 
28 28
 class Cron extends Base {
29
-	protected function getMode() {
30
-		return 'cron';
31
-	}
29
+    protected function getMode() {
30
+        return 'cron';
31
+    }
32 32
 }
Please login to merge, or discard this patch.
core/Command/Background/WebCron.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 namespace OC\Core\Command\Background;
27 27
 
28 28
 class WebCron extends Base {
29
-	protected function getMode() {
30
-		return 'webcron';
31
-	}
29
+    protected function getMode() {
30
+        return 'webcron';
31
+    }
32 32
 }
Please login to merge, or discard this patch.
core/templates/layout.guest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 									<?php p($theme->getName()); ?>
30 30
 								</h1>
31 31
 								<?php if (\OC::$server->getConfig()->getSystemValue('installed', false)
32
-									&& \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?>
32
+                                    && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?>
33 33
 									<img src="<?php p($theme->getLogo()); ?>"/>
34 34
 								<?php endif; ?>
35 35
 							</div>
Please login to merge, or discard this patch.
lib/private/Setup/AbstractDatabase.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -35,118 +35,118 @@
 block discarded – undo
35 35
 
36 36
 abstract class AbstractDatabase {
37 37
 
38
-	/** @var IL10N */
39
-	protected $trans;
40
-	/** @var string */
41
-	protected $dbUser;
42
-	/** @var string */
43
-	protected $dbPassword;
44
-	/** @var string */
45
-	protected $dbName;
46
-	/** @var string */
47
-	protected $dbHost;
48
-	/** @var string */
49
-	protected $dbPort;
50
-	/** @var string */
51
-	protected $tablePrefix;
52
-	/** @var SystemConfig */
53
-	protected $config;
54
-	/** @var ILogger */
55
-	protected $logger;
56
-	/** @var ISecureRandom */
57
-	protected $random;
38
+    /** @var IL10N */
39
+    protected $trans;
40
+    /** @var string */
41
+    protected $dbUser;
42
+    /** @var string */
43
+    protected $dbPassword;
44
+    /** @var string */
45
+    protected $dbName;
46
+    /** @var string */
47
+    protected $dbHost;
48
+    /** @var string */
49
+    protected $dbPort;
50
+    /** @var string */
51
+    protected $tablePrefix;
52
+    /** @var SystemConfig */
53
+    protected $config;
54
+    /** @var ILogger */
55
+    protected $logger;
56
+    /** @var ISecureRandom */
57
+    protected $random;
58 58
 
59
-	public function __construct(IL10N $trans, SystemConfig $config, ILogger $logger, ISecureRandom $random) {
60
-		$this->trans = $trans;
61
-		$this->config = $config;
62
-		$this->logger = $logger;
63
-		$this->random = $random;
64
-	}
59
+    public function __construct(IL10N $trans, SystemConfig $config, ILogger $logger, ISecureRandom $random) {
60
+        $this->trans = $trans;
61
+        $this->config = $config;
62
+        $this->logger = $logger;
63
+        $this->random = $random;
64
+    }
65 65
 
66
-	public function validate($config) {
67
-		$errors = [];
68
-		if (empty($config['dbuser']) && empty($config['dbname'])) {
69
-			$errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
70
-		} elseif (empty($config['dbuser'])) {
71
-			$errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
72
-		} elseif (empty($config['dbname'])) {
73
-			$errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
74
-		}
75
-		if (substr_count($config['dbname'], '.') >= 1) {
76
-			$errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]);
77
-		}
78
-		return $errors;
79
-	}
66
+    public function validate($config) {
67
+        $errors = [];
68
+        if (empty($config['dbuser']) && empty($config['dbname'])) {
69
+            $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
70
+        } elseif (empty($config['dbuser'])) {
71
+            $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
72
+        } elseif (empty($config['dbname'])) {
73
+            $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
74
+        }
75
+        if (substr_count($config['dbname'], '.') >= 1) {
76
+            $errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]);
77
+        }
78
+        return $errors;
79
+    }
80 80
 
81
-	public function initialize($config) {
82
-		$dbUser = $config['dbuser'];
83
-		$dbPass = $config['dbpass'];
84
-		$dbName = $config['dbname'];
85
-		$dbHost = !empty($config['dbhost']) ? $config['dbhost'] : 'localhost';
86
-		$dbPort = !empty($config['dbport']) ? $config['dbport'] : '';
87
-		$dbTablePrefix = isset($config['dbtableprefix']) ? $config['dbtableprefix'] : 'oc_';
81
+    public function initialize($config) {
82
+        $dbUser = $config['dbuser'];
83
+        $dbPass = $config['dbpass'];
84
+        $dbName = $config['dbname'];
85
+        $dbHost = !empty($config['dbhost']) ? $config['dbhost'] : 'localhost';
86
+        $dbPort = !empty($config['dbport']) ? $config['dbport'] : '';
87
+        $dbTablePrefix = isset($config['dbtableprefix']) ? $config['dbtableprefix'] : 'oc_';
88 88
 
89
-		$this->config->setValues([
90
-			'dbname' => $dbName,
91
-			'dbhost' => $dbHost,
92
-			'dbport' => $dbPort,
93
-			'dbtableprefix' => $dbTablePrefix,
94
-		]);
89
+        $this->config->setValues([
90
+            'dbname' => $dbName,
91
+            'dbhost' => $dbHost,
92
+            'dbport' => $dbPort,
93
+            'dbtableprefix' => $dbTablePrefix,
94
+        ]);
95 95
 
96
-		$this->dbUser = $dbUser;
97
-		$this->dbPassword = $dbPass;
98
-		$this->dbName = $dbName;
99
-		$this->dbHost = $dbHost;
100
-		$this->dbPort = $dbPort;
101
-		$this->tablePrefix = $dbTablePrefix;
102
-	}
96
+        $this->dbUser = $dbUser;
97
+        $this->dbPassword = $dbPass;
98
+        $this->dbName = $dbName;
99
+        $this->dbHost = $dbHost;
100
+        $this->dbPort = $dbPort;
101
+        $this->tablePrefix = $dbTablePrefix;
102
+    }
103 103
 
104
-	/**
105
-	 * @param array $configOverwrite
106
-	 * @return \OC\DB\Connection
107
-	 */
108
-	protected function connect(array $configOverwrite = []) {
109
-		$connectionParams = [
110
-			'host' => $this->dbHost,
111
-			'user' => $this->dbUser,
112
-			'password' => $this->dbPassword,
113
-			'tablePrefix' => $this->tablePrefix,
114
-			'dbname' => $this->dbName
115
-		];
104
+    /**
105
+     * @param array $configOverwrite
106
+     * @return \OC\DB\Connection
107
+     */
108
+    protected function connect(array $configOverwrite = []) {
109
+        $connectionParams = [
110
+            'host' => $this->dbHost,
111
+            'user' => $this->dbUser,
112
+            'password' => $this->dbPassword,
113
+            'tablePrefix' => $this->tablePrefix,
114
+            'dbname' => $this->dbName
115
+        ];
116 116
 
117
-		// adding port support through installer
118
-		if (!empty($this->dbPort)) {
119
-			if (ctype_digit($this->dbPort)) {
120
-				$connectionParams['port'] = $this->dbPort;
121
-			} else {
122
-				$connectionParams['unix_socket'] = $this->dbPort;
123
-			}
124
-		} elseif (strpos($this->dbHost, ':')) {
125
-			// Host variable may carry a port or socket.
126
-			list($host, $portOrSocket) = explode(':', $this->dbHost, 2);
127
-			if (ctype_digit($portOrSocket)) {
128
-				$connectionParams['port'] = $portOrSocket;
129
-			} else {
130
-				$connectionParams['unix_socket'] = $portOrSocket;
131
-			}
132
-			$connectionParams['host'] = $host;
133
-		}
117
+        // adding port support through installer
118
+        if (!empty($this->dbPort)) {
119
+            if (ctype_digit($this->dbPort)) {
120
+                $connectionParams['port'] = $this->dbPort;
121
+            } else {
122
+                $connectionParams['unix_socket'] = $this->dbPort;
123
+            }
124
+        } elseif (strpos($this->dbHost, ':')) {
125
+            // Host variable may carry a port or socket.
126
+            list($host, $portOrSocket) = explode(':', $this->dbHost, 2);
127
+            if (ctype_digit($portOrSocket)) {
128
+                $connectionParams['port'] = $portOrSocket;
129
+            } else {
130
+                $connectionParams['unix_socket'] = $portOrSocket;
131
+            }
132
+            $connectionParams['host'] = $host;
133
+        }
134 134
 
135
-		$connectionParams = array_merge($connectionParams, $configOverwrite);
136
-		$cf = new ConnectionFactory($this->config);
137
-		return $cf->getConnection($this->config->getValue('dbtype', 'sqlite'), $connectionParams);
138
-	}
135
+        $connectionParams = array_merge($connectionParams, $configOverwrite);
136
+        $cf = new ConnectionFactory($this->config);
137
+        return $cf->getConnection($this->config->getValue('dbtype', 'sqlite'), $connectionParams);
138
+    }
139 139
 
140
-	/**
141
-	 * @param string $userName
142
-	 */
143
-	abstract public function setupDatabase($userName);
140
+    /**
141
+     * @param string $userName
142
+     */
143
+    abstract public function setupDatabase($userName);
144 144
 
145
-	public function runMigrations() {
146
-		if (!is_dir(\OC::$SERVERROOT."/core/Migrations")) {
147
-			return;
148
-		}
149
-		$ms = new MigrationService('core', \OC::$server->getDatabaseConnection());
150
-		$ms->migrate();
151
-	}
145
+    public function runMigrations() {
146
+        if (!is_dir(\OC::$SERVERROOT."/core/Migrations")) {
147
+            return;
148
+        }
149
+        $ms = new MigrationService('core', \OC::$server->getDatabaseConnection());
150
+        $ms->migrate();
151
+    }
152 152
 }
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/FunctionBuilder/PgSqlFunctionBuilder.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 use OC\DB\QueryBuilder\QueryFunction;
25 25
 
26 26
 class PgSqlFunctionBuilder extends FunctionBuilder {
27
-	public function concat($x, $y) {
28
-		return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')');
29
-	}
27
+    public function concat($x, $y) {
28
+        return new QueryFunction('(' . $this->helper->quoteColumnName($x) . ' || ' . $this->helper->quoteColumnName($y) . ')');
29
+    }
30 30
 }
Please login to merge, or discard this patch.
lib/private/Files/ObjectStore/S3.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 use OCP\Files\ObjectStore\IObjectStore;
25 25
 
26 26
 class S3 implements IObjectStore {
27
-	use S3ConnectionTrait;
28
-	use S3ObjectTrait;
27
+    use S3ConnectionTrait;
28
+    use S3ObjectTrait;
29 29
 
30
-	public function __construct($parameters) {
31
-		$this->parseParams($parameters);
32
-	}
30
+    public function __construct($parameters) {
31
+        $this->parseParams($parameters);
32
+    }
33 33
 
34
-	/**
35
-	 * @return string the container or bucket name where objects are stored
36
-	 * @since 7.0.0
37
-	 */
38
-	public function getStorageId() {
39
-		return $this->id;
40
-	}
34
+    /**
35
+     * @return string the container or bucket name where objects are stored
36
+     * @since 7.0.0
37
+     */
38
+    public function getStorageId() {
39
+        return $this->id;
40
+    }
41 41
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,43 +11,43 @@
 block discarded – undo
11 11
 use OCP\Share\IManager;
12 12
 
13 13
 class OCSShareAPIMiddleware extends Middleware {
14
-	/** @var IManager */
15
-	private $shareManager;
16
-	/** @var IL10N */
17
-	private $l;
14
+    /** @var IManager */
15
+    private $shareManager;
16
+    /** @var IL10N */
17
+    private $l;
18 18
 
19
-	public function __construct(IManager $shareManager,
20
-								IL10N $l) {
21
-		$this->shareManager = $shareManager;
22
-		$this->l = $l;
23
-	}
19
+    public function __construct(IManager $shareManager,
20
+                                IL10N $l) {
21
+        $this->shareManager = $shareManager;
22
+        $this->l = $l;
23
+    }
24 24
 
25
-	/**
26
-	 * @param Controller $controller
27
-	 * @param string $methodName
28
-	 *
29
-	 * @throws OCSNotFoundException
30
-	 */
31
-	public function beforeController($controller, $methodName) {
32
-		if ($controller instanceof ShareAPIController) {
33
-			if (!$this->shareManager->shareApiEnabled()) {
34
-				throw new OCSNotFoundException($this->l->t('Share API is disabled'));
35
-			}
36
-		}
37
-	}
25
+    /**
26
+     * @param Controller $controller
27
+     * @param string $methodName
28
+     *
29
+     * @throws OCSNotFoundException
30
+     */
31
+    public function beforeController($controller, $methodName) {
32
+        if ($controller instanceof ShareAPIController) {
33
+            if (!$this->shareManager->shareApiEnabled()) {
34
+                throw new OCSNotFoundException($this->l->t('Share API is disabled'));
35
+            }
36
+        }
37
+    }
38 38
 
39
-	/**
40
-	 * @param Controller $controller
41
-	 * @param string $methodName
42
-	 * @param Response $response
43
-	 * @return Response
44
-	 */
45
-	public function afterController($controller, $methodName, Response $response) {
46
-		if ($controller instanceof ShareAPIController) {
47
-			/** @var ShareAPIController $controller */
48
-			$controller->cleanup();
49
-		}
39
+    /**
40
+     * @param Controller $controller
41
+     * @param string $methodName
42
+     * @param Response $response
43
+     * @return Response
44
+     */
45
+    public function afterController($controller, $methodName, Response $response) {
46
+        if ($controller instanceof ShareAPIController) {
47
+            /** @var ShareAPIController $controller */
48
+            $controller->cleanup();
49
+        }
50 50
 
51
-		return $response;
52
-	}
51
+        return $response;
52
+    }
53 53
 }
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php 1 patch
Indentation   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -33,161 +33,161 @@
 block discarded – undo
33 33
 
34 34
 class OCIExpressionBuilder extends ExpressionBuilder {
35 35
 
36
-	/**
37
-	 * @param mixed $column
38
-	 * @param mixed|null $type
39
-	 * @return array|IQueryFunction|string
40
-	 */
41
-	protected function prepareColumn($column, $type) {
42
-		if ($type === IQueryBuilder::PARAM_STR && !is_array($column) && !($column instanceof IParameter) && !($column instanceof ILiteral)) {
43
-			$column = $this->castColumn($column, $type);
44
-		} else {
45
-			$column = $this->helper->quoteColumnNames($column);
46
-		}
47
-		return $column;
48
-	}
49
-
50
-	/**
51
-	 * @inheritdoc
52
-	 */
53
-	public function comparison($x, $operator, $y, $type = null) {
54
-		$x = $this->prepareColumn($x, $type);
55
-		$y = $this->prepareColumn($y, $type);
56
-
57
-		return $this->expressionBuilder->comparison($x, $operator, $y);
58
-	}
59
-
60
-	/**
61
-	 * @inheritdoc
62
-	 */
63
-	public function eq($x, $y, $type = null) {
64
-		$x = $this->prepareColumn($x, $type);
65
-		$y = $this->prepareColumn($y, $type);
66
-
67
-		return $this->expressionBuilder->eq($x, $y);
68
-	}
69
-
70
-	/**
71
-	 * @inheritdoc
72
-	 */
73
-	public function neq($x, $y, $type = null) {
74
-		$x = $this->prepareColumn($x, $type);
75
-		$y = $this->prepareColumn($y, $type);
76
-
77
-		return $this->expressionBuilder->neq($x, $y);
78
-	}
79
-
80
-	/**
81
-	 * @inheritdoc
82
-	 */
83
-	public function lt($x, $y, $type = null) {
84
-		$x = $this->prepareColumn($x, $type);
85
-		$y = $this->prepareColumn($y, $type);
86
-
87
-		return $this->expressionBuilder->lt($x, $y);
88
-	}
89
-
90
-	/**
91
-	 * @inheritdoc
92
-	 */
93
-	public function lte($x, $y, $type = null) {
94
-		$x = $this->prepareColumn($x, $type);
95
-		$y = $this->prepareColumn($y, $type);
96
-
97
-		return $this->expressionBuilder->lte($x, $y);
98
-	}
99
-
100
-	/**
101
-	 * @inheritdoc
102
-	 */
103
-	public function gt($x, $y, $type = null) {
104
-		$x = $this->prepareColumn($x, $type);
105
-		$y = $this->prepareColumn($y, $type);
106
-
107
-		return $this->expressionBuilder->gt($x, $y);
108
-	}
109
-
110
-	/**
111
-	 * @inheritdoc
112
-	 */
113
-	public function gte($x, $y, $type = null) {
114
-		$x = $this->prepareColumn($x, $type);
115
-		$y = $this->prepareColumn($y, $type);
116
-
117
-		return $this->expressionBuilder->gte($x, $y);
118
-	}
119
-
120
-	/**
121
-	 * @inheritdoc
122
-	 */
123
-	public function in($x, $y, $type = null) {
124
-		$x = $this->prepareColumn($x, $type);
125
-		$y = $this->prepareColumn($y, $type);
126
-
127
-		return $this->expressionBuilder->in($x, $y);
128
-	}
129
-
130
-	/**
131
-	 * @inheritdoc
132
-	 */
133
-	public function notIn($x, $y, $type = null) {
134
-		$x = $this->prepareColumn($x, $type);
135
-		$y = $this->prepareColumn($y, $type);
136
-
137
-		return $this->expressionBuilder->notIn($x, $y);
138
-	}
139
-
140
-	/**
141
-	 * Creates a $x = '' statement, because Oracle needs a different check
142
-	 *
143
-	 * @param string $x The field in string format to be inspected by the comparison.
144
-	 * @return string
145
-	 * @since 13.0.0
146
-	 */
147
-	public function emptyString($x) {
148
-		return $this->isNull($x);
149
-	}
150
-
151
-	/**
152
-	 * Creates a `$x <> ''` statement, because Oracle needs a different check
153
-	 *
154
-	 * @param string $x The field in string format to be inspected by the comparison.
155
-	 * @return string
156
-	 * @since 13.0.0
157
-	 */
158
-	public function nonEmptyString($x) {
159
-		return $this->isNotNull($x);
160
-	}
161
-
162
-	/**
163
-	 * Returns a IQueryFunction that casts the column to the given type
164
-	 *
165
-	 * @param string $column
166
-	 * @param mixed $type One of IQueryBuilder::PARAM_*
167
-	 * @return IQueryFunction
168
-	 */
169
-	public function castColumn($column, $type) {
170
-		if ($type === IQueryBuilder::PARAM_STR) {
171
-			$column = $this->helper->quoteColumnName($column);
172
-			return new QueryFunction('to_char(' . $column . ')');
173
-		}
174
-
175
-		return parent::castColumn($column, $type);
176
-	}
177
-
178
-	/**
179
-	 * @inheritdoc
180
-	 */
181
-	public function like($x, $y, $type = null) {
182
-		return parent::like($x, $y, $type) . " ESCAPE '\\'";
183
-	}
184
-
185
-	/**
186
-	 * @inheritdoc
187
-	 */
188
-	public function iLike($x, $y, $type = null) {
189
-		$x = $this->helper->quoteColumnName($x);
190
-		$y = $this->helper->quoteColumnName($y);
191
-		return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')');
192
-	}
36
+    /**
37
+     * @param mixed $column
38
+     * @param mixed|null $type
39
+     * @return array|IQueryFunction|string
40
+     */
41
+    protected function prepareColumn($column, $type) {
42
+        if ($type === IQueryBuilder::PARAM_STR && !is_array($column) && !($column instanceof IParameter) && !($column instanceof ILiteral)) {
43
+            $column = $this->castColumn($column, $type);
44
+        } else {
45
+            $column = $this->helper->quoteColumnNames($column);
46
+        }
47
+        return $column;
48
+    }
49
+
50
+    /**
51
+     * @inheritdoc
52
+     */
53
+    public function comparison($x, $operator, $y, $type = null) {
54
+        $x = $this->prepareColumn($x, $type);
55
+        $y = $this->prepareColumn($y, $type);
56
+
57
+        return $this->expressionBuilder->comparison($x, $operator, $y);
58
+    }
59
+
60
+    /**
61
+     * @inheritdoc
62
+     */
63
+    public function eq($x, $y, $type = null) {
64
+        $x = $this->prepareColumn($x, $type);
65
+        $y = $this->prepareColumn($y, $type);
66
+
67
+        return $this->expressionBuilder->eq($x, $y);
68
+    }
69
+
70
+    /**
71
+     * @inheritdoc
72
+     */
73
+    public function neq($x, $y, $type = null) {
74
+        $x = $this->prepareColumn($x, $type);
75
+        $y = $this->prepareColumn($y, $type);
76
+
77
+        return $this->expressionBuilder->neq($x, $y);
78
+    }
79
+
80
+    /**
81
+     * @inheritdoc
82
+     */
83
+    public function lt($x, $y, $type = null) {
84
+        $x = $this->prepareColumn($x, $type);
85
+        $y = $this->prepareColumn($y, $type);
86
+
87
+        return $this->expressionBuilder->lt($x, $y);
88
+    }
89
+
90
+    /**
91
+     * @inheritdoc
92
+     */
93
+    public function lte($x, $y, $type = null) {
94
+        $x = $this->prepareColumn($x, $type);
95
+        $y = $this->prepareColumn($y, $type);
96
+
97
+        return $this->expressionBuilder->lte($x, $y);
98
+    }
99
+
100
+    /**
101
+     * @inheritdoc
102
+     */
103
+    public function gt($x, $y, $type = null) {
104
+        $x = $this->prepareColumn($x, $type);
105
+        $y = $this->prepareColumn($y, $type);
106
+
107
+        return $this->expressionBuilder->gt($x, $y);
108
+    }
109
+
110
+    /**
111
+     * @inheritdoc
112
+     */
113
+    public function gte($x, $y, $type = null) {
114
+        $x = $this->prepareColumn($x, $type);
115
+        $y = $this->prepareColumn($y, $type);
116
+
117
+        return $this->expressionBuilder->gte($x, $y);
118
+    }
119
+
120
+    /**
121
+     * @inheritdoc
122
+     */
123
+    public function in($x, $y, $type = null) {
124
+        $x = $this->prepareColumn($x, $type);
125
+        $y = $this->prepareColumn($y, $type);
126
+
127
+        return $this->expressionBuilder->in($x, $y);
128
+    }
129
+
130
+    /**
131
+     * @inheritdoc
132
+     */
133
+    public function notIn($x, $y, $type = null) {
134
+        $x = $this->prepareColumn($x, $type);
135
+        $y = $this->prepareColumn($y, $type);
136
+
137
+        return $this->expressionBuilder->notIn($x, $y);
138
+    }
139
+
140
+    /**
141
+     * Creates a $x = '' statement, because Oracle needs a different check
142
+     *
143
+     * @param string $x The field in string format to be inspected by the comparison.
144
+     * @return string
145
+     * @since 13.0.0
146
+     */
147
+    public function emptyString($x) {
148
+        return $this->isNull($x);
149
+    }
150
+
151
+    /**
152
+     * Creates a `$x <> ''` statement, because Oracle needs a different check
153
+     *
154
+     * @param string $x The field in string format to be inspected by the comparison.
155
+     * @return string
156
+     * @since 13.0.0
157
+     */
158
+    public function nonEmptyString($x) {
159
+        return $this->isNotNull($x);
160
+    }
161
+
162
+    /**
163
+     * Returns a IQueryFunction that casts the column to the given type
164
+     *
165
+     * @param string $column
166
+     * @param mixed $type One of IQueryBuilder::PARAM_*
167
+     * @return IQueryFunction
168
+     */
169
+    public function castColumn($column, $type) {
170
+        if ($type === IQueryBuilder::PARAM_STR) {
171
+            $column = $this->helper->quoteColumnName($column);
172
+            return new QueryFunction('to_char(' . $column . ')');
173
+        }
174
+
175
+        return parent::castColumn($column, $type);
176
+    }
177
+
178
+    /**
179
+     * @inheritdoc
180
+     */
181
+    public function like($x, $y, $type = null) {
182
+        return parent::like($x, $y, $type) . " ESCAPE '\\'";
183
+    }
184
+
185
+    /**
186
+     * @inheritdoc
187
+     */
188
+    public function iLike($x, $y, $type = null) {
189
+        $x = $this->helper->quoteColumnName($x);
190
+        $y = $this->helper->quoteColumnName($y);
191
+        return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')');
192
+    }
193 193
 }
Please login to merge, or discard this patch.
lib/private/Lockdown/Filesystem/NullStorage.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -25,155 +25,155 @@
 block discarded – undo
25 25
 use OCP\Files\Storage\IStorage;
26 26
 
27 27
 class NullStorage extends Common {
28
-	public function __construct($parameters) {
29
-		parent::__construct($parameters);
30
-	}
28
+    public function __construct($parameters) {
29
+        parent::__construct($parameters);
30
+    }
31 31
 
32
-	public function getId() {
33
-		return 'null';
34
-	}
32
+    public function getId() {
33
+        return 'null';
34
+    }
35 35
 
36
-	public function mkdir($path) {
37
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
38
-	}
36
+    public function mkdir($path) {
37
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
38
+    }
39 39
 
40
-	public function rmdir($path) {
41
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
42
-	}
40
+    public function rmdir($path) {
41
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
42
+    }
43 43
 
44
-	public function opendir($path) {
45
-		return new IteratorDirectory([]);
46
-	}
44
+    public function opendir($path) {
45
+        return new IteratorDirectory([]);
46
+    }
47 47
 
48
-	public function is_dir($path) {
49
-		return $path === '';
50
-	}
48
+    public function is_dir($path) {
49
+        return $path === '';
50
+    }
51 51
 
52
-	public function is_file($path) {
53
-		return false;
54
-	}
52
+    public function is_file($path) {
53
+        return false;
54
+    }
55 55
 
56
-	public function stat($path) {
57
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
58
-	}
56
+    public function stat($path) {
57
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
58
+    }
59 59
 
60
-	public function filetype($path) {
61
-		return ($path === '') ? 'dir' : false;
62
-	}
60
+    public function filetype($path) {
61
+        return ($path === '') ? 'dir' : false;
62
+    }
63 63
 
64
-	public function filesize($path) {
65
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
66
-	}
64
+    public function filesize($path) {
65
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
66
+    }
67 67
 
68
-	public function isCreatable($path) {
69
-		return false;
70
-	}
68
+    public function isCreatable($path) {
69
+        return false;
70
+    }
71 71
 
72
-	public function isReadable($path) {
73
-		return $path === '';
74
-	}
72
+    public function isReadable($path) {
73
+        return $path === '';
74
+    }
75 75
 
76
-	public function isUpdatable($path) {
77
-		return false;
78
-	}
76
+    public function isUpdatable($path) {
77
+        return false;
78
+    }
79 79
 
80
-	public function isDeletable($path) {
81
-		return false;
82
-	}
80
+    public function isDeletable($path) {
81
+        return false;
82
+    }
83 83
 
84
-	public function isSharable($path) {
85
-		return false;
86
-	}
84
+    public function isSharable($path) {
85
+        return false;
86
+    }
87 87
 
88
-	public function getPermissions($path) {
89
-		return null;
90
-	}
88
+    public function getPermissions($path) {
89
+        return null;
90
+    }
91 91
 
92
-	public function file_exists($path) {
93
-		return $path === '';
94
-	}
92
+    public function file_exists($path) {
93
+        return $path === '';
94
+    }
95 95
 
96
-	public function filemtime($path) {
97
-		return ($path === '') ? time() : false;
98
-	}
96
+    public function filemtime($path) {
97
+        return ($path === '') ? time() : false;
98
+    }
99 99
 
100
-	public function file_get_contents($path) {
101
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
102
-	}
100
+    public function file_get_contents($path) {
101
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
102
+    }
103 103
 
104
-	public function file_put_contents($path, $data) {
105
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
106
-	}
104
+    public function file_put_contents($path, $data) {
105
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
106
+    }
107 107
 
108
-	public function unlink($path) {
109
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
110
-	}
108
+    public function unlink($path) {
109
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
110
+    }
111 111
 
112
-	public function rename($path1, $path2) {
113
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
114
-	}
112
+    public function rename($path1, $path2) {
113
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
114
+    }
115 115
 
116
-	public function copy($path1, $path2) {
117
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
118
-	}
116
+    public function copy($path1, $path2) {
117
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
118
+    }
119 119
 
120
-	public function fopen($path, $mode) {
121
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
122
-	}
120
+    public function fopen($path, $mode) {
121
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
122
+    }
123 123
 
124
-	public function getMimeType($path) {
125
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
126
-	}
124
+    public function getMimeType($path) {
125
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
126
+    }
127 127
 
128
-	public function hash($type, $path, $raw = false) {
129
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
130
-	}
128
+    public function hash($type, $path, $raw = false) {
129
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
130
+    }
131 131
 
132
-	public function free_space($path) {
133
-		return FileInfo::SPACE_UNKNOWN;
134
-	}
132
+    public function free_space($path) {
133
+        return FileInfo::SPACE_UNKNOWN;
134
+    }
135 135
 
136
-	public function touch($path, $mtime = null) {
137
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
138
-	}
136
+    public function touch($path, $mtime = null) {
137
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
138
+    }
139 139
 
140
-	public function getLocalFile($path) {
141
-		return false;
142
-	}
140
+    public function getLocalFile($path) {
141
+        return false;
142
+    }
143 143
 
144
-	public function hasUpdated($path, $time) {
145
-		return false;
146
-	}
144
+    public function hasUpdated($path, $time) {
145
+        return false;
146
+    }
147 147
 
148
-	public function getETag($path) {
149
-		return '';
150
-	}
148
+    public function getETag($path) {
149
+        return '';
150
+    }
151 151
 
152
-	public function isLocal() {
153
-		return false;
154
-	}
152
+    public function isLocal() {
153
+        return false;
154
+    }
155 155
 
156
-	public function getDirectDownload($path) {
157
-		return false;
158
-	}
156
+    public function getDirectDownload($path) {
157
+        return false;
158
+    }
159 159
 
160
-	public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
161
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
162
-	}
160
+    public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
161
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
162
+    }
163 163
 
164
-	public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
165
-		throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
166
-	}
164
+    public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
165
+        throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
166
+    }
167 167
 
168
-	public function test() {
169
-		return true;
170
-	}
168
+    public function test() {
169
+        return true;
170
+    }
171 171
 
172
-	public function getOwner($path) {
173
-		return null;
174
-	}
172
+    public function getOwner($path) {
173
+        return null;
174
+    }
175 175
 
176
-	public function getCache($path = '', $storage = null) {
177
-		return new NullCache();
178
-	}
176
+    public function getCache($path = '', $storage = null) {
177
+        return new NullCache();
178
+    }
179 179
 }
Please login to merge, or discard this patch.