Passed
Push — master ( b8b4d2...dd9780 )
by Joas
16:34 queued 26s
created
lib/public/SystemTag/SystemTagsEntityEvent.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 	 */
63 63
 	public function addEntityCollection(string $name, \Closure $entityExistsFunction) {
64 64
 		if (isset($this->collections[$name])) {
65
-			throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"');
65
+			throw new \OutOfBoundsException('Duplicate entity name "'.$name.'"');
66 66
 		}
67 67
 
68 68
 		$this->collections[$name] = $entityExistsFunction;
Please login to merge, or discard this patch.
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -37,49 +37,49 @@
 block discarded – undo
37 37
  */
38 38
 class SystemTagsEntityEvent extends Event {
39 39
 
40
-	/**
41
-	 * @deprecated 22.0.0
42
-	 */
43
-	public const EVENT_ENTITY = 'OCP\SystemTag\ISystemTagManager::registerEntity';
40
+    /**
41
+     * @deprecated 22.0.0
42
+     */
43
+    public const EVENT_ENTITY = 'OCP\SystemTag\ISystemTagManager::registerEntity';
44 44
 
45
-	/** @var string */
46
-	protected $event;
47
-	/** @var \Closure[] */
48
-	protected $collections;
45
+    /** @var string */
46
+    protected $event;
47
+    /** @var \Closure[] */
48
+    protected $collections;
49 49
 
50
-	/**
51
-	 * SystemTagsEntityEvent constructor.
52
-	 *
53
-	 * @param string $event
54
-	 * @since 9.1.0
55
-	 */
56
-	public function __construct(string $event) {
57
-		$this->event = $event;
58
-		$this->collections = [];
59
-	}
50
+    /**
51
+     * SystemTagsEntityEvent constructor.
52
+     *
53
+     * @param string $event
54
+     * @since 9.1.0
55
+     */
56
+    public function __construct(string $event) {
57
+        $this->event = $event;
58
+        $this->collections = [];
59
+    }
60 60
 
61
-	/**
62
-	 * @param string $name
63
-	 * @param \Closure $entityExistsFunction The closure should take one
64
-	 *                 argument, which is the id of the entity, that tags
65
-	 *                 should be handled for. The return should then be bool,
66
-	 *                 depending on whether tags are allowed (true) or not.
67
-	 * @throws \OutOfBoundsException when the entity name is already taken
68
-	 * @since 9.1.0
69
-	 */
70
-	public function addEntityCollection(string $name, \Closure $entityExistsFunction) {
71
-		if (isset($this->collections[$name])) {
72
-			throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"');
73
-		}
61
+    /**
62
+     * @param string $name
63
+     * @param \Closure $entityExistsFunction The closure should take one
64
+     *                 argument, which is the id of the entity, that tags
65
+     *                 should be handled for. The return should then be bool,
66
+     *                 depending on whether tags are allowed (true) or not.
67
+     * @throws \OutOfBoundsException when the entity name is already taken
68
+     * @since 9.1.0
69
+     */
70
+    public function addEntityCollection(string $name, \Closure $entityExistsFunction) {
71
+        if (isset($this->collections[$name])) {
72
+            throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"');
73
+        }
74 74
 
75
-		$this->collections[$name] = $entityExistsFunction;
76
-	}
75
+        $this->collections[$name] = $entityExistsFunction;
76
+    }
77 77
 
78
-	/**
79
-	 * @return \Closure[]
80
-	 * @since 9.1.0
81
-	 */
82
-	public function getEntityCollections(): array {
83
-		return $this->collections;
84
-	}
78
+    /**
79
+     * @return \Closure[]
80
+     * @since 9.1.0
81
+     */
82
+    public function getEntityCollections(): array {
83
+        return $this->collections;
84
+    }
85 85
 }
Please login to merge, or discard this patch.
lib/public/Log/IWriter.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
  * @since 14.0.0
31 31
  */
32 32
 interface IWriter {
33
-	/**
34
-	 * @since 14.0.0
35
-	 */
36
-	public function write(string $app, $message, int $level);
33
+    /**
34
+     * @since 14.0.0
35
+     */
36
+    public function write(string $app, $message, int $level);
37 37
 }
Please login to merge, or discard this patch.
lib/private/DateTimeZone.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		try {
66 66
 			return new \DateTimeZone($timeZone);
67 67
 		} catch (\Exception $e) {
68
-			\OCP\Util::writeLog('datetimezone', 'Failed to created DateTimeZone "' . $timeZone . "'", ILogger::DEBUG);
68
+			\OCP\Util::writeLog('datetimezone', 'Failed to created DateTimeZone "'.$timeZone."'", ILogger::DEBUG);
69 69
 			return new \DateTimeZone($this->getDefaultTimeZone());
70 70
 		}
71 71
 	}
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 			// so a positive offset means negative timeZone
87 87
 			// and the other way around.
