@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function setId($id) { |
| 88 | 88 | if (is_int($id)) { |
| 89 | - $id = (string)$id; |
|
| 89 | + $id = (string) $id; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if(!is_string($id)) { |
|
| 92 | + if (!is_string($id)) { |
|
| 93 | 93 | throw new \InvalidArgumentException('String expected.'); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -115,14 +115,14 @@ discard block |
||
| 115 | 115 | if ($this->providerId === null || $this->id === null) { |
| 116 | 116 | throw new \UnexpectedValueException; |
| 117 | 117 | } |
| 118 | - return $this->providerId . ':' . $this->id; |
|
| 118 | + return $this->providerId.':'.$this->id; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * @inheritdoc |
| 123 | 123 | */ |
| 124 | 124 | public function setProviderId($id) { |
| 125 | - if(!is_string($id)) { |
|
| 125 | + if (!is_string($id)) { |
|
| 126 | 126 | throw new \InvalidArgumentException('String expected.'); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | // for federated shares the owner can be a remote user, in this |
| 158 | 158 | // case we use the initiator |
| 159 | - if($this->userManager->userExists($this->shareOwner)) { |
|
| 159 | + if ($this->userManager->userExists($this->shareOwner)) { |
|
| 160 | 160 | $userFolder = $this->rootFolder->getUserFolder($this->shareOwner); |
| 161 | 161 | } else { |
| 162 | 162 | $userFolder = $this->rootFolder->getUserFolder($this->sharedBy); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $nodes = $userFolder->getById($this->fileId); |
| 166 | 166 | if (empty($nodes)) { |
| 167 | - throw new NotFoundException('Node for share not found, fileid: ' . $this->fileId); |
|
| 167 | + throw new NotFoundException('Node for share not found, fileid: '.$this->fileId); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $this->node = $nodes[0]; |
@@ -68,14 +68,14 @@ |
||
| 68 | 68 | |
| 69 | 69 | public function validate($config) { |
| 70 | 70 | $errors = array(); |
| 71 | - if(empty($config['dbuser']) && empty($config['dbname'])) { |
|
| 71 | + if (empty($config['dbuser']) && empty($config['dbname'])) { |
|
| 72 | 72 | $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname)); |
| 73 | - } else if(empty($config['dbuser'])) { |
|
| 73 | + } else if (empty($config['dbuser'])) { |
|
| 74 | 74 | $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname)); |
| 75 | - } else if(empty($config['dbname'])) { |
|
| 75 | + } else if (empty($config['dbname'])) { |
|
| 76 | 76 | $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname)); |
| 77 | 77 | } |
| 78 | - if(substr_count($config['dbname'], '.') >= 1) { |
|
| 78 | + if (substr_count($config['dbname'], '.') >= 1) { |
|
| 79 | 79 | $errors[] = $this->trans->t("%s you may not use dots in the database name", array($this->dbprettyname)); |
| 80 | 80 | } |
| 81 | 81 | return $errors; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | $mount = $file->getMountPoint(); |
| 247 | - if ($mount and !$mount->getOption('previews', true)){ |
|
| 247 | + if ($mount and !$mount->getOption('previews', true)) { |
|
| 248 | 248 | return false; |
| 249 | 249 | } |
| 250 | 250 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | protected function registerCoreProvider($class, $mimeType, $options = []) { |
| 332 | 332 | if (in_array(trim($class, '\\'), $this->getEnabledDefaultProvider())) { |
| 333 | - $this->registerProvider($mimeType, function () use ($class, $options) { |
|
| 333 | + $this->registerProvider($mimeType, function() use ($class, $options) { |
|
| 334 | 334 | return new $class($options); |
| 335 | 335 | }); |
| 336 | 336 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 88 | 88 | $path = Filesystem::getPath($params['fileSource']); |
| 89 | 89 | list($owner, $ownerPath) = $this->getOwnerPath($path); |
| 90 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
| 90 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
| 91 | 91 | $this->update($absPath); |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 104 | 104 | $path = Filesystem::getPath($params['fileSource']); |
| 105 | 105 | list($owner, $ownerPath) = $this->getOwnerPath($path); |
| 106 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
| 106 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
| 107 | 107 | $this->update($absPath); |
| 108 | 108 | } |
| 109 | 109 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function postRestore($params) { |
| 119 | 119 | if ($this->encryptionManager->isEnabled()) { |
| 120 | - $path = Filesystem::normalizePath('/' . $this->uid . '/files/' . $params['filePath']); |
|
| 120 | + $path = Filesystem::normalizePath('/'.$this->uid.'/files/'.$params['filePath']); |
|
| 121 | 121 | $this->update($path); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | public function postRename($params) { |
| 132 | 132 | $source = $params['oldpath']; |
| 133 | 133 | $target = $params['newpath']; |
| 134 | - if( |
|
| 134 | + if ( |
|
| 135 | 135 | $this->encryptionManager->isEnabled() && |
| 136 | 136 | dirname($source) !== dirname($target) |
| 137 | 137 | ) { |
| 138 | 138 | list($owner, $ownerPath) = $this->getOwnerPath($target); |
| 139 | - $absPath = '/' . $owner . '/files/' . $ownerPath; |
|
| 139 | + $absPath = '/'.$owner.'/files/'.$ownerPath; |
|
| 140 | 140 | $this->update($absPath); |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | protected function getOwnerPath($path) { |
| 152 | 152 | $info = Filesystem::getFileInfo($path); |
| 153 | 153 | $owner = Filesystem::getOwner($path); |
| 154 | - $view = new View('/' . $owner . '/files'); |
|
| 154 | + $view = new View('/'.$owner.'/files'); |
|
| 155 | 155 | $path = $view->getPath($info->getId()); |
| 156 | 156 | if ($path === null) { |
| 157 | - throw new \InvalidArgumentException('No file found for ' . $info->getId()); |
|
| 157 | + throw new \InvalidArgumentException('No file found for '.$info->getId()); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return array($owner, $path); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @param string $name |
| 33 | 33 | */ |
| 34 | 34 | public function __construct($id, $name) { |
| 35 | - parent::__construct('Id "' . $id . '" already used by encryption module "' . $name . '"'); |
|
| 35 | + parent::__construct('Id "'.$id.'" already used by encryption module "'.$name.'"'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | } |
@@ -31,6 +31,6 @@ |
||
| 31 | 31 | * @param string $key |
| 32 | 32 | */ |
| 33 | 33 | public function __construct($key) { |
| 34 | - parent::__construct('header key "'. $key . '" already reserved by ownCloud'); |
|
| 34 | + parent::__construct('header key "'.$key.'" already reserved by ownCloud'); |
|
| 35 | 35 | } |
| 36 | 36 | } |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | |
| 27 | 27 | use OCP\Encryption\Exceptions\GenericEncryptionException; |
| 28 | 28 | |
| 29 | -class EncryptionFailedException extends GenericEncryptionException{ |
|
| 29 | +class EncryptionFailedException extends GenericEncryptionException { |
|
| 30 | 30 | |
| 31 | 31 | } |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | |
| 27 | 27 | use OCP\Encryption\Exceptions\GenericEncryptionException; |
| 28 | 28 | |
| 29 | -class EmptyEncryptionDataException extends GenericEncryptionException{ |
|
| 29 | +class EmptyEncryptionDataException extends GenericEncryptionException { |
|
| 30 | 30 | |
| 31 | 31 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | // always add owner to the list of users with access to the file |
| 59 | 59 | $userIds = array($owner); |
| 60 | 60 | |
| 61 | - if (!$this->util->isFile($owner . '/' . $ownerPath)) { |
|
| 61 | + if (!$this->util->isFile($owner.'/'.$ownerPath)) { |
|
| 62 | 62 | return array('users' => $userIds, 'public' => false); |
| 63 | 63 | } |
| 64 | 64 | |