@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { |
| 52 | 52 | $access = parent::checkPrivileges($uri, $privileges, $recursion, false); |
| 53 | - if($access === false && $throwExceptions) { |
|
| 53 | + if ($access === false && $throwExceptions) { |
|
| 54 | 54 | /** @var INode $node */ |
| 55 | 55 | $node = $this->server->tree->getNodeForPath($uri); |
| 56 | 56 | |
| 57 | - switch(get_class($node)) { |
|
| 57 | + switch (get_class($node)) { |
|
| 58 | 58 | case 'OCA\DAV\CardDAV\AddressBook': |
| 59 | 59 | $type = 'Addressbook'; |
| 60 | 60 | break; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function propFind(PropFind $propFind, INode $node) { |
| 78 | 78 | // If the node is neither readable nor writable then fail unless its of |
| 79 | 79 | // the standard user-principal |
| 80 | - if(!($node instanceof User)) { |
|
| 80 | + if (!($node instanceof User)) { |
|
| 81 | 81 | $path = $propFind->getPath(); |
| 82 | 82 | $readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false); |
| 83 | 83 | $writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false); |
@@ -60,9 +60,9 @@ |
||
| 60 | 60 | |
| 61 | 61 | public function propFind(PropFind $propFind, INode $node) { |
| 62 | 62 | /* Overload current-user-principal */ |
| 63 | - $propFind->handle('{DAV:}current-user-principal', function () { |
|
| 63 | + $propFind->handle('{DAV:}current-user-principal', function() { |
|
| 64 | 64 | if ($url = parent::getCurrentUserPrincipal()) { |
| 65 | - return new Principal(Principal::HREF, $url . '/'); |
|
| 65 | + return new Principal(Principal::HREF, $url.'/'); |
|
| 66 | 66 | } else { |
| 67 | 67 | return new Principal(Principal::UNAUTHENTICATED); |
| 68 | 68 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $dispatcher = $this->getContainer()->getServer()->getEventDispatcher(); |
| 71 | 71 | |
| 72 | 72 | // first time login event setup |
| 73 | - $dispatcher->addListener(IUser::class . '::firstLogin', function ($event) use ($hm) { |
|
| 73 | + $dispatcher->addListener(IUser::class.'::firstLogin', function($event) use ($hm) { |
|
| 74 | 74 | if ($event instanceof GenericEvent) { |
| 75 | 75 | $hm->firstLogin($event->getSubject()); |
| 76 | 76 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $server->on('beforeMethod', [$this, 'beforeMethod']); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - public function beforeMethod(RequestInterface $request, ResponseInterface $response){ |
|
| 58 | + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { |
|
| 59 | 59 | // verify that the owner didn't have his share permissions revoked |
| 60 | 60 | if ($this->fileInfo && !$this->fileInfo->isShareable()) { |
| 61 | 61 | throw new NotFound(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->enabled = false; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - public function beforeMethod(RequestInterface $request, ResponseInterface $response){ |
|
| 67 | + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { |
|
| 68 | 68 | |
| 69 | 69 | if (!$this->enabled) { |
| 70 | 70 | return; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $path = array_pop($path); |
| 79 | 79 | |
| 80 | 80 | $newName = \OC_Helper::buildNotExistingFileNameForView('/', $path, $this->view); |
| 81 | - $url = $request->getBaseUrl() . $newName; |
|
| 81 | + $url = $request->getBaseUrl().$newName; |
|
| 82 | 82 | $request->setUrl($url); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | function createDirectory($name) { |
| 43 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
| 43 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | function getChild($name) { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | function createFile($name, $data = null) { |
| 42 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
| 42 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | function createDirectory($name) { |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | $rootView = new View(); |
| 84 | 84 | $user = \OC::$server->getUserSession()->getUser(); |
| 85 | 85 | Filesystem::initMountPoints($user->getUID()); |
| 86 | - if (!$rootView->file_exists('/' . $user->getUID() . '/uploads')) { |
|
| 87 | - $rootView->mkdir('/' . $user->getUID() . '/uploads'); |
|
| 86 | + if (!$rootView->file_exists('/'.$user->getUID().'/uploads')) { |
|
| 87 | + $rootView->mkdir('/'.$user->getUID().'/uploads'); |
|
| 88 | 88 | } |
| 89 | - $view = new View('/' . $user->getUID() . '/uploads'); |
|
| 89 | + $view = new View('/'.$user->getUID().'/uploads'); |
|
| 90 | 90 | $rootInfo = $view->getFileInfo(''); |
| 91 | 91 | $impl = new Directory($view, $rootInfo); |
| 92 | 92 | return $impl; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | // build additional information |
| 75 | 75 | $this->sortedNodes = []; |
| 76 | 76 | $start = 0; |
| 77 | - foreach($this->nodes as $node) { |
|
| 77 | + foreach ($this->nodes as $node) { |
|
| 78 | 78 | $size = $node->getSize(); |
| 79 | 79 | $name = $node->getName(); |
| 80 | 80 | $this->sortedNodes[$name] = ['node' => $node, 'start' => $start, 'end' => $start + $size]; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | if (isset($context[$name])) { |
| 217 | 217 | $context = $context[$name]; |
| 218 | 218 | } else { |
| 219 | - throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set'); |
|
| 219 | + throw new \BadMethodCallException('Invalid context, "'.$name.'" options not set'); |
|
| 220 | 220 | } |
| 221 | 221 | if (isset($context['nodes']) and is_array($context['nodes'])) { |
| 222 | 222 | $this->nodes = $context['nodes']; |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * @return IFile | null |
| 254 | 254 | */ |
| 255 | 255 | private function getNodeForPosition($pos) { |
| 256 | - foreach($this->sortedNodes as $node) { |
|
| 256 | + foreach ($this->sortedNodes as $node) { |
|
| 257 | 257 | if ($pos >= $node['start'] && $pos < $node['end']) { |
| 258 | 258 | return [$node['node'], $pos - $node['start']]; |
| 259 | 259 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | return $data; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - return fopen('data://text/plain,' . $data,'r'); |
|
| 274 | + return fopen('data://text/plain,'.$data, 'r'); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | } |
@@ -88,39 +88,39 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | if ($event->getSubject() === self::SUBJECT_ADD) { |
| 90 | 90 | $subject = $this->l->t('{actor} created calendar {calendar}'); |
| 91 | - } else if ($event->getSubject() === self::SUBJECT_ADD . '_self') { |
|
| 91 | + } else if ($event->getSubject() === self::SUBJECT_ADD.'_self') { |
|
| 92 | 92 | $subject = $this->l->t('You created calendar {calendar}'); |
| 93 | 93 | } else if ($event->getSubject() === self::SUBJECT_DELETE) { |
| 94 | 94 | $subject = $this->l->t('{actor} deleted calendar {calendar}'); |
| 95 | - } else if ($event->getSubject() === self::SUBJECT_DELETE . '_self') { |
|
| 95 | + } else if ($event->getSubject() === self::SUBJECT_DELETE.'_self') { |
|
| 96 | 96 | $subject = $this->l->t('You deleted calendar {calendar}'); |
| 97 | 97 | } else if ($event->getSubject() === self::SUBJECT_UPDATE) { |
| 98 | 98 | $subject = $this->l->t('{actor} updated calendar {calendar}'); |
| 99 | - } else if ($event->getSubject() === self::SUBJECT_UPDATE . '_self') { |
|
| 99 | + } else if ($event->getSubject() === self::SUBJECT_UPDATE.'_self') { |
|
| 100 | 100 | $subject = $this->l->t('You updated calendar {calendar}'); |
| 101 | 101 | |
| 102 | 102 | } else if ($event->getSubject() === self::SUBJECT_SHARE_USER) { |
| 103 | 103 | $subject = $this->l->t('{actor} shared calendar {calendar} with you'); |
| 104 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') { |
|
| 104 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_you') { |
|
| 105 | 105 | $subject = $this->l->t('You shared calendar {calendar} with {user}'); |
| 106 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') { |
|
| 106 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_by') { |
|
| 107 | 107 | $subject = $this->l->t('{actor} shared calendar {calendar} with {user}'); |
| 108 | 108 | } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER) { |
| 109 | 109 | $subject = $this->l->t('{actor} unshared calendar {calendar} from you'); |
| 110 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') { |
|
| 110 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_you') { |
|
| 111 | 111 | $subject = $this->l->t('You unshared calendar {calendar} from {user}'); |
| 112 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') { |
|
| 112 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_by') { |
|
| 113 | 113 | $subject = $this->l->t('{actor} unshared calendar {calendar} from {user}'); |
| 114 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') { |
|
| 114 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_self') { |
|
| 115 | 115 | $subject = $this->l->t('{actor} unshared calendar {calendar} from themselves'); |
| 116 | 116 | |
| 117 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') { |
|
| 117 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_you') { |
|
| 118 | 118 | $subject = $this->l->t('You shared calendar {calendar} with group {group}'); |
| 119 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') { |
|
| 119 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_by') { |
|
| 120 | 120 | $subject = $this->l->t('{actor} shared calendar {calendar} with group {group}'); |
| 121 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') { |
|
| 121 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_you') { |
|
| 122 | 122 | $subject = $this->l->t('You unshared calendar {calendar} from group {group}'); |
| 123 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') { |
|
| 123 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_by') { |
|
| 124 | 124 | $subject = $this->l->t('{actor} unshared calendar {calendar} from group {group}'); |
| 125 | 125 | } else { |
| 126 | 126 | throw new \InvalidArgumentException(); |
@@ -154,39 +154,39 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | switch ($subject) { |
| 156 | 156 | case self::SUBJECT_ADD: |
| 157 | - case self::SUBJECT_ADD . '_self': |
|
| 157 | + case self::SUBJECT_ADD.'_self': |
|
| 158 | 158 | case self::SUBJECT_DELETE: |
| 159 | - case self::SUBJECT_DELETE . '_self': |
|
| 159 | + case self::SUBJECT_DELETE.'_self': |
|
| 160 | 160 | case self::SUBJECT_UPDATE: |
| 161 | - case self::SUBJECT_UPDATE . '_self': |
|
| 161 | + case self::SUBJECT_UPDATE.'_self': |
|
| 162 | 162 | case self::SUBJECT_SHARE_USER: |
| 163 | 163 | case self::SUBJECT_UNSHARE_USER: |
| 164 | - case self::SUBJECT_UNSHARE_USER . '_self': |
|
| 164 | + case self::SUBJECT_UNSHARE_USER.'_self': |
|
| 165 | 165 | return [ |
| 166 | 166 | 'actor' => $this->generateUserParameter($parameters[0]), |
| 167 | 167 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
| 168 | 168 | ]; |
| 169 | - case self::SUBJECT_SHARE_USER . '_you': |
|
| 170 | - case self::SUBJECT_UNSHARE_USER . '_you': |
|
| 169 | + case self::SUBJECT_SHARE_USER.'_you': |
|
| 170 | + case self::SUBJECT_UNSHARE_USER.'_you': |
|
| 171 | 171 | return [ |
| 172 | 172 | 'user' => $this->generateUserParameter($parameters[0]), |
| 173 | 173 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
| 174 | 174 | ]; |
| 175 | - case self::SUBJECT_SHARE_USER . '_by': |
|
| 176 | - case self::SUBJECT_UNSHARE_USER . '_by': |
|
| 175 | + case self::SUBJECT_SHARE_USER.'_by': |
|
| 176 | + case self::SUBJECT_UNSHARE_USER.'_by': |
|
| 177 | 177 | return [ |
| 178 | 178 | 'user' => $this->generateUserParameter($parameters[0]), |
| 179 | 179 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
| 180 | 180 | 'actor' => $this->generateUserParameter($parameters[2]), |
| 181 | 181 | ]; |
| 182 | - case self::SUBJECT_SHARE_GROUP . '_you': |
|
| 183 | - case self::SUBJECT_UNSHARE_GROUP . '_you': |
|
| 182 | + case self::SUBJECT_SHARE_GROUP.'_you': |
|
| 183 | + case self::SUBJECT_UNSHARE_GROUP.'_you': |
|
| 184 | 184 | return [ |
| 185 | 185 | 'group' => $this->generateGroupParameter($parameters[0]), |
| 186 | 186 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
| 187 | 187 | ]; |
| 188 | - case self::SUBJECT_SHARE_GROUP . '_by': |
|
| 189 | - case self::SUBJECT_UNSHARE_GROUP . '_by': |
|
| 188 | + case self::SUBJECT_SHARE_GROUP.'_by': |
|
| 189 | + case self::SUBJECT_UNSHARE_GROUP.'_by': |
|
| 190 | 190 | return [ |
| 191 | 191 | 'group' => $this->generateGroupParameter($parameters[0]), |
| 192 | 192 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |