Passed
Push — master ( 078203...c81798 )
by Joas
14:40 queued 14s
created
apps/files_sharing/lib/Notification/Listener.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -37,97 +37,97 @@
 block discarded – undo
37 37
 
38 38
 class Listener {
39 39
 
40
-	/** @var INotificationManager */
41
-	protected $notificationManager;
42
-	/** @var IShareManager */
43
-	protected $shareManager;
44
-	/** @var IGroupManager */
45
-	protected $groupManager;
46
-
47
-	public function __construct(
48
-		INotificationManager $notificationManager,
49
-		IShareManager $shareManager,
50
-		IGroupManager $groupManager
51
-	) {
52
-		$this->notificationManager = $notificationManager;
53
-		$this->shareManager = $shareManager;
54
-		$this->groupManager = $groupManager;
55
-	}
56
-
57
-	/**
58
-	 * @param GenericEvent $event
59
-	 */
60
-	public function shareNotification(GenericEvent $event): void {
61
-		/** @var IShare $share */
62
-		$share = $event->getSubject();
63
-		$notification = $this->instantiateNotification($share);
64
-
65
-		if ($share->getShareType() === IShare::TYPE_USER) {
66
-			$notification->setSubject(Notifier::INCOMING_USER_SHARE)
67
-				->setUser($share->getSharedWith());
68
-			$this->notificationManager->notify($notification);
69
-		} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
70
-			$notification->setSubject(Notifier::INCOMING_GROUP_SHARE);
71
-			$group = $this->groupManager->get($share->getSharedWith());
72
-
73
-			foreach ($group->getUsers() as $user) {
74
-				if ($user->getUID() === $share->getShareOwner() ||
75
-					$user->getUID() === $share->getSharedBy()) {
76
-					continue;
77
-				}
78
-
79
-				$notification->setUser($user->getUID());
80
-				$this->notificationManager->notify($notification);
81
-			}
82
-		}
83
-	}
84
-
85
-	/**
86
-	 * @param GenericEvent $event
87
-	 */
88
-	public function userAddedToGroup(GenericEvent $event): void {
89
-		/** @var IGroup $group */
90
-		$group = $event->getSubject();
91
-		/** @var IUser $user */
92
-		$user = $event->getArgument('user');
93
-
94
-		$offset = 0;
95
-		while (true) {
96
-			$shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, 50, $offset);
97
-			if (empty($shares)) {
98
-				break;
99
-			}
100
-
101
-			foreach ($shares as $share) {
102
-				if ($share->getSharedWith() !== $group->getGID()) {
103
-					continue;
104
-				}
105
-
106
-				if ($user->getUID() === $share->getShareOwner() ||
107
-					$user->getUID() === $share->getSharedBy()) {
108
-					continue;
109
-				}
110
-
111
-				$notification = $this->instantiateNotification($share);
112
-				$notification->setSubject(Notifier::INCOMING_GROUP_SHARE)
113
-					->setUser($user->getUID());
114
-				$this->notificationManager->notify($notification);
115
-			}
116
-			$offset += 50;
117
-		}
118
-	}
119
-
120
-	/**
121
-	 * @param IShare $share
122
-	 * @return INotification
123
-	 */
124
-	protected function instantiateNotification(IShare $share): INotification {
125
-		$notification = $this->notificationManager->createNotification();
126
-		$notification
127
-			->setApp('files_sharing')
128
-			->setObject('share', $share->getFullId())
129
-			->setDateTime($share->getShareTime());
130
-
131
-		return $notification;
132
-	}
40
+    /** @var INotificationManager */
41
+    protected $notificationManager;
42
+    /** @var IShareManager */
43
+    protected $shareManager;
44
+    /** @var IGroupManager */
45
+    protected $groupManager;
46
+
47
+    public function __construct(
48
+        INotificationManager $notificationManager,
49
+        IShareManager $shareManager,
50
+        IGroupManager $groupManager
51
+    ) {
52
+        $this->notificationManager = $notificationManager;
53
+        $this->shareManager = $shareManager;
54
+        $this->groupManager = $groupManager;
55
+    }
56
+
57
+    /**
58
+     * @param GenericEvent $event
59
+     */
60
+    public function shareNotification(GenericEvent $event): void {
61
+        /** @var IShare $share */
62
+        $share = $event->getSubject();
63
+        $notification = $this->instantiateNotification($share);
64
+
65
+        if ($share->getShareType() === IShare::TYPE_USER) {
66
+            $notification->setSubject(Notifier::INCOMING_USER_SHARE)
67
+                ->setUser($share->getSharedWith());
68
+            $this->notificationManager->notify($notification);
69
+        } elseif ($share->getShareType() === IShare::TYPE_GROUP) {
70
+            $notification->setSubject(Notifier::INCOMING_GROUP_SHARE);
71
+            $group = $this->groupManager->get($share->getSharedWith());
72
+
73
+            foreach ($group->getUsers() as $user) {
74
+                if ($user->getUID() === $share->getShareOwner() ||
75
+                    $user->getUID() === $share->getSharedBy()) {
76
+                    continue;
77
+                }
78
+
79
+                $notification->setUser($user->getUID());
80
+                $this->notificationManager->notify($notification);
81
+            }
82
+        }
83
+    }
84
+
85
+    /**
86
+     * @param GenericEvent $event
87
+     */
88
+    public function userAddedToGroup(GenericEvent $event): void {
89
+        /** @var IGroup $group */
90
+        $group = $event->getSubject();
91
+        /** @var IUser $user */
92
+        $user = $event->getArgument('user');
93
+
94
+        $offset = 0;
95
+        while (true) {
96
+            $shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, 50, $offset);
97
+            if (empty($shares)) {
98
+                break;
99
+            }
100
+
101
+            foreach ($shares as $share) {
102
+                if ($share->getSharedWith() !== $group->getGID()) {
103
+                    continue;
104
+                }
105
+
106
+                if ($user->getUID() === $share->getShareOwner() ||
107
+                    $user->getUID() === $share->getSharedBy()) {
108
+                    continue;
109
+                }
110
+
111
+                $notification = $this->instantiateNotification($share);
112
+                $notification->setSubject(Notifier::INCOMING_GROUP_SHARE)
113
+                    ->setUser($user->getUID());
114
+                $this->notificationManager->notify($notification);
115
+            }
116
+            $offset += 50;
117
+        }
118
+    }
119
+
120
+    /**
121
+     * @param IShare $share
122
+     * @return INotification
123
+     */
124
+    protected function instantiateNotification(IShare $share): INotification {
125
+        $notification = $this->notificationManager->createNotification();
126
+        $notification
127
+            ->setApp('files_sharing')
128
+            ->setObject('share', $share->getFullId())
129
+            ->setDateTime($share->getShareTime());
130
+
131
+        return $notification;
132
+    }
133 133
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Check/AbstractStringCheck.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -27,96 +27,96 @@
 block discarded – undo
27 27
 
28 28
 abstract class AbstractStringCheck implements ICheck {
29 29
 
30
-	/** @var array[] Nested array: [Pattern => [ActualValue => Regex Result]] */
31
-	protected $matches;
30
+    /** @var array[] Nested array: [Pattern => [ActualValue => Regex Result]] */
31
+    protected $matches;
32 32
 
33
-	/** @var IL10N */
34
-	protected $l;
33
+    /** @var IL10N */
34
+    protected $l;
35 35
 
36
-	/**
37
-	 * @param IL10N $l
38
-	 */
39
-	public function __construct(IL10N $l) {
40
-		$this->l = $l;
41
-	}
36
+    /**
37
+     * @param IL10N $l
38
+     */
39
+    public function __construct(IL10N $l) {
40
+        $this->l = $l;
41
+    }
42 42
 
43
-	/**
44
-	 * @return string
45
-	 */
46
-	abstract protected function getActualValue();
43
+    /**
44
+     * @return string
45
+     */
46
+    abstract protected function getActualValue();
47 47
 
48
-	/**
49
-	 * @param string $operator
50
-	 * @param string $value
51
-	 * @return bool
52
-	 */
53
-	public function executeCheck($operator, $value) {
54
-		$actualValue = $this->getActualValue();
55
-		return $this->executeStringCheck($operator, $value, $actualValue);
56
-	}
48
+    /**
49
+     * @param string $operator
50
+     * @param string $value
51
+     * @return bool
52
+     */
53
+    public function executeCheck($operator, $value) {
54
+        $actualValue = $this->getActualValue();
55
+        return $this->executeStringCheck($operator, $value, $actualValue);
56
+    }
57 57
 
58
-	/**
59
-	 * @param string $operator
60
-	 * @param string $checkValue
61
-	 * @param string $actualValue
62
-	 * @return bool
63
-	 */
64
-	protected function executeStringCheck($operator, $checkValue, $actualValue) {
65
-		if ($operator === 'is') {
66
-			return $checkValue === $actualValue;
67
-		} elseif ($operator === '!is') {
68
-			return $checkValue !== $actualValue;
69
-		} else {
70
-			$match = $this->match($checkValue, $actualValue);
71
-			if ($operator === 'matches') {
72
-				return $match === 1;
73
-			} else {
74
-				return $match === 0;
75
-			}
76
-		}
77
-	}
58
+    /**
59
+     * @param string $operator
60
+     * @param string $checkValue
61
+     * @param string $actualValue
62
+     * @return bool
63
+     */
64
+    protected function executeStringCheck($operator, $checkValue, $actualValue) {
65
+        if ($operator === 'is') {
66
+            return $checkValue === $actualValue;
67
+        } elseif ($operator === '!is') {
68
+            return $checkValue !== $actualValue;
69
+        } else {
70
+            $match = $this->match($checkValue, $actualValue);
71
+            if ($operator === 'matches') {
72
+                return $match === 1;
73
+            } else {
74
+                return $match === 0;
75
+            }
76
+        }
77
+    }
78 78
 
79
-	/**
80
-	 * @param string $operator
81
-	 * @param string $value
82
-	 * @throws \UnexpectedValueException
83
-	 */
84
-	public function validateCheck($operator, $value) {
85
-		if (!in_array($operator, ['is', '!is', 'matches', '!matches'])) {
86
-			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
87
-		}
79
+    /**
80
+     * @param string $operator
81
+     * @param string $value
82
+     * @throws \UnexpectedValueException
83
+     */
84
+    public function validateCheck($operator, $value) {
85
+        if (!in_array($operator, ['is', '!is', 'matches', '!matches'])) {
86
+            throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
87
+        }
88 88
 
89
-		if (in_array($operator, ['matches', '!matches']) &&
90
-			  @preg_match($value, null) === false) {
91
-			throw new \UnexpectedValueException($this->l->t('The given regular expression is invalid'), 2);
92
-		}
93
-	}
89
+        if (in_array($operator, ['matches', '!matches']) &&
90
+              @preg_match($value, null) === false) {
91
+            throw new \UnexpectedValueException($this->l->t('The given regular expression is invalid'), 2);
92
+        }
93
+    }
94 94
 
95
-	public function supportedEntities(): array {
96
-		// universal by default
97
-		return [];
98
-	}
95
+    public function supportedEntities(): array {
96
+        // universal by default
97
+        return [];
98
+    }
99 99
 
100
-	public function isAvailableForScope(int $scope): bool {
101
-		// admin only by default
102
-		return $scope === IManager::SCOPE_ADMIN;
103
-	}
100
+    public function isAvailableForScope(int $scope): bool {
101
+        // admin only by default
102
+        return $scope === IManager::SCOPE_ADMIN;
103
+    }
104 104
 
105
-	/**
106
-	 * @param string $pattern
107
-	 * @param string $subject
108
-	 * @return int|bool
109
-	 */
110
-	protected function match($pattern, $subject) {
111
-		$patternHash = md5($pattern);
112
-		$subjectHash = md5($subject);
113
-		if (isset($this->matches[$patternHash][$subjectHash])) {
114
-			return $this->matches[$patternHash][$subjectHash];
115
-		}
116
-		if (!isset($this->matches[$patternHash])) {
117
-			$this->matches[$patternHash] = [];
118
-		}
119
-		$this->matches[$patternHash][$subjectHash] = preg_match($pattern, $subject);
120
-		return $this->matches[$patternHash][$subjectHash];
121
-	}
105
+    /**
106
+     * @param string $pattern
107
+     * @param string $subject
108
+     * @return int|bool
109
+     */
110
+    protected function match($pattern, $subject) {
111
+        $patternHash = md5($pattern);
112
+        $subjectHash = md5($subject);
113
+        if (isset($this->matches[$patternHash][$subjectHash])) {
114
+            return $this->matches[$patternHash][$subjectHash];
115
+        }
116
+        if (!isset($this->matches[$patternHash])) {
117
+            $this->matches[$patternHash] = [];
118
+        }
119
+        $this->matches[$patternHash][$subjectHash] = preg_match($pattern, $subject);
120
+        return $this->matches[$patternHash][$subjectHash];
121
+    }
122 122
 }
Please login to merge, or discard this patch.
apps/settings/templates/settings/empty.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,4 +21,4 @@
 block discarded – undo
21 21
  *
22 22
  */
23 23
 
24
-	# used for Personal/Additional settings as fallback for legacy settings
24
+    # used for Personal/Additional settings as fallback for legacy settings
Please login to merge, or discard this patch.
lib/private/DateTimeFormatter.php 1 patch
Indentation   +268 added lines, -268 removed lines patch added patch discarded remove patch
@@ -26,294 +26,294 @@
 block discarded – undo
26 26
 namespace OC;
27 27
 
28 28
 class DateTimeFormatter implements \OCP\IDateTimeFormatter {
29
-	/** @var \DateTimeZone */
30
-	protected $defaultTimeZone;
29
+    /** @var \DateTimeZone */
30
+    protected $defaultTimeZone;
31 31
 
32
-	/** @var \OCP\IL10N */
33
-	protected $defaultL10N;
32
+    /** @var \OCP\IL10N */
33
+    protected $defaultL10N;
34 34
 
35
-	/**
36
-	 * Constructor
37
-	 *
38
-	 * @param \DateTimeZone $defaultTimeZone Set the timezone for the format
39
-	 * @param \OCP\IL10N $defaultL10N Set the language for the format
40
-	 */
41
-	public function __construct(\DateTimeZone $defaultTimeZone, \OCP\IL10N $defaultL10N) {
42
-		$this->defaultTimeZone = $defaultTimeZone;
43
-		$this->defaultL10N = $defaultL10N;
44
-	}
35
+    /**
36
+     * Constructor
37
+     *
38
+     * @param \DateTimeZone $defaultTimeZone Set the timezone for the format
39
+     * @param \OCP\IL10N $defaultL10N Set the language for the format
40
+     */
41
+    public function __construct(\DateTimeZone $defaultTimeZone, \OCP\IL10N $defaultL10N) {
42
+        $this->defaultTimeZone = $defaultTimeZone;
43
+        $this->defaultL10N = $defaultL10N;
44
+    }
45 45
 
46
-	/**
47
-	 * Get TimeZone to use
48
-	 *
49
-	 * @param \DateTimeZone $timeZone	The timezone to use
50
-	 * @return \DateTimeZone		The timezone to use, falling back to the current user's timezone
51
-	 */
52
-	protected function getTimeZone($timeZone = null) {
53
-		if ($timeZone === null) {
54
-			$timeZone = $this->defaultTimeZone;
55
-		}
46
+    /**
47
+     * Get TimeZone to use
48
+     *
49
+     * @param \DateTimeZone $timeZone	The timezone to use
50
+     * @return \DateTimeZone		The timezone to use, falling back to the current user's timezone
51
+     */
52
+    protected function getTimeZone($timeZone = null) {
53
+        if ($timeZone === null) {
54
+            $timeZone = $this->defaultTimeZone;
55
+        }
56 56
 
57
-		return $timeZone;
58
-	}
57
+        return $timeZone;
58
+    }
59 59
 
60
-	/**
61
-	 * Get \OCP\IL10N to use
62
-	 *
63
-	 * @param \OCP\IL10N $l	The locale to use
64
-	 * @return \OCP\IL10N		The locale to use, falling back to the current user's locale
65
-	 */
66
-	protected function getLocale($l = null) {
67
-		if ($l === null) {
68
-			$l = $this->defaultL10N;
69
-		}
60
+    /**
61
+     * Get \OCP\IL10N to use
62
+     *
63
+     * @param \OCP\IL10N $l	The locale to use
64
+     * @return \OCP\IL10N		The locale to use, falling back to the current user's locale
65
+     */
66
+    protected function getLocale($l = null) {
67
+        if ($l === null) {
68
+            $l = $this->defaultL10N;
69
+        }
70 70
 
71
-		return $l;
72
-	}
71
+        return $l;
72
+    }
73 73
 
74
-	/**
75
-	 * Generates a DateTime object with the given timestamp and TimeZone
76
-	 *
77
-	 * @param mixed $timestamp
78
-	 * @param \DateTimeZone $timeZone	The timezone to use
79
-	 * @return \DateTime
80
-	 */
81
-	protected function getDateTime($timestamp, \DateTimeZone $timeZone = null) {
82
-		if ($timestamp === null) {
83
-			return new \DateTime('now', $timeZone);
84
-		} elseif (!$timestamp instanceof \DateTime) {
85
-			$dateTime = new \DateTime('now', $timeZone);
86
-			$dateTime->setTimestamp($timestamp);
87
-			return $dateTime;
88
-		}
89
-		if ($timeZone) {
90
-			$timestamp->setTimezone($timeZone);
91
-		}
92
-		return $timestamp;
93
-	}
74
+    /**
75
+     * Generates a DateTime object with the given timestamp and TimeZone
76
+     *
77
+     * @param mixed $timestamp
78
+     * @param \DateTimeZone $timeZone	The timezone to use
79
+     * @return \DateTime
80
+     */
81
+    protected function getDateTime($timestamp, \DateTimeZone $timeZone = null) {
82
+        if ($timestamp === null) {
83
+            return new \DateTime('now', $timeZone);
84
+        } elseif (!$timestamp instanceof \DateTime) {
85
+            $dateTime = new \DateTime('now', $timeZone);
86
+            $dateTime->setTimestamp($timestamp);
87
+            return $dateTime;
88
+        }
89
+        if ($timeZone) {
90
+            $timestamp->setTimezone($timeZone);
91
+        }
92
+        return $timestamp;
93
+    }
94 94
 
95
-	/**
96
-	 * Formats the date of the given timestamp
97
-	 *
98
-	 * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
99
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
100
-	 * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
101
-	 * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
102
-	 * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
103
-	 * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
104
-	 * 				The exact format is dependent on the language
105
-	 * @param \DateTimeZone	$timeZone	The timezone to use
106
-	 * @param \OCP\IL10N	$l			The locale to use
107
-	 * @return string Formatted date string
108
-	 */
109
-	public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
110
-		return $this->format($timestamp, 'date', $format, $timeZone, $l);
111
-	}
95
+    /**
96
+     * Formats the date of the given timestamp
97
+     *
98
+     * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
99
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
100
+     * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
101
+     * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
102
+     * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
103
+     * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
104
+     * 				The exact format is dependent on the language
105
+     * @param \DateTimeZone	$timeZone	The timezone to use
106
+     * @param \OCP\IL10N	$l			The locale to use
107
+     * @return string Formatted date string
108
+     */
109
+    public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
110
+        return $this->format($timestamp, 'date', $format, $timeZone, $l);
111
+    }
112 112
 
