Skip to content

Instantly share code, notes, and snippets.

@stefanorg
Created March 7, 2016 14:10
Show Gist options
  • Save stefanorg/b8ffaee7c2a395caab45 to your computer and use it in GitHub Desktop.
Save stefanorg/b8ffaee7c2a395caab45 to your computer and use it in GitHub Desktop.
class InvalidRowException extends \Exception
{
// One off error messages can use this method...
public static function create(Row $row, $reason)
{
return new static("Row " . $row->getIndex() . " is invalid because: " . $reason);
}
// ...and predefined methods can use it internally.
public static function blankLine(Row $row)
{
return static::create($row, "Is a blank line.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment