2021-05-06 13:26:28 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-05-06 13:26:28 +02:00
|
|
|
namespace Rector\FileFormatter\Exception;
|
|
|
|
|
|
|
|
use InvalidArgumentException;
|
2021-05-10 22:23:08 +00:00
|
|
|
final class InvalidNewLineStringException extends \InvalidArgumentException
|
2021-05-06 13:26:28 +02:00
|
|
|
{
|
2021-05-09 20:15:43 +00:00
|
|
|
/**
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public static function fromString(string $string)
|
2021-05-06 13:26:28 +02:00
|
|
|
{
|
2021-05-09 20:15:43 +00:00
|
|
|
return new self(\sprintf('"%s" is not a valid new-line character sequence.', $string));
|
2021-05-06 13:26:28 +02:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
/**
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public static function create(string $message)
|
2021-05-06 13:26:28 +02:00
|
|
|
{
|
|
|
|
return new self($message);
|
|
|
|
}
|
|
|
|
}
|