88 88
 			if ($offset > 0) {
89
-				$timeZone = 'Etc/GMT-' . $offset;
89
+				$timeZone = 'Etc/GMT-'.$offset;
90 90
 			} else {
91
-				$timeZone = 'Etc/GMT+' . abs($offset);
91
+				$timeZone = 'Etc/GMT+'.abs($offset);
92 92
 			}
93 93
 
94 94
 			return new \DateTimeZone($timeZone);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			}
111 111
 
112 112
 			// No timezone found, fallback to UTC
113
-			\OCP\Util::writeLog('datetimezone', 'Failed to find DateTimeZone for offset "' . $offset . "'", ILogger::DEBUG);
113
+			\OCP\Util::writeLog('datetimezone', 'Failed to find DateTimeZone for offset "'.$offset."'", ILogger::DEBUG);
114 114
 			return new \DateTimeZone($this->getDefaultTimeZone());
115 115
 		}
116 116
 	}
Please login to merge, or discard this patch.
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -30,100 +30,100 @@
 block discarded – undo
30 30
 use OCP\ISession;
31 31
 
32 32
 class DateTimeZone implements IDateTimeZone {
33
-	/** @var IConfig */
34
-	protected $config;
33
+    /** @var IConfig */
34
+    protected $config;
35 35
 
36
-	/** @var ISession */
37
-	protected $session;
36
+    /** @var ISession */
37
+    protected $session;
38 38
 
39
-	/**
40
-	 * Constructor
41
-	 *
42
-	 * @param IConfig $config
43
-	 * @param ISession $session
44
-	 */
45
-	public function __construct(IConfig $config, ISession $session) {
46
-		$this->config = $config;
47
-		$this->session = $session;
48
-	}
39
+    /**
40
+     * Constructor
41
+     *
42
+     * @param IConfig $config
43
+     * @param ISession $session
44
+     */
45
+    public function __construct(IConfig $config, ISession $session) {
46
+        $this->config = $config;
47
+        $this->session = $session;
48
+    }
49 49
 
50
-	/**
51
-	 * Get the timezone of the current user, based on his session information and config data
52
-	 *
53
-	 * @param bool|int $timestamp
54
-	 * @return \DateTimeZone
55
-	 */
56
-	public function getTimeZone($timestamp = false) {
57
-		$timeZone = $this->config->getUserValue($this->session->get('user_id'), 'core', 'timezone', null);
58
-		if ($timeZone === null) {
59
-			if ($this->session->exists('timezone')) {
60
-				return $this->guessTimeZoneFromOffset($this->session->get('timezone'), $timestamp);
61
-			}
62
-			$timeZone = $this->getDefaultTimeZone();
63
-		}
50
+    /**
51
+     * Get the timezone of the current user, based on his session information and config data
52
+     *
53
+     * @param bool|int $timestamp
54
+     * @return \DateTimeZone
55
+     */
56
+    public function getTimeZone($timestamp = false) {
57
+        $timeZone = $this->config->getUserValue($this->session->get('user_id'), 'core', 'timezone', null);
58
+        if ($timeZone === null) {
59
+            if ($this->session->exists('timezone')) {
60
+                return $this->guessTimeZoneFromOffset($this->session->get('timezone'), $timestamp);
61
+            }
62
+            $timeZone = $this->getDefaultTimeZone();
63
+        }
64 64
 
65
-		try {
66
-			return new \DateTimeZone($timeZone);
67
-		} catch (\Exception $e) {
68
-			\OCP\Util::writeLog('datetimezone', 'Failed to created DateTimeZone "' . $timeZone . "'", ILogger::DEBUG);
69
-			return new \DateTimeZone($this->getDefaultTimeZone());
70
-		}
71
-	}
65
+        try {
66
+            return new \DateTimeZone($timeZone);
67
+        } catch (\Exception $e) {
68
+            \OCP\Util::writeLog('datetimezone', 'Failed to created DateTimeZone "' . $timeZone . "'", ILogger::DEBUG);
69
+            return new \DateTimeZone($this->getDefaultTimeZone());
70
+        }
71
+    }
72 72
 
73
-	/**
74
-	 * Guess the DateTimeZone for a given offset
75
-	 *
76
-	 * We first try to find a Etc/GMT* timezone, if that does not exist,
77
-	 * we try to find it manually, before falling back to UTC.
78
-	 *
79
-	 * @param mixed $offset
80
-	 * @param bool|int $timestamp
81
-	 * @return \DateTimeZone
82
-	 */
83
-	protected function guessTimeZoneFromOffset($offset, $timestamp) {
84
-		try {
85
-			// Note: the timeZone name is the inverse to the offset,
86
-			// so a positive offset means negative timeZone
87
-			// and the other way around.
88
-			if ($offset > 0) {
89
-				$timeZone = 'Etc/GMT-' . $offset;
90
-			} else {
91
-				$timeZone = 'Etc/GMT+' . abs($offset);
92
-			}
73
+    /**
74
+     * Guess the DateTimeZone for a given offset
75
+     *
76
+     * We first try to find a Etc/GMT* timezone, if that does not exist,
77
+     * we try to find it manually, before falling back to UTC.
78
+     *
79
+     * @param mixed $offset
80
+     * @param bool|int $timestamp
81
+     * @return \DateTimeZone
82
+     */
83
+    protected function guessTimeZoneFromOffset($offset, $timestamp) {
84
+        try {
85
+            // Note: the timeZone name is the inverse to the offset,
86
+            // so a positive offset means negative timeZone
87
+            // and the other way around.
88
+            if ($offset > 0) {
89
+                $timeZone = 'Etc/GMT-' . $offset;
90
+            } else {
91
+                $timeZone = 'Etc/GMT+' . abs($offset);
92
+            }
93 93
 
94
-			return new \DateTimeZone($timeZone);
95
-		} catch (\Exception $e) {
96
-			// If the offset has no Etc/GMT* timezone,
97
-			// we try to guess one timezone that has the same offset
98
-			foreach (\DateTimeZone::listIdentifiers() as $timeZone) {
99
-				$dtz = new \DateTimeZone($timeZone);
100
-				$dateTime = new \DateTime();
94
+            return new \DateTimeZone($timeZone);
95
+        } catch (\Exception $e) {
96
+            // If the offset has no Etc/GMT* timezone,
97
+            // we try to guess one timezone that has the same offset
98
+            foreach (\DateTimeZone::listIdentifiers() as $timeZone) {
99
+                $dtz = new \DateTimeZone($timeZone);
100
+                $dateTime = new \DateTime();
101 101
 
102
-				if ($timestamp !== false) {
103
-					$dateTime->setTimestamp($timestamp);
104
-				}
102
+                if ($timestamp !== false) {
103
+                    $dateTime->setTimestamp($timestamp);
104
+                }
105 105
 
106
-				$dtOffset = $dtz->getOffset($dateTime);
107
-				if ($dtOffset == 3600 * $offset) {
108
-					return $dtz;
109
-				}
110
-			}
106
+                $dtOffset = $dtz->getOffset($dateTime);
107
+                if ($dtOffset == 3600 * $offset) {
108
+                    return $dtz;
109
+                }
110
+            }
111 111
 
112
-			// No timezone found, fallback to UTC
113
-			\OCP\Util::writeLog('datetimezone', 'Failed to find DateTimeZone for offset "' . $offset . "'", ILogger::DEBUG);
114
-			return new \DateTimeZone($this->getDefaultTimeZone());
115
-		}
116
-	}
112
+            // No timezone found, fallback to UTC
113
+            \OCP\Util::writeLog('datetimezone', 'Failed to find DateTimeZone for offset "' . $offset . "'", ILogger::DEBUG);
114
+            return new \DateTimeZone($this->getDefaultTimeZone());
115
+        }
116
+    }
117 117
 
118
-	/**
119
-	 * Get the default timezone of the server
120
-	 *
121
-	 * Falls back to UTC if it is not yet set.
122
-	 *
123
-	 * @return string
124
-	 */
125
-	protected function getDefaultTimeZone() {
126
-		$serverTimeZone = date_default_timezone_get();
127
-		return $serverTimeZone ?: 'UTC';
128
-	}
118
+    /**
119
+     * Get the default timezone of the server
120
+     *
121
+     * Falls back to UTC if it is not yet set.
122
+     *
123
+     * @return string
124
+     */
125
+    protected function getDefaultTimeZone() {
126
+        $serverTimeZone = date_default_timezone_get();
127
+        return $serverTimeZone ?: 'UTC';
128
+    }
129 129
 }
Please login to merge, or discard this patch.
ocm-provider/index.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  */
21 21
 
22 22
 
23
-require_once __DIR__ . '/../lib/base.php';
23
+require_once __DIR__.'/../lib/base.php';
24 24
 
25 25
 header('Content-Type: application/json');
26 26
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 $isEnabled = $server->getAppManager()->isEnabledForUser('cloud_federation_api');
30 30
 
31 31
 if ($isEnabled) {
32
-	// Make sure the routes are loaded
33
-	\OC_App::loadApp('cloud_federation_api');
34
-	$capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator());
35
-	header('Content-Type: application/json');
36
-	echo json_encode($capabilities->getCapabilities()['ocm']);
32
+    // Make sure the routes are loaded
33
+    \OC_App::loadApp('cloud_federation_api');
34
+    $capabilities = new OCA\CloudFederationAPI\Capabilities($server->getURLGenerator());
35
+    header('Content-Type: application/json');
36
+    echo json_encode($capabilities->getCapabilities()['ocm']);
37 37
 } else {
38
-	header($_SERVER["SERVER_PROTOCOL"]." 501 Not Implemented", true, 501);
39
-	exit("501 Not Implemented");
38
+    header($_SERVER["SERVER_PROTOCOL"]." 501 Not Implemented", true, 501);
39
+    exit("501 Not Implemented");
40 40
 }
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function __construct($providerId) {
34 34
 		$l = \OC::$server->getL10N('federation');
35
-		$message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.';
35
+		$message = 'Cloud Federation Provider with ID: "'.$providerId.'" does not exist.';
36 36
 		$hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]);
