Skip to content

Commit

Permalink
Merge pull request #19 from sapfeer0k/master
Browse files Browse the repository at this point in the history
pFilename is required parameter for save
  • Loading branch information
Progi1984 committed Jun 10, 2014
2 parents 50fd978 + 4e4a476 commit c5eab5d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- Images in Layouts other than first Master Slide within Template file causes corrupted PPTX - @maartenba CP-4596
- Fixed A3 and A4 formats dimensions - @delphiki GH-16
- Fixed custom document layout - @delphiki GH-18
- Filename parameter is required for IWriter::save method

### Miscellaneous

Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPPowerPoint/Writer/IWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ interface PHPPowerPoint_Writer_IWriter
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null);
public function save($pFilename);
}
5 changes: 4 additions & 1 deletion Classes/PHPPowerPoint/Writer/ODPresentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ public function __construct(PHPPowerPoint $pPHPPowerPoint = null)
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null)
public function save($pFilename)
{
if (empty($pFilename)) {
throw new Exception("Filename is empty");
}
if (!is_null($this->_presentation)) {
// If $pFilename is php://output or php://stdout, make it a temporary file...
$originalFilename = $pFilename;
Expand Down
5 changes: 4 additions & 1 deletion Classes/PHPPowerPoint/Writer/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ public function getWriterPart($pPartName = '')
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null)
public function save($pFilename)
{
if (empty($pFilename)) {
throw new Exception("Filename is empty");
}
if (!is_null($this->_presentation)) {
// If $pFilename is php://output or php://stdout, make it a temporary file...
$originalFilename = $pFilename;
Expand Down
5 changes: 4 additions & 1 deletion Classes/PHPPowerPoint/Writer/Serialized.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ public function __construct(PHPPowerPoint $pPHPPowerPoint = null)
* @param string $pFilename
* @throws Exception
*/
public function save($pFilename = null)
public function save($pFilename)
{
if (empty($pFilename)) {
throw new Exception("Filename is empty");
}
if (!is_null($this->_presentation)) {
// Create new ZIP file and open it for writing
$objZip = new ZipArchive();
Expand Down

0 comments on commit c5eab5d

Please sign in to comment.