Completed
Pull Request — master (#6779)
by Blizzz
11:54
created
apps/comments/lib/Collaboration/CommentersSorter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function sort(array &$sortArray, array $context) {
51 51
 		$commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']);
52
-		if(count($commenters) === 0) {
52
+		if (count($commenters) === 0) {
53 53
 			return;
54 54
 		}
55 55
 
56 56
 		foreach ($sortArray as &$byType) {
57
-			usort($byType, function ($a, $b) use ($commenters) {
57
+			usort($byType, function($a, $b) use ($commenters) {
58 58
 				$this->compare($a, $b, $commenters);
59 59
 			});
60 60
 		}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	protected function retrieveCommentsInformation($type, $id) {
69 69
 		$comments = $this->commentsManager->getForObject($type, $id, 1);
70
-		if(count($comments) === 0) {
70
+		if (count($comments) === 0) {
71 71
 			return [];
72 72
 		}
73 73
 
Please login to merge, or discard this patch.
lib/private/Comments/Manager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 			!is_string($type) || empty($type)
191 191
 			|| !is_string($id) || empty($id)
192 192
 		) {
193
-			throw new \InvalidArgumentException($role . ' parameters must be string and not empty');
193
+			throw new \InvalidArgumentException($role.' parameters must be string and not empty');
194 194
 		}
195 195
 	}
196 196
 
@@ -363,18 +363,18 @@  discard block
 block discarded – undo
363 363
 	 *
364 364
 	 */
365 365
 	protected function extractActor(array $node, array &$actors) {
366
-		if(isset($node['replies'])) {
366
+		if (isset($node['replies'])) {
367 367
 			foreach ($node['replies'] as $subNode) {
368 368
 				$this->extractActor($subNode, $actors);
369 369
 			}
370 370
 		}
371
-		if(isset($node['comment']) && $node['comment'] instanceof IComment) {
371
+		if (isset($node['comment']) && $node['comment'] instanceof IComment) {
372 372
 			/** @var IComment $comment */
373 373
 			$comment = $node['comment'];
374
-			if(!isset($actors[$comment->getActorType()])) {
374
+			if (!isset($actors[$comment->getActorType()])) {
375 375
 				$actors[$comment->getActorType()] = [];
376 376
 			}
377
-			if(!isset($actors[$comment->getActorType()][$comment->getActorId()])) {
377
+			if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) {
378 378
 				$actors[$comment->getActorType()][$comment->getActorId()] = 1;
379 379
 			} else {
380 380
 				$actors[$comment->getActorType()][$comment->getActorId()] += 1;
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 		$qb = $this->dbConn->getQueryBuilder();
479 479
 		$query = $qb->select('f.fileid')
480 480
 			->selectAlias(
481
-				$qb->createFunction('COUNT(' . $qb->getColumnName('c.id') . ')'),
481
+				$qb->createFunction('COUNT('.$qb->getColumnName('c.id').')'),
482 482
 				'num_ids'
483 483
 			)
484 484
 			->from('comments', 'c')
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
 	 * @param IComment $comment
612 612
 	 * @return bool
613 613
 	 */
614
-	protected function insert(IComment &$comment) {
614
+	protected function insert(IComment & $comment) {
615 615
 		$qb = $this->dbConn->getQueryBuilder();
616 616
 		$affectedRows = $qb
617 617
 			->insert('comments')
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 		if (!isset($this->displayNameResolvers[$type])) {
912 912
 			throw new \OutOfBoundsException('No Displayname resolver for this type registered');
913 913
 		}
914
-		return (string)$this->displayNameResolvers[$type]($id);
914
+		return (string) $this->displayNameResolvers[$type]($id);
915 915
 	}
916 916
 
917 917
 	/**
Please login to merge, or discard this patch.
lib/private/Collaboration/AutoComplete/Manager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 class Manager implements IManager {
31 31
 	/** @var string[] */
32
-	protected $sorters =[];
32
+	protected $sorters = [];
33 33
 
34 34
 	/** @var ISorter[]  */
35 35
 	protected $sorterInstances = [];
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function runSorters(array $sorters, array &$sortArray, array $context) {
44 44
 		$sorterInstances = $this->getSorters();
45
-		while($sorter = array_shift($sorters)) {
46
-			if(isset($sorterInstances[$sorter])) {
45
+		while ($sorter = array_shift($sorters)) {
46
+			if (isset($sorterInstances[$sorter])) {
47 47
 				$sorterInstances[$sorter]->sort($sortArray, $context);
48 48
 			} else {
49 49
 				$this->c->getLogger()->warning('No sorter for ID "{id}", skipping', [
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 	}
59 59
 
60 60
 	protected function getSorters() {
61
-		if(count($this->sorterInstances) === 0) {
61
+		if (count($this->sorterInstances) === 0) {
62 62
 			foreach ($this->sorters as $sorter) {
63 63
 				/** @var ISorter $instance */
64 64
 				$instance = $this->c->resolve($sorter);
65
-				if(!$instance instanceof ISorter) {
65
+				if (!$instance instanceof ISorter) {
66 66
 					$this->c->getLogger()->notice('Skipping sorter which is not an instance of ISorter. Class name: {class}',
67 67
 						['app' => 'core', 'class' => $sorter]);
68 68
 					continue;
69 69
 				}
70 70
 				$sorterId = trim($instance->getId());
71
-				if(trim($sorterId) === '') {
71
+				if (trim($sorterId) === '') {
72 72
 					$this->c->getLogger()->notice('Skipping sorter with empty ID. Class name: {class}',
73 73
 						['app' => 'core', 'class' => $sorter]);
74 74
 					continue;
Please login to merge, or discard this patch.