@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * {@inheritdoc} |
|
| 137 | - */ |
|
| 136 | + * {@inheritdoc} |
|
| 137 | + */ |
|
| 138 | 138 | public function moveTo(string|DirectoryInterface $directory): FileInterface|DirectoryInterface |
| 139 | 139 | { |
| 140 | 140 | $dest = $this->copyTo($directory); |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * {@inheritdoc} |
|
| 149 | - */ |
|
| 148 | + * {@inheritdoc} |
|
| 149 | + */ |
|
| 150 | 150 | public function chmod(int $mode): self |
| 151 | 151 | { |
| 152 | 152 | chmod($this->path, $mode); |
@@ -155,24 +155,24 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * {@inheritdoc} |
|
| 159 | - */ |
|
| 158 | + * {@inheritdoc} |
|
| 159 | + */ |
|
| 160 | 160 | public function exists(): bool |
| 161 | 161 | { |
| 162 | 162 | return $this->isExists($this->path); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | - * {@inheritdoc} |
|
| 167 | - */ |
|
| 166 | + * {@inheritdoc} |
|
| 167 | + */ |
|
| 168 | 168 | public function getLocation(): string |
| 169 | 169 | { |
| 170 | 170 | return dirname($this->path); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
| 174 | - * {@inheritdoc} |
|
| 175 | - */ |
|
| 174 | + * {@inheritdoc} |
|
| 175 | + */ |
|
| 176 | 176 | public function getMtime(): int |
| 177 | 177 | { |
| 178 | 178 | $time = filemtime($this->path); |
@@ -180,16 +180,16 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * {@inheritdoc} |
|
| 184 | - */ |
|
| 183 | + * {@inheritdoc} |
|
| 184 | + */ |
|
| 185 | 185 | public function getName(): string |
| 186 | 186 | { |
| 187 | 187 | return basename($this->path); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | - * {@inheritdoc} |
|
| 192 | - */ |
|
| 191 | + * {@inheritdoc} |
|
| 192 | + */ |
|
| 193 | 193 | public function getPermission(): string |
| 194 | 194 | { |
| 195 | 195 | $permission = fileperms($this->path); |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | - * {@inheritdoc} |
|
| 207 | - */ |
|
| 206 | + * {@inheritdoc} |
|
| 207 | + */ |
|
| 208 | 208 | public function getSize(): int |
| 209 | 209 | { |
| 210 | 210 | $size = filesize($this->path); |
@@ -212,40 +212,40 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | - * {@inheritdoc} |
|
| 216 | - */ |
|
| 215 | + * {@inheritdoc} |
|
| 216 | + */ |
|
| 217 | 217 | public function isDir(): bool |
| 218 | 218 | { |
| 219 | 219 | return $this->getType() === 'dir'; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
| 223 | - * {@inheritdoc} |
|
| 224 | - */ |
|
| 223 | + * {@inheritdoc} |
|
| 224 | + */ |
|
| 225 | 225 | public function isFile(): bool |
| 226 | 226 | { |
| 227 | 227 | return $this->getType() === 'file'; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | - * {@inheritdoc} |
|
| 232 | - */ |
|
| 231 | + * {@inheritdoc} |
|
| 232 | + */ |
|
| 233 | 233 | public function isReadable(): bool |
| 234 | 234 | { |
| 235 | 235 | return is_readable($this->path); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /** |
| 239 | - * {@inheritdoc} |
|
| 240 | - */ |
|
| 239 | + * {@inheritdoc} |
|
| 240 | + */ |
|
| 241 | 241 | public function isWritable(): bool |
| 242 | 242 | { |
| 243 | 243 | return is_writable($this->path); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * {@inheritdoc} |
|
| 248 | - */ |
|
| 247 | + * {@inheritdoc} |
|
| 248 | + */ |
|
| 249 | 249 | public function rename(string $newPath): self |
| 250 | 250 | { |
| 251 | 251 | $normalizedNewPath = rtrim(Path::normalizePathDS($newPath), '\\/'); |
@@ -264,8 +264,8 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /** |
| 267 | - * {@inheritdoc} |
|
| 268 | - */ |
|
| 267 | + * {@inheritdoc} |
|
| 268 | + */ |
|
| 269 | 269 | public function touch(int $time): self |
| 270 | 270 | { |
| 271 | 271 | touch($this->path, $time); |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | class Directory extends AbstractLocal implements DirectoryInterface |
| 60 | 60 | { |
| 61 | 61 | /** |
| 62 | - * {@inheritdoc} |
|
| 63 | - */ |
|
| 62 | + * {@inheritdoc} |
|
| 63 | + */ |
|
| 64 | 64 | public function copyTo( |
| 65 | 65 | string|DirectoryInterface $directory, |
| 66 | 66 | int $mode = 0775 |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * {@inheritdoc} |
|
| 100 | - */ |
|
| 99 | + * {@inheritdoc} |
|
| 100 | + */ |
|
| 101 | 101 | public function create(string $name, int $mode = 0775, bool $recursive = false): DirectoryInterface |
| 102 | 102 | { |
| 103 | 103 | if (!file_exists($this->path . DIRECTORY_SEPARATOR . $name)) { |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | - * {@inheritdoc} |
|
| 116 | - */ |
|
| 115 | + * {@inheritdoc} |
|
| 116 | + */ |
|
| 117 | 117 | public function createFile( |
| 118 | 118 | string $name, |
| 119 | 119 | string $content = '', |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * {@inheritdoc} |
|
| 132 | - */ |
|
| 131 | + * {@inheritdoc} |
|
| 132 | + */ |
|
| 133 | 133 | public function delete(): self |
| 134 | 134 | { |
| 135 | 135 | if (!$this->exists()) { |
@@ -145,16 +145,16 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * {@inheritdoc} |
|
| 149 | - */ |
|
| 148 | + * {@inheritdoc} |
|
| 149 | + */ |
|
| 150 | 150 | public function getType(): string |
| 151 | 151 | { |
| 152 | 152 | return 'dir'; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
| 156 | - * {@inheritdoc} |
|
| 157 | - */ |
|
| 156 | + * {@inheritdoc} |
|
| 157 | + */ |
|
| 158 | 158 | public function read(int $type = self::ALL): array |
| 159 | 159 | { |
| 160 | 160 | $files = [ |
@@ -197,8 +197,8 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
| 200 | - * {@inheritdoc} |
|
| 201 | - */ |
|
| 200 | + * {@inheritdoc} |
|
| 201 | + */ |
|
| 202 | 202 | public function scan(): array |
| 203 | 203 | { |
| 204 | 204 | $list = []; |
@@ -87,24 +87,24 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * {@inheritdoc} |
|
| 91 | - */ |
|
| 90 | + * {@inheritdoc} |
|
| 91 | + */ |
|
| 92 | 92 | public function directory(string $path = ''): DirectoryInterface |
| 93 | 93 | { |
| 94 | 94 | return new Directory($path, $this); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * {@inheritdoc} |
|
| 99 | - */ |
|
| 98 | + * {@inheritdoc} |
|
| 99 | + */ |
|
| 100 | 100 | public function file(string $path = ''): FileInterface |
| 101 | 101 | { |
| 102 | 102 | return new File($path, $this); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * {@inheritdoc} |
|
| 107 | - */ |
|
| 106 | + * {@inheritdoc} |
|
| 107 | + */ |
|
| 108 | 108 | public function get(string $path): FileInterface|DirectoryInterface|null |
| 109 | 109 | { |
| 110 | 110 | $absolutePath = $this->getAbsolutePath($path); |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * {@inheritdoc} |
|
| 125 | - */ |
|
| 124 | + * {@inheritdoc} |
|
| 125 | + */ |
|
| 126 | 126 | public function getAbsolutePath(string $path): string |
| 127 | 127 | { |
| 128 | 128 | $normalizedPath = Path::normalizePathDS($path); |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | class File extends AbstractLocal implements FileInterface |
| 59 | 59 | { |
| 60 | 60 | /** |
| 61 | - * {@inheritdoc} |
|
| 62 | - */ |
|
| 61 | + * {@inheritdoc} |
|
| 62 | + */ |
|
| 63 | 63 | public function append(string $content): self |
| 64 | 64 | { |
| 65 | 65 | file_put_contents($this->path, $content, FILE_APPEND); |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * {@inheritdoc} |
|
| 72 | - */ |
|
| 71 | + * {@inheritdoc} |
|
| 72 | + */ |
|
| 73 | 73 | public function copyTo( |
| 74 | 74 | string|DirectoryInterface $directory, |
| 75 | 75 | int $mode = 0775 |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | - * {@inheritdoc} |
|
| 90 | - */ |
|
| 89 | + * {@inheritdoc} |
|
| 90 | + */ |
|
| 91 | 91 | public function create(string $path, string $content = '', int $mode = 0775): FileInterface |
| 92 | 92 | { |
| 93 | 93 | $file = $this->adapter->file($path)->write($content); |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | - * {@inheritdoc} |
|
| 101 | - */ |
|
| 100 | + * {@inheritdoc} |
|
| 101 | + */ |
|
| 102 | 102 | public function delete(): self |
| 103 | 103 | { |
| 104 | 104 | unlink($this->path); |
@@ -107,16 +107,16 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * {@inheritdoc} |
|
| 111 | - */ |
|
| 110 | + * {@inheritdoc} |
|
| 111 | + */ |
|
| 112 | 112 | public function getExtension(): string |
| 113 | 113 | { |
| 114 | 114 | return pathinfo($this->path, PATHINFO_EXTENSION); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | - * {@inheritdoc} |
|
| 119 | - */ |
|
| 118 | + * {@inheritdoc} |
|
| 119 | + */ |
|
| 120 | 120 | public function getMime(): string |
| 121 | 121 | { |
| 122 | 122 | $mime = mime_content_type($this->path); |
@@ -128,24 +128,24 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * {@inheritdoc} |
|
| 132 | - */ |
|
| 131 | + * {@inheritdoc} |
|
| 132 | + */ |
|
| 133 | 133 | public function getType(): string |
| 134 | 134 | { |
| 135 | 135 | return 'file'; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | - * {@inheritdoc} |
|
| 140 | - */ |
|
| 139 | + * {@inheritdoc} |
|
| 140 | + */ |
|
| 141 | 141 | public function read(): string |
| 142 | 142 | { |
| 143 | 143 | return (string) file_get_contents($this->path); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | - * {@inheritdoc} |
|
| 148 | - */ |
|
| 147 | + * {@inheritdoc} |
|
| 148 | + */ |
|
| 149 | 149 | public function write(string $content): self |
| 150 | 150 | { |
| 151 | 151 | file_put_contents($this->path, $content); |