@@ -86,37 +86,37 @@ discard block |
||
86 | 86 | |
87 | 87 | if ($event->getSubject() === self::SUBJECT_ADD) { |
88 | 88 | $subject = $l->t('{actor} created address book {addressbook}'); |
89 | - } elseif ($event->getSubject() === self::SUBJECT_ADD . '_self') { |
|
89 | + } elseif ($event->getSubject() === self::SUBJECT_ADD.'_self') { |
|
90 | 90 | $subject = $l->t('You created address book {addressbook}'); |
91 | 91 | } elseif ($event->getSubject() === self::SUBJECT_DELETE) { |
92 | 92 | $subject = $l->t('{actor} deleted address book {addressbook}'); |
93 | - } elseif ($event->getSubject() === self::SUBJECT_DELETE . '_self') { |
|
93 | + } elseif ($event->getSubject() === self::SUBJECT_DELETE.'_self') { |
|
94 | 94 | $subject = $l->t('You deleted address book {addressbook}'); |
95 | 95 | } elseif ($event->getSubject() === self::SUBJECT_UPDATE) { |
96 | 96 | $subject = $l->t('{actor} updated address book {addressbook}'); |
97 | - } elseif ($event->getSubject() === self::SUBJECT_UPDATE . '_self') { |
|
97 | + } elseif ($event->getSubject() === self::SUBJECT_UPDATE.'_self') { |
|
98 | 98 | $subject = $l->t('You updated address book {addressbook}'); |
99 | 99 | } elseif ($event->getSubject() === self::SUBJECT_SHARE_USER) { |
100 | 100 | $subject = $l->t('{actor} shared address book {addressbook} with you'); |
101 | - } elseif ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') { |
|
101 | + } elseif ($event->getSubject() === self::SUBJECT_SHARE_USER.'_you') { |
|
102 | 102 | $subject = $l->t('You shared address book {addressbook} with {user}'); |
103 | - } elseif ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') { |
|
103 | + } elseif ($event->getSubject() === self::SUBJECT_SHARE_USER.'_by') { |
|
104 | 104 | $subject = $l->t('{actor} shared address book {addressbook} with {user}'); |
105 | 105 | } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER) { |
106 | 106 | $subject = $l->t('{actor} unshared address book {addressbook} from you'); |
107 | - } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') { |
|
107 | + } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_you') { |
|
108 | 108 | $subject = $l->t('You unshared address book {addressbook} from {user}'); |
109 | - } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') { |
|
109 | + } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_by') { |
|
110 | 110 | $subject = $l->t('{actor} unshared address book {addressbook} from {user}'); |
111 | - } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') { |
|
111 | + } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_self') { |
|
112 | 112 | $subject = $l->t('{actor} unshared address book {addressbook} from themselves'); |
113 | - } elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') { |
|
113 | + } elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_you') { |
|
114 | 114 | $subject = $l->t('You shared address book {addressbook} with group {group}'); |
115 | - } elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') { |
|
115 | + } elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_by') { |
|
116 | 116 | $subject = $l->t('{actor} shared address book {addressbook} with group {group}'); |
117 | - } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') { |
|
117 | + } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_you') { |
|
118 | 118 | $subject = $l->t('You unshared address book {addressbook} from group {group}'); |
119 | - } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') { |
|
119 | + } elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_by') { |
|
120 | 120 | $subject = $l->t('{actor} unshared address book {addressbook} from group {group}'); |
121 | 121 | } else { |
122 | 122 | throw new \InvalidArgumentException(); |
@@ -146,39 +146,39 @@ discard block |
||
146 | 146 | |
147 | 147 | switch ($subject) { |
148 | 148 | case self::SUBJECT_ADD: |
149 | - case self::SUBJECT_ADD . '_self': |
|
149 | + case self::SUBJECT_ADD.'_self': |
|
150 | 150 | case self::SUBJECT_DELETE: |
151 | - case self::SUBJECT_DELETE . '_self': |
|
151 | + case self::SUBJECT_DELETE.'_self': |
|
152 | 152 | case self::SUBJECT_UPDATE: |
153 | - case self::SUBJECT_UPDATE . '_self': |
|
153 | + case self::SUBJECT_UPDATE.'_self': |
|
154 | 154 | case self::SUBJECT_SHARE_USER: |
155 | 155 | case self::SUBJECT_UNSHARE_USER: |
156 | - case self::SUBJECT_UNSHARE_USER . '_self': |
|
156 | + case self::SUBJECT_UNSHARE_USER.'_self': |
|
157 | 157 | return [ |
158 | 158 | 'actor' => $this->generateUserParameter($parameters['actor']), |
159 | 159 | 'addressbook' => $this->generateAddressbookParameter($parameters['addressbook'], $l), |
160 | 160 | ]; |
161 | - case self::SUBJECT_SHARE_USER . '_you': |
|
162 | - case self::SUBJECT_UNSHARE_USER . '_you': |
|
161 | + case self::SUBJECT_SHARE_USER.'_you': |
|
162 | + case self::SUBJECT_UNSHARE_USER.'_you': |
|
163 | 163 | return [ |
164 | 164 | 'addressbook' => $this->generateAddressbookParameter($parameters['addressbook'], $l), |
165 | 165 | 'user' => $this->generateUserParameter($parameters['user']), |
166 | 166 | ]; |
167 | - case self::SUBJECT_SHARE_USER . '_by': |
|
168 | - case self::SUBJECT_UNSHARE_USER . '_by': |
|
167 | + case self::SUBJECT_SHARE_USER.'_by': |
|
168 | + case self::SUBJECT_UNSHARE_USER.'_by': |
|
169 | 169 | return [ |
170 | 170 | 'actor' => $this->generateUserParameter($parameters['actor']), |
171 | 171 | 'addressbook' => $this->generateAddressbookParameter($parameters['addressbook'], $l), |
172 | 172 | 'user' => $this->generateUserParameter($parameters['user']), |
173 | 173 | ]; |
174 | - case self::SUBJECT_SHARE_GROUP . '_you': |
|
175 | - case self::SUBJECT_UNSHARE_GROUP . '_you': |
|
174 | + case self::SUBJECT_SHARE_GROUP.'_you': |
|
175 | + case self::SUBJECT_UNSHARE_GROUP.'_you': |
|
176 | 176 | return [ |
177 | 177 | 'addressbook' => $this->generateAddressbookParameter($parameters['addressbook'], $l), |
178 | 178 | 'group' => $this->generateGroupParameter($parameters['group']), |
179 | 179 | ]; |
180 | - case self::SUBJECT_SHARE_GROUP . '_by': |
|
181 | - case self::SUBJECT_UNSHARE_GROUP . '_by': |
|
180 | + case self::SUBJECT_SHARE_GROUP.'_by': |
|
181 | + case self::SUBJECT_UNSHARE_GROUP.'_by': |
|
182 | 182 | return [ |
183 | 183 | 'actor' => $this->generateUserParameter($parameters['actor']), |
184 | 184 | 'addressbook' => $this->generateAddressbookParameter($parameters['addressbook'], $l), |
@@ -114,13 +114,13 @@ |
||
114 | 114 | if ($this->shareManager->checkPassword($share, $password)) { |
115 | 115 | return true; |
116 | 116 | } elseif ($this->session->exists('public_link_authenticated') |
117 | - && $this->session->get('public_link_authenticated') === (string)$share->getId()) { |
|
117 | + && $this->session->get('public_link_authenticated') === (string) $share->getId()) { |
|
118 | 118 | return true; |
119 | 119 | } else { |
120 | 120 | if (in_array('XMLHttpRequest', explode(',', $this->request->getHeader('X-Requested-With')))) { |
121 | 121 | // do not re-authenticate over ajax, use dummy auth name to prevent browser popup |
122 | 122 | http_response_code(401); |
123 | - header('WWW-Authenticate: DummyBasic realm="' . $this->realm . '"'); |
|
123 | + header('WWW-Authenticate: DummyBasic realm="'.$this->realm.'"'); |
|
124 | 124 | throw new \Sabre\DAV\Exception\NotAuthenticated('Cannot authenticate over ajax calls'); |
125 | 125 | } |
126 | 126 |
@@ -105,6 +105,6 @@ |
||
105 | 105 | $time = new \DateTime('now', $timeZone); |
106 | 106 | $timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTimeInterface::ATOM)); |
107 | 107 | |
108 | - return $timestampInfo . ' ' . $this->formatter->format($message); |
|
108 | + return $timestampInfo.' '.$this->formatter->format($message); |
|
109 | 109 | } |
110 | 110 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | PropFind $propFind, |
103 | 103 | INode $node): void { |
104 | 104 | if ($node instanceof DeletedCalendarObject) { |
105 | - $propFind->handle(self::PROPERTY_DELETED_AT, function () use ($node) { |
|
105 | + $propFind->handle(self::PROPERTY_DELETED_AT, function() use ($node) { |
|
106 | 106 | $ts = $node->getDeletedAt(); |
107 | 107 | if ($ts === null) { |
108 | 108 | return null; |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | ->setTimestamp($ts) |
113 | 113 | ->format(DateTimeInterface::ATOM); |
114 | 114 | }); |
115 | - $propFind->handle(self::PROPERTY_CALENDAR_URI, function () use ($node) { |
|
115 | + $propFind->handle(self::PROPERTY_CALENDAR_URI, function() use ($node) { |
|
116 | 116 | return $node->getCalendarUri(); |
117 | 117 | }); |
118 | 118 | } |
119 | 119 | if ($node instanceof TrashbinHome) { |
120 | - $propFind->handle(self::PROPERTY_RETENTION_DURATION, function () use ($node) { |
|
120 | + $propFind->handle(self::PROPERTY_RETENTION_DURATION, function() use ($node) { |
|
121 | 121 | return $this->retentionService->getDuration(); |
122 | 122 | }); |
123 | 123 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | - if (isset($property) && $property->getValue() !== (string)$newValue) { |
|
67 | + if (isset($property) && $property->getValue() !== (string) $newValue) { |
|
68 | 68 | $property->setValue($newValue); |
69 | 69 | $this->accountManager->updateAccount($account); |
70 | 70 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @return string |
63 | 63 | */ |
64 | 64 | public function __toString(): string { |
65 | - return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
65 | + return __CLASS__.": [{$this->code}]: {$this->message} ({$this->hint})\n"; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | // Append an "a" behind the password and hash it to prevent reusing the same password as for encryption |
77 | - $password = hash('sha512', $password . 'a'); |
|
77 | + $password = hash('sha512', $password.'a'); |
|
78 | 78 | |
79 | 79 | $hash = new Hash('sha512'); |
80 | 80 | $hash->setKey($password); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $this->cipher->setPassword($encryptionKey); |
153 | 153 | $this->cipher->setIV($iv); |
154 | 154 | |
155 | - if (!hash_equals($this->calculateHMAC($parts[0] . $parts[1], $hmacKey), $hmac)) { |
|
155 | + if (!hash_equals($this->calculateHMAC($parts[0].$parts[1], $hmacKey), $hmac)) { |
|
156 | 156 | throw new Exception('HMAC does not match.'); |
157 | 157 | } |
158 | 158 | |
@@ -166,15 +166,15 @@ discard block |
||
166 | 166 | |
167 | 167 | private function hex2bin(string $hex): string { |
168 | 168 | if (!ctype_xdigit($hex)) { |
169 | - throw new \RuntimeException('String contains non hex chars: ' . $hex); |
|
169 | + throw new \RuntimeException('String contains non hex chars: '.$hex); |
|
170 | 170 | } |
171 | 171 | if (strlen($hex) % 2 !== 0) { |
172 | - throw new \RuntimeException('Hex string is not of even length: ' . $hex); |
|
172 | + throw new \RuntimeException('Hex string is not of even length: '.$hex); |
|
173 | 173 | } |
174 | 174 | $result = hex2bin($hex); |
175 | 175 | |
176 | 176 | if ($result === false) { |
177 | - throw new \RuntimeException('Hex to bin conversion failed: ' . $hex); |
|
177 | + throw new \RuntimeException('Hex to bin conversion failed: '.$hex); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | return $result; |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | $icon->setImageFormat("png32"); |
74 | 74 | |
75 | 75 | $clone = clone $icon; |
76 | - $clone->scaleImage(16,0); |
|
76 | + $clone->scaleImage(16, 0); |
|
77 | 77 | $favicon->addImage($clone); |
78 | 78 | |
79 | 79 | $clone = clone $icon; |
80 | - $clone->scaleImage(32,0); |
|
80 | + $clone->scaleImage(32, 0); |
|
81 | 81 | $favicon->addImage($clone); |
82 | 82 | |
83 | 83 | $clone = clone $icon; |
84 | - $clone->scaleImage(64,0); |
|
84 | + $clone->scaleImage(64, 0); |
|
85 | 85 | $favicon->addImage($clone); |
86 | 86 | |
87 | 87 | $clone = clone $icon; |
88 | - $clone->scaleImage(128,0); |
|
88 | + $clone->scaleImage(128, 0); |
|
89 | 89 | $favicon->addImage($clone); |
90 | 90 | |
91 | 91 | $data = $favicon->getImagesBlob(); |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | $color = $this->themingDefaults->getColorPrimary(); |
146 | 146 | |
147 | 147 | // generate background image with rounded corners |
148 | - $background = '<?xml version="1.0" encoding="UTF-8"?>' . |
|
149 | - '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" width="512" height="512" xmlns:xlink="http://www.w3.org/1999/xlink">' . |
|
150 | - '<rect x="0" y="0" rx="100" ry="100" width="512" height="512" style="fill:' . $color . ';" />' . |
|
148 | + $background = '<?xml version="1.0" encoding="UTF-8"?>'. |
|
149 | + '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" width="512" height="512" xmlns:xlink="http://www.w3.org/1999/xlink">'. |
|
150 | + '<rect x="0" y="0" rx="100" ry="100" width="512" height="512" style="fill:'.$color.';" />'. |
|
151 | 151 | '</svg>'; |
152 | 152 | // resize svg magic as this seems broken in Imagemagick |
153 | 153 | if ($mime === "image/svg+xml" || substr($appIconContent, 0, 4) === "<svg") { |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | |
172 | 172 | // convert svg to resized image |
173 | 173 | $appIconFile = new Imagick(); |
174 | - $resX = (int)(512 * $res['x'] / $max * 2.53); |
|
175 | - $resY = (int)(512 * $res['y'] / $max * 2.53); |
|
174 | + $resX = (int) (512 * $res['x'] / $max * 2.53); |
|
175 | + $resY = (int) (512 * $res['y'] / $max * 2.53); |
|
176 | 176 | $appIconFile->setResolution($resX, $resY); |
177 | 177 | $appIconFile->setBackgroundColor(new ImagickPixel('transparent')); |
178 | 178 | $appIconFile->readImageBlob($svg); |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | $appIconFile->scaleImage(512, 512, true); |
196 | 196 | } |
197 | 197 | // offset for icon positioning |
198 | - $border_w = (int)($appIconFile->getImageWidth() * 0.05); |
|
199 | - $border_h = (int)($appIconFile->getImageHeight() * 0.05); |
|
198 | + $border_w = (int) ($appIconFile->getImageWidth() * 0.05); |
|
199 | + $border_h = (int) ($appIconFile->getImageHeight() * 0.05); |
|
200 | 200 | $innerWidth = ($appIconFile->getImageWidth() - $border_w * 2); |
201 | 201 | $innerHeight = ($appIconFile->getImageHeight() - $border_h * 2); |
202 | 202 | $appIconFile->adaptiveResizeImage($innerWidth, $innerHeight); |
203 | 203 | // center icon |
204 | - $offset_w = (int)(512 / 2 - $innerWidth / 2); |
|
205 | - $offset_h = (int)(512 / 2 - $innerHeight / 2); |
|
204 | + $offset_w = (int) (512 / 2 - $innerWidth / 2); |
|
205 | + $offset_h = (int) (512 / 2 - $innerHeight / 2); |
|
206 | 206 | |
207 | 207 | $finalIconFile = new Imagick(); |
208 | 208 | $finalIconFile->setBackgroundColor(new ImagickPixel('transparent')); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $result = $this->checker->verifyCoreSignature(); |
69 | 69 | $this->writeArrayInOutputFormat($input, $output, $result); |
70 | 70 | if (count($result) > 0) { |
71 | - $output->writeln('<error>' . count($result) . ' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
71 | + $output->writeln('<error>'.count($result).' errors found</error>', OutputInterface::VERBOSITY_VERBOSE); |
|
72 | 72 | return 1; |
73 | 73 | } |
74 | 74 | $output->writeln('<info>No errors found</info>', OutputInterface::VERBOSITY_VERBOSE); |