Skip to content

Commit

Permalink
Drop most deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Sep 16, 2022
1 parent c5e7a53 commit b9f1151
Show file tree
Hide file tree
Showing 31 changed files with 33 additions and 999 deletions.
2 changes: 1 addition & 1 deletion samples/Sample_33_FormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// New Word document
echo date('H:i:s'), ' Create new PhpWord object', EOL;
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->getProtection()->setEditing('forms');
$phpWord->getSettings()->getDocumentProtection()->setEditing('forms');

// New section
$section = $phpWord->addSection();
Expand Down
2 changes: 1 addition & 1 deletion samples/Sample_36_RTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$table = $section->addTable($tableStyle);
$cellHCentered = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER];
$cellHEnd = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END];
$cellVCentered = ['valign' => \PhpOffice\PhpWord\Style\Cell::VALIGN_CENTER];
$cellVCentered = ['valign' => \PhpOffice\PhpWord\SimpleType\VerticalJc::CENTER];

//Vidually bidirectinal table
$table->addRow();
Expand Down
32 changes: 0 additions & 32 deletions src/PhpWord/Element/AbstractContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,36 +285,4 @@ private function checkValidity($method)

return true;
}

/**
* Create textrun element.
*
* @deprecated 0.10.0
*
* @param mixed $paragraphStyle
*
* @return \PhpOffice\PhpWord\Element\TextRun
*
* @codeCoverageIgnore
*/
public function createTextRun($paragraphStyle = null)
{
return $this->addTextRun($paragraphStyle);
}

/**
* Create footnote element.
*
* @deprecated 0.10.0
*
* @param mixed $paragraphStyle
*
* @return \PhpOffice\PhpWord\Element\Footnote
*
* @codeCoverageIgnore
*/
public function createFootnote($paragraphStyle = null)
{
return $this->addFootnote($paragraphStyle);
}
}
28 changes: 0 additions & 28 deletions src/PhpWord/Element/Footnote.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,4 @@ public function getParagraphStyle()
{
return $this->paragraphStyle;
}

/**
* Get Footnote Reference ID.
*
* @deprecated 0.10.0
*
* @codeCoverageIgnore
*
* @return int
*/
public function getReferenceId()
{
return $this->getRelationId();
}

/**
* Set Footnote Reference ID.
*
* @deprecated 0.10.0
*
* @codeCoverageIgnore
*
* @param int $rId
*/
public function setReferenceId($rId): void
{
$this->setRelationId($rId);
}
}
24 changes: 0 additions & 24 deletions src/PhpWord/Element/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,28 +554,4 @@ private function setProportionalSize($actualWidth, $actualHeight): void
}
}
}

/**
* Get is watermark.
*
* @deprecated 0.10.0
*
* @codeCoverageIgnore
*/
public function getIsWatermark()
{
return $this->isWatermark();
}

/**
* Get is memory image.
*
* @deprecated 0.10.0
*
* @codeCoverageIgnore
*/
public function getIsMemImage()
{
return $this->isMemImage();
}
}
42 changes: 0 additions & 42 deletions src/PhpWord/Element/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,48 +126,6 @@ public function getParagraphStyle()
return $this->paragraphStyle;
}

/**
* Get link target.
*
* @deprecated 0.12.0
*
* @return string
*
* @codeCoverageIgnore
*/
public function getTarget()
{
return $this->source;
}

/**
* Get Link source.
*
* @deprecated 0.10.0
*
* @return string
*
* @codeCoverageIgnore
*/
public function getLinkSrc()
{
return $this->getSource();
}

/**
* Get Link name.
*
* @deprecated 0.10.0
*
* @return string
*
* @codeCoverageIgnore
*/
public function getLinkName()
{
return $this->getText();
}

/**
* is internal.
*
Expand Down
28 changes: 0 additions & 28 deletions src/PhpWord/Element/OLEObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,32 +136,4 @@ public function setImageRelationId($rId): void
{
$this->imageRelationId = $rId;
}

/**
* Get Object ID.
*
* @deprecated 0.10.0
*
* @return int
*
* @codeCoverageIgnore
*/
public function getObjectId()
{
return $this->relationId + 1325353440;
}

/**
* Set Object ID.
*
* @deprecated 0.10.0
*
* @param int $objId
*
* @codeCoverageIgnore
*/
public function setObjectId($objId): void
{
$this->relationId = $objId;
}
}
88 changes: 0 additions & 88 deletions src/PhpWord/Element/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,6 @@ public function getFootnoteProperties()
return $this->footnoteProperties;
}

/**
* Get the footnote properties.
*
* @deprecated Use the `getFootnoteProperties` method instead
*
* @return FootnoteProperties
*
* @codeCoverageIgnore
*/
public function getFootnotePropoperties()
{
return $this->footnoteProperties;
}

/**
* Set the footnote properties.
*
Expand Down Expand Up @@ -230,78 +216,4 @@ private function addHeaderFooter($type = Header::AUTO, $header = true)

throw new Exception('Invalid header/footer type.');
}

/**
* Set section style.
*
* @deprecated 0.12.0
*
* @param array $settings
*
* @codeCoverageIgnore
*/
public function setSettings($settings = null): void
{
$this->setStyle($settings);
}

/**
* Get section style.
*
* @deprecated 0.12.0
*
* @return \PhpOffice\PhpWord\Style\Section
*
* @codeCoverageIgnore
*/
public function getSettings()
{
return $this->getStyle();
}

/**
* Create header.
*
* @deprecated 0.10.0
*
* @return Header
*
* @codeCoverageIgnore
*/
public function createHeader()
{
return $this->addHeader();
}

/**
* Create footer.
*
* @deprecated 0.10.0
*
* @return Footer
*
* @codeCoverageIgnore
*/
public function createFooter()
{
return $this->addFooter();
}

/**
* Get footer.
*
* @deprecated 0.10.0
*
* @return Footer
*
* @codeCoverageIgnore
*/
public function getFooter()
{
if (empty($this->footers)) {
return null;
}

return $this->footers[1];
}
}
Loading

0 comments on commit b9f1151

Please sign in to comment.