Skip to content

Commit

Permalink
Cleanup source code PHPOffice#3
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanlanin committed Apr 19, 2014
1 parent f2c0a56 commit 8ce83b2
Show file tree
Hide file tree
Showing 76 changed files with 5,225 additions and 5,090 deletions.
24 changes: 15 additions & 9 deletions Classes/PHPPowerPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ public function getProperties()
/**
* Set properties
*
* @param PHPPowerPoint_DocumentProperties $value
* @param PHPPowerPoint_DocumentProperties $value
* @return PHPPowerPoint
*/
public function setProperties(PHPPowerPoint_DocumentProperties $value)
{
$this->_properties = $value;

return $this;
}

Expand All @@ -120,12 +121,13 @@ public function getLayout()
/**
* Set layout
*
* @param PHPPowerPoint_DocumentLayout $value
* @param PHPPowerPoint_DocumentLayout $value
* @return PHPPowerPoint
*/
public function setLayout(PHPPowerPoint_DocumentLayout $value)
{
$this->_layout = $value;

return $this;
}

Expand Down Expand Up @@ -156,20 +158,21 @@ public function createSlide()
/**
* Add slide
*
* @param PHPPowerPoint_Slide $slide
* @param PHPPowerPoint_Slide $slide
* @throws Exception
* @return PHPPowerPoint_Slide
*/
public function addSlide(PHPPowerPoint_Slide $slide = null)
{
$this->_slideCollection[] = $slide;

return $slide;
}

/**
* Remove slide by index
*
* @param int $index Slide index
* @param int $index Slide index
* @throws Exception
* @return PHPPowerPoint
*/
Expand All @@ -180,13 +183,14 @@ public function removeSlideByIndex($index = 0)
} else {
array_splice($this->_slideCollection, $index, 1);
}

return $this;
}

/**
* Get slide by index
*
* @param int $index Slide index
* @param int $index Slide index
* @return PHPPowerPoint_Slide
* @throws Exception
*/
Expand All @@ -212,8 +216,8 @@ public function getAllSlides()
/**
* Get index for slide
*
* @param PHPPowerPoint_Slide $slide
* @return Slide index
* @param PHPPowerPoint_Slide $slide
* @return Slide index
* @throws Exception
*/
public function getIndex(PHPPowerPoint_Slide $slide)
Expand Down Expand Up @@ -248,7 +252,7 @@ public function getActiveSlideIndex()
/**
* Set active slide index
*
* @param int $index Active slide index
* @param int $index Active slide index
* @throws Exception
* @return PHPPowerPoint_Slide
*/
Expand All @@ -259,19 +263,21 @@ public function setActiveSlideIndex($index = 0)
} else {
$this->_activeSlideIndex = $index;
}

return $this->getActiveSlide();
}

