php-ml/src/Phpml/Exception/DatasetException.php

39 lines
804 B
PHP
Raw Normal View History

2016-04-06 19:46:17 +00:00
<?php
2016-11-20 21:53:17 +00:00
declare(strict_types=1);
2016-04-06 19:46:17 +00:00
namespace Phpml\Exception;
class DatasetException extends \Exception
{
/**
2016-12-12 17:50:27 +00:00
* @param string $filepath
*
2016-04-06 19:46:17 +00:00
* @return DatasetException
*/
2016-12-12 17:50:27 +00:00
public static function missingFile(string $filepath)
2016-04-06 19:46:17 +00:00
{
2016-07-16 21:29:40 +00:00
return new self(sprintf('Dataset file "%s" missing.', $filepath));
}
/**
2016-12-12 17:50:27 +00:00
* @param string $path
*
2016-07-16 21:29:40 +00:00
* @return DatasetException
*/
2016-12-12 17:50:27 +00:00
public static function missingFolder(string $path)
2016-07-16 21:29:40 +00:00
{
return new self(sprintf('Dataset root folder "%s" missing.', $path));
2016-04-06 19:46:17 +00:00
}
2016-12-12 17:50:27 +00:00
/**
* @param string $filepath
*
* @return DatasetException
*/
public static function cantOpenFile(string $filepath)
2016-04-06 19:46:17 +00:00
{
2016-07-16 21:29:40 +00:00
return new self(sprintf('Dataset file "%s" can\'t be open.', $filepath));
2016-04-06 19:46:17 +00:00
}
}