public static function createForFileCouldNotBeFound(string $file, int $code = 0, \Throwable $previous = null) : \InvalidArgumentException
{
return new \InvalidArgumentException(sprintf('The file "%s" could not be found.', $file), $code, $previous);
}
/** * {@inheritDoc} * * @param string $file Local PHP file */ public function parse(string $file) : array { if (false === file_exists($file)) { throw InvalidArgumentExceptionFactory::createForFileCouldNotBeFound($file); } $data = (include $file); if (false === is_array($data)) { throw TypeErrorFactory::createForInvalidFixtureFileReturnedData($file); } return $data; }