113
-	/**
114
-	 * Formats the date of the given timestamp
115
-	 *
116
-	 * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
117
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
118
-	 * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
119
-	 * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
120
-	 * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
121
-	 * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
122
-	 * 				The exact format is dependent on the language
123
-	 * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
124
-	 * @param \DateTimeZone	$timeZone	The timezone to use
125
-	 * @param \OCP\IL10N	$l			The locale to use
126
-	 * @return string Formatted relative date string
127
-	 */
128
-	public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
129
-		if (substr($format, -1) !== '*' && substr($format, -1) !== '*') {
130
-			$format .= '^';
131
-		}
113
+    /**
114
+     * Formats the date of the given timestamp
115
+     *
116
+     * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
117
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
118
+     * 				full:	e.g. 'EEEE, MMMM d, y'	=> 'Wednesday, August 20, 2014'
119
+     * 				long:	e.g. 'MMMM d, y'		=> 'August 20, 2014'
120
+     * 				medium:	e.g. 'MMM d, y'			=> 'Aug 20, 2014'
121
+     * 				short:	e.g. 'M/d/yy'			=> '8/20/14'
122
+     * 				The exact format is dependent on the language
123
+     * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
124
+     * @param \DateTimeZone	$timeZone	The timezone to use
125
+     * @param \OCP\IL10N	$l			The locale to use
126
+     * @return string Formatted relative date string
127
+     */
128
+    public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
129
+        if (substr($format, -1) !== '*' && substr($format, -1) !== '*') {
130
+            $format .= '^';
131
+        }
132 132
 
133
-		return $this->format($timestamp, 'date', $format, $timeZone, $l);
134
-	}
133
+        return $this->format($timestamp, 'date', $format, $timeZone, $l);
134
+    }
135 135
 
136
-	/**
137
-	 * Gives the relative date of the timestamp
138
-	 * Only works for past dates
139
-	 *
140
-	 * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
141
-	 * @param int|\DateTime	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
142
-	 * @return string	Dates returned are:
143
-	 * 				<  1 month	=> Today, Yesterday, n days ago
144
-	 * 				< 13 month	=> last month, n months ago
145
-	 * 				>= 13 month	=> last year, n years ago
146
-	 * @param \OCP\IL10N	$l			The locale to use
147
-	 * @return string Formatted date span
148
-	 */
149
-	public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null) {
150
-		$l = $this->getLocale($l);
151
-		$timestamp = $this->getDateTime($timestamp);
152
-		$timestamp->setTime(0, 0, 0);
136
+    /**
137
+     * Gives the relative date of the timestamp
138
+     * Only works for past dates
139
+     *
140
+     * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
141
+     * @param int|\DateTime	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
142
+     * @return string	Dates returned are:
143
+     * 				<  1 month	=> Today, Yesterday, n days ago
144
+     * 				< 13 month	=> last month, n months ago
145
+     * 				>= 13 month	=> last year, n years ago
146
+     * @param \OCP\IL10N	$l			The locale to use
147
+     * @return string Formatted date span
148
+     */
149
+    public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null) {
150
+        $l = $this->getLocale($l);
151
+        $timestamp = $this->getDateTime($timestamp);
152
+        $timestamp->setTime(0, 0, 0);
153 153
 
154
-		if ($baseTimestamp === null) {
155
-			$baseTimestamp = time();
156
-		}
157
-		$baseTimestamp = $this->getDateTime($baseTimestamp);
158
-		$baseTimestamp->setTime(0, 0, 0);
159
-		$dateInterval = $timestamp->diff($baseTimestamp);
154
+        if ($baseTimestamp === null) {
155
+            $baseTimestamp = time();
156
+        }
157
+        $baseTimestamp = $this->getDateTime($baseTimestamp);
158
+        $baseTimestamp->setTime(0, 0, 0);
159
+        $dateInterval = $timestamp->diff($baseTimestamp);
160 160
 
161
-		if ($dateInterval->y == 0 && $dateInterval->m == 0 && $dateInterval->d == 0) {
162
-			return $l->t('today');
163
-		} elseif ($dateInterval->y == 0 && $dateInterval->m == 0 && $dateInterval->d == 1) {
164
-			if ($timestamp > $baseTimestamp) {
165
-				return $l->t('tomorrow');
166
-			} else {
167
-				return $l->t('yesterday');
168
-			}
169
-		} elseif ($dateInterval->y == 0 && $dateInterval->m == 0) {
170
-			if ($timestamp > $baseTimestamp) {
171
-				return $l->n('in %n day', 'in %n days', $dateInterval->d);
172
-			} else {
173
-				return $l->n('%n day ago', '%n days ago', $dateInterval->d);
174
-			}
175
-		} elseif ($dateInterval->y == 0 && $dateInterval->m == 1) {
176
-			if ($timestamp > $baseTimestamp) {
177
-				return $l->t('next month');
178
-			} else {
179
-				return $l->t('last month');
180
-			}
181
-		} elseif ($dateInterval->y == 0) {
182
-			if ($timestamp > $baseTimestamp) {
183
-				return $l->n('in %n month', 'in %n months', $dateInterval->m);
184
-			} else {
185
-				return $l->n('%n month ago', '%n months ago', $dateInterval->m);
186
-			}
187
-		} elseif ($dateInterval->y == 1) {
188
-			if ($timestamp > $baseTimestamp) {
189
-				return $l->t('next year');
190
-			} else {
191
-				return $l->t('last year');
192
-			}
193
-		}
194
-		if ($timestamp > $baseTimestamp) {
195
-			return $l->n('in %n year', 'in %n years', $dateInterval->y);
196
-		} else {
197
-			return $l->n('%n year ago', '%n years ago', $dateInterval->y);
198
-		}
199
-	}
161
+        if ($dateInterval->y == 0 && $dateInterval->m == 0 && $dateInterval->d == 0) {
162
+            return $l->t('today');
163
+        } elseif ($dateInterval->y == 0 && $dateInterval->m == 0 && $dateInterval->d == 1) {
164
+            if ($timestamp > $baseTimestamp) {
165
+                return $l->t('tomorrow');
166
+            } else {
167
+                return $l->t('yesterday');
168
+            }
169
+        } elseif ($dateInterval->y == 0 && $dateInterval->m == 0) {
170
+            if ($timestamp > $baseTimestamp) {
171
+                return $l->n('in %n day', 'in %n days', $dateInterval->d);
172
+            } else {
173
+                return $l->n('%n day ago', '%n days ago', $dateInterval->d);
174
+            }
175
+        } elseif ($dateInterval->y == 0 && $dateInterval->m == 1) {
176
+            if ($timestamp > $baseTimestamp) {
177
+                return $l->t('next month');
178
+            } else {
179
+                return $l->t('last month');
180
+            }
181
+        } elseif ($dateInterval->y == 0) {
182
+            if ($timestamp > $baseTimestamp) {
183
+                return $l->n('in %n month', 'in %n months', $dateInterval->m);
184
+            } else {
185
+                return $l->n('%n month ago', '%n months ago', $dateInterval->m);
186
+            }
187
+        } elseif ($dateInterval->y == 1) {
188
+            if ($timestamp > $baseTimestamp) {
189
+                return $l->t('next year');
190
+            } else {
191
+                return $l->t('last year');
192
+            }
193
+        }
194
+        if ($timestamp > $baseTimestamp) {
195
+            return $l->n('in %n year', 'in %n years', $dateInterval->y);
196
+        } else {
197
+            return $l->n('%n year ago', '%n years ago', $dateInterval->y);
198
+        }
199
+    }
200 200
 
