Passed
Push — master ( da9ad9...c724eb )
by Roeland
13:33 queued 01:55
created
lib/private/DB/OracleConnection.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -26,80 +26,80 @@
 block discarded – undo
26 26
 namespace OC\DB;
27 27
 
28 28
 class OracleConnection extends Connection {
29
-	/**
30
-	 * Quote the keys of the array
31
-	 */
32
-	private function quoteKeys(array $data) {
33
-		$return = [];
34
-		$c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter();
35
-		foreach ($data as $key => $value) {
36
-			if ($key[0] !== $c) {
37
-				$return[$this->quoteIdentifier($key)] = $value;
38
-			} else {
39
-				$return[$key] = $value;
40
-			}
41
-		}
42
-		return $return;
43
-	}
29
+    /**
30
+     * Quote the keys of the array
31
+     */
32
+    private function quoteKeys(array $data) {
33
+        $return = [];
34
+        $c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter();
35
+        foreach ($data as $key => $value) {
36
+            if ($key[0] !== $c) {
37
+                $return[$this->quoteIdentifier($key)] = $value;
38
+            } else {
39
+                $return[$key] = $value;
40
+            }
41
+        }
42
+        return $return;
43
+    }
44 44
 
45
-	/**
46
-	 * {@inheritDoc}
47
-	 */
48
-	public function insert($tableName, array $data, array $types = []) {
49
-		if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
50
-			$tableName = $this->quoteIdentifier($tableName);
51
-		}
52
-		$data = $this->quoteKeys($data);
53
-		return parent::insert($tableName, $data, $types);
54
-	}
45
+    /**
46
+     * {@inheritDoc}
47
+     */
48
+    public function insert($tableName, array $data, array $types = []) {
49
+        if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
50
+            $tableName = $this->quoteIdentifier($tableName);
51
+        }
52
+        $data = $this->quoteKeys($data);
53
+        return parent::insert($tableName, $data, $types);
54
+    }
55 55
 
56
-	/**
57
-	 * {@inheritDoc}
58
-	 */
59
-	public function update($tableName, array $data, array $identifier, array $types = []) {
60
-		if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
61
-			$tableName = $this->quoteIdentifier($tableName);
62
-		}
63
-		$data = $this->quoteKeys($data);
64
-		$identifier = $this->quoteKeys($identifier);
65
-		return parent::update($tableName, $data, $identifier, $types);
66
-	}
56
+    /**
57
+     * {@inheritDoc}
58
+     */
59
+    public function update($tableName, array $data, array $identifier, array $types = []) {
60
+        if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
61
+            $tableName = $this->quoteIdentifier($tableName);
62
+        }
63
+        $data = $this->quoteKeys($data);
64
+        $identifier = $this->quoteKeys($identifier);
65
+        return parent::update($tableName, $data, $identifier, $types);
66
+    }
67 67
 
68
-	/**
69
-	 * {@inheritDoc}
70
-	 */
71
-	public function delete($tableExpression, array $identifier, array $types = []) {
72
-		if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
73
-			$tableExpression = $this->quoteIdentifier($tableExpression);
74
-		}
75
-		$identifier = $this->quoteKeys($identifier);
76
-		return parent::delete($tableExpression, $identifier);
77
-	}
68
+    /**
69
+     * {@inheritDoc}
70
+     */
71
+    public function delete($tableExpression, array $identifier, array $types = []) {
72
+        if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
73
+            $tableExpression = $this->quoteIdentifier($tableExpression);
74
+        }
75
+        $identifier = $this->quoteKeys($identifier);
76
+        return parent::delete($tableExpression, $identifier);
77
+    }
78 78
 
79
-	/**
80
-	 * Drop a table from the database if it exists
81
-	 *
82
-	 * @param string $table table name without the prefix
83
-	 */
84
-	public function dropTable($table) {
85
-		$table = $this->tablePrefix . trim($table);
86
-		$table = $this->quoteIdentifier($table);
87
-		$schema = $this->getSchemaManager();
88
-		if ($schema->tablesExist([$table])) {
89
-			$schema->dropTable($table);
90
-		}
91
-	}
79
+    /**
80
+     * Drop a table from the database if it exists
81
+     *
82
+     * @param string $table table name without the prefix
83
+     */
84
+    public function dropTable($table) {
85
+        $table = $this->tablePrefix . trim($table);
86
+        $table = $this->quoteIdentifier($table);
87
+        $schema = $this->getSchemaManager();
88
+        if ($schema->tablesExist([$table])) {
89
+            $schema->dropTable($table);
90
+        }
91
+    }
92 92
 
