Passed
Push — master ( b306a8...3e64be )
by Roeland
09:52 queued 10s
created
apps/files_sharing/lib/Command/CleanupRemoteStorages.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 
61 61
 		$remoteStorages = $this->getRemoteStorages();
62 62
 
63
-		$output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked');
63
+		$output->writeln(count($remoteStorages).' remote storage(s) need(s) to be checked');
64 64
 
65 65
 		$remoteShareIds = $this->getRemoteShareIds();
66 66
 
67
-		$output->writeln(count($remoteShareIds) . ' remote share(s) exist');
67
+		$output->writeln(count($remoteShareIds).' remote share(s) exist');
68 68
 
69 69
 		foreach ($remoteShareIds as $id => $remoteShareId) {
70 70
 			if (isset($remoteStorages[$remoteShareId])) {
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 			->where($queryBuilder->expr()->like(
143 143
 				'id',
144 144
 				// match all 'shared::' + 32 characters storages
145
-				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)),
145
+				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::').str_repeat('_', 32)),
146 146
 				IQueryBuilder::PARAM_STR)
147 147
 			)
148 148
 			->andWhere($queryBuilder->expr()->notLike(
149 149
 				'id',
150 150
 				// but not the ones starting with a '/', they are for normal shares
151
-				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
151
+				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/').'%'),
152 152
 				IQueryBuilder::PARAM_STR)
153 153
 			)->orderBy('numeric_id');
154 154
 		$query = $queryBuilder->execute();
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		$remoteShareIds = [];
173 173
 
174 174
 		while ($row = $query->fetch()) {
175
-			$remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $row['remote']);
175
+			$remoteShareIds[$row['id']] = 'shared::'.md5($row['share_token'].'@'.$row['remote']);
176 176
 		}
177 177
 
178 178
 		return $remoteShareIds;
Please login to merge, or discard this patch.
Indentation   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -37,147 +37,147 @@
 block discarded – undo
37 37
  */