201
-	/**
202
-	 * Formats the time of the given timestamp
203
-	 *
204
-	 * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
205
-	 * @param string	$format			Either 'full', 'long', 'medium' or 'short'
206
-	 * 				full:	e.g. 'h:mm:ss a zzzz'	=> '11:42:13 AM GMT+0:00'
207
-	 * 				long:	e.g. 'h:mm:ss a z'		=> '11:42:13 AM GMT'
208
-	 * 				medium:	e.g. 'h:mm:ss a'		=> '11:42:13 AM'
209
-	 * 				short:	e.g. 'h:mm a'			=> '11:42 AM'
210
-	 * 				The exact format is dependent on the language
211
-	 * @param \DateTimeZone	$timeZone	The timezone to use
212
-	 * @param \OCP\IL10N	$l			The locale to use
213
-	 * @return string Formatted time string
214
-	 */
215
-	public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
216
-		return $this->format($timestamp, 'time', $format, $timeZone, $l);
217
-	}
201
+    /**
202
+     * Formats the time of the given timestamp
203
+     *
204
+     * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
205
+     * @param string	$format			Either 'full', 'long', 'medium' or 'short'
206
+     * 				full:	e.g. 'h:mm:ss a zzzz'	=> '11:42:13 AM GMT+0:00'
207
+     * 				long:	e.g. 'h:mm:ss a z'		=> '11:42:13 AM GMT'
208
+     * 				medium:	e.g. 'h:mm:ss a'		=> '11:42:13 AM'
209
+     * 				short:	e.g. 'h:mm a'			=> '11:42 AM'
210
+     * 				The exact format is dependent on the language
211
+     * @param \DateTimeZone	$timeZone	The timezone to use
212
+     * @param \OCP\IL10N	$l			The locale to use
213
+     * @return string Formatted time string
214
+     */
215
+    public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
216
+        return $this->format($timestamp, 'time', $format, $timeZone, $l);
217
+    }
218 218
 