93
-	/**
94
-	 * Check if a table exists
95
-	 *
96
-	 * @param string $table table name without the prefix
97
-	 * @return bool
98
-	 */
99
-	public function tableExists($table) {
100
-		$table = $this->tablePrefix . trim($table);
101
-		$table = $this->quoteIdentifier($table);
102
-		$schema = $this->getSchemaManager();
103
-		return $schema->tablesExist([$table]);
104
-	}
93
+    /**
94
+     * Check if a table exists
95
+     *
96
+     * @param string $table table name without the prefix
97
+     * @return bool
98
+     */
99
+    public function tableExists($table) {
100
+        $table = $this->tablePrefix . trim($table);
101
+        $table = $this->quoteIdentifier($table);
102
+        $schema = $this->getSchemaManager();
103
+        return $schema->tablesExist([$table]);
104
+    }
105 105
 }
Please login to merge, or discard this patch.
lib/private/DB/MDB2SchemaWriter.php 1 patch
Indentation   +138 added lines, -138 removed lines patch added patch discarded remove patch
@@ -31,150 +31,150 @@
 block discarded – undo
31 31
 
32 32
 class MDB2SchemaWriter {
33 33
 
34
-	/**
35
-	 * @param string $file
36
-	 * @param \OC\DB\Connection $conn
37
-	 * @return bool
38
-	 */
39
-	public static function saveSchemaToFile($file, \OC\DB\Connection $conn) {
40
-		$config = \OC::$server->getConfig();
34
+    /**
35
+     * @param string $file
36
+     * @param \OC\DB\Connection $conn
37
+     * @return bool
38
+     */
39
+    public static function saveSchemaToFile($file, \OC\DB\Connection $conn) {
40
+        $config = \OC::$server->getConfig();
41 41
 
42
-		$xml = new \SimpleXMLElement('<database/>');
43
-		$xml->addChild('name', $config->getSystemValue('dbname', 'owncloud'));
44
-		$xml->addChild('create', 'true');
45
-		$xml->addChild('overwrite', 'false');
46
-		if ($config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false)) {
47
-			$xml->addChild('charset', 'utf8mb4');
48
-		} else {
49
-			$xml->addChild('charset', 'utf8');
50
-		}
42
+        $xml = new \SimpleXMLElement('<database/>');
43
+        $xml->addChild('name', $config->getSystemValue('dbname', 'owncloud'));
44
+        $xml->addChild('create', 'true');
45
+        $xml->addChild('overwrite', 'false');
46
+        if ($config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false)) {
47
+            $xml->addChild('charset', 'utf8mb4');
48
+        } else {
49
+            $xml->addChild('charset', 'utf8');
50
+        }
51 51
 
52
-		// FIX ME: bloody work around
53
-		if ($config->getSystemValue('dbtype', 'sqlite') === 'oci') {
54
-			$filterExpression = '/^"' . preg_quote($conn->getPrefix()) . '/';
55
-		} else {
56
-			$filterExpression = '/^' . preg_quote($conn->getPrefix()) . '/';
57
-		}
58
-		$conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
52
+        // FIX ME: bloody work around
53
+        if ($config->getSystemValue('dbtype', 'sqlite') === 'oci') {
54
+            $filterExpression = '/^"' . preg_quote($conn->getPrefix()) . '/';
55
+        } else {
56
+            $filterExpression = '/^' . preg_quote($conn->getPrefix()) . '/';
57
+        }
58
+        $conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
59 59
 
60
-		foreach ($conn->getSchemaManager()->listTables() as $table) {
61
-			self::saveTable($table, $xml->addChild('table'));
62
-		}
63
-		file_put_contents($file, $xml->asXML());
64
-		return true;
65
-	}
60
+        foreach ($conn->getSchemaManager()->listTables() as $table) {
61
+            self::saveTable($table, $xml->addChild('table'));
62
+        }
63
+        file_put_contents($file, $xml->asXML());
64
+        return true;
65
+    }
66 66
 