/**
* Add external slide
*
* @param PHPPowerPoint_Slide $slide External slide to add
* @param PHPPowerPoint_Slide $slide External slide to add
* @throws Exception
* @return PHPPowerPoint_Slide
*/
public function addExternalSheet(PHPPowerPoint_Slide $slide)
{
$slide->rebindParent($this);

return $this->addSheet($slide);
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/PHPPowerPoint/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function Register()
/**
* Autoload a class identified by name
*
* @param string $pClassName Name of the object to load
* @param string $pClassName Name of the object to load
*/
public static function Load($pObjectName)
{
Expand Down
10 changes: 5 additions & 5 deletions Classes/PHPPowerPoint/DocumentLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @version ##VERSION##, ##DATE##
*/


/**
* PHPPowerPoint_DocumentLayout
*
Expand Down Expand Up @@ -56,7 +55,6 @@ class PHPPowerPoint_DocumentLayout
*/
private $_dimension = array(PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_4x3 => array('cx' => 9144000, 'cy' => 6858000), PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x10 => array('cx' => 9144000, 'cy' => 5715000), PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_16x9 => array('cx' => 9144000, 'cy' => 5143500), PHPPowerPoint_DocumentLayout::LAYOUT_35mm => array('cx' => 10287000, 'cy' => 6858000), PHPPowerPoint_DocumentLayout::LAYOUT_A3 => array('cx' => 15120000, 'cy' => 10692000), PHPPowerPoint_DocumentLayout::LAYOUT_A4 => array('cx' => 10692000, 'cy' => 7560000), PHPPowerPoint_DocumentLayout::LAYOUT_B4ISO => array('cx' => 10826750, 'cy' => 8120063), PHPPowerPoint_DocumentLayout::LAYOUT_B5ISO => array('cx' => 7169150, 'cy' => 5376863), PHPPowerPoint_DocumentLayout::LAYOUT_BANNER => array('cx' => 7315200, 'cy' => 914400), PHPPowerPoint_DocumentLayout::LAYOUT_LETTER => array('cx' => 9144000, 'cy' => 6858000), PHPPowerPoint_DocumentLayout::LAYOUT_OVERHEAD => array('cx' => 9144000, 'cy' => 6858000));


/**
* Fill type
*
Expand Down Expand Up @@ -90,7 +88,7 @@ public function getDocumentLayout()
/**
* Set Document Layout
*
* @param array $pValue PHPPowerPoint_DocumentLayout document layout
* @param array $pValue PHPPowerPoint_DocumentLayout document layout
* @return PHPPowerPoint_DocumentLayout
*/
public function setDocumentLayout($pValue = PHPPowerPoint_DocumentLayout::LAYOUT_SCREEN_4x3, $isLandscape = true)
Expand Down Expand Up @@ -171,25 +169,27 @@ public function getLayoutYmilli()
/**
* Set Document Layout in millimeters
*
* @param integer $pValue Layout width
* @param integer $pValue Layout width
* @return PHPPowerPoint_DocumentLayout
*/
public function setLayoutXmilli($pValue)
{
$this->_cx = $pValue * 36000;
$this->_layout = PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM;

return $this;
}
/**
* Set Document Layout in millimeters
*
* @param integer $pValue Layout height
* @param integer $pValue Layout height
* @return PHPPowerPoint_DocumentLayout
*/
public function setLayoutYmilli($pValue)
{
$this->_cy = $pValue * 36000;
$this->_layout = PHPPowerPoint_DocumentLayout::LAYOUT_CUSTOM;

return $this;
}

Expand Down
31 changes: 20 additions & 11 deletions Classes/PHPPowerPoint/DocumentProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @version ##VERSION##, ##DATE##
*/


/**
* PHPPowerPoint_DocumentProperties
*
Expand Down Expand Up @@ -136,12 +135,13 @@ public function getCreator()
/**
* Set Creator
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setCreator($pValue = '')
{
$this->_creator = $pValue;

return $this;
}

Expand All @@ -158,12 +158,13 @@ public function getLastModifiedBy()
/**
* Set Last Modified By
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setLastModifiedBy($pValue = '')
{
$this->_lastModifiedBy = $pValue;

return $this;
}

Expand All @@ -180,7 +181,7 @@ public function getCreated()
/**
* Set Created
*
* @param datetime $pValue
* @param datetime $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setCreated($pValue = null)
Expand All @@ -189,6 +190,7 @@ public function setCreated($pValue = null)
$pValue = time();
}
$this->_created = $pValue;

return $this;
}

Expand All @@ -205,7 +207,7 @@ public function getModified()
/**
* Set Modified
*
* @param datetime $pValue
* @param datetime $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setModified($pValue = null)
Expand All @@ -214,6 +216,7 @@ public function setModified($pValue = null)
$pValue = time();
}
$this->_modified = $pValue;

return $this;
}

Expand All @@ -230,12 +233,13 @@ public function getTitle()
/**
* Set Title
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setTitle($pValue = '')
{
$this->_title = $pValue;

return $this;
}

Expand All @@ -252,12 +256,13 @@ public function getDescription()
/**
* Set Description
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setDescription($pValue = '')
{
$this->_description = $pValue;

return $this;
}

Expand All @@ -274,12 +279,13 @@ public function getSubject()
/**
* Set Subject
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setSubject($pValue = '')
{
$this->_subject = $pValue;

return $this;
}

Expand All @@ -296,12 +302,13 @@ public function getKeywords()
/**
* Set Keywords
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setKeywords($pValue = '')
{
$this->_keywords = $pValue;

return $this;
}

Expand All @@ -318,12 +325,13 @@ public function getCategory()
/**
* Set Category
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setCategory($pValue = '')
{
$this->_category = $pValue;

return $this;
}

Expand All @@ -340,12 +348,13 @@ public function getCompany()
/**
* Set Company
*
* @param string $pValue
* @param string $pValue
* @return PHPPowerPoint_DocumentProperties
*/
public function setCompany($pValue = '')
{
$this->_company = $pValue;

return $this;
}

Expand Down
Loading

0 comments on commit 8ce83b2

Please sign in to comment.