38 38
 class CleanupRemoteStorages extends Command {
39 39
 
40
-	/**
41
-	 * @var IDBConnection
42
-	 */
43
-	protected $connection;
44
-
45
-	public function __construct(IDBConnection $connection) {
46
-		$this->connection = $connection;
47
-		parent::__construct();
48
-	}
49
-
50
-	protected function configure() {
51
-		$this
52
-			->setName('sharing:cleanup-remote-storages')
53
-			->setDescription('Cleanup shared storage entries that have no matching entry in the shares_external table')
54
-			->addOption(
55
-				'dry-run',
56
-				null,
57
-				InputOption::VALUE_NONE,
58
-				'only show which storages would be deleted'
59
-			);
60
-	}
61
-
62
-	public function execute(InputInterface $input, OutputInterface $output) {
63
-
64
-		$remoteStorages = $this->getRemoteStorages();
65
-
66
-		$output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked');
67
-
68
-		$remoteShareIds = $this->getRemoteShareIds();
69
-
70
-		$output->writeln(count($remoteShareIds) . ' remote share(s) exist');
71
-
72
-		foreach ($remoteShareIds as $id => $remoteShareId) {
73
-			if (isset($remoteStorages[$remoteShareId])) {
74
-				if ($input->getOption('dry-run') || $output->isVerbose()) {
75
-					$output->writeln("<info>$remoteShareId belongs to remote share $id</info>");
76
-				}
77
-
78
-				unset($remoteStorages[$remoteShareId]);
79
-			} else {
80
-				$output->writeln("<comment>$remoteShareId for share $id has no matching storage, yet</comment>");
81
-			}
82
-		}
83
-
84
-		if (empty($remoteStorages)) {
85
-			$output->writeln('<info>no storages deleted</info>');
86
-		} else {
87
-			$dryRun = $input->getOption('dry-run');
88
-			foreach ($remoteStorages as $id => $numericId) {
89
-				if ($dryRun) {
90
-					$output->writeln("<error>$id [$numericId] can be deleted</error>");
91
-					$this->countFiles($numericId, $output);
92
-				} else {
93
-					$this->deleteStorage($id, $numericId, $output);
94
-				}
95
-			}
96
-		}
97
-	}
98
-
99
-	public function countFiles($numericId, OutputInterface $output) {
100
-		$queryBuilder = $this->connection->getQueryBuilder();
101
-		$queryBuilder->select($queryBuilder->func()->count('fileid'))
102
-			->from('filecache')
103
-			->where($queryBuilder->expr()->eq(
104
-				'storage',
105
-				$queryBuilder->createNamedParameter($numericId, IQueryBuilder::PARAM_STR),
106
-				IQueryBuilder::PARAM_STR)
107
-			);
108
-		$result = $queryBuilder->execute();
109
-		$count = $result->fetchColumn();
110
-		$output->writeln("$count files can be deleted for storage $numericId");
111
-	}
112
-
113
-	public function deleteStorage($id, $numericId, OutputInterface $output) {
114
-		$queryBuilder = $this->connection->getQueryBuilder();
115
-		$queryBuilder->delete('storages')
116
-			->where($queryBuilder->expr()->eq(
117
-				'id',
118
-				$queryBuilder->createNamedParameter($id, IQueryBuilder::PARAM_STR),
119
-				IQueryBuilder::PARAM_STR)
120
-			);
121
-		$output->write("deleting $id [$numericId] ... ");
122
-		$count = $queryBuilder->execute();
123
-		$output->writeln("deleted $count storage");
124
-		$this->deleteFiles($numericId, $output);
125
-	}
126
-
127
-	public function deleteFiles($numericId, OutputInterface $output) {
128
-		$queryBuilder = $this->connection->getQueryBuilder();
129
-		$queryBuilder->delete('filecache')
130
-			->where($queryBuilder->expr()->eq(
131
-				'storage',
132
-				$queryBuilder->createNamedParameter($numericId, IQueryBuilder::PARAM_STR),
133
-				IQueryBuilder::PARAM_STR)
134
-			);
135
-		$output->write("deleting files for storage $numericId ... ");
136
-		$count = $queryBuilder->execute();
137
-		$output->writeln("deleted $count files");
138
-	}
139
-
140
-	public function getRemoteStorages() {
141
-
142
-		$queryBuilder = $this->connection->getQueryBuilder();
143
-		$queryBuilder->select(['id', 'numeric_id'])
144
-			->from('storages')
145
-			->where($queryBuilder->expr()->like(
146
-				'id',
147
-				// match all 'shared::' + 32 characters storages
148
-				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)),
149
-				IQueryBuilder::PARAM_STR)
150
-			)
151
-			->andWhere($queryBuilder->expr()->notLike(
152
-				'id',
153
-				// but not the ones starting with a '/', they are for normal shares
154
-				$queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
155
-				IQueryBuilder::PARAM_STR)
156
-			)->orderBy('numeric_id');
157
-		$query = $queryBuilder->execute();
158
-
159
-		$remoteStorages = [];
160
-
161
-		while ($row = $query->fetch()) {
162
-			$remoteStorages[$row['id']] = $row['numeric_id'];
163
-		}
164
-
165
-		return $remoteStorages;
166
-	}
167
-
168
-	public function getRemoteShareIds() {
169
-
170
-		$queryBuilder = $this->connection->getQueryBuilder();
171
-		$queryBuilder->select(['id', 'share_token', 'remote'])
172
-			->from('share_external');
173
-		$query = $queryBuilder->execute();
174
-
175
-		$remoteShareIds = [];
176
-
177
-		while ($row = $query->fetch()) {
178
-			$remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $row['remote']);
179
-		}
180
-
181
-		return $remoteShareIds;
182
-	}
40
+    /**
41
+     * @var IDBConnection
42
+     */
43
+    protected $connection;
44
+
45
+    public function __construct(IDBConnection $connection) {
46
+        $this->connection = $connection;
47
+        parent::__construct();
48
+    }
49
+
50
+    protected function configure() {
51
+        $this
52
+            ->setName('sharing:cleanup-remote-storages')
53
+            ->setDescription('Cleanup shared storage entries that have no matching entry in the shares_external table')
54
+            ->addOption(
55
+                'dry-run',
56
+                null,
57
+                InputOption::VALUE_NONE,
58
+                'only show which storages would be deleted'
59
+            );
60
+    }
61
+
62
+    public function execute(InputInterface $input, OutputInterface $output) {
63
+
64
+        $remoteStorages = $this->getRemoteStorages();
65
+
66
+        $output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked');
67
+
68
+        $remoteShareIds = $this->getRemoteShareIds();
69
+
70
+        $output->writeln(count($remoteShareIds) . ' remote share(s) exist');
71
+
72
+        foreach ($remoteShareIds as $id => $remoteShareId) {
73
+            if (isset($remoteStorages[$remoteShareId])) {
74
+                if ($input->getOption('dry-run') || $output->isVerbose()) {
75
+                    $output->writeln("<info>$remoteShareId belongs to remote share $id</info>");
76
+                }
77
+
78
+                unset($remoteStorages[$remoteShareId]);
79
+            } else {
80
+                $output->writeln("<comment>$remoteShareId for share $id has no matching storage, yet</comment>");
81
+            }
82
+        }
83
+
84
+        if (empty($remoteStorages)) {
85
+            $output->writeln('<info>no storages deleted</info>');
86
+        } else {
87
+            $dryRun = $input->getOption('dry-run');
88
+            foreach ($remoteStorages as $id => $numericId) {
89
+                if ($dryRun) {
90
+                    $output->writeln("<error>$id [$numericId] can be deleted</error>");
91
+                    $this->countFiles($numericId, $output);
92
+                } else {
93
+                    $this->deleteStorage($id, $numericId, $output);
94
+                }
95
+            }
96
+        }
97
+    }
98
+
99
+    public function countFiles($numericId, OutputInterface $output) {
100
+        $queryBuilder = $this->connection->getQueryBuilder();
101
+        $queryBuilder->select($queryBuilder->func()->count('fileid'))
102
+            ->from('filecache')
103
+            ->where($queryBuilder->expr()->eq(
104
+                'storage',
105
+                $queryBuilder->createNamedParameter($numericId, IQueryBuilder::PARAM_STR),
106
+                IQueryBuilder::PARAM_STR)
107
+            );
108
+        $result = $queryBuilder->execute();
109
+        $count = $result->fetchColumn();
110
+        $output->writeln("$count files can be deleted for storage $numericId");
111
+    }
112
+
113
+    public function deleteStorage($id, $numericId, OutputInterface $output) {
114
+        $queryBuilder = $this->connection->getQueryBuilder();
115
+        $queryBuilder->delete('storages')
116
+            ->where($queryBuilder->expr()->eq(
117
+                'id',
118
+                $queryBuilder->createNamedParameter($id, IQueryBuilder::PARAM_STR),
119
+                IQueryBuilder::PARAM_STR)
120
+            );
121
+        $output->write("deleting $id [$numericId] ... ");
122
+        $count = $queryBuilder->execute();
123
+        $output->writeln("deleted $count storage");
124
+        $this->deleteFiles($numericId, $output);
125
+    }
126
+
127
+    public function deleteFiles($numericId, OutputInterface $output) {
128
+        $queryBuilder = $this->connection->getQueryBuilder();
129
+        $queryBuilder->delete('filecache')
130
+            ->where($queryBuilder->expr()->eq(
131
+                'storage',
132
+                $queryBuilder->createNamedParameter($numericId, IQueryBuilder::PARAM_STR),
133
+                IQueryBuilder::PARAM_STR)
134
+            );
135
+        $output->write("deleting files for storage $numericId ... ");
136
+        $count = $queryBuilder->execute();
137
+        $output->writeln("deleted $count files");
138
+    }
139
+
140
+    public function getRemoteStorages() {
141
+
142
+        $queryBuilder = $this->connection->getQueryBuilder();
143
+        $queryBuilder->select(['id', 'numeric_id'])
144
+            ->from('storages')
145
+            ->where($queryBuilder->expr()->like(
146
+                'id',
147
+                // match all 'shared::' + 32 characters storages
148
+                $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)),
149
+                IQueryBuilder::PARAM_STR)
150
+            )
151
+            ->andWhere($queryBuilder->expr()->notLike(
152
+                'id',
153
+                // but not the ones starting with a '/', they are for normal shares
154
+                $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'),
155
+                IQueryBuilder::PARAM_STR)
156
+            )->orderBy('numeric_id');
157
+        $query = $queryBuilder->execute();
158
+
159
+        $remoteStorages = [];
160
+
161
+        while ($row = $query->fetch()) {
162
+            $remoteStorages[$row['id']] = $row['numeric_id'];
163
+        }
164
+
165
+        return $remoteStorages;
166
+    }
167
+
168
+    public function getRemoteShareIds() {
169
+
170
+        $queryBuilder = $this->connection->getQueryBuilder();
171
+        $queryBuilder->select(['id', 'share_token', 'remote'])
172
+            ->from('share_external');
173
+        $query = $queryBuilder->execute();
174
+
175
+        $remoteShareIds = [];
176
+
177
+        while ($row = $query->fetch()) {
178
+            $remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $row['remote']);
179
+        }
180
+
181
+        return $remoteShareIds;
182
+    }
183 183
 }