67
-	/**
68
-	 * @param \Doctrine\DBAL\Schema\Table $table
69
-	 * @param \SimpleXMLElement $xml
70
-	 */
71
-	private static function saveTable($table, $xml) {
72
-		$xml->addChild('name', $table->getName());
73
-		$declaration = $xml->addChild('declaration');
74
-		foreach ($table->getColumns() as $column) {
75
-			self::saveColumn($column, $declaration->addChild('field'));
76
-		}
77
-		foreach ($table->getIndexes() as $index) {
78
-			if ($index->getName() == 'PRIMARY') {
79
-				$autoincrement = false;
80
-				foreach ($index->getColumns() as $column) {
81
-					if ($table->getColumn($column)->getAutoincrement()) {
82
-						$autoincrement = true;
83
-					}
84
-				}
85
-				if ($autoincrement) {
86
-					continue;
87
-				}
88
-			}
89
-			self::saveIndex($index, $declaration->addChild('index'));
90
-		}
91
-	}
67
+    /**
68
+     * @param \Doctrine\DBAL\Schema\Table $table
69
+     * @param \SimpleXMLElement $xml
70
+     */
71
+    private static function saveTable($table, $xml) {
72
+        $xml->addChild('name', $table->getName());
73
+        $declaration = $xml->addChild('declaration');
74
+        foreach ($table->getColumns() as $column) {
75
+            self::saveColumn($column, $declaration->addChild('field'));
76
+        }
77
+        foreach ($table->getIndexes() as $index) {
78
+            if ($index->getName() == 'PRIMARY') {
79
+                $autoincrement = false;
80
+                foreach ($index->getColumns() as $column) {
81
+                    if ($table->getColumn($column)->getAutoincrement()) {
82
+                        $autoincrement = true;
83
+                    }
84
+                }
85
+                if ($autoincrement) {
86
+                    continue;
87
+                }
88
+            }
89
+            self::saveIndex($index, $declaration->addChild('index'));
90
+        }
91
+    }
92 92
 
93
-	/**
94
-	 * @param Column $column
95
-	 * @param \SimpleXMLElement $xml
96
-	 */
97
-	private static function saveColumn($column, $xml) {
98
-		$xml->addChild('name', $column->getName());
99
-		switch ($column->getType()) {
100
-			case 'SmallInt':
101
-			case 'Integer':
102
-			case 'BigInt':
103
-				$xml->addChild('type', 'integer');
104
-				$default = $column->getDefault();
105
-				if (is_null($default) && $column->getAutoincrement()) {
106
-					$default = '0';
107
-				}
108
-				$xml->addChild('default', $default);
109
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
110
-				if ($column->getAutoincrement()) {
111
-					$xml->addChild('autoincrement', '1');
112
-				}
113
-				if ($column->getUnsigned()) {
114
-					$xml->addChild('unsigned', 'true');
115
-				}
116
-				$length = '4';
117
-				if ($column->getType() == 'SmallInt') {
118
-					$length = '2';
119
-				} elseif ($column->getType() == 'BigInt') {
120
-					$length = '8';
121
-				}
122
-				$xml->addChild('length', $length);
123
-				break;
124
-			case 'String':
125
-				$xml->addChild('type', 'text');
126
-				$default = trim($column->getDefault());
127
-				if ($default === '') {
128
-					$default = false;
129
-				}
130
-				$xml->addChild('default', $default);
131
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
132
-				$xml->addChild('length', $column->getLength());
133
-				break;
134
-			case 'Text':
135
-				$xml->addChild('type', 'clob');
136
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
137
-				break;
138
-			case 'Decimal':
139
-				$xml->addChild('type', 'decimal');
140
-				$xml->addChild('default', $column->getDefault());
141
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
142
-				$xml->addChild('length', '15');
143
-				break;
144
-			case 'Boolean':
145
-				$xml->addChild('type', 'integer');
146
-				$xml->addChild('default', $column->getDefault());
147
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
148
-				$xml->addChild('length', '1');
149
-				break;
150
-			case 'DateTime':
151
-				$xml->addChild('type', 'timestamp');
152
-				$xml->addChild('default', $column->getDefault());
153
-				$xml->addChild('notnull', self::toBool($column->getNotnull()));
154
-				break;
93
+    /**
94
+     * @param Column $column
95
+     * @param \SimpleXMLElement $xml
96
+     */
97
+    private static function saveColumn($column, $xml) {
98
+        $xml->addChild('name', $column->getName());
99
+        switch ($column->getType()) {
100
+            case 'SmallInt':
101
+            case 'Integer':
102
+            case 'BigInt':
103
+                $xml->addChild('type', 'integer');
104
+                $default = $column->getDefault();
105
+                if (is_null($default) && $column->getAutoincrement()) {
106
+                    $default = '0';
107
+                }
108
+                $xml->addChild('default', $default);
109
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
110
+                if ($column->getAutoincrement()) {
111
+                    $xml->addChild('autoincrement', '1');
112
+                }
113
+                if ($column->getUnsigned()) {
114
+                    $xml->addChild('unsigned', 'true');
115
+                }
116
+                $length = '4';
117
+                if ($column->getType() == 'SmallInt') {
118
+                    $length = '2';
119
+                } elseif ($column->getType() == 'BigInt') {
120
+                    $length = '8';
121
+                }
122
+                $xml->addChild('length', $length);
123
+                break;
124
+            case 'String':
125
+                $xml->addChild('type', 'text');
126
+                $default = trim($column->getDefault());
127
+                if ($default === '') {
128
+                    $default = false;
129
+                }
130
+                $xml->addChild('default', $default);
131
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
132
+                $xml->addChild('length', $column->getLength());
133
+                break;
134
+            case 'Text':
135
+                $xml->addChild('type', 'clob');
136
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
137
+                break;
138
+            case 'Decimal':
139
+                $xml->addChild('type', 'decimal');
140
+                $xml->addChild('default', $column->getDefault());
141
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
142
+                $xml->addChild('length', '15');
143
+                break;
144
+            case 'Boolean':
145
+                $xml->addChild('type', 'integer');
146
+                $xml->addChild('default', $column->getDefault());
147
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
148
+                $xml->addChild('length', '1');
149
+                break;
150
+            case 'DateTime':
151
+                $xml->addChild('type', 'timestamp');
152
+                $xml->addChild('default', $column->getDefault());
153
+                $xml->addChild('notnull', self::toBool($column->getNotnull()));
154
+                break;
155 155
 
156
-		}
157
-	}
156
+        }
157
+    }
158 158
 
159
-	/**
160
-	 * @param Index $index
161
-	 * @param \SimpleXMLElement $xml
162
-	 */
163
-	private static function saveIndex($index, $xml) {
164
-		$xml->addChild('name', $index->getName());
165
-		if ($index->isPrimary()) {
166
-			$xml->addChild('primary', 'true');
167
-		} elseif ($index->isUnique()) {
168
-			$xml->addChild('unique', 'true');
169
-		}
170
-		foreach ($index->getColumns() as $column) {
171
-			$field = $xml->addChild('field');
172
-			$field->addChild('name', $column);
173
-			$field->addChild('sorting', 'ascending');
174
-		}
175
-	}
159
+    /**
160
+     * @param Index $index
161
+     * @param \SimpleXMLElement $xml
162
+     */
163
+    private static function saveIndex($index, $xml) {
164
+        $xml->addChild('name', $index->getName());
165
+        if ($index->isPrimary()) {
166
+            $xml->addChild('primary', 'true');
167
+        } elseif ($index->isUnique()) {
168
+            $xml->addChild('unique', 'true');
169
+        }
170
+        foreach ($index->getColumns() as $column) {
171
+            $field = $xml->addChild('field');
172
+            $field->addChild('name', $column);
173
+            $field->addChild('sorting', 'ascending');
174
+        }
175
+    }
176 176
 
177
-	private static function toBool($bool) {
178
-		return $bool ? 'true' : 'false';
179
-	}
177
+    private static function toBool($bool) {
178
+        return $bool ? 'true' : 'false';
179
+    }
180 180
 }
Please login to merge, or discard this patch.
lib/private/DB/SQLiteMigrator.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -32,62 +32,62 @@
 block discarded – undo
32 32
 
33 33
 class SQLiteMigrator extends Migrator {
34 34
 
35
-	/**
36
-	 * @param \Doctrine\DBAL\Schema\Schema $targetSchema
37
-	 * @throws \OC\DB\MigrationException
38
-	 *
39
-	 * For sqlite we simple make a copy of the entire database, and test the migration on that
40
-	 */
41
-	public function checkMigrate(\Doctrine\DBAL\Schema\Schema $targetSchema) {
42
-		$dbFile = $this->connection->getDatabase();
43
-		$tmpFile = $this->buildTempDatabase();
44
-		copy($dbFile, $tmpFile);
35
+    /**
36
+     * @param \Doctrine\DBAL\Schema\Schema $targetSchema
37
+     * @throws \OC\DB\MigrationException
38
+     *
39
+     * For sqlite we simple make a copy of the entire database, and test the migration on that
40
+     */
41
+    public function checkMigrate(\Doctrine\DBAL\Schema\Schema $targetSchema) {
42
+        $dbFile = $this->connection->getDatabase();
43
+        $tmpFile = $this->buildTempDatabase();
44
+        copy($dbFile, $tmpFile);
45 45
 
46
-		$connectionParams = [
47
-			'path' => $tmpFile,
48
-			'driver' => 'pdo_sqlite',
49
-		];
50
-		$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
51
-		try {
52
-			$this->applySchema($targetSchema, $conn);
53
-			$conn->close();
54
-			unlink($tmpFile);
55
-		} catch (DBALException $e) {
56
-			$conn->close();
57
-			unlink($tmpFile);
58
-			throw new MigrationException('', $e->getMessage());
59
-		}
60
-	}
46
+        $connectionParams = [
47
+            'path' => $tmpFile,
48
+            'driver' => 'pdo_sqlite',
49
+        ];
50
+        $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
51
+        try {
52
+            $this->applySchema($targetSchema, $conn);
53
+            $conn->close();
54
+            unlink($tmpFile);
55
+        } catch (DBALException $e) {
56
+            $conn->close();
57
+            unlink($tmpFile);
58
+            throw new MigrationException('', $e->getMessage());
59
+        }
60
+    }
61 61
 
62
-	/**
63
-	 * @return string
64
-	 */
65
-	private function buildTempDatabase() {
66
-		$dataDir = $this->config->getSystemValue("datadirectory", \OC::$SERVERROOT . '/data');
67
-		$tmpFile = uniqid("oc_");
68
-		return "$dataDir/$tmpFile.db";
69
-	}
62
+    /**
63
+     * @return string
64
+     */
65
+    private function buildTempDatabase() {
66
+        $dataDir = $this->config->getSystemValue("datadirectory", \OC::$SERVERROOT . '/data');
67
+        $tmpFile = uniqid("oc_");
68
+        return "$dataDir/$tmpFile.db";
69
+    }
70 70
 
71
-	/**
72
-	 * @param Schema $targetSchema
73
-	 * @param \Doctrine\DBAL\Connection $connection
74
-	 * @return \Doctrine\DBAL\Schema\SchemaDiff
75
-	 */
76
-	protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
77
-		$platform = $connection->getDatabasePlatform();
78
-		$platform->registerDoctrineTypeMapping('tinyint unsigned', 'integer');
79
-		$platform->registerDoctrineTypeMapping('smallint unsigned', 'integer');
80
-		$platform->registerDoctrineTypeMapping('varchar ', 'string');
71
+    /**
72
+     * @param Schema $targetSchema
73
+     * @param \Doctrine\DBAL\Connection $connection
74
+     * @return \Doctrine\DBAL\Schema\SchemaDiff
75
+     */
76
+    protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
77
+        $platform = $connection->getDatabasePlatform();
78
+        $platform->registerDoctrineTypeMapping('tinyint unsigned', 'integer');
79
+        $platform->registerDoctrineTypeMapping('smallint unsigned', 'integer');
80
+        $platform->registerDoctrineTypeMapping('varchar ', 'string');
81 81
 
82
-		// with sqlite autoincrement columns is of type integer
83
-		foreach ($targetSchema->getTables() as $table) {
84
-			foreach ($table->getColumns() as $column) {
85
-				if ($column->getType() instanceof BigIntType && $column->getAutoincrement()) {
86
-					$column->setType(Type::getType('integer'));
87
-				}
88
-			}
89
-		}
82
+        // with sqlite autoincrement columns is of type integer
83
+        foreach ($targetSchema->getTables() as $table) {
84
+            foreach ($table->getColumns() as $column) {
85
+                if ($column->getType() instanceof BigIntType && $column->getAutoincrement()) {
86
+                    $column->setType(Type::getType('integer'));
87
+                }
88
+            }
89
+        }
90 90
 
91
-		return parent::getDiff($targetSchema, $connection);
92
-	}
91
+        return parent::getDiff($targetSchema, $connection);
92
+    }
93 93
 }
Please login to merge, or discard this patch.
lib/private/Command/FileAccess.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
25 25
 use OCP\IUser;
26 26
 
27 27
 trait FileAccess {
28
-	protected function setupFS(IUser $user) {
29
-		\OC_Util::setupFS($user->getUID());
30
-	}
28
+    protected function setupFS(IUser $user) {
29
+        \OC_Util::setupFS($user->getUID());
30
+    }
31 31
 
32
-	protected function getUserFolder(IUser $user) {
33
-		$this->setupFS($user);
34
-		return \OC::$server->getUserFolder($user->getUID());
35
-	}
32
+    protected function getUserFolder(IUser $user) {
33
+        $this->setupFS($user);
34
+        return \OC::$server->getUserFolder($user->getUID());
35
+    }
36 36
 }
Please login to merge, or discard this patch.
lib/private/Memcache/NullCache.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -27,47 +27,47 @@
 block discarded – undo
27 27
 namespace OC\Memcache;
28 28
 
29 29
 class NullCache extends Cache implements \OCP\IMemcache {
30
-	public function get($key) {
31
-		return null;
32
-	}
30
+    public function get($key) {
31
+        return null;
32
+    }
33 33
 
34
-	public function set($key, $value, $ttl = 0) {
35
-		return true;
36
-	}
34
+    public function set($key, $value, $ttl = 0) {
35
+        return true;
36
+    }
37 37
 
38
-	public function hasKey($key) {
39
-		return false;
40
-	}
38
+    public function hasKey($key) {
39
+        return false;
40
+    }
41 41
 
42
-	public function remove($key) {
43
-		return true;
44
-	}
42
+    public function remove($key) {
43
+        return true;
44
+    }
45 45
 
46
-	public function add($key, $value, $ttl = 0) {
47
-		return true;
48
-	}
46
+    public function add($key, $value, $ttl = 0) {
47
+        return true;
48
+    }
49 49
 
50
-	public function inc($key, $step = 1) {
51
-		return true;
52
-	}
50
+    public function inc($key, $step = 1) {
51
+        return true;
52
+    }
53 53
 
54
-	public function dec($key, $step = 1) {
55
-		return true;
56
-	}
54
+    public function dec($key, $step = 1) {
55
+        return true;
56
+    }
57 57
 
58
-	public function cas($key, $old, $new) {
59
-		return true;
60
-	}
58
+    public function cas($key, $old, $new) {
59
+        return true;
60
+    }
61 61
 
62
-	public function cad($key, $old) {
63
-		return true;
64
-	}
62
+    public function cad($key, $old) {
63
+        return true;
64
+    }
65 65
 
66
-	public function clear($prefix = '') {
67
-		return true;
68
-	}
66
+    public function clear($prefix = '') {
67
+        return true;
68
+    }
69 69
 
70
-	public static function isAvailable() {
71
-		return true;
72
-	}
70
+    public static function isAvailable() {
71
+        return true;
72
+    }
73 73
 }
Please login to merge, or discard this patch.
lib/private/Contacts/ContactsMenu/Entry.php 1 patch
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -29,140 +29,140 @@
 block discarded – undo
29 29
 
30 30
 class Entry implements IEntry {
31 31
 
32
-	/** @var string|int|null */
33
-	private $id = null;
34
-
35
-	/** @var string */
36
-	private $fullName = '';
37
-
38
-	/** @var string[] */
39
-	private $emailAddresses = [];
40
-
41
-	/** @var string|null */
42
-	private $avatar;
43
-
44
-	/** @var IAction[] */
45
-	private $actions = [];
46
-
47
-	/** @var array */
48
-	private $properties = [];
49
-
50
-	/**
51
-	 * @param string $id
52
-	 */
53
-	public function setId($id) {
54
-		$this->id = $id;
55
-	}
56
-
57
-	/**
58
-	 * @param string $displayName
59
-	 */
60
-	public function setFullName($displayName) {
61
-		$this->fullName = $displayName;
62
-	}
63
-
64
-	/**
65
-	 * @return string
66
-	 */
67
-	public function getFullName() {
68
-		return $this->fullName;
69
-	}
70
-
71
-	/**
72
-	 * @param string $address
73
-	 */
74
-	public function addEMailAddress($address) {
75
-		$this->emailAddresses[] = $address;
76
-	}
77
-
78
-	/**
79
-	 * @return string
80
-	 */
81
-	public function getEMailAddresses() {
82
-		return $this->emailAddresses;
83
-	}
84
-
85
-	/**
86
-	 * @param string $avatar
87
-	 */
88
-	public function setAvatar($avatar) {
89
-		$this->avatar = $avatar;
90
-	}
91
-
92
-	/**
93
-	 * @return string
94
-	 */
95
-	public function getAvatar() {
96
-		return $this->avatar;
97
-	}
98
-
99
-	/**
100
-	 * @param IAction $action
101
-	 */
102
-	public function addAction(IAction $action) {
103
-		$this->actions[] = $action;
104
-		$this->sortActions();
105
-	}
106
-
107
-	/**
108
-	 * @return IAction[]
109
-	 */
110
-	public function getActions() {
111
-		return $this->actions;
112
-	}
113
-
114
-	/**
115
-	 * sort the actions by priority and name
116
-	 */
117
-	private function sortActions() {
118
-		usort($this->actions, function (IAction $action1, IAction $action2) {
119
-			$prio1 = $action1->getPriority();
120
-			$prio2 = $action2->getPriority();
121
-
122
-			if ($prio1 === $prio2) {
123
-				// Ascending order for same priority
124
-				return strcasecmp($action1->getName(), $action2->getName());
125
-			}
126
-
127
-			// Descending order when priority differs
128
-			return $prio2 - $prio1;
129
-		});
130
-	}
131
-
132
-	/**
133
-	 * @param array $contact key-value array containing additional properties
134
-	 */
135
-	public function setProperties(array $contact) {
136
-		$this->properties = $contact;
137
-	}
138
-
139
-	/**
140
-	 * @param string $key
141
-	 * @return mixed
142
-	 */
143
-	public function getProperty($key) {
144
-		if (!isset($this->properties[$key])) {
145
-			return null;
146
-		}
147
-		return $this->properties[$key];
148
-	}
149
-
150
-	/**
151
-	 * @return array
152
-	 */
153
-	public function jsonSerialize() {
154
-		$topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
155
-		$otherActions = array_map(function (IAction $action) {
156
-			return $action->jsonSerialize();
157
-		}, array_slice($this->actions, 1));
158
-
159
-		return [
160
-			'id' => $this->id,
161
-			'fullName' => $this->fullName,
162
-			'avatar' => $this->getAvatar(),
163
-			'topAction' => $topAction,
164
-			'actions' => $otherActions,
165
-			'lastMessage' => '',
166
-		];
167
-	}
32
+    /** @var string|int|null */
33
+    private $id = null;
34
+
35
+    /** @var string */
36
+    private $fullName = '';
37
+
38
+    /** @var string[] */
39
+    private $emailAddresses = [];
40
+
41
+    /** @var string|null */
42
+    private $avatar;
43
+
44
+    /** @var IAction[] */
45
+    private $actions = [];
46
+
47
+    /** @var array */
48
+    private $properties = [];
49
+
50
+    /**
51
+     * @param string $id
52
+     */
53
+    public function setId($id) {
54
+        $this->id = $id;
55
+    }
56
+
57
+    /**
58
+     * @param string $displayName
59
+     */
60
+    public function setFullName($displayName) {
61
+        $this->fullName = $displayName;
62
+    }
63
+
64
+    /**
65
+     * @return string
66
+     */
67
+    public function getFullName() {
68
+        return $this->fullName;
69
+    }
70
+
71
+    /**
72
+     * @param string $address
73
+     */
74
+    public function addEMailAddress($address) {
75
+        $this->emailAddresses[] = $address;
76
+    }
77
+
78
+    /**
79
+     * @return string
80
+     */
81
+    public function getEMailAddresses() {
82
+        return $this->emailAddresses;
83
+    }
84
+
85
+    /**
86
+     * @param string $avatar
87
+     */
88
+    public function setAvatar($avatar) {
89
+        $this->avatar = $avatar;
90
+    }
91
+
92
+    /**
93
+     * @return string
94
+     */
95
+    public function getAvatar() {
96
+        return $this->avatar;
97
+    }
98
+
99
+    /**
100
+     * @param IAction $action
101
+     */
102
+    public function addAction(IAction $action) {
103
+        $this->actions[] = $action;
104
+        $this->sortActions();
105
+    }
106
+
107
+    /**
108
+     * @return IAction[]
109
+     */
110
+    public function getActions() {
111
+        return $this->actions;
112
+    }
113
+
114
+    /**
115
+     * sort the actions by priority and name
116
+     */
117
+    private function sortActions() {
118
+        usort($this->actions, function (IAction $action1, IAction $action2) {
119
+            $prio1 = $action1->getPriority();
120
+            $prio2 = $action2->getPriority();
121
+
122
+            if ($prio1 === $prio2) {
123
+                // Ascending order for same priority
124
+                return strcasecmp($action1->getName(), $action2->getName());
125
+            }
126
+
127
+            // Descending order when priority differs
128
+            return $prio2 - $prio1;
129
+        });
130
+    }
131
+
132
+    /**
133
+     * @param array $contact key-value array containing additional properties
134
+     */
135
+    public function setProperties(array $contact) {
136
+        $this->properties = $contact;
137
+    }
138
+
139
+    /**
140
+     * @param string $key
141
+     * @return mixed
142
+     */
143
+    public function getProperty($key) {
144
+        if (!isset($this->properties[$key])) {
145
+            return null;
146
+        }
147
+        return $this->properties[$key];
148
+    }
149
+
150
+    /**
151
+     * @return array
152
+     */
153
+    public function jsonSerialize() {
154
+        $topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
155
+        $otherActions = array_map(function (IAction $action) {
156
+            return $action->jsonSerialize();
157
+        }, array_slice($this->actions, 1));
158
+
159
+        return [
160
+            'id' => $this->id,
161
+            'fullName' => $this->fullName,
162
+            'avatar' => $this->getAvatar(),
163
+            'topAction' => $topAction,
164
+            'actions' => $otherActions,
165
+            'lastMessage' => '',
166
+        ];
167
+    }
168 168
 }