37 37
 		parent::__construct($message, $hint);
38 38
 	}
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,18 +32,18 @@
 block discarded – undo
32 32
  */
33 33
 class ProviderDoesNotExistsException extends HintException {
34 34
 
35
-	/**
36
-	 * ProviderDoesNotExistsException constructor.
37
-	 *
38
-	 * @since 14.0.0
39
-	 *
40
-	 * @param string $providerId cloud federation provider ID
41
-	 */
42
-	public function __construct($providerId) {
43
-		$l = \OC::$server->getL10N('federation');
44
-		$message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.';
45
-		$hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]);
46
-		parent::__construct($message, $hint);
47
-	}
35
+    /**
36
+     * ProviderDoesNotExistsException constructor.
37
+     *
38
+     * @since 14.0.0
39
+     *
40
+     * @param string $providerId cloud federation provider ID
41
+     */
42
+    public function __construct($providerId) {
43
+        $l = \OC::$server->getL10N('federation');
44
+        $message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.';
45
+        $hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]);
46
+        parent::__construct($message, $hint);
47
+    }
48 48
 
49 49
 }
Please login to merge, or discard this patch.
lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@
 block discarded – undo
30 30
 
31 31
 class AddPreviewBackgroundCleanupJob implements IRepairStep {
32 32
 
33
-	/** @var IJobList */
34
-	private $jobList;
33
+    /** @var IJobList */
34
+    private $jobList;
35 35
 
36
-	public function __construct(IJobList $jobList) {
37
-		$this->jobList = $jobList;
38
-	}
36
+    public function __construct(IJobList $jobList) {
37
+        $this->jobList = $jobList;
38
+    }
39 39
 
40
-	public function getName(): string {
41
-		return 'Add preview background cleanup job';
42
-	}
40
+    public function getName(): string {
41
+        return 'Add preview background cleanup job';
42
+    }
43 43
 
44
-	public function run(IOutput $output) {
45
-		$this->jobList->add(BackgroundCleanupJob::class);
46
-	}
44
+    public function run(IOutput $output) {
45
+        $this->jobList->add(BackgroundCleanupJob::class);
46
+    }
47 47
 
48 48
 }
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/ActionNotSupportedException.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct($action) {
33 33
 		$l = \OC::$server->getL10N('federation');
34
-		$message = 'Action "' . $action . '" not supported or implemented.';
34
+		$message = 'Action "'.$action.'" not supported or implemented.';
35 35
 		$hint = $l->t('Action "%s" not supported or implemented.', [$action]);
36 36
 		parent::__construct($message, $hint);
37 37
 	}
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
  */
