| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* League.Csv (https://csv.thephpleague.com) |
| 5 |
* |
| 6 |
* (c) Ignace Nyamagana Butera <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
declare(strict_types=1); |
| 13 |
|
| 14 |
namespace League\Csv; |
| 15 |
|
| 16 |
final class UnavailableStream extends Exception |
| 17 |
{ |
| 18 |
private function __construct(string $message) |
| 19 |
{ |
| 20 |
parent::__construct($message); |
| 21 |
} |
| 22 |
|
| 23 |
public static function dueToPathNotFound(string $path): self |
| 24 |
{ |
| 25 |
return new self('`'.$path.'`: failed to open stream: No such file or directory.'); |
| 26 |
} |
| 27 |
|
| 28 |
public static function dueToForbiddenCloning(string $class_name): self |
| 29 |
{ |
| 30 |
return new self('An object of class '.$class_name.' cannot be cloned.'); |
| 31 |
} |
| 32 |
} |
| 33 |
|