| 1 | <?php |
||
| 7 | class ImportFileException extends Exception |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * File type is unsupported. |
||
| 11 | * |
||
| 12 | * @param string $type |
||
| 13 | * @return \Dyrynda\Artisan\Exceptions\ImportFileException |
||
| 14 | */ |
||
| 15 | 1 | public static function unsupported($type) |
|
| 19 | |||
| 20 | /** |
||
| 21 | * File has no extension. |
||
| 22 | * |
||
| 23 | * @return \Dyrynda\Artisan\Exceptions\ImportFileException |
||
| 24 | */ |
||
| 25 | 1 | public static function noExtension() |
|
| 29 | |||
| 30 | /** |
||
| 31 | * File doesn't exist. |
||
| 32 | * |
||
| 33 | * @param string $path |
||
| 34 | * @return \Dyrynda\Artisan\Exceptions\ImportFileException |
||
| 35 | */ |
||
| 36 | 1 | public static function notExist($path) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * File syntax is invalid. |
||
| 43 | * |
||
| 44 | * @param string $filename |
||
| 45 | * @param string|null $error |
||
| 46 | * @return \Dyrynda\Artisan\Exceptions\ImportFileException |
||
| 47 | */ |
||
| 48 | 3 | public static function invalidSyntax($filename, $error = null) |
|
| 49 | { |
||
| 50 | 3 | return new static("Errors detected in structure of {$filename}".($error ? ': '.$error : '')); |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Unable to get the list of fields/columns from file. |
||
| 55 | * |
||
| 56 | * @return \Dyrynda\Artisan\Exceptions\ImportFileException |
||
| 57 | */ |
||
| 58 | public static function noFields() |
||
| 62 | } |
||
| 63 |