33 33
 class ActionNotSupportedException extends HintException {
34 34
 
35
-	/**
36
-	 * ActionNotSupportedException constructor.
37
-	 *
38
-	 * @since 14.0.0
39
-	 *
40
-	 */
41
-	public function __construct($action) {
42
-		$l = \OC::$server->getL10N('federation');
43
-		$message = 'Action "' . $action . '" not supported or implemented.';
44
-		$hint = $l->t('Action "%s" not supported or implemented.', [$action]);
45
-		parent::__construct($message, $hint);
46
-	}
35
+    /**
36
+     * ActionNotSupportedException constructor.
37
+     *
38
+     * @since 14.0.0
39
+     *
40
+     */
41
+    public function __construct($action) {
42
+        $l = \OC::$server->getL10N('federation');
43
+        $message = 'Action "' . $action . '" not supported or implemented.';
44
+        $hint = $l->t('Action "%s" not supported or implemented.', [$action]);
45
+        parent::__construct($message, $hint);
46
+    }
47 47
 
48 48
 }
Please login to merge, or discard this patch.
lib/private/Preview/Watcher.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		}
56 56
 
57 57
 		try {
58
-			$folder = $this->appData->getFolder((string)$node->getId());
58
+			$folder = $this->appData->getFolder((string) $node->getId());
59 59
 			$folder->delete();
60 60
 		} catch (NotFoundException $e) {
61 61
 			//Nothing to do
Please login to merge, or discard this patch.
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,39 +36,39 @@
 block discarded – undo
36 36
  * Class that will watch filesystem activity and remove previews as needed.
37 37
  */
38 38
 class Watcher {
39
-	/** @var IAppData */
40
-	private $appData;
39
+    /** @var IAppData */
40
+    private $appData;
41 41
 
42
-	/**
43
-	 * Watcher constructor.
44
-	 *
45
-	 * @param IAppData $appData
46
-	 */
47
-	public function __construct(IAppData $appData) {
48
-		$this->appData = $appData;
49
-	}
42
+    /**
43
+     * Watcher constructor.
44
+     *
45
+     * @param IAppData $appData
46
+     */
47
+    public function __construct(IAppData $appData) {
48
+        $this->appData = $appData;
49
+    }
50 50
 
51
-	public function postWrite(Node $node) {
52
-		$this->deleteNode($node);
53
-	}
51
+    public function postWrite(Node $node) {
52
+        $this->deleteNode($node);
53
+    }
54 54
 
55
-	protected function deleteNode(Node $node) {
56
-		// We only handle files
57
-		if ($node instanceof Folder) {
58
-			return;
59
-		}
55
+    protected function deleteNode(Node $node) {
56
+        // We only handle files
57
+        if ($node instanceof Folder) {
58
+            return;
59
+        }
60 60
 
61
-		try {
62
-			$folder = $this->appData->getFolder((string)$node->getId());
63
-			$folder->delete();
64
-		} catch (NotFoundException $e) {
65
-			//Nothing to do
66
-		}
67
-	}
61
+        try {
62
+            $folder = $this->appData->getFolder((string)$node->getId());
63
+            $folder->delete();
64
+        } catch (NotFoundException $e) {
65
+            //Nothing to do
66
+        }
67
+    }
68 68
 
69
-	public function versionRollback(array $data) {
70
-		if (isset($data['node'])) {
71
-			$this->deleteNode($data['node']);
72
-		}
73
-	}
69
+    public function versionRollback(array $data) {
70
+        if (isset($data['node'])) {
71
+            $this->deleteNode($data['node']);
72
+        }
73
+    }
74 74
 }
Please login to merge, or discard this patch.
lib/private/Preview/WatcherConnector.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -29,39 +29,39 @@
 block discarded – undo
29 29
 
30 30
 class WatcherConnector {
31 31
 
32
-	/** @var IRootFolder */
33
-	private $root;
32
+    /** @var IRootFolder */
33
+    private $root;
34 34
 
35
-	/** @var SystemConfig */
36
-	private $config;
35
+    /** @var SystemConfig */
36
+    private $config;
37 37
 
38
-	/**
39
-	 * WatcherConnector constructor.
40
-	 *
41
-	 * @param IRootFolder $root
42
-	 * @param SystemConfig $config
43
-	 */
44
-	public function __construct(IRootFolder $root,
45
-								SystemConfig $config) {
46
-		$this->root = $root;
47
-		$this->config = $config;
48
-	}
38
+    /**
39
+     * WatcherConnector constructor.
40
+     *
41
+     * @param IRootFolder $root
42
+     * @param SystemConfig $config
43
+     */
44
+    public function __construct(IRootFolder $root,
45
+                                SystemConfig $config) {
46
+        $this->root = $root;
47
+        $this->config = $config;
48
+    }
49 49
 
50
-	/**
51
-	 * @return Watcher
52
-	 */
53
-	private function getWatcher(): Watcher {
54
-		return \OC::$server->query(Watcher::class);
55
-	}
50
+    /**
51
+     * @return Watcher
52
+     */
53
+    private function getWatcher(): Watcher {
54
+        return \OC::$server->query(Watcher::class);
55
+    }
56 56
 
57
-	public function connectWatcher() {
58
-		// Do not connect if we are not setup yet!
59
-		if ($this->config->getValue('instanceid', null) !== null) {
60
-			$this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
61
-				$this->getWatcher()->postWrite($node);
62
-			});
57
+    public function connectWatcher() {
58
+        // Do not connect if we are not setup yet!
59
+        if ($this->config->getValue('instanceid', null) !== null) {
60
+            $this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
61
+                $this->getWatcher()->postWrite($node);
62
+            });
63 63
 
64
-			\OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
65
-		}
66
-	}
64
+            \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
65
+        }
66
+    }
67 67
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 	public function connectWatcher() {
58 58
 		// Do not connect if we are not setup yet!
59 59
 		if ($this->config->getValue('instanceid', null) !== null) {
60
-			$this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
60
+			$this->root->listen('\OC\Files', 'postWrite', function(Node $node) {
61 61
 				$this->getWatcher()->postWrite($node);
62 62
 			});
63 63
 
Please login to merge, or discard this patch.