219
-	/**
220
-	 * Gives the relative past time of the timestamp
221
-	 *
222
-	 * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
223
-	 * @param int|\DateTime	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
224
-	 * @return string	Dates returned are:
225
-	 * 				< 60 sec	=> seconds ago
226
-	 * 				<  1 hour	=> n minutes ago
227
-	 * 				<  1 day	=> n hours ago
228
-	 * 				<  1 month	=> Yesterday, n days ago
229
-	 * 				< 13 month	=> last month, n months ago
230
-	 * 				>= 13 month	=> last year, n years ago
231
-	 * @param \OCP\IL10N	$l			The locale to use
232
-	 * @return string Formatted time span
233
-	 */
234
-	public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null) {
235
-		$l = $this->getLocale($l);
236
-		$timestamp = $this->getDateTime($timestamp);
237
-		if ($baseTimestamp === null) {
238
-			$baseTimestamp = time();
239
-		}
240
-		$baseTimestamp = $this->getDateTime($baseTimestamp);
219
+    /**
220
+     * Gives the relative past time of the timestamp
221
+     *
222
+     * @param int|\DateTime	$timestamp	Either a Unix timestamp or DateTime object
223
+     * @param int|\DateTime	$baseTimestamp	Timestamp to compare $timestamp against, defaults to current time
224
+     * @return string	Dates returned are:
225
+     * 				< 60 sec	=> seconds ago
226
+     * 				<  1 hour	=> n minutes ago
227
+     * 				<  1 day	=> n hours ago
228
+     * 				<  1 month	=> Yesterday, n days ago
229
+     * 				< 13 month	=> last month, n months ago
230
+     * 				>= 13 month	=> last year, n years ago
231
+     * @param \OCP\IL10N	$l			The locale to use
232
+     * @return string Formatted time span
233
+     */
234
+    public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null) {
235
+        $l = $this->getLocale($l);
236
+        $timestamp = $this->getDateTime($timestamp);
237
+        if ($baseTimestamp === null) {
238
+            $baseTimestamp = time();
239
+        }
240
+        $baseTimestamp = $this->getDateTime($baseTimestamp);
241 241
 
242
-		$diff = $timestamp->diff($baseTimestamp);
243
-		if ($diff->y > 0 || $diff->m > 0 || $diff->d > 0) {
244
-			return $this->formatDateSpan($timestamp, $baseTimestamp, $l);
245
-		}
242
+        $diff = $timestamp->diff($baseTimestamp);
243
+        if ($diff->y > 0 || $diff->m > 0 || $diff->d > 0) {
244
+            return $this->formatDateSpan($timestamp, $baseTimestamp, $l);
245
+        }
246 246
 
247
-		if ($diff->h > 0) {
248
-			if ($timestamp > $baseTimestamp) {
249
-				return $l->n('in %n hour', 'in %n hours', $diff->h);
250
-			} else {
251
-				return $l->n('%n hour ago', '%n hours ago', $diff->h);
252
-			}
253
-		} elseif ($diff->i > 0) {
254
-			if ($timestamp > $baseTimestamp) {
255
-				return $l->n('in %n minute', 'in %n minutes', $diff->i);
256
-			} else {
257
-				return $l->n('%n minute ago', '%n minutes ago', $diff->i);
258
-			}
259
-		}
260
-		if ($timestamp > $baseTimestamp) {
261
-			return $l->t('in a few seconds');
262
-		} else {
263
-			return $l->t('seconds ago');
264
-		}
265
-	}
247
+        if ($diff->h > 0) {
248
+            if ($timestamp > $baseTimestamp) {
249
+                return $l->n('in %n hour', 'in %n hours', $diff->h);
250
+            } else {
251
+                return $l->n('%n hour ago', '%n hours ago', $diff->h);
252
+            }
253
+        } elseif ($diff->i > 0) {
254
+            if ($timestamp > $baseTimestamp) {
255
+                return $l->n('in %n minute', 'in %n minutes', $diff->i);
256
+            } else {
257
+                return $l->n('%n minute ago', '%n minutes ago', $diff->i);
258
+            }
259
+        }
260
+        if ($timestamp > $baseTimestamp) {
261
+            return $l->t('in a few seconds');
262
+        } else {
263
+            return $l->t('seconds ago');
264
+        }
265
+    }
266 266
 
267
-	/**
268
-	 * Formats the date and time of the given timestamp
269
-	 *
270
-	 * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
271
-	 * @param string		$formatDate		See formatDate() for description
272
-	 * @param string		$formatTime		See formatTime() for description
273
-	 * @param \DateTimeZone	$timeZone	The timezone to use
274
-	 * @param \OCP\IL10N	$l			The locale to use
275
-	 * @return string Formatted date and time string
276
-	 */
277
-	public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
278
-		return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
279
-	}
267
+    /**
268
+     * Formats the date and time of the given timestamp
269
+     *
270
+     * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
271
+     * @param string		$formatDate		See formatDate() for description
272
+     * @param string		$formatTime		See formatTime() for description
273
+     * @param \DateTimeZone	$timeZone	The timezone to use
274
+     * @param \OCP\IL10N	$l			The locale to use
275
+     * @return string Formatted date and time string
276
+     */
277
+    public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
278
+        return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
279
+    }
280 280
 
281
-	/**
282
-	 * Formats the date and time of the given timestamp
283
-	 *
284
-	 * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
285
-	 * @param string	$formatDate		See formatDate() for description
286
-	 * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
287
-	 * @param string	$formatTime		See formatTime() for description
288
-	 * @param \DateTimeZone	$timeZone	The timezone to use
289
-	 * @param \OCP\IL10N	$l			The locale to use
290
-	 * @return string Formatted relative date and time string
291
-	 */
292
-	public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
293
-		if (substr($formatDate, -1) !== '^' && substr($formatDate, -1) !== '*') {
294
-			$formatDate .= '^';
295
-		}
281
+    /**
282
+     * Formats the date and time of the given timestamp
283
+     *
284
+     * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
285
+     * @param string	$formatDate		See formatDate() for description
286
+     * 					Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
287
+     * @param string	$formatTime		See formatTime() for description
288
+     * @param \DateTimeZone	$timeZone	The timezone to use
289
+     * @param \OCP\IL10N	$l			The locale to use
290
+     * @return string Formatted relative date and time string
291
+     */
292
+    public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
293
+        if (substr($formatDate, -1) !== '^' && substr($formatDate, -1) !== '*') {
294
+            $formatDate .= '^';
295
+        }
296 296
 
297
-		return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
298
-	}
297
+        return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l);
298
+    }
299 299
 
300
-	/**
301
-	 * Formats the date and time of the given timestamp
302
-	 *
303
-	 * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
304
-	 * @param string		$type		One of 'date', 'datetime' or 'time'
305
-	 * @param string		$format		Format string
306
-	 * @param \DateTimeZone	$timeZone	The timezone to use
307
-	 * @param \OCP\IL10N	$l			The locale to use
308
-	 * @return string Formatted date and time string
309
-	 */
310
-	protected function format($timestamp, $type, $format, \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
311
-		$l = $this->getLocale($l);
312
-		$timeZone = $this->getTimeZone($timeZone);
313
-		$timestamp = $this->getDateTime($timestamp, $timeZone);
300
+    /**
301
+     * Formats the date and time of the given timestamp
302
+     *
303
+     * @param int|\DateTime $timestamp	Either a Unix timestamp or DateTime object
304
+     * @param string		$type		One of 'date', 'datetime' or 'time'
305
+     * @param string		$format		Format string
306
+     * @param \DateTimeZone	$timeZone	The timezone to use
307
+     * @param \OCP\IL10N	$l			The locale to use
308
+     * @return string Formatted date and time string
309
+     */
310
+    protected function format($timestamp, $type, $format, \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) {
311
+        $l = $this->getLocale($l);
312
+        $timeZone = $this->getTimeZone($timeZone);
313
+        $timestamp = $this->getDateTime($timestamp, $timeZone);
314 314
 
315
-		return $l->l($type, $timestamp, [
316
-			'width' => $format,
317
-		]);
318
-	}
315
+        return $l->l($type, $timestamp, [
316
+            'width' => $format,
317
+        ]);
318
+    }
319 319
 }
Please login to merge, or discard this patch.
lib/public/Collaboration/Collaborators/SearchResultType.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -31,44 +31,44 @@
 block discarded – undo
31 31
  * @since 13.0.0
32 32
  */
33 33
 class SearchResultType {
34
-	/** @var string  */
35
-	protected $label;
34
+    /** @var string  */
35
+    protected $label;
36 36
 
37
-	/**
38
-	 * SearchResultType constructor.
39
-	 *
40
-	 * @param string $label
41
-	 * @since 13.0.0
42
-	 */
43
-	public function __construct($label) {
44
-		$this->label = $this->getValidatedType($label);
45
-	}
37
+    /**
38
+     * SearchResultType constructor.
39
+     *
40
+     * @param string $label
41
+     * @since 13.0.0
42
+     */
43
+    public function __construct($label) {
44
+        $this->label = $this->getValidatedType($label);
45
+    }
46 46
 
47
-	/**
48
-	 * @return string
49
-	 * @since 13.0.0
50
-	 */
51
-	public function getLabel() {
52
-		return $this->label;
53
-	}
47
+    /**
48
+     * @return string
49
+     * @since 13.0.0
50
+     */
51
+    public function getLabel() {
52
+        return $this->label;
53
+    }
54 54
 
55
-	/**
56
-	 * @param $type
57
-	 * @return string
58
-	 * @throws \InvalidArgumentException
59
-	 * @since 13.0.0
60
-	 */
61
-	protected function getValidatedType($type) {
62
-		$type = trim((string)$type);
55
+    /**
56
+     * @param $type
57
+     * @return string
58
+     * @throws \InvalidArgumentException
59
+     * @since 13.0.0
60
+     */
61
+    protected function getValidatedType($type) {
62
+        $type = trim((string)$type);
63 63
 
64
-		if ($type === '') {
65
-			throw new \InvalidArgumentException('Type must not be empty');
66
-		}
64
+        if ($type === '') {
65
+            throw new \InvalidArgumentException('Type must not be empty');
66
+        }
67 67
 
68
-		if ($type === 'exact') {
69
-			throw new \InvalidArgumentException('Provided type is a reserved word');
70
-		}
68
+        if ($type === 'exact') {
69
+            throw new \InvalidArgumentException('Provided type is a reserved word');
70
+        }
71 71
 
72
-		return $type;
73
-	}
72
+        return $type;
73
+    }
74 74
 }
Please login to merge, or discard this patch.
lib/public/AppFramework/Http/RedirectResponse.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -33,27 +33,27 @@
 block discarded – undo
33 33
  * @since 7.0.0
34 34
  */
35 35
 class RedirectResponse extends Response {
36
-	private $redirectURL;
36
+    private $redirectURL;
37 37
 
38
-	/**
39
-	 * Creates a response that redirects to a url
40
-	 * @param string $redirectURL the url to redirect to
41
-	 * @since 7.0.0
42
-	 */
43
-	public function __construct($redirectURL) {
44
-		parent::__construct();
38
+    /**
39
+     * Creates a response that redirects to a url
40
+     * @param string $redirectURL the url to redirect to
41
+     * @since 7.0.0
42
+     */
43
+    public function __construct($redirectURL) {
44
+        parent::__construct();
45 45
 
46
-		$this->redirectURL = $redirectURL;
47
-		$this->setStatus(Http::STATUS_SEE_OTHER);
48
-		$this->addHeader('Location', $redirectURL);
49
-	}
46
+        $this->redirectURL = $redirectURL;
47
+        $this->setStatus(Http::STATUS_SEE_OTHER);
48
+        $this->addHeader('Location', $redirectURL);
49
+    }
50 50
 
51 51
 
52
-	/**
53
-	 * @return string the url to redirect
54
-	 * @since 7.0.0
55
-	 */
56
-	public function getRedirectURL() {
57
-		return $this->redirectURL;
58
-	}
52
+    /**
53
+     * @return string the url to redirect
54
+     * @since 7.0.0
55
+     */
56
+    public function getRedirectURL() {
57
+        return $this->redirectURL;
58
+    }
59 59
 }
Please login to merge, or discard this patch.
lib/private/IntegrityCheck/Helpers/FileAccessHelper.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -34,57 +34,57 @@
 block discarded – undo
34 34
  * @package OC\IntegrityCheck\Helpers
35 35
  */
