@@ -227,7 +227,9 @@ public function sheetNameExists($pSheetName)
227
227
public function addSheet (PHPExcel_Worksheet $ pSheet , $ iSheetIndex = NULL )
228
228
{
229
229
if ($ this ->sheetNameExists ($ pSheet ->getTitle ())) {
230
- throw new PHPExcel_Exception ("Workbook already contains a worksheet named ' {$ pSheet ->getTitle ()}'. Rename this worksheet first. " );
230
+ throw new PHPExcel_Exception (
231
+ "Workbook already contains a worksheet named ' {$ pSheet ->getTitle ()}'. Rename this worksheet first. "
232
+ );
231
233
}
232
234
233
235
if ($ iSheetIndex === NULL ) {
@@ -264,7 +266,9 @@ public function removeSheetByIndex($pIndex = 0)
264
266
$ numSheets = count ($ this ->_workSheetCollection );
265
267
266
268
if ($ pIndex > count ($ this ->_workSheetCollection ) - 1 ) {
267
- throw new PHPExcel_Exception ("Sheet index is out of bounds. Actual number of sheets is {$ numSheets }" );
269
+ throw new PHPExcel_Exception (
270
+ "The requested Sheet index: {$ pIndex } is out of bounds. Actual number of sheets is {$ numSheets }"
271
+ );
268
272
} else {
269
273
array_splice ($ this ->_workSheetCollection , $ pIndex , 1 );
270
274
}
@@ -289,7 +293,9 @@ public function getSheet($pIndex = 0)
289
293
$ numSheets = count ($ this ->_workSheetCollection );
290
294
291
295
if ($ pIndex > $ numSheets - 1 ) {
292
- throw new PHPExcel_Exception ("Sheet index is out of bounds. Actual number of sheets is {$ numSheets }" );
296
+ throw new PHPExcel_Exception (
297
+ "The requested Sheet index: {$ pIndex } is out of bounds. Actual number of sheets is {$ numSheets }"
298
+ );
293
299
} else {
294
300
return $ this ->_workSheetCollection [$ pIndex ];
295
301
}
0 commit comments