@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - public function __construct(Filesystem $files, array|string $path) |
|
| 57 | + public function __construct(Filesystem $files, array | string $path) |
|
| 58 | 58 | { |
| 59 | 59 | $this->files = $files; |
| 60 | 60 | $this->path = is_string($path) ? [$path] : $path; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | protected function loadFilePaths($locale, $group): array |
| 89 | 89 | { |
| 90 | 90 | return collect($this->path) |
| 91 | - ->reduce(function ($output, $path) use ($locale, $group) { |
|
| 91 | + ->reduce(function($output, $path) use ($locale, $group) { |
|
| 92 | 92 | $slash = DIRECTORY_SEPARATOR; |
| 93 | 93 | |
| 94 | 94 | if ($this->files->exists($fullPath = "{$path}$slash{$locale}$slash{$group}.php")) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | protected function loadJsonPaths($locale): array |
| 110 | 110 | { |
| 111 | 111 | return collect($this->path) |
| 112 | - ->reduce(function ($output, $path) use ($locale) { |
|
| 112 | + ->reduce(function($output, $path) use ($locale) { |
|
| 113 | 113 | $slash = DIRECTORY_SEPARATOR; |
| 114 | 114 | |
| 115 | 115 | if ($this->files->exists($fullPath = "{$path}$slash{$locale}.json")) { |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |------------------------------------------------------------------------ |
| 7 | 7 | | DateTime Language Lines |
| 8 | 8 | |------------------------------------------------------------------------ |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |------------------------------------------------------------------------ |
| 7 | 7 | | Vista de Líneas De Fecha y Hora |
| 8 | 8 | |------------------------------------------------------------------------ |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |------------------------------------------------------------------------ |
| 7 | 7 | | DateTime Language Lines |
| 8 | 8 | |------------------------------------------------------------------------ |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | - namespace Syscodes\Components\Finder\Exceptions; |
|
| 23 | + namespace Syscodes\Components\Finder\Exceptions; |
|
| 24 | 24 | |
| 25 | 25 | use UnexpectedValueException; |
| 26 | 26 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @return static |
| 133 | 133 | */ |
| 134 | - public function date(string|array $dates): static |
|
| 134 | + public function date(string | array $dates): static |
|
| 135 | 135 | { |
| 136 | 136 | foreach ((array) $dates as $date) { |
| 137 | 137 | $this->dates[] = new DateComparator($date); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * |
| 148 | 148 | * @return static |
| 149 | 149 | */ |
| 150 | - public function path(string|array $patterns): static |
|
| 150 | + public function path(string | array $patterns): static |
|
| 151 | 151 | { |
| 152 | 152 | $this->paths = array_merge($this->paths, (array) $patterns); |
| 153 | 153 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | * |
| 162 | 162 | * @return static |
| 163 | 163 | */ |
| 164 | - public function notPath(string|array $patterns): static |
|
| 164 | + public function notPath(string | array $patterns): static |
|
| 165 | 165 | { |
| 166 | 166 | $this->notPaths = array_merge($this->notPaths, (array) $patterns); |
| 167 | 167 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @throws DirectoryNotFoundException if one of the directories does not exist |
| 197 | 197 | */ |
| 198 | - public function in(string|array $dirs): static |
|
| 198 | + public function in(string | array $dirs): static |
|
| 199 | 199 | { |
| 200 | 200 | $resolvedDirs = []; |
| 201 | 201 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct(?string $value) |
| 41 | 41 | { |
| 42 | - if (null === $value || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $value, $matches)) { |
|
| 42 | + if (null === $value || ! preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $value, $matches)) { |
|
| 43 | 43 | throw new InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $value ?? 'null')); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -42,162 +42,162 @@ |
||
| 42 | 42 | const VISIBILITY_PRIVATE = 'private'; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Append given data string to this file. |
|
| 46 | - * |
|
| 47 | - * @param string $path |
|
| 48 | - * @param string $data |
|
| 49 | - * |
|
| 50 | - * @return bool |
|
| 51 | - */ |
|
| 52 | - public function append($path, $data); |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * Copy a file to a new location. |
|
| 56 | - * |
|
| 57 | - * @param string $path |
|
| 58 | - * @param string $target |
|
| 59 | - * |
|
| 60 | - * @return bool |
|
| 61 | - */ |
|
| 62 | - public function copy($path, $target): bool; |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * Get the contents of a file. |
|
| 66 | - * |
|
| 67 | - * @param string $path |
|
| 68 | - * @param bool $lock |
|
| 69 | - * @param bool $force |
|
| 70 | - * |
|
| 71 | - * @return string |
|
| 72 | - * |
|
| 73 | - * @throws FileNotFoundException |
|
| 74 | - */ |
|
| 75 | - public function get($path, $lock = false, $force = false): string; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * Get contents of a file with shared access. |
|
| 79 | - * |
|
| 80 | - * @param string $path |
|
| 81 | - * @param bool $force |
|
| 82 | - * |
|
| 83 | - * @return string |
|
| 84 | - */ |
|
| 85 | - public function read($path, $force = false): string; |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * Creates the file. |
|
| 89 | - * |
|
| 90 | - * @param string $path |
|
| 91 | - * |
|
| 92 | - * @return bool |
|
| 93 | - */ |
|
| 94 | - public function create($path): bool; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * Determine if a file exists. |
|
| 98 | - * |
|
| 99 | - * @param string $path |
|
| 100 | - * |
|
| 101 | - * @return bool |
|
| 102 | - */ |
|
| 103 | - public function exists($path): bool; |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * Retrieve the file size. |
|
| 107 | - * |
|
| 108 | - * Implementations SHOULD return the value stored in the "size" key of |
|
| 109 | - * the file in the $_FILES array if available, as PHP calculates this |
|
| 110 | - * based on the actual size transmitted. |
|
| 111 | - * |
|
| 112 | - * @param string $path |
|
| 113 | - * @param string $unit |
|
| 114 | - * |
|
| 115 | - * @return int|null The file size in bytes or null if unknown |
|
| 116 | - */ |
|
| 117 | - public function size($path, $unit = 'b'): int|null; |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Get all of the directories within a given directory. |
|
| 121 | - * |
|
| 122 | - * @param string $directory |
|
| 123 | - * |
|
| 124 | - * @return array |
|
| 125 | - */ |
|
| 126 | - public function directories($directory): array; |
|
| 127 | - |
|
| 128 | - /** |
|
| 129 | - * Delete the file at a given path. |
|
| 130 | - * |
|
| 131 | - * @param string $paths |
|
| 132 | - * |
|
| 133 | - * @return bool |
|
| 134 | - */ |
|
| 135 | - public function delete($paths): bool; |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * Create a directory. |
|
| 139 | - * |
|
| 140 | - * @param string $path |
|
| 141 | - * @param int $mode |
|
| 142 | - * @param bool $recursive |
|
| 143 | - * @param bool $force |
|
| 144 | - * |
|
| 145 | - * @return bool |
|
| 146 | - * |
|
| 147 | - * @throws FileException |
|
| 148 | - */ |
|
| 149 | - public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false): bool; |
|
| 150 | - |
|
| 151 | - /** |
|
| 152 | - * Recursively delete a directory and optionally you can keep |
|
| 153 | - * the directory if you wish. |
|
| 154 | - * |
|
| 155 | - * @param string $directory |
|
| 156 | - * @param bool $keep |
|
| 157 | - * |
|
| 158 | - * @return bool |
|
| 159 | - */ |
|
| 160 | - public function deleteDirectory($directory, $keep = false): bool; |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * Move a file to a new location. |
|
| 164 | - * |
|
| 165 | - * @param string $path |
|
| 166 | - * @param string $target |
|
| 167 | - * |
|
| 168 | - * @return bool |
|
| 169 | - */ |
|
| 170 | - public function move($path, $target): bool; |
|
| 171 | - |
|
| 172 | - /** |
|
| 173 | - * Prepend to a file. |
|
| 174 | - * |
|
| 175 | - * @param string $path |
|
| 176 | - * @param string $data |
|
| 177 | - * |
|
| 178 | - * @return int |
|
| 179 | - */ |
|
| 180 | - public function prepend($path, $data): int; |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * Write the content of a file. |
|
| 184 | - * |
|
| 185 | - * @param string $path |
|
| 186 | - * @param string $contents |
|
| 187 | - * @param bool $lock |
|
| 188 | - * |
|
| 189 | - * @return int|bool |
|
| 190 | - */ |
|
| 191 | - public function put($path, $contents, $lock = false): int|bool; |
|
| 192 | - |
|
| 193 | - /** |
|
| 194 | - * Write given data to this file. |
|
| 195 | - * |
|
| 196 | - * @param string $path |
|
| 197 | - * @param string $data Data to write to this File |
|
| 198 | - * @param bool $force The file to open |
|
| 199 | - * |
|
| 200 | - * @return bool |
|
| 201 | - */ |
|
| 202 | - public function write($path, $data, $force = false): bool; |
|
| 45 | + * Append given data string to this file. |
|
| 46 | + * |
|
| 47 | + * @param string $path |
|
| 48 | + * @param string $data |
|
| 49 | + * |
|
| 50 | + * @return bool |
|
| 51 | + */ |
|
| 52 | + public function append($path, $data); |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * Copy a file to a new location. |
|
| 56 | + * |
|
| 57 | + * @param string $path |
|
| 58 | + * @param string $target |
|
| 59 | + * |
|
| 60 | + * @return bool |
|
| 61 | + */ |
|
| 62 | + public function copy($path, $target): bool; |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * Get the contents of a file. |
|
| 66 | + * |
|
| 67 | + * @param string $path |
|
| 68 | + * @param bool $lock |
|
| 69 | + * @param bool $force |
|
| 70 | + * |
|
| 71 | + * @return string |
|
| 72 | + * |
|
| 73 | + * @throws FileNotFoundException |
|
| 74 | + */ |
|
| 75 | + public function get($path, $lock = false, $force = false): string; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * Get contents of a file with shared access. |
|
| 79 | + * |
|
| 80 | + * @param string $path |
|
| 81 | + * @param bool $force |
|
| 82 | + * |
|
| 83 | + * @return string |
|
| 84 | + */ |
|
| 85 | + public function read($path, $force = false): string; |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * Creates the file. |
|
| 89 | + * |
|
| 90 | + * @param string $path |
|
| 91 | + * |
|
| 92 | + * @return bool |
|
| 93 | + */ |
|
| 94 | + public function create($path): bool; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * Determine if a file exists. |
|
| 98 | + * |
|
| 99 | + * @param string $path |
|
| 100 | + * |
|
| 101 | + * @return bool |
|
| 102 | + */ |
|
| 103 | + public function exists($path): bool; |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * Retrieve the file size. |
|
| 107 | + * |
|
| 108 | + * Implementations SHOULD return the value stored in the "size" key of |
|
| 109 | + * the file in the $_FILES array if available, as PHP calculates this |
|
| 110 | + * based on the actual size transmitted. |
|
| 111 | + * |
|
| 112 | + * @param string $path |
|
| 113 | + * @param string $unit |
|
| 114 | + * |
|
| 115 | + * @return int|null The file size in bytes or null if unknown |
|
| 116 | + */ |
|
| 117 | + public function size($path, $unit = 'b'): int|null; |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Get all of the directories within a given directory. |
|
| 121 | + * |
|
| 122 | + * @param string $directory |
|
| 123 | + * |
|
| 124 | + * @return array |
|
| 125 | + */ |
|
| 126 | + public function directories($directory): array; |
|
| 127 | + |
|
| 128 | + /** |
|
| 129 | + * Delete the file at a given path. |
|
| 130 | + * |
|
| 131 | + * @param string $paths |
|
| 132 | + * |
|
| 133 | + * @return bool |
|
| 134 | + */ |
|
| 135 | + public function delete($paths): bool; |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * Create a directory. |
|
| 139 | + * |
|
| 140 | + * @param string $path |
|
| 141 | + * @param int $mode |
|
| 142 | + * @param bool $recursive |
|
| 143 | + * @param bool $force |
|
| 144 | + * |
|
| 145 | + * @return bool |
|
| 146 | + * |
|
| 147 | + * @throws FileException |
|
| 148 | + */ |
|
| 149 | + public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false): bool; |
|
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * Recursively delete a directory and optionally you can keep |
|
| 153 | + * the directory if you wish. |
|
| 154 | + * |
|
| 155 | + * @param string $directory |
|
| 156 | + * @param bool $keep |
|
| 157 | + * |
|
| 158 | + * @return bool |
|
| 159 | + */ |
|
| 160 | + public function deleteDirectory($directory, $keep = false): bool; |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * Move a file to a new location. |
|
| 164 | + * |
|
| 165 | + * @param string $path |
|
| 166 | + * @param string $target |
|
| 167 | + * |
|
| 168 | + * @return bool |
|
| 169 | + */ |
|
| 170 | + public function move($path, $target): bool; |
|
| 171 | + |
|
| 172 | + /** |
|
| 173 | + * Prepend to a file. |
|
| 174 | + * |
|
| 175 | + * @param string $path |
|
| 176 | + * @param string $data |
|
| 177 | + * |
|
| 178 | + * @return int |
|
| 179 | + */ |
|
| 180 | + public function prepend($path, $data): int; |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * Write the content of a file. |
|
| 184 | + * |
|
| 185 | + * @param string $path |
|
| 186 | + * @param string $contents |
|
| 187 | + * @param bool $lock |
|
| 188 | + * |
|
| 189 | + * @return int|bool |
|
| 190 | + */ |
|
| 191 | + public function put($path, $contents, $lock = false): int|bool; |
|
| 192 | + |
|
| 193 | + /** |
|
| 194 | + * Write given data to this file. |
|
| 195 | + * |
|
| 196 | + * @param string $path |
|
| 197 | + * @param string $data Data to write to this File |
|
| 198 | + * @param bool $force The file to open |
|
| 199 | + * |
|
| 200 | + * @return bool |
|
| 201 | + */ |
|
| 202 | + public function write($path, $data, $force = false): bool; |
|
| 203 | 203 | } |
| 204 | 204 | \ No newline at end of file |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @return int|null The file size in bytes or null if unknown |
| 116 | 116 | */ |
| 117 | - public function size($path, $unit = 'b'): int|null; |
|
| 117 | + public function size($path, $unit = 'b'): int | null; |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * Get all of the directories within a given directory. |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * |
| 189 | 189 | * @return int|bool |
| 190 | 190 | */ |
| 191 | - public function put($path, $contents, $lock = false): int|bool; |
|
| 191 | + public function put($path, $contents, $lock = false): int | bool; |
|
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | 194 | * Write given data to this file. |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | - namespace Syscodes\Components\Filesystem; |
|
| 23 | + namespace Syscodes\Components\Filesystem; |
|
| 24 | 24 | |
| 25 | 25 | use Syscodes\Components\Contracts\Filesystem\Filesystem; |
| 26 | 26 | |
@@ -58,207 +58,207 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * Append given data string to this file. |
|
| 62 | - * |
|
| 63 | - * @param string $path |
|
| 64 | - * @param string $data |
|
| 65 | - * |
|
| 66 | - * @return bool |
|
| 67 | - */ |
|
| 68 | - public function append($path, $data) |
|
| 61 | + * Append given data string to this file. |
|
| 62 | + * |
|
| 63 | + * @param string $path |
|
| 64 | + * @param string $data |
|
| 65 | + * |
|
| 66 | + * @return bool |
|
| 67 | + */ |
|
| 68 | + public function append($path, $data) |
|
| 69 | 69 | { |
| 70 | 70 | return $this->driver->append($path, $data); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | - * Copy a file to a new location. |
|
| 75 | - * |
|
| 76 | - * @param string $path |
|
| 77 | - * @param string $target |
|
| 78 | - * |
|
| 79 | - * @return bool |
|
| 80 | - */ |
|
| 81 | - public function copy($path, $target): bool |
|
| 74 | + * Copy a file to a new location. |
|
| 75 | + * |
|
| 76 | + * @param string $path |
|
| 77 | + * @param string $target |
|
| 78 | + * |
|
| 79 | + * @return bool |
|
| 80 | + */ |
|
| 81 | + public function copy($path, $target): bool |
|
| 82 | 82 | { |
| 83 | - return $this->driver->copy($path, $target); |
|
| 83 | + return $this->driver->copy($path, $target); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * Get the contents of a file. |
|
| 88 | - * |
|
| 89 | - * @param string $path |
|
| 90 | - * @param bool $lock |
|
| 91 | - * @param bool $force |
|
| 92 | - * |
|
| 93 | - * @return string |
|
| 94 | - * |
|
| 95 | - * @throws FileNotFoundException |
|
| 96 | - */ |
|
| 97 | - public function get($path, $lock = false, $force = false): string |
|
| 87 | + * Get the contents of a file. |
|
| 88 | + * |
|
| 89 | + * @param string $path |
|
| 90 | + * @param bool $lock |
|
| 91 | + * @param bool $force |
|
| 92 | + * |
|
| 93 | + * @return string |
|
| 94 | + * |
|
| 95 | + * @throws FileNotFoundException |
|
| 96 | + */ |
|
| 97 | + public function get($path, $lock = false, $force = false): string |
|
| 98 | 98 | { |
| 99 | - return $this->driver->get($path, $lock, $force); |
|
| 99 | + return $this->driver->get($path, $lock, $force); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Get contents of a file with shared access. |
|
| 104 | - * |
|
| 105 | - * @param string $path |
|
| 106 | - * @param bool $force |
|
| 107 | - * |
|
| 108 | - * @return string |
|
| 109 | - */ |
|
| 110 | - public function read($path, $force = false): string |
|
| 103 | + * Get contents of a file with shared access. |
|
| 104 | + * |
|
| 105 | + * @param string $path |
|
| 106 | + * @param bool $force |
|
| 107 | + * |
|
| 108 | + * @return string |
|
| 109 | + */ |
|
| 110 | + public function read($path, $force = false): string |
|
| 111 | 111 | { |
| 112 | - return $this->driver->read($path, $force); |
|
| 112 | + return $this->driver->read($path, $force); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * Creates the file. |
|
| 117 | - * |
|
| 118 | - * @param string $path |
|
| 119 | - * |
|
| 120 | - * @return bool |
|
| 121 | - */ |
|
| 122 | - public function create($path): bool |
|
| 116 | + * Creates the file. |
|
| 117 | + * |
|
| 118 | + * @param string $path |
|
| 119 | + * |
|
| 120 | + * @return bool |
|
| 121 | + */ |
|
| 122 | + public function create($path): bool |
|
| 123 | 123 | { |
| 124 | - return $this->driver->create($path); |
|
| 124 | + return $this->driver->create($path); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | - * Determine if a file exists. |
|
| 129 | - * |
|
| 130 | - * @param string $path |
|
| 131 | - * |
|
| 132 | - * @return bool |
|
| 133 | - */ |
|
| 134 | - public function exists($path): bool |
|
| 128 | + * Determine if a file exists. |
|
| 129 | + * |
|
| 130 | + * @param string $path |
|
| 131 | + * |
|
| 132 | + * @return bool |
|
| 133 | + */ |
|
| 134 | + public function exists($path): bool |
|
| 135 | 135 | { |
| 136 | - return $this->driver->exists($path); |
|
| 136 | + return $this->driver->exists($path); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | - * Retrieve the file size. |
|
| 141 | - * |
|
| 142 | - * Implementations SHOULD return the value stored in the "size" key of |
|
| 143 | - * the file in the $_FILES array if available, as PHP calculates this |
|
| 144 | - * based on the actual size transmitted. |
|
| 145 | - * |
|
| 146 | - * @param string $path |
|
| 147 | - * @param string $unit |
|
| 148 | - * |
|
| 149 | - * @return int|null The file size in bytes or null if unknown |
|
| 150 | - */ |
|
| 151 | - public function size($path, $unit = 'b'): int|null |
|
| 140 | + * Retrieve the file size. |
|
| 141 | + * |
|
| 142 | + * Implementations SHOULD return the value stored in the "size" key of |
|
| 143 | + * the file in the $_FILES array if available, as PHP calculates this |
|
| 144 | + * based on the actual size transmitted. |
|
| 145 | + * |
|
| 146 | + * @param string $path |
|
| 147 | + * @param string $unit |
|
| 148 | + * |
|
| 149 | + * @return int|null The file size in bytes or null if unknown |
|
| 150 | + */ |
|
| 151 | + public function size($path, $unit = 'b'): int|null |
|
| 152 | 152 | { |
| 153 | - return $this->driver->size($path, $unit); |
|
| 153 | + return $this->driver->size($path, $unit); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | - * Get all of the directories within a given directory. |
|
| 158 | - * |
|
| 159 | - * @param string $directory |
|
| 160 | - * |
|
| 161 | - * @return array |
|
| 162 | - */ |
|
| 163 | - public function directories($directory): array |
|
| 157 | + * Get all of the directories within a given directory. |
|
| 158 | + * |
|
| 159 | + * @param string $directory |
|
| 160 | + * |
|
| 161 | + * @return array |
|
| 162 | + */ |
|
| 163 | + public function directories($directory): array |
|
| 164 | 164 | { |
| 165 | - return $this->driver->directories($directory); |
|
| 165 | + return $this->driver->directories($directory); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
| 169 | - * Delete the file at a given path. |
|
| 170 | - * |
|
| 171 | - * @param string $paths |
|
| 172 | - * |
|
| 173 | - * @return bool |
|
| 174 | - */ |
|
| 175 | - public function delete($paths): bool |
|
| 169 | + * Delete the file at a given path. |
|
| 170 | + * |
|
| 171 | + * @param string $paths |
|
| 172 | + * |
|
| 173 | + * @return bool |
|
| 174 | + */ |
|
| 175 | + public function delete($paths): bool |
|
| 176 | 176 | { |
| 177 | - return $this->driver->delete($paths); |
|
| 177 | + return $this->driver->delete($paths); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
| 181 | - * Create a directory. |
|
| 182 | - * |
|
| 183 | - * @param string $path |
|
| 184 | - * @param int $mode |
|
| 185 | - * @param bool $recursive |
|
| 186 | - * @param bool $force |
|
| 187 | - * |
|
| 188 | - * @return bool |
|
| 189 | - * |
|
| 190 | - * @throws FileException |
|
| 191 | - */ |
|
| 192 | - public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false): bool |
|
| 181 | + * Create a directory. |
|
| 182 | + * |
|
| 183 | + * @param string $path |
|
| 184 | + * @param int $mode |
|
| 185 | + * @param bool $recursive |
|
| 186 | + * @param bool $force |
|
| 187 | + * |
|
| 188 | + * @return bool |
|
| 189 | + * |
|
| 190 | + * @throws FileException |
|
| 191 | + */ |
|
| 192 | + public function makeDirectory($path, $mode = 0755, $recursive = false, $force = false): bool |
|
| 193 | 193 | { |
| 194 | - return $this->driver->makeDirectory($path, $mode, $recursive, $force); |
|
| 194 | + return $this->driver->makeDirectory($path, $mode, $recursive, $force); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | - * Recursively delete a directory and optionally you can keep |
|
| 199 | - * the directory if you wish. |
|
| 200 | - * |
|
| 201 | - * @param string $directory |
|
| 202 | - * @param bool $keep |
|
| 203 | - * |
|
| 204 | - * @return bool |
|
| 205 | - */ |
|
| 206 | - public function deleteDirectory($directory, $keep = false): bool |
|
| 198 | + * Recursively delete a directory and optionally you can keep |
|
| 199 | + * the directory if you wish. |
|
| 200 | + * |
|
| 201 | + * @param string $directory |
|
| 202 | + * @param bool $keep |
|
| 203 | + * |
|
| 204 | + * @return bool |
|
| 205 | + */ |
|
| 206 | + public function deleteDirectory($directory, $keep = false): bool |
|
| 207 | 207 | { |
| 208 | - return $this->driver->deleteDirectory($directory, $keep); |
|
| 208 | + return $this->driver->deleteDirectory($directory, $keep); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * Move a file to a new location. |
|
| 213 | - * |
|
| 214 | - * @param string $path |
|
| 215 | - * @param string $target |
|
| 216 | - * |
|
| 217 | - * @return bool |
|
| 218 | - */ |
|
| 219 | - public function move($path, $target): bool |
|
| 212 | + * Move a file to a new location. |
|
| 213 | + * |
|
| 214 | + * @param string $path |
|
| 215 | + * @param string $target |
|
| 216 | + * |
|
| 217 | + * @return bool |
|
| 218 | + */ |
|
| 219 | + public function move($path, $target): bool |
|
| 220 | 220 | { |
| 221 | - return $this->driver->move($path, $target); |
|
| 221 | + return $this->driver->move($path, $target); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
| 225 | - * Prepend to a file. |
|
| 226 | - * |
|
| 227 | - * @param string $path |
|
| 228 | - * @param string $data |
|
| 229 | - * |
|
| 230 | - * @return int |
|
| 231 | - */ |
|
| 232 | - public function prepend($path, $data): int |
|
| 225 | + * Prepend to a file. |
|
| 226 | + * |
|
| 227 | + * @param string $path |
|
| 228 | + * @param string $data |
|
| 229 | + * |
|
| 230 | + * @return int |
|
| 231 | + */ |
|
| 232 | + public function prepend($path, $data): int |
|
| 233 | 233 | { |
| 234 | - return $this->driver->prepend($path, $data); |
|
| 234 | + return $this->driver->prepend($path, $data); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | - * Write the content of a file. |
|
| 239 | - * |
|
| 240 | - * @param string $path |
|
| 241 | - * @param string $contents |
|
| 242 | - * @param bool $lock |
|
| 243 | - * |
|
| 244 | - * @return int|bool |
|
| 245 | - */ |
|
| 246 | - public function put($path, $contents, $lock = false): int|bool |
|
| 238 | + * Write the content of a file. |
|
| 239 | + * |
|
| 240 | + * @param string $path |
|
| 241 | + * @param string $contents |
|
| 242 | + * @param bool $lock |
|
| 243 | + * |
|
| 244 | + * @return int|bool |
|
| 245 | + */ |
|
| 246 | + public function put($path, $contents, $lock = false): int|bool |
|
| 247 | 247 | { |
| 248 | - return $this->driver->put($path, $contents, $lock); |
|
| 248 | + return $this->driver->put($path, $contents, $lock); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | - * Write given data to this file. |
|
| 253 | - * |
|
| 254 | - * @param string $path |
|
| 255 | - * @param string $data Data to write to this File |
|
| 256 | - * @param bool $force The file to open |
|
| 257 | - * |
|
| 258 | - * @return bool |
|
| 259 | - */ |
|
| 260 | - public function write($path, $data, $force = false): bool |
|
| 252 | + * Write given data to this file. |
|
| 253 | + * |
|
| 254 | + * @param string $path |
|
| 255 | + * @param string $data Data to write to this File |
|
| 256 | + * @param bool $force The file to open |
|
| 257 | + * |
|
| 258 | + * @return bool |
|
| 259 | + */ |
|
| 260 | + public function write($path, $data, $force = false): bool |
|
| 261 | 261 | { |
| 262 | - return $this->driver->write($path, $data, $force); |
|
| 262 | + return $this->driver->write($path, $data, $force); |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | \ No newline at end of file |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * |
| 149 | 149 | * @return int|null The file size in bytes or null if unknown |
| 150 | 150 | */ |
| 151 | - public function size($path, $unit = 'b'): int|null |
|
| 151 | + public function size($path, $unit = 'b'): int | null |
|
| 152 | 152 | { |
| 153 | 153 | return $this->driver->size($path, $unit); |
| 154 | 154 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * |
| 244 | 244 | * @return int|bool |
| 245 | 245 | */ |
| 246 | - public function put($path, $contents, $lock = false): int|bool |
|
| 246 | + public function put($path, $contents, $lock = false): int | bool |
|
| 247 | 247 | { |
| 248 | 248 | return $this->driver->put($path, $contents, $lock); |
| 249 | 249 | } |