36 36
 class FileAccessHelper {
37
-	/**
38
-	 * Wrapper around file_get_contents($filename, $data)
39
-	 *
40
-	 * @param string $filename
41
-	 * @return string|false
42
-	 */
43
-	public function file_get_contents(string $filename) {
44
-		return file_get_contents($filename);
45
-	}
37
+    /**
38
+     * Wrapper around file_get_contents($filename, $data)
39
+     *
40
+     * @param string $filename
41
+     * @return string|false
42
+     */
43
+    public function file_get_contents(string $filename) {
44
+        return file_get_contents($filename);
45
+    }
46 46
 
47
-	/**
48
-	 * Wrapper around file_exists($filename)
49
-	 *
50
-	 * @param string $filename
51
-	 * @return bool
52
-	 */
53
-	public function file_exists(string $filename): bool {
54
-		return file_exists($filename);
55
-	}
47
+    /**
48
+     * Wrapper around file_exists($filename)
49
+     *
50
+     * @param string $filename
51
+     * @return bool
52
+     */
53
+    public function file_exists(string $filename): bool {
54
+        return file_exists($filename);
55
+    }
56 56
 
57
-	/**
58
-	 * Wrapper around file_put_contents($filename, $data)
59
-	 *
60
-	 * @param string $filename
61
-	 * @param string $data
62
-	 * @return int
63
-	 * @throws \Exception
64
-	 */
65
-	public function file_put_contents(string $filename, string $data): int {
66
-		$bytesWritten = @file_put_contents($filename, $data);
67
-		if ($bytesWritten === false || $bytesWritten !== \strlen($data)) {
68
-			throw new \Exception('Failed to write into ' . $filename);
69
-		}
70
-		return $bytesWritten;
71
-	}
57
+    /**
58
+     * Wrapper around file_put_contents($filename, $data)
59
+     *
60
+     * @param string $filename
61
+     * @param string $data
62
+     * @return int
63
+     * @throws \Exception
64
+     */
65
+    public function file_put_contents(string $filename, string $data): int {
66
+        $bytesWritten = @file_put_contents($filename, $data);
67
+        if ($bytesWritten === false || $bytesWritten !== \strlen($data)) {
68
+            throw new \Exception('Failed to write into ' . $filename);
69
+        }
70
+        return $bytesWritten;
71
+    }
72 72
 
73
-	/**
74
-	 * @param string $path
75
-	 * @return bool
76
-	 */
77
-	public function is_writable(string $path): bool {
78
-		return is_writable($path);
79
-	}
73
+    /**
74
+     * @param string $path
75
+     * @return bool
76
+     */
77
+    public function is_writable(string $path): bool {
78
+        return is_writable($path);
79
+    }
80 80
 
81
-	/**
82
-	 * @param string $path
83
-	 * @throws \Exception
84
-	 */
85
-	public function assertDirectoryExists(string $path) {
86
-		if (!is_dir($path)) {
87
-			throw new \Exception('Directory ' . $path . ' does not exist.');
88
-		}
89
-	}
81
+    /**
82
+     * @param string $path
83
+     * @throws \Exception
84
+     */
85
+    public function assertDirectoryExists(string $path) {
86
+        if (!is_dir($path)) {
87
+            throw new \Exception('Directory ' . $path . ' does not exist.');
88
+        }
89
+    }
90 90
 }
Please login to merge, or discard this patch.
lib/private/IntegrityCheck/Helpers/AppLocator.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -34,27 +34,27 @@
 block discarded – undo
34 34
  * @package OC\IntegrityCheck\Helpers
35 35
  */
36 36
 class AppLocator {
37
-	/**
38
-	 * Provides \OC_App::getAppPath($appId)
39
-	 *
40
-	 * @param string $appId
41
-	 * @return string
42
-	 * @throws \Exception If the app cannot be found
43
-	 */
44
-	public function getAppPath(string $appId): string {
45
-		$path = \OC_App::getAppPath($appId);
46
-		if ($path === false) {
47
-			throw new \Exception('App not found');
48
-		}
49
-		return $path;
50
-	}
37
+    /**
38
+     * Provides \OC_App::getAppPath($appId)
39
+     *
40
+     * @param string $appId
41
+     * @return string
42
+     * @throws \Exception If the app cannot be found
43
+     */
44
+    public function getAppPath(string $appId): string {
45
+        $path = \OC_App::getAppPath($appId);
46
+        if ($path === false) {
47
+            throw new \Exception('App not found');
48
+        }
49
+        return $path;
50
+    }
51 51
 
52
-	/**
53
-	 * Providers \OC_App::getAllApps()
54
-	 *
55
-	 * @return array
56
-	 */
57
-	public function getAllApps(): array {
58
-		return \OC_App::getAllApps();
59
-	}
52
+    /**
53
+     * Providers \OC_App::getAllApps()
54
+     *
55
+     * @return array
56
+     */
57
+    public function getAllApps(): array {
58
+        return \OC_App::getAllApps();
59
+    }
60 60
 }
Please login to merge, or discard this patch.
lib/private/Federation/CloudFederationNotification.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -33,35 +33,35 @@
 block discarded – undo
33 33
  * @since 14.0.0
34 34
  */
35 35
 class CloudFederationNotification implements ICloudFederationNotification {
36
-	private $message = [];
36
+    private $message = [];
37 37
 
38
-	/**
39
-	 * add a message to the notification
40
-	 *
41
-	 * @param string $notificationType (e.g. SHARE_ACCEPTED)
42
-	 * @param string $resourceType (e.g. file, calendar, contact,...)
43
-	 * @param string $providerId id of the share
44
-	 * @param array $notification payload of the notification
45
-	 *
46
-	 * @since 14.0.0
47
-	 */
48
-	public function setMessage($notificationType, $resourceType, $providerId, array $notification) {
49
-		$this->message = [
50
-			'notificationType' => $notificationType,
51
-			'resourceType' => $resourceType,
52
-			'providerId' => $providerId,
53
-			'notification' => $notification,
54
-		];
55
-	}
38
+    /**
39
+     * add a message to the notification
40
+     *
41
+     * @param string $notificationType (e.g. SHARE_ACCEPTED)
42
+     * @param string $resourceType (e.g. file, calendar, contact,...)
43
+     * @param string $providerId id of the share
44
+     * @param array $notification payload of the notification
45
+     *
46
+     * @since 14.0.0
47
+     */
48
+    public function setMessage($notificationType, $resourceType, $providerId, array $notification) {
49
+        $this->message = [
50
+            'notificationType' => $notificationType,
51
+            'resourceType' => $resourceType,
52
+            'providerId' => $providerId,
53
+            'notification' => $notification,
54
+        ];
55
+    }
56 56
 
57
-	/**
58
-	 * get message, ready to send out
59
-	 *
60
-	 * @return array
61
-	 *
62
-	 * @since 14.0.0
63
-	 */
64
-	public function getMessage() {
65
-		return $this->message;
66
-	}
57
+    /**
58
+     * get message, ready to send out
59
+     *
60
+     * @return array
61
+     *
62
+     * @since 14.0.0
63
+     */
64
+    public function getMessage() {
65
+        return $this->message;
66
+    }
67 67
 }
Please login to merge, or discard this patch.