文字コード判定と必須列のチェックまで

This commit is contained in:
shibafu
2020-02-04 01:44:16 +09:00
parent b2eed9a9c5
commit 38ae540009
6 changed files with 146 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Exceptions;
use Throwable;
class CsvImportException extends \RuntimeException
{
/** @var string[] */
private $errors;
/**
* CsvImportException constructor.
* @param string[] $errors
*/
public function __construct(array $errors)
{
parent::__construct(array_first($errors));
$this->errors = $errors;
}
/**
* @return string[]
*/
public function getErrors(): array
{
return $this->errors;
}
}