@@ -89,6 +89,6 @@ |
||
89 | 89 | if (empty($this->value)) { |
90 | 90 | return null; |
91 | 91 | } |
92 | - return 'tel:' . $this->value; |
|
92 | + return 'tel:'.$this->value; |
|
93 | 93 | } |
94 | 94 | } |
@@ -89,6 +89,6 @@ |
||
89 | 89 | if (empty($this->value)) { |
90 | 90 | return null; |
91 | 91 | } |
92 | - return 'mailto:' . $this->value; |
|
92 | + return 'mailto:'.$this->value; |
|
93 | 93 | } |
94 | 94 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | public function getTitle(): string { |
78 | - $displayUsername = $this->value[0] === '@' ? $this->value : '@' . $this->value; |
|
78 | + $displayUsername = $this->value[0] === '@' ? $this->value : '@'.$this->value; |
|
79 | 79 | return $this->l10nFactory->get('lib')->t('View %s on Twitter', [$displayUsername]); |
80 | 80 | } |
81 | 81 | |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | $username = $this->value[0] === '@' ? substr($this->value, 1) : $this->value; |
95 | - return 'https://twitter.com/' . $username; |
|
95 | + return 'https://twitter.com/'.$username; |
|
96 | 96 | } |
97 | 97 | } |
@@ -136,22 +136,22 @@ discard block |
||
136 | 136 | |
137 | 137 | if ($action->getAppId() !== self::CORE_APP_ID) { |
138 | 138 | if (!$this->appManager->isEnabledForUser($action->getAppId(), $targetUser)) { |
139 | - $this->logger->notice('App: ' . $action->getAppId() . ' cannot register actions as it is not enabled for the target user: ' . $targetUser->getUID()); |
|
139 | + $this->logger->notice('App: '.$action->getAppId().' cannot register actions as it is not enabled for the target user: '.$targetUser->getUID()); |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | if (!$this->appManager->isEnabledForUser($action->getAppId(), $visitingUser)) { |
143 | - $this->logger->notice('App: ' . $action->getAppId() . ' cannot register actions as it is not enabled for the visiting user: ' . $visitingUser->getUID()); |
|
143 | + $this->logger->notice('App: '.$action->getAppId().' cannot register actions as it is not enabled for the visiting user: '.$visitingUser->getUID()); |
|
144 | 144 | return; |
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | 148 | if (in_array($action->getId(), self::PROFILE_PROPERTIES, true)) { |
149 | - $this->logger->error('Cannot register action with ID: ' . $action->getId() . ', as it is used by a core account property.'); |
|
149 | + $this->logger->error('Cannot register action with ID: '.$action->getId().', as it is used by a core account property.'); |
|
150 | 150 | return; |
151 | 151 | } |
152 | 152 | |
153 | 153 | if (isset($this->actions[$action->getId()])) { |
154 | - $this->logger->error('Cannot register duplicate action: ' . $action->getId()); |
|
154 | + $this->logger->error('Cannot register duplicate action: '.$action->getId()); |
|
155 | 155 | return; |
156 | 156 | } |
157 | 157 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $actionsClone = $this->actions; |
190 | 190 | // Sort associative array into indexed array in ascending order of priority |
191 | - usort($actionsClone, function (ILinkAction $a, ILinkAction $b) { |
|
191 | + usort($actionsClone, function(ILinkAction $a, ILinkAction $b) { |
|
192 | 192 | return $a->getPriority() === $b->getPriority() ? 0 : ($a->getPriority() < $b->getPriority() ? -1 : 1); |
193 | 193 | }); |
194 | 194 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | // Add actions |
284 | 284 | $profileParameters['actions'] = array_map( |
285 | - function (ILinkAction $action) { |
|
285 | + function(ILinkAction $action) { |
|
286 | 286 | return [ |
287 | 287 | 'id' => $action->getId(), |
288 | 288 | 'icon' => $action->getIcon(), |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | array_values( |
295 | 295 | array_filter( |
296 | 296 | $this->getActions($targetUser, $visitingUser), |
297 | - function (ILinkAction $action) use ($targetUser, $visitingUser) { |
|
297 | + function(ILinkAction $action) use ($targetUser, $visitingUser) { |
|
298 | 298 | return $this->isParameterVisible($action->getId(), $targetUser, $visitingUser); |
299 | 299 | } |
300 | 300 | ), |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | private function hash(string $methodIdentifier, |
58 | 58 | string $userIdentifier): string { |
59 | - return hash('sha512', $methodIdentifier . $userIdentifier); |
|
59 | + return hash('sha512', $methodIdentifier.$userIdentifier); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $row = $cursor->fetchOne(); |
92 | 92 | $cursor->closeCursor(); |
93 | 93 | |
94 | - return (int)$row; |
|
94 | + return (int) $row; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -109,8 +109,8 @@ |
||
109 | 109 | ISecureRandom::CHAR_LOWER. |
110 | 110 | ISecureRandom::CHAR_UPPER |
111 | 111 | ); |
112 | - $tokenValue = $this->timeFactory->getTime() .':'. $token; |
|
113 | - $encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix . $this->config->getSystemValue('secret')); |
|
112 | + $tokenValue = $this->timeFactory->getTime().':'.$token; |
|
113 | + $encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix.$this->config->getSystemValue('secret')); |
|
114 | 114 | $this->config->setUserValue($user->getUID(), 'core', $subject, $encryptedValue); |
115 | 115 | $jobArgs = json_encode([ |
116 | 116 | 'userId' => $user->getUID(), |
@@ -60,10 +60,10 @@ |
||
60 | 60 | public function setArgument($argument) { |
61 | 61 | parent::setArgument($argument); |
62 | 62 | $args = \json_decode($argument, true); |
63 | - $this->userId = (string)$args['userId']; |
|
64 | - $this->subject = (string)$args['subject']; |
|
65 | - $this->pwdPrefix = (string)$args['pp']; |
|
66 | - $this->runNotBefore = (int)$args['notBefore']; |
|
63 | + $this->userId = (string) $args['userId']; |
|
64 | + $this->subject = (string) $args['subject']; |
|
65 | + $this->pwdPrefix = (string) $args['pp']; |
|
66 | + $this->runNotBefore = (int) $args['notBefore']; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | protected function run($argument) { |
@@ -96,7 +96,7 @@ |
||
96 | 96 | try { |
97 | 97 | $provider = $this->container->get($this->providerClass); |
98 | 98 | } catch (ContainerExceptionInterface $e) { |
99 | - $this->logger->error('Could not load user-status "' . $this->providerClass . '" provider dynamically: ' . $e->getMessage(), [ |
|
99 | + $this->logger->error('Could not load user-status "'.$this->providerClass.'" provider dynamically: '.$e->getMessage(), [ |
|
100 | 100 | 'exception' => $e, |
101 | 101 | ]); |
102 | 102 | return; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function shouldJoinTags(ISearchOperator $operator) { |
78 | 78 | if ($operator instanceof ISearchBinaryOperator) { |
79 | - return array_reduce($operator->getArguments(), function ($shouldJoin, ISearchOperator $operator) { |
|
79 | + return array_reduce($operator->getArguments(), function($shouldJoin, ISearchOperator $operator) { |
|
80 | 80 | return $shouldJoin || $this->shouldJoinTags($operator); |
81 | 81 | }, false); |
82 | 82 | } elseif ($operator instanceof ISearchComparison) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param ISearchOperator[] $operators |
91 | 91 | */ |
92 | 92 | public function searchOperatorArrayToDBExprArray(IQueryBuilder $builder, array $operators) { |
93 | - return array_filter(array_map(function ($operator) use ($builder) { |
|
93 | + return array_filter(array_map(function($operator) use ($builder) { |
|
94 | 94 | return $this->searchOperatorToDBExpr($builder, $operator); |
95 | 95 | }, $operators)); |
96 | 96 | } |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | case ISearchBinaryOperator::OPERATOR_OR: |
118 | 118 | return call_user_func_array([$expr, 'orX'], $this->searchOperatorArrayToDBExprArray($builder, $operator->getArguments())); |
119 | 119 | default: |
120 | - throw new \InvalidArgumentException('Invalid operator type: ' . $operator->getType()); |
|
120 | + throw new \InvalidArgumentException('Invalid operator type: '.$operator->getType()); |
|
121 | 121 | } |
122 | 122 | } elseif ($operator instanceof ISearchComparison) { |
123 | 123 | return $this->searchComparisonToDBExpr($builder, $operator, self::$searchOperatorMap); |
124 | 124 | } else { |
125 | - throw new \InvalidArgumentException('Invalid operator type: ' . get_class($operator)); |
|
125 | + throw new \InvalidArgumentException('Invalid operator type: '.get_class($operator)); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $queryOperator = $operatorMap[$type]; |
135 | 135 | return $builder->expr()->$queryOperator($field, $this->getParameterForValue($builder, $value)); |
136 | 136 | } else { |
137 | - throw new \InvalidArgumentException('Invalid operator type: ' . $comparison->getType()); |
|
137 | + throw new \InvalidArgumentException('Invalid operator type: '.$comparison->getType()); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | $value = $operator->getValue(); |
144 | 144 | $type = $operator->getType(); |
145 | 145 | if ($field === 'mimetype') { |
146 | - $value = (string)$value; |
|
146 | + $value = (string) $value; |
|
147 | 147 | if ($operator->getType() === ISearchComparison::COMPARE_EQUAL) { |
148 | - $value = (int)$this->mimetypeLoader->getId($value); |
|
148 | + $value = (int) $this->mimetypeLoader->getId($value); |
|
149 | 149 | } elseif ($operator->getType() === ISearchComparison::COMPARE_LIKE) { |
150 | 150 | // transform "mimetype='foo/%'" to "mimepart='foo'" |
151 | 151 | if (preg_match('|(.+)/%|', $value, $matches)) { |
152 | 152 | $field = 'mimepart'; |
153 | - $value = (int)$this->mimetypeLoader->getId($matches[1]); |
|
153 | + $value = (int) $this->mimetypeLoader->getId($matches[1]); |
|
154 | 154 | $type = ISearchComparison::COMPARE_EQUAL; |
155 | 155 | } elseif (strpos($value, '%') !== false) { |
156 | - throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported'); |
|
156 | + throw new \InvalidArgumentException('Unsupported query value for mimetype: '.$value.', only values in the format "mime/type" or "mime/%" are supported'); |
|
157 | 157 | } else { |
158 | 158 | $field = 'mimetype'; |
159 | - $value = (int)$this->mimetypeLoader->getId($value); |
|
159 | + $value = (int) $this->mimetypeLoader->getId($value); |
|
160 | 160 | $type = ISearchComparison::COMPARE_EQUAL; |
161 | 161 | } |
162 | 162 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $field = 'file.fileid'; |
170 | 170 | } elseif ($field === 'path' && $type === ISearchComparison::COMPARE_EQUAL && $operator->getQueryHint(ISearchComparison::HINT_PATH_EQ_HASH, true)) { |
171 | 171 | $field = 'path_hash'; |
172 | - $value = md5((string)$value); |
|
172 | + $value = md5((string) $value); |
|
173 | 173 | } |
174 | 174 | return [$field, $value, $type]; |
175 | 175 | } |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | ]; |
200 | 200 | |
201 | 201 | if (!isset($types[$operator->getField()])) { |
202 | - throw new \InvalidArgumentException('Unsupported comparison field ' . $operator->getField()); |
|
202 | + throw new \InvalidArgumentException('Unsupported comparison field '.$operator->getField()); |
|
203 | 203 | } |
204 | 204 | $type = $types[$operator->getField()]; |
205 | 205 | if (gettype($operator->getValue()) !== $type) { |
206 | - throw new \InvalidArgumentException('Invalid type for field ' . $operator->getField()); |
|
206 | + throw new \InvalidArgumentException('Invalid type for field '.$operator->getField()); |
|
207 | 207 | } |
208 | 208 | if (!in_array($operator->getType(), $comparisons[$operator->getField()])) { |
209 | - throw new \InvalidArgumentException('Unsupported comparison for field ' . $operator->getField() . ': ' . $operator->getType()); |
|
209 | + throw new \InvalidArgumentException('Unsupported comparison for field '.$operator->getField().': '.$operator->getType()); |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 |