2017-02-02 08:03:09 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Phpml\Exception;
|
|
|
|
|
2017-11-22 21:16:10 +00:00
|
|
|
use Exception;
|
|
|
|
|
|
|
|
class SerializeException extends Exception
|
2017-02-02 08:03:09 +00:00
|
|
|
{
|
2017-11-22 21:16:10 +00:00
|
|
|
public static function cantUnserialize(string $filepath): self
|
2017-02-02 08:03:09 +00:00
|
|
|
{
|
|
|
|
return new self(sprintf('"%s" can not be unserialized.', $filepath));
|
|
|
|
}
|
|
|
|
|
2017-11-22 21:16:10 +00:00
|
|
|
public static function cantSerialize(string $classname): self
|
2017-02-02 08:03:09 +00:00
|
|
|
{
|
|
|
|
return new self(sprintf('Class "%s" can not be serialized.', $classname));
|
|
|
|
}
|
|
|
|
}
|