mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-24 09:09:22 +00:00
Change reader exceptions to PHPExcel_Reader_Exception
This commit is contained in:
@@ -174,7 +174,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @param string $pFileName
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function canRead($pFilename)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
// Read sample data (first 2 KB will do)
|
||||
@@ -227,16 +227,16 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function listWorksheetNames($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
if (!$this->canRead($pFilename)) {
|
||||
throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
|
||||
$worksheetNames = array();
|
||||
@@ -258,13 +258,13 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function listWorksheetInfo($pFilename)
|
||||
{
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
$worksheetInfo = array();
|
||||
@@ -330,7 +330,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
*
|
||||
* @param string $pFilename
|
||||
* @return PHPExcel
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function load($pFilename)
|
||||
{
|
||||
@@ -392,7 +392,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
* @param string $pFilename
|
||||
* @param PHPExcel $objPHPExcel
|
||||
* @return PHPExcel
|
||||
* @throws Exception
|
||||
* @throws PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
|
||||
{
|
||||
@@ -427,11 +427,11 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader
|
||||
|
||||
// Check if file exists
|
||||
if (!file_exists($pFilename)) {
|
||||
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
if (!$this->canRead($pFilename)) {
|
||||
throw new Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
|
||||
}
|
||||
|
||||
$xml = simplexml_load_file($pFilename);
|
||||
|
||||
Reference in New Issue
Block a user