@@ -148,27 +148,27 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | protected function normalizePermissions($permissions) |
| 150 | 150 | { |
| 151 | - if (is_numeric($permissions)) { |
|
| 151 | + if (is_numeric($permissions)) { |
|
| 152 | 152 | return $permissions & 0777; |
| 153 | - } |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - // remove the type identifier |
|
| 156 | - $permissions = substr($permissions, 1); |
|
| 155 | + // remove the type identifier |
|
| 156 | + $permissions = substr($permissions, 1); |
|
| 157 | 157 | |
| 158 | - // map the string rights to the numeric counterparts |
|
| 159 | - $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; |
|
| 160 | - $permissions = strtr($permissions, $map); |
|
| 158 | + // map the string rights to the numeric counterparts |
|
| 159 | + $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; |
|
| 160 | + $permissions = strtr($permissions, $map); |
|
| 161 | 161 | |
| 162 | - // split up the permission groups |
|
| 163 | - $parts = str_split($permissions, 3); |
|
| 162 | + // split up the permission groups |
|
| 163 | + $parts = str_split($permissions, 3); |
|
| 164 | 164 | |
| 165 | - // convert the groups |
|
| 166 | - $mapper = function ($part) { |
|
| 165 | + // convert the groups |
|
| 166 | + $mapper = function ($part) { |
|
| 167 | 167 | return array_sum(str_split($part)); |
| 168 | - }; |
|
| 168 | + }; |
|
| 169 | 169 | |
| 170 | - // converts to decimal number |
|
| 171 | - return octdec(implode('', array_map($mapper, $parts))); |
|
| 170 | + // converts to decimal number |
|
| 171 | + return octdec(implode('', array_map($mapper, $parts))); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $ret['mode'] = $metadata['type'] === 'dir' ? 040000 : 0100000; |
| 189 | 189 | $visibility = $metadata['visibility']; |
| 190 | 190 | if ($visibility != AdapterInterface::VISIBILITY_PUBLIC && $visibility != AdapterInterface::VISIBILITY_PRIVATE) { |
| 191 | - $visibility = $this->normalizePermissions($visibility) & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; |
|
| 191 | + $visibility = $this->normalizePermissions($visibility) & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; |
|
| 192 | 192 | } |
| 193 | 193 | $ret['mode'] += $this->permissions[$metadata['type']][$visibility]; |
| 194 | 194 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $keys = array_diff($this->required, array_keys($metadata), $ignore); |
| 124 | 124 | |
| 125 | 125 | foreach ($keys as $key) { |
| 126 | - $method = 'get' . ucfirst($key); |
|
| 126 | + $method = 'get'.ucfirst($key); |
|
| 127 | 127 | |
| 128 | 128 | try { |
| 129 | 129 | $metadata[$key] = $this->filesystem->$method($path); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $parts = str_split($permissions, 3); |
| 164 | 164 | |
| 165 | 165 | // convert the groups |
| 166 | - $mapper = function ($part) { |
|
| 166 | + $mapper = function($part) { |
|
| 167 | 167 | return array_sum(str_split($part)); |
| 168 | 168 | }; |
| 169 | 169 | |
@@ -163,7 +163,8 @@ |
||
| 163 | 163 | $parts = str_split($permissions, 3); |
| 164 | 164 | |
| 165 | 165 | // convert the groups |
| 166 | - $mapper = function ($part) { |
|
| 166 | + $mapper = function ($part) |
|
| 167 | + { |
|
| 167 | 168 | return array_sum(str_split($part)); |
| 168 | 169 | }; |
| 169 | 170 | |