Please login to merge, or discard this patch.
lib/private/BackgroundJob/Legacy/QueuedJob.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
 namespace OC\BackgroundJob\Legacy;
25 25
 
26 26
 class QueuedJob extends \OC\BackgroundJob\QueuedJob {
27
-	public function run($argument) {
28
-		$class = $argument['klass'];
29
-		$method = $argument['method'];
30
-		$parameters = $argument['parameters'];
31
-		if (is_callable([$class, $method])) {
32
-			call_user_func([$class, $method], $parameters);
33
-		}
34
-	}
27
+    public function run($argument) {
28
+        $class = $argument['klass'];
29
+        $method = $argument['method'];
30
+        $parameters = $argument['parameters'];
31
+        if (is_callable([$class, $method])) {
32
+            call_user_func([$class, $method], $parameters);
33
+        }
34
+    }
35 35
 }
Please login to merge, or discard this patch.
lib/private/Hooks/ForwardingEmitter.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -31,35 +31,35 @@
 block discarded – undo
31 31
  * @package OC\Hooks
32 32
  */
33 33
 abstract class ForwardingEmitter extends BasicEmitter {
34
-	/**
35
-	 * @var \OC\Hooks\Emitter[] array
36
-	 */
37
-	private $forwardEmitters = [];
34
+    /**
35
+     * @var \OC\Hooks\Emitter[] array
36
+     */
37
+    private $forwardEmitters = [];
38 38
 
39
-	/**
40
-	 * @param string $scope
41
-	 * @param string $method
42
-	 * @param callable $callback
43
-	 */
44
-	public function listen($scope, $method, callable $callback) {
45
-		parent::listen($scope, $method, $callback);
46
-		foreach ($this->forwardEmitters as $emitter) {
47
-			$emitter->listen($scope, $method, $callback);
48
-		}
49
-	}
39
+    /**
40
+     * @param string $scope
41
+     * @param string $method
42
+     * @param callable $callback
43
+     */
44
+    public function listen($scope, $method, callable $callback) {
45
+        parent::listen($scope, $method, $callback);
46
+        foreach ($this->forwardEmitters as $emitter) {
47
+            $emitter->listen($scope, $method, $callback);
48
+        }
49
+    }
50 50
 
51
-	/**
52
-	 * @param \OC\Hooks\Emitter $emitter
53
-	 */
54
-	protected function forward(Emitter $emitter) {
55
-		$this->forwardEmitters[] = $emitter;
51
+    /**
52
+     * @param \OC\Hooks\Emitter $emitter
53
+     */
54
+    protected function forward(Emitter $emitter) {
55
+        $this->forwardEmitters[] = $emitter;
56 56
 
57
-		//forward all previously connected hooks
58
-		foreach ($this->listeners as $key => $listeners) {
59
-			list($scope, $method) = explode('::', $key, 2);
60
-			foreach ($listeners as $listener) {
61
-				$emitter->listen($scope, $method, $listener);
62
-			}
63
-		}
64
-	}
57
+        //forward all previously connected hooks
58
+        foreach ($this->listeners as $key => $listeners) {
59
+            list($scope, $method) = explode('::', $key, 2);
60
+            foreach ($listeners as $listener) {
61
+                $emitter->listen($scope, $method, $listener);
62
+            }
63
+        }
64
+    }
65 65
 }
Please login to merge, or discard this patch.
lib/private/Hooks/LegacyEmitter.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@
 block discarded – undo
24 24
 namespace OC\Hooks;
25 25
 
26 26
 abstract class LegacyEmitter extends BasicEmitter {
27
-	/**
28
-	 * @param string $scope
29
-	 * @param string $method
30
-	 * @param array $arguments
31
-	 *
32
-	 * @suppress PhanAccessMethodProtected
33
-	 */
34
-	protected function emit($scope, $method, array $arguments = []) {
35
-		\OC_Hook::emit($scope, $method, $arguments);
36
-		parent::emit($scope, $method, $arguments);
37
-	}
27
+    /**
28
+     * @param string $scope
29
+     * @param string $method
30
+     * @param array $arguments
31
+     *
32
+     * @suppress PhanAccessMethodProtected
33
+     */
34
+    protected function emit($scope, $method, array $arguments = []) {
35
+        \OC_Hook::emit($scope, $method, $arguments);
36
+        parent::emit($scope, $method, $arguments);
37
+    }
38 38
 }
Please login to merge, or discard this patch.