Please login to merge, or discard this patch.
lib/private/legacy/db/statementwrapper.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	/**
55 55
 	 * pass all other function directly to the \Doctrine\DBAL\Driver\Statement
56 56
 	 */
57
-	public function __call($name,$arguments) {
58
-		return call_user_func_array(array($this->statement,$name), $arguments);
57
+	public function __call($name, $arguments) {
58
+		return call_user_func_array(array($this->statement, $name), $arguments);
59 59
 	}
60 60
 
61 61
 	/**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * @param array $input
65 65
 	 * @return \OC_DB_StatementWrapper|int|bool
66 66
 	 */
67
-	public function execute($input= []) {
67
+	public function execute($input = []) {
68 68
 		$this->lastArguments = $input;
69 69
 		if (count($input) > 0) {
70 70
 			$result = $this->statement->execute($input);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 * @param integer|null $length max length when using an OUT bind
114 114
 	 * @return boolean
115 115
 	 */
116
-	public function bindParam($column, &$variable, $type = null, $length = null){
116
+	public function bindParam($column, &$variable, $type = null, $length = null) {
117 117
 		return $this->statement->bindParam($column, $variable, $type, $length);
118 118
 	}
119 119
 }
Please login to merge, or discard this patch.
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -37,83 +37,83 @@
 block discarded – undo
37 37
  * @method array fetchAll(integer $fetchMode = null);
38 38
  */
39 39
 class OC_DB_StatementWrapper {
40
-	/**
41
-	 * @var \Doctrine\DBAL\Driver\Statement
42
-	 */
43
-	private $statement = null;
44
-	private $isManipulation = false;
45
-	private $lastArguments = array();
40
+    /**
41
+     * @var \Doctrine\DBAL\Driver\Statement
42
+     */
43
+    private $statement = null;
44
+    private $isManipulation = false;
45
+    private $lastArguments = array();
46 46
 
47
-	/**
48
-	 * @param boolean $isManipulation
49
-	 */
50
-	public function __construct($statement, $isManipulation) {
51
-		$this->statement = $statement;
52
-		$this->isManipulation = $isManipulation;
53
-	}
47
+    /**
48
+     * @param boolean $isManipulation
49
+     */
50
+    public function __construct($statement, $isManipulation) {
51
+        $this->statement = $statement;
52
+        $this->isManipulation = $isManipulation;
53
+    }
54 54
 
55
-	/**
56
-	 * pass all other function directly to the \Doctrine\DBAL\Driver\Statement
57
-	 */
58
-	public function __call($name,$arguments) {
59
-		return call_user_func_array(array($this->statement,$name), $arguments);
60
-	}
55
+    /**
56
+     * pass all other function directly to the \Doctrine\DBAL\Driver\Statement
57
+     */
58
+    public function __call($name,$arguments) {
59
+        return call_user_func_array(array($this->statement,$name), $arguments);
60
+    }
61 61
 
62
-	/**
63
-	 * make execute return the result instead of a bool
64
-	 *
65
-	 * @param array $input
66
-	 * @return \OC_DB_StatementWrapper|int|bool
67
-	 */
68
-	public function execute($input= []) {
69
-		$this->lastArguments = $input;
70
-		if (count($input) > 0) {
71
-			$result = $this->statement->execute($input);
72
-		} else {
73
-			$result = $this->statement->execute();
74
-		}
62
+    /**
63
+     * make execute return the result instead of a bool
64
+     *
65
+     * @param array $input
66
+     * @return \OC_DB_StatementWrapper|int|bool
67
+     */
68
+    public function execute($input= []) {
69
+        $this->lastArguments = $input;
70
+        if (count($input) > 0) {
71
+            $result = $this->statement->execute($input);
72
+        } else {
73
+            $result = $this->statement->execute();
74
+        }
75 75
 
76
-		if ($result === false) {
77
-			return false;
78
-		}
79
-		if ($this->isManipulation) {
80
-			return $this->statement->rowCount();
81
-		} else {
82
-			return $this;
83
-		}
84
-	}
76
+        if ($result === false) {
77
+            return false;
78
+        }
79
+        if ($this->isManipulation) {
80
+            return $this->statement->rowCount();
81
+        } else {
82
+            return $this;
83
+        }
84
+    }
85 85
 
86
-	/**
87
-	 * provide an alias for fetch
88
-	 *
89
-	 * @return mixed
90
-	 */
91
-	public function fetchRow() {
92
-		return $this->statement->fetch();
93
-	}
86
+    /**
87
+     * provide an alias for fetch
88
+     *
89
+     * @return mixed
90
+     */
91
+    public function fetchRow() {
92
+        return $this->statement->fetch();
93
+    }
94 94
 
95
-	/**
96
-	 * Provide a simple fetchOne.
97
-	 *
98
-	 * fetch single column from the next row
99
-	 * @param int $column the column number to fetch
100
-	 * @return string
101
-	 */
102
-	public function fetchOne($column = 0) {
103
-		return $this->statement->fetchColumn($column);
104
-	}
95
+    /**
96
+     * Provide a simple fetchOne.
97
+     *
98
+     * fetch single column from the next row
99
+     * @param int $column the column number to fetch
100
+     * @return string
101
+     */
102
+    public function fetchOne($column = 0) {
103
+        return $this->statement->fetchColumn($column);
104
+    }
105 105
 
106
-	/**
107
-	 * Binds a PHP variable to a corresponding named or question mark placeholder in the
108
-	 * SQL statement that was use to prepare the statement.
109
-	 *
110
-	 * @param mixed $column Either the placeholder name or the 1-indexed placeholder index
111
-	 * @param mixed $variable The variable to bind
112
-	 * @param integer|null $type one of the  PDO::PARAM_* constants
113
-	 * @param integer|null $length max length when using an OUT bind
114
-	 * @return boolean
115
-	 */
116
-	public function bindParam($column, &$variable, $type = null, $length = null){
117
-		return $this->statement->bindParam($column, $variable, $type, $length);
118
-	}
106
+    /**
107
+     * Binds a PHP variable to a corresponding named or question mark placeholder in the
108
+     * SQL statement that was use to prepare the statement.
109
+     *
110
+     * @param mixed $column Either the placeholder name or the 1-indexed placeholder index
111
+     * @param mixed $variable The variable to bind
112
+     * @param integer|null $type one of the  PDO::PARAM_* constants
113
+     * @param integer|null $length max length when using an OUT bind
114
+     * @return boolean
115
+     */
116
+    public function bindParam($column, &$variable, $type = null, $length = null){
117
+        return $this->statement->bindParam($column, $variable, $type, $length);
118
+    }
119 119
 }
Please login to merge, or discard this patch.
lib/private/App/CodeChecker/MigrationSchemaChecker.php 1 patch
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -29,179 +29,179 @@
 block discarded – undo
29 29
 
30 30
 class MigrationSchemaChecker extends NodeVisitorAbstract {
31 31
 
32
-	/** @var string */
33
-	protected $schemaVariableName = null;
34
-	/** @var array */
35
-	protected $tableVariableNames = [];
36
-	/** @var array */
37
-	public $errors = [];
32
+    /** @var string */
33
+    protected $schemaVariableName = null;
34
+    /** @var array */
35
+    protected $tableVariableNames = [];
36
+    /** @var array */
37
+    public $errors = [];
38 38
 
39
-	/**
40
-	 * @param Node $node
41
-	 * @return void
42
-	 *
43
-	 * @suppress PhanUndeclaredProperty
44
-	 */
45
-	public function enterNode(Node $node) {
46
-		/**
47
-		 * Check tables
48
-		 */
49
-		if ($this->schemaVariableName !== null &&
50
-			 $node instanceof Node\Expr\Assign &&
51
-			 $node->var instanceof Node\Expr\Variable &&
52
-			 $node->expr instanceof Node\Expr\MethodCall &&
53
-			 $node->expr->var instanceof Node\Expr\Variable &&
54
-			 $node->expr->var->name === $this->schemaVariableName) {
39
+    /**
40
+     * @param Node $node
41
+     * @return void
42
+     *
43
+     * @suppress PhanUndeclaredProperty
44
+     */
45
+    public function enterNode(Node $node) {
46
+        /**
47
+         * Check tables
48
+         */
49
+        if ($this->schemaVariableName !== null &&
50
+             $node instanceof Node\Expr\Assign &&
51
+             $node->var instanceof Node\Expr\Variable &&
52
+             $node->expr instanceof Node\Expr\MethodCall &&
53
+             $node->expr->var instanceof Node\Expr\Variable &&
54
+             $node->expr->var->name === $this->schemaVariableName) {
55 55
 
56
-			if ($node->expr->name === 'createTable') {
57
-				if (isset($node->expr->args[0]) && $node->expr->args[0]->value instanceof Node\Scalar\String_) {
58
-					if (!$this->checkNameLength($node->expr->args[0]->value->value)) {
59
-						$this->errors[] = [
60
-							'line' => $node->getLine(),
61
-							'disallowedToken' => $node->expr->args[0]->value->value,
62
-							'reason' => 'Table name is too long (max. 27)',
63
-						];
64
-					} else {
65
-						$this->tableVariableNames[$node->var->name] = $node->expr->args[0]->value->value;
66
-					}
67
-				}
68
-			} else if ($node->expr->name === 'getTable') {
69
-				if (isset($node->expr->args[0]) && $node->expr->args[0]->value instanceof Node\Scalar\String_) {
70
-					$this->tableVariableNames[$node->var->name] = $node->expr->args[0]->value->value;
71
-				}
72
-			}
73
-		} else if ($this->schemaVariableName !== null &&
74
-			 $node instanceof Node\Expr\MethodCall &&
75
-			 $node->var instanceof Node\Expr\Variable &&
76
-			 $node->var->name === $this->schemaVariableName) {
56
+            if ($node->expr->name === 'createTable') {
57
+                if (isset($node->expr->args[0]) && $node->expr->args[0]->value instanceof Node\Scalar\String_) {
58
+                    if (!$this->checkNameLength($node->expr->args[0]->value->value)) {
59
+                        $this->errors[] = [
60
+                            'line' => $node->getLine(),
61
+                            'disallowedToken' => $node->expr->args[0]->value->value,
62
+                            'reason' => 'Table name is too long (max. 27)',
63
+                        ];
64
+                    } else {
65
+                        $this->tableVariableNames[$node->var->name] = $node->expr->args[0]->value->value;
66
+                    }
67
+                }
68
+            } else if ($node->expr->name === 'getTable') {
69
+                if (isset($node->expr->args[0]) && $node->expr->args[0]->value instanceof Node\Scalar\String_) {
70
+                    $this->tableVariableNames[$node->var->name] = $node->expr->args[0]->value->value;
71
+                }
72
+            }
73
+        } else if ($this->schemaVariableName !== null &&
74
+             $node instanceof Node\Expr\MethodCall &&
75
+             $node->var instanceof Node\Expr\Variable &&
76
+             $node->var->name === $this->schemaVariableName) {
77 77
 
78
-			if ($node->name === 'renameTable') {
79
-				$this->errors[] = [
80
-					'line' => $node->getLine(),
81
-					'disallowedToken' => 'Deprecated method',
82
-					'reason' => sprintf(
83
-						'`$%s->renameTable()` must not be used',
84
-						$node->var->name
85
-					),
86
-				];
87
-			}
78
+            if ($node->name === 'renameTable') {
79
+                $this->errors[] = [
80
+                    'line' => $node->getLine(),
81
+                    'disallowedToken' => 'Deprecated method',
82
+                    'reason' => sprintf(
83
+                        '`$%s->renameTable()` must not be used',
84
+                        $node->var->name
85
+                    ),
86
+                ];
87
+            }
88 88
 
89
-		/**
90
-		 * Check columns and Indexes
91
-		 */
92
-		} else if (!empty($this->tableVariableNames) &&
93
-			 $node instanceof Node\Expr\MethodCall &&
94
-			 $node->var instanceof Node\Expr\Variable &&
95
-			 isset($this->tableVariableNames[$node->var->name])) {
89
+        /**
90
+         * Check columns and Indexes
91
+         */
92
+        } else if (!empty($this->tableVariableNames) &&
93
+             $node instanceof Node\Expr\MethodCall &&
94
+             $node->var instanceof Node\Expr\Variable &&
95
+             isset($this->tableVariableNames[$node->var->name])) {
96 96
 
97
-			if ($node->name === 'addColumn' || $node->name === 'changeColumn') {
98
-				if (isset($node->args[0]) && $node->args[0]->value instanceof Node\Scalar\String_) {
99
-					if (!$this->checkNameLength($node->args[0]->value->value)) {
100
-						$this->errors[] = [
101
-							'line' => $node->getLine(),
102
-							'disallowedToken' => $node->args[0]->value->value,
103
-							'reason' => sprintf(
104
-								'Column name is too long on table `%s` (max. 27)',
105
-								$this->tableVariableNames[$node->var->name]
106
-							),
107
-						];
108
-					}
97
+            if ($node->name === 'addColumn' || $node->name === 'changeColumn') {
98
+                if (isset($node->args[0]) && $node->args[0]->value instanceof Node\Scalar\String_) {
99
+                    if (!$this->checkNameLength($node->args[0]->value->value)) {
100
+                        $this->errors[] = [
101
+                            'line' => $node->getLine(),
102
+                            'disallowedToken' => $node->args[0]->value->value,
103
+                            'reason' => sprintf(
104
+                                'Column name is too long on table `%s` (max. 27)',
105
+                                $this->tableVariableNames[$node->var->name]
106
+                            ),
107
+                        ];
108
+                    }
109 109
 
110
-					// On autoincrement the max length of the table name is 21 instead of 27
111
-					if (isset($node->args[2]) && $node->args[2]->value instanceof Node\Expr\Array_) {
112
-						/** @var Node\Expr\Array_ $options */
113
-						$options = $node->args[2]->value;
114
-						if ($this->checkColumnForAutoincrement($options)) {
115
-							if (!$this->checkNameLength($this->tableVariableNames[$node->var->name], true)) {
116
-								$this->errors[] = [
117
-									'line' => $node->getLine(),
118
-									'disallowedToken' => $this->tableVariableNames[$node->var->name],
119
-									'reason' => 'Table name is too long because of autoincrement (max. 21)',
120
-								];
121
-							}
122
-						}
123
-					}
124
-				}
125
-			} else if ($node->name === 'addIndex' ||
126
-				 $node->name === 'addUniqueIndex' ||
127
-				 $node->name === 'renameIndex' ||
128
-				 $node->name === 'setPrimaryKey') {
129
-				if (isset($node->args[1]) && $node->args[1]->value instanceof Node\Scalar\String_) {
130
-					if (!$this->checkNameLength($node->args[1]->value->value)) {
131
-						$this->errors[] = [
132
-							'line' => $node->getLine(),
133
-							'disallowedToken' => $node->args[1]->value->value,
134
-							'reason' => sprintf(
135
-								'Index name is too long on table `%s` (max. 27)',
136
-								$this->tableVariableNames[$node->var->name]
137
-							),
138
-						];
139
-					}
140
-				}
141
-			} else if ($node->name === 'addForeignKeyConstraint') {
142
-				if (isset($node->args[4]) && $node->args[4]->value instanceof Node\Scalar\String_) {
143
-					if (!$this->checkNameLength($node->args[4]->value->value)) {
144
-						$this->errors[] = [
145
-							'line' => $node->getLine(),
146
-							'disallowedToken' => $node->args[4]->value->value,
147
-							'reason' => sprintf(
148
-								'Constraint name is too long on table `%s` (max. 27)',
149
-								$this->tableVariableNames[$node->var->name]
150
-							),
151
-						];
152
-					}
153
-				}
154
-			} else if ($node->name === 'renameColumn') {
155
-				$this->errors[] = [
156
-					'line' => $node->getLine(),
157
-					'disallowedToken' => 'Deprecated method',
158
-					'reason' => sprintf(
159
-						'`$%s->renameColumn()` must not be used',
160
-						$node->var->name
161
-					),
162
-				];
163
-			}
110
+                    // On autoincrement the max length of the table name is 21 instead of 27
111
+                    if (isset($node->args[2]) && $node->args[2]->value instanceof Node\Expr\Array_) {
112
+                        /** @var Node\Expr\Array_ $options */
113
+                        $options = $node->args[2]->value;
114
+                        if ($this->checkColumnForAutoincrement($options)) {
115
+                            if (!$this->checkNameLength($this->tableVariableNames[$node->var->name], true)) {
116
+                                $this->errors[] = [
117
+                                    'line' => $node->getLine(),
118
+                                    'disallowedToken' => $this->tableVariableNames[$node->var->name],
119
+                                    'reason' => 'Table name is too long because of autoincrement (max. 21)',
120
+                                ];
121
+                            }
122
+                        }
123
+                    }
124
+                }
125
+            } else if ($node->name === 'addIndex' ||
126
+                 $node->name === 'addUniqueIndex' ||
127
+                 $node->name === 'renameIndex' ||
128
+                 $node->name === 'setPrimaryKey') {
129
+                if (isset($node->args[1]) && $node->args[1]->value instanceof Node\Scalar\String_) {
130
+                    if (!$this->checkNameLength($node->args[1]->value->value)) {
131
+                        $this->errors[] = [
132
+                            'line' => $node->getLine(),
133
+                            'disallowedToken' => $node->args[1]->value->value,
134
+                            'reason' => sprintf(
135
+                                'Index name is too long on table `%s` (max. 27)',
136
+                                $this->tableVariableNames[$node->var->name]
137
+                            ),
138
+                        ];
139
+                    }
140
+                }
141
+            } else if ($node->name === 'addForeignKeyConstraint') {
142
+                if (isset($node->args[4]) && $node->args[4]->value instanceof Node\Scalar\String_) {
143
+                    if (!$this->checkNameLength($node->args[4]->value->value)) {
144
+                        $this->errors[] = [
145
+                            'line' => $node->getLine(),
146
+                            'disallowedToken' => $node->args[4]->value->value,
147
+                            'reason' => sprintf(
148
+                                'Constraint name is too long on table `%s` (max. 27)',
149
+                                $this->tableVariableNames[$node->var->name]
150
+                            ),
151
+                        ];
152
+                    }
153
+                }
154
+            } else if ($node->name === 'renameColumn') {
155
+                $this->errors[] = [
156
+                    'line' => $node->getLine(),
157
+                    'disallowedToken' => 'Deprecated method',
158
+                    'reason' => sprintf(
159
+                        '`$%s->renameColumn()` must not be used',
160
+                        $node->var->name
161
+                    ),
162
+                ];
163
+            }
164 164
 
165
-		/**
166
-		 * Find the schema
167
-		 */
168
-		} else if ($node instanceof Node\Expr\Assign &&
169
-			 $node->expr instanceof Node\Expr\FuncCall &&
170
-			 $node->var instanceof Node\Expr\Variable &&
171
-			 $node->expr->name instanceof Node\Expr\Variable &&
172
-			 $node->expr->name->name === 'schemaClosure') {
173
-			// E.g. $schema = $schemaClosure();
174
-			$this->schemaVariableName = $node->var->name;
175
-		}
176
-	}
165
+        /**
166
+         * Find the schema
167
+         */
168
+        } else if ($node instanceof Node\Expr\Assign &&
169
+             $node->expr instanceof Node\Expr\FuncCall &&
170
+             $node->var instanceof Node\Expr\Variable &&
171
+             $node->expr->name instanceof Node\Expr\Variable &&
172
+             $node->expr->name->name === 'schemaClosure') {
173
+            // E.g. $schema = $schemaClosure();
174
+            $this->schemaVariableName = $node->var->name;
175
+        }
176
+    }
177 177
 
178
-	protected function checkNameLength($tableName, $hasAutoincrement = false) {
179
-		if ($hasAutoincrement) {
180
-			return strlen($tableName) <= 21;
181
-		}
182
-		return strlen($tableName) <= 27;
183
-	}
178
+    protected function checkNameLength($tableName, $hasAutoincrement = false) {
179
+        if ($hasAutoincrement) {
180
+            return strlen($tableName) <= 21;
181
+        }
182
+        return strlen($tableName) <= 27;
183
+    }
184 184
 
185
-	/**
186
-	 * @param Node\Expr\Array_ $optionsArray
187
-	 * @return bool Whether the column is an autoincrement column
188
-	 */
189
-	protected function checkColumnForAutoincrement(Node\Expr\Array_ $optionsArray) {
190
-		foreach ($optionsArray->items as $option) {
191
-			if ($option->key instanceof Node\Scalar\String_) {
192
-				if ($option->key->value === 'autoincrement' &&
193
-					 $option->value instanceof Node\Expr\ConstFetch) {
194
-					/** @var Node\Expr\ConstFetch $const */
195
-					$const = $option->value;
185
+    /**
186
+     * @param Node\Expr\Array_ $optionsArray
187
+     * @return bool Whether the column is an autoincrement column
188
+     */
189
+    protected function checkColumnForAutoincrement(Node\Expr\Array_ $optionsArray) {
190
+        foreach ($optionsArray->items as $option) {
191
+            if ($option->key instanceof Node\Scalar\String_) {
192
+                if ($option->key->value === 'autoincrement' &&
193
+                     $option->value instanceof Node\Expr\ConstFetch) {
194
+                    /** @var Node\Expr\ConstFetch $const */
195
+                    $const = $option->value;
196 196
 
197
-					if ($const->name instanceof Name &&
198
-						 $const->name->parts === ['true']) {
199
-						return true;
200
-					}
201
-				}
202
-			}
203
-		}
197
+                    if ($const->name instanceof Name &&
198
+                         $const->name->parts === ['true']) {
199
+                        return true;
200
+                    }
201
+                }
202
+            }
203
+        }
204 204
 
205
-		return false;
206
-	}
205
+        return false;
206
+    }
207 207
 }
Please login to merge, or discard this patch.
lib/private/OCS/Exception.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@
 block discarded – undo
25 25
 
26 26
 class Exception extends \Exception {
27 27
 
28
-	/** @var Result */
29
-	private $result;
28
+    /** @var Result */
29
+    private $result;
30 30
 
31
-	public function __construct(Result $result) {
32
-		parent::__construct();
33
-		$this->result = $result;
34
-	}
31
+    public function __construct(Result $result) {
32
+        parent::__construct();
33
+        $this->result = $result;
34
+    }
35 35
 
36
-	public function getResult() {
37
-		return $this->result;
38
-	}
36
+    public function getResult() {
37
+        return $this->result;
38
+    }
39 39
 
40 40
 }
Please login to merge, or discard this patch.
lib/private/BackgroundJob/TimedJob.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,26 +32,26 @@
 block discarded – undo
32 32
  * @package OC\BackgroundJob
33 33
  */
34 34
 abstract class TimedJob extends Job {
35
-	protected $interval = 0;
35
+    protected $interval = 0;
36 36
 
37
-	/**
38
-	 * set the interval for the job
39
-	 *
40
-	 * @param int $interval
41
-	 */
42
-	public function setInterval($interval) {
43
-		$this->interval = $interval;
44
-	}
37
+    /**
38
+     * set the interval for the job
39
+     *
40
+     * @param int $interval
41
+     */
42
+    public function setInterval($interval) {
43
+        $this->interval = $interval;
44
+    }
45 45
 
46
-	/**
47
-	 * run the job if
48
-	 *
49
-	 * @param JobList $jobList
50
-	 * @param ILogger|null $logger
51
-	 */
52
-	public function execute($jobList, ILogger $logger = null) {
53
-		if ((time() - $this->lastRun) > $this->interval) {
54
-			parent::execute($jobList, $logger);
55
-		}
56
-	}
46
+    /**
47
+     * run the job if
48
+     *
49
+     * @param JobList $jobList
50
+     * @param ILogger|null $logger
51
+     */
52
+    public function execute($jobList, ILogger $logger = null) {
53
+        if ((time() - $this->lastRun) > $this->interval) {
54
+            parent::execute($jobList, $logger);
55
+        }
56
+    }
57 57
 }
Please login to merge, or discard this patch.
lib/private/BackgroundJob/QueuedJob.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@
 block discarded – undo
32 32
  * @package OC\BackgroundJob
33 33
  */
34 34
 abstract class QueuedJob extends Job {
35
-	/**
36
-	 * run the job, then remove it from the joblist
37
-	 *
38
-	 * @param JobList $jobList
39
-	 * @param ILogger|null $logger
40
-	 */
41
-	public function execute($jobList, ILogger $logger = null) {
42
-		$jobList->remove($this, $this->argument);
43
-		parent::execute($jobList, $logger);
44
-	}
35
+    /**
36
+     * run the job, then remove it from the joblist
37
+     *
38
+     * @param JobList $jobList
39
+     * @param ILogger|null $logger
40
+     */
41
+    public function execute($jobList, ILogger $logger = null) {
42
+        $jobList->remove($this, $this->argument);
43
+        parent::execute($jobList, $logger);
44
+    }
45 45
 }
Please login to merge, or discard this patch.
lib/public/IDateTimeFormatter.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -30,114 +30,114 @@
 block discarded – undo
30 30
  * @since 8.0.0
31 31
  */
32 32
 interface IDateTimeFormatter {
33
-	/**
34
-	 * Formats the date of the given timestamp
35
-	 *
36
-	 * @param int|\DateTime		$timestamp
37
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
38
-	 * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
39
-	 * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
40
-	 * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
41
-	 * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
42
-	 * 				The exact format is dependent on the language
43
-	 * @param \DateTimeZone|null	$timeZone	The timezone to use
44
-	 * @param \OCP\IL10N|null	$l			The locale to use
45
-	 * @return string Formatted date string
46
-	 * @since 8.0.0
47
-	 */
48
-	public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
33
+    /**
34
+     * Formats the date of the given timestamp
35
+     *
36
+     * @param int|\DateTime		$timestamp
37
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
38
+     * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
39
+     * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
40
+     * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
41
+     * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
42
+     * 				The exact format is dependent on the language
43
+     * @param \DateTimeZone|null	$timeZone	The timezone to use
44
+     * @param \OCP\IL10N|null	$l			The locale to use
45
+     * @return string Formatted date string
46
+     * @since 8.0.0
47
+     */
48
+    public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
49 49
 
50
-	/**
51
-	 * Formats the date of the given timestamp
52
-	 *
53
-	 * @param int|\DateTime		$timestamp
54
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
55
-	 * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
56
-	 * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
57
-	 * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
58
-	 * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
59
-	 * 				The exact format is dependent on the language
60
-	 * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
61
-	 * @param \DateTimeZone|null	$timeZone	The timezone to use
62
-	 * @param \OCP\IL10N|null	$l			The locale to use
63
-	 * @return string Formatted relative date string
64
-	 * @since 8.0.0
65
-	 */
66
-	public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
50
+    /**
51
+     * Formats the date of the given timestamp
52
+     *
53
+     * @param int|\DateTime		$timestamp
54
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
55
+     * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
56
+     * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
57
+     * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
58
+     * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
59
+     * 				The exact format is dependent on the language
60
+     * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
61
+     * @param \DateTimeZone|null	$timeZone	The timezone to use
62
+     * @param \OCP\IL10N|null	$l			The locale to use
63
+     * @return string Formatted relative date string
64
+     * @since 8.0.0
65
+     */
66
+    public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
67 67
 
68
-	/**
69
-	 * Gives the relative date of the timestamp
70
-	 * Only works for past dates
71
-	 *
72
-	 * @param int|\DateTime	$timestamp
73
-	 * @param int|\DateTime|null	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
74
-	 * @param \OCP\IL10N|null		$l			The locale to use
75
-	 * @return string	Dates returned are:
76
-	 * 				<  1 month	=> Today, Yesterday, n days ago
77
-	 * 				< 13 month	=> last month, n months ago
78
-	 * 				>= 13 month	=> last year, n years ago
79
-	 * @since 8.0.0
80
-	 */
81
-	public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
68
+    /**
69
+     * Gives the relative date of the timestamp
70
+     * Only works for past dates
71
+     *
72
+     * @param int|\DateTime	$timestamp
73
+     * @param int|\DateTime|null	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
74
+     * @param \OCP\IL10N|null		$l			The locale to use
75
+     * @return string	Dates returned are:
76
+     * 				<  1 month	=> Today, Yesterday, n days ago
77
+     * 				< 13 month	=> last month, n months ago
78
+     * 				>= 13 month	=> last year, n years ago
79
+     * @since 8.0.0
80
+     */
81
+    public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
82 82
 
83
-	/**
84
-	 * Formats the time of the given timestamp
85
-	 *
86
-	 * @param int|\DateTime $timestamp
87
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
88
-	 * 				full:	e.g. 'h:mm:ss a zzzz'	=> '11:42:13 AM GMT+0:00'
89
-	 * 				long:	e.g. 'h:mm:ss a z'		=> '11:42:13 AM GMT'
90
-	 * 				medium:	e.g. 'h:mm:ss a'		=> '11:42:13 AM'
91
-	 * 				short:	e.g. 'h:mm a'			=> '11:42 AM'
92
-	 * 				The exact format is dependent on the language
93
-	 * @param \DateTimeZone|null	$timeZone	The timezone to use
94
-	 * @param \OCP\IL10N|null		$l			The locale to use
95
-	 * @return string Formatted time string
96
-	 * @since 8.0.0
97
-	 */
98
-	public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
83
+    /**
84
+     * Formats the time of the given timestamp
85
+     *
86
+     * @param int|\DateTime $timestamp
87
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
88
+     * 				full:	e.g. 'h:mm:ss a zzzz'	=> '11:42:13 AM GMT+0:00'
89
+     * 				long:	e.g. 'h:mm:ss a z'		=> '11:42:13 AM GMT'
90
+     * 				medium:	e.g. 'h:mm:ss a'		=> '11:42:13 AM'
91
+     * 				short:	e.g. 'h:mm a'			=> '11:42 AM'
92
+     * 				The exact format is dependent on the language
93
+     * @param \DateTimeZone|null	$timeZone	The timezone to use
94
+     * @param \OCP\IL10N|null		$l			The locale to use
95
+     * @return string Formatted time string
96
+     * @since 8.0.0
97
+     */
98
+    public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
99 99
 
100
-	/**
101
-	 * Gives the relative past time of the timestamp
102
-	 *
103
-	 * @param int|\DateTime	$timestamp
104
-	 * @param int|\DateTime|null	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
105
-	 * @param \OCP\IL10N|null		$l			The locale to use
106
-	 * @return string	Dates returned are:
107
-	 * 				< 60 sec	=> seconds ago
108
-	 * 				<  1 hour	=> n minutes ago
109
-	 * 				<  1 day	=> n hours ago
110
-	 * 				<  1 month	=> Yesterday, n days ago
111
-	 * 				< 13 month	=> last month, n months ago
112
-	 * 				>= 13 month	=> last year, n years ago
113
-	 * @since 8.0.0
114
-	 */
115
-	public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
100
+    /**
101
+     * Gives the relative past time of the timestamp
102
+     *
103
+     * @param int|\DateTime	$timestamp
104
+     * @param int|\DateTime|null	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
105
+     * @param \OCP\IL10N|null		$l			The locale to use
106
+     * @return string	Dates returned are:
107
+     * 				< 60 sec	=> seconds ago
108
+     * 				<  1 hour	=> n minutes ago
109
+     * 				<  1 day	=> n hours ago
110
+     * 				<  1 month	=> Yesterday, n days ago
111
+     * 				< 13 month	=> last month, n months ago
112
+     * 				>= 13 month	=> last year, n years ago
113
+     * @since 8.0.0
114
+     */
115
+    public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
116 116
 
117
-	/**
118
-	 * Formats the date and time of the given timestamp
119
-	 *
120
-	 * @param int|\DateTime $timestamp
121
-	 * @param string	$formatDate		See formatDate() for description
122
-	 * @param string	$formatTime		See formatTime() for description
123
-	 * @param \DateTimeZone|null	$timeZone	The timezone to use
124
-	 * @param \OCP\IL10N|null		$l			The locale to use
125
-	 * @return string Formatted date and time string
126
-	 * @since 8.0.0
127
-	 */
128
-	public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
117
+    /**
118
+     * Formats the date and time of the given timestamp
119
+     *
120
+     * @param int|\DateTime $timestamp
121
+     * @param string	$formatDate		See formatDate() for description
122
+     * @param string	$formatTime		See formatTime() for description
123
+     * @param \DateTimeZone|null	$timeZone	The timezone to use
124
+     * @param \OCP\IL10N|null		$l			The locale to use
125
+     * @return string Formatted date and time string
126
+     * @since 8.0.0
127
+     */
128
+    public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
129 129
 
130
-	/**
131
-	 * Formats the date and time of the given timestamp
132
-	 *
133
-	 * @param int|\DateTime $timestamp
134
-	 * @param string	$formatDate		See formatDate() for description
135
-	 * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
136
-	 * @param string	$formatTime		See formatTime() for description
137
-	 * @param \DateTimeZone|null	$timeZone	The timezone to use
138
-	 * @param \OCP\IL10N|null		$l			The locale to use
139
-	 * @return string Formatted relative date and time string
140
-	 * @since 8.0.0
141
-	 */
142
-	public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
130
+    /**
131
+     * Formats the date and time of the given timestamp
132
+     *
133
+     * @param int|\DateTime $timestamp
134
+     * @param string	$formatDate		See formatDate() for description
135
+     * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
136
+     * @param string	$formatTime		See formatTime() for description
137
+     * @param \DateTimeZone|null	$timeZone	The timezone to use
138
+     * @param \OCP\IL10N|null		$l			The locale to use
139
+     * @return string Formatted relative date and time string
140
+     * @since 8.0.0
141
+     */
142
+    public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null);
143 143
 }
Please login to merge, or discard this patch.
lib/public/Search/PagedProvider.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -30,39 +30,39 @@
 block discarded – undo
30 30
  */
31 31
 abstract class PagedProvider extends Provider {
32 32
 
33
-	/**
34
-	 * show all results
35
-	 * @since 8.0.0
36
-	 */
37
-	const SIZE_ALL = 0;
33
+    /**
34
+     * show all results
35
+     * @since 8.0.0
36
+     */
37
+    const SIZE_ALL = 0;
38 38
 
39
-	/**
40
-	 * Constructor
41
-	 * @param array $options
42
-	 * @since 8.0.0
43
-	 */
44
-	public function __construct($options) {
45
-		parent::__construct($options);
46
-	}
39
+    /**
40
+     * Constructor
41
+     * @param array $options
42
+     * @since 8.0.0
43
+     */
44
+    public function __construct($options) {
45
+        parent::__construct($options);
46
+    }
47 47
 
48
-	/**
49
-	 * Search for $query
50
-	 * @param string $query
51
-	 * @return array An array of OCP\Search\Result's
52
-	 * @since 8.0.0
53
-	 */
54
-	public function search($query) {
55
-		// old apps might assume they get all results, so we use SIZE_ALL
56
-		return $this->searchPaged($query, 1, self::SIZE_ALL);
57
-	}
48
+    /**
49
+     * Search for $query
50
+     * @param string $query
51
+     * @return array An array of OCP\Search\Result's
52
+     * @since 8.0.0
53
+     */
54
+    public function search($query) {
55
+        // old apps might assume they get all results, so we use SIZE_ALL
56
+        return $this->searchPaged($query, 1, self::SIZE_ALL);
57
+    }
58 58
 
59
-	/**
60
-	 * Search for $query
61
-	 * @param string $query
62
-	 * @param int $page pages start at page 1
63
-	 * @param int $size 0 = SIZE_ALL
64
-	 * @return array An array of OCP\Search\Result's
65
-	 * @since 8.0.0
66
-	 */
67
-	abstract public function searchPaged($query, $page, $size);
59
+    /**
60
+     * Search for $query
61
+     * @param string $query
62
+     * @param int $page pages start at page 1
63
+     * @param int $size 0 = SIZE_ALL
64
+     * @return array An array of OCP\Search\Result's
65
+     * @since 8.0.0
66
+     */
67
+    abstract public function searchPaged($query, $page, $size);
68 68
 }
Please login to merge, or discard this patch.
lib/public/Share/Exceptions/GenericShareException.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -31,18 +31,18 @@
 block discarded – undo
31 31
  */
32 32
 class GenericShareException extends HintException {
33 33
 
34
-	/**
35
-	 * @param string $message
36
-	 * @param string $hint
37
-	 * @param int $code
38
-	 * @param \Exception|null $previous
39
-	 * @since 9.0.0
40
-	 */
41
-	public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
42
-		if (empty($message)) {
43
-			$message = 'There was an error retrieving the share. Maybe the link is wrong, it was unshared, or it was deleted.';
44
-		}
45
-		parent::__construct($message, $hint, $code, $previous);
46
-	}
34
+    /**
35
+     * @param string $message
36
+     * @param string $hint
37
+     * @param int $code
38
+     * @param \Exception|null $previous
39
+     * @since 9.0.0
40
+     */
41
+    public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
42
+        if (empty($message)) {
43
+            $message = 'There was an error retrieving the share. Maybe the link is wrong, it was unshared, or it was deleted.';
44
+        }
45
+        parent::__construct($message, $hint, $code, $previous);
46
+    }
47 47
 
48 48
 }
Please login to merge, or discard this patch.