Skip to content

Commit b9f1151

Browse files
committed
Drop most deprecations
1 parent c5e7a53 commit b9f1151

31 files changed

+33
-999
lines changed

samples/Sample_33_FormField.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// New Word document
66
echo date('H:i:s'), ' Create new PhpWord object', EOL;
77
$phpWord = new \PhpOffice\PhpWord\PhpWord();
8-
$phpWord->getProtection()->setEditing('forms');
8+
$phpWord->getSettings()->getDocumentProtection()->setEditing('forms');
99

1010
// New section
1111
$section = $phpWord->addSection();

samples/Sample_36_RTL.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
$table = $section->addTable($tableStyle);
2323
$cellHCentered = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::CENTER];
2424
$cellHEnd = ['alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END];
25-
$cellVCentered = ['valign' => \PhpOffice\PhpWord\Style\Cell::VALIGN_CENTER];
25+
$cellVCentered = ['valign' => \PhpOffice\PhpWord\SimpleType\VerticalJc::CENTER];
2626

2727
//Vidually bidirectinal table
2828
$table->addRow();

src/PhpWord/Element/AbstractContainer.php

-32
Original file line numberDiff line numberDiff line change
@@ -285,36 +285,4 @@ private function checkValidity($method)
285285

286286
return true;
287287
}
288-
289-
/**
290-
* Create textrun element.
291-
*
292-
* @deprecated 0.10.0
293-
*
294-
* @param mixed $paragraphStyle
295-
*
296-
* @return \PhpOffice\PhpWord\Element\TextRun
297-
*
298-
* @codeCoverageIgnore
299-
*/
300-
public function createTextRun($paragraphStyle = null)
301-
{
302-
return $this->addTextRun($paragraphStyle);
303-
}
304-
305-
/**
306-
* Create footnote element.
307-
*
308-
* @deprecated 0.10.0
309-
*
310-
* @param mixed $paragraphStyle
311-
*
312-
* @return \PhpOffice\PhpWord\Element\Footnote
313-
*
314-
* @codeCoverageIgnore
315-
*/
316-
public function createFootnote($paragraphStyle = null)
317-
{
318-
return $this->addFootnote($paragraphStyle);
319-
}
320288
}

src/PhpWord/Element/Footnote.php

-28
Original file line numberDiff line numberDiff line change
@@ -60,32 +60,4 @@ public function getParagraphStyle()
6060
{
6161
return $this->paragraphStyle;
6262
}
63-
64-
/**
65-
* Get Footnote Reference ID.
66-
*
67-
* @deprecated 0.10.0
68-
*
69-
* @codeCoverageIgnore
70-
*
71-
* @return int
72-
*/
73-
public function getReferenceId()
74-
{
75-
return $this->getRelationId();
76-
}
77-
78-
/**
79-
* Set Footnote Reference ID.
80-
*
81-
* @deprecated 0.10.0
82-
*
83-
* @codeCoverageIgnore
84-
*
85-
* @param int $rId
86-
*/
87-
public function setReferenceId($rId): void
88-
{
89-
$this->setRelationId($rId);
90-
}
9163
}

src/PhpWord/Element/Image.php

-24
Original file line numberDiff line numberDiff line change
@@ -554,28 +554,4 @@ private function setProportionalSize($actualWidth, $actualHeight): void
554554
}
555555
}
556556
}
557-
558-
/**
559-
* Get is watermark.
560-
*
561-
* @deprecated 0.10.0
562-
*
563-
* @codeCoverageIgnore
564-
*/
565-
public function getIsWatermark()
566-
{
567-
return $this->isWatermark();
568-
}
569-
570-
/**
571-
* Get is memory image.
572-
*
573-
* @deprecated 0.10.0
574-
*
575-
* @codeCoverageIgnore
576-
*/
577-
public function getIsMemImage()
578-
{
579-
return $this->isMemImage();
580-
}
581557
}

src/PhpWord/Element/Link.php

-42
Original file line numberDiff line numberDiff line change
@@ -126,48 +126,6 @@ public function getParagraphStyle()
126126
return $this->paragraphStyle;
127127
}
128128

129-
/**
130-
* Get link target.
131-
*
132-
* @deprecated 0.12.0
133-
*
134-
* @return string
135-
*
136-
* @codeCoverageIgnore
137-
*/
138-
public function getTarget()
139-
{
140-
return $this->source;
141-
}
142-
143-
/**
144-
* Get Link source.
145-
*
146-
* @deprecated 0.10.0
147-
*
148-
* @return string
149-
*
150-
* @codeCoverageIgnore
151-
*/
152-
public function getLinkSrc()
153-
{
154-
return $this->getSource();
155-
}
156-
157-
/**
158-
* Get Link name.
159-
*
160-
* @deprecated 0.10.0
161-
*
162-
* @return string
163-
*
164-
* @codeCoverageIgnore
165-
*/
166-
public function getLinkName()
167-
{
168-
return $this->getText();
169-
}
170-
171129
/**
172130
* is internal.
173131
*

src/PhpWord/Element/OLEObject.php

-28
Original file line numberDiff line numberDiff line change
@@ -136,32 +136,4 @@ public function setImageRelationId($rId): void
136136
{
137137
$this->imageRelationId = $rId;
138138
}
139-
140-
/**
141-
* Get Object ID.
142-
*
143-
* @deprecated 0.10.0
144-
*
145-
* @return int
146-
*
147-
* @codeCoverageIgnore
148-
*/
149-
public function getObjectId()
150-
{
151-
return $this->relationId + 1325353440;
152-
}
153-
154-
/**
155-
* Set Object ID.
156-
*
157-
* @deprecated 0.10.0
158-
*
159-
* @param int $objId
160-
*
161-
* @codeCoverageIgnore
162-
*/
163-
public function setObjectId($objId): void
164-
{
165-
$this->relationId = $objId;
166-
}
167139
}

src/PhpWord/Element/Section.php

-88
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,6 @@ public function getFootnoteProperties()
152152
return $this->footnoteProperties;
153153
}
154154

155-
/**
156-
* Get the footnote properties.
157-
*
158-
* @deprecated Use the `getFootnoteProperties` method instead
159-
*
160-
* @return FootnoteProperties
161-
*
162-
* @codeCoverageIgnore
163-
*/
164-
public function getFootnotePropoperties()
165-
{
166-
return $this->footnoteProperties;
167-
}
168-
169155
/**
170156
* Set the footnote properties.
171157
*
@@ -230,78 +216,4 @@ private function addHeaderFooter($type = Header::AUTO, $header = true)
230216

231217
throw new Exception('Invalid header/footer type.');
232218
}
233-
234-
/**
235-
* Set section style.
236-
*
237-
* @deprecated 0.12.0
238-
*
239-
* @param array $settings
240-
*
241-
* @codeCoverageIgnore
242-
*/
243-
public function setSettings($settings = null): void
244-
{
245-
$this->setStyle($settings);
246-
}
247-
248-
/**
249-
* Get section style.
250-
*
251-
* @deprecated 0.12.0
252-
*
253-
* @return \PhpOffice\PhpWord\Style\Section
254-
*
255-
* @codeCoverageIgnore
256-
*/
257-
public function getSettings()
258-
{
259-
return $this->getStyle();
260-
}
261-
262-
/**
263-
* Create header.
264-
*
265-
* @deprecated 0.10.0
266-
*
267-
* @return Header
268-
*
269-
* @codeCoverageIgnore
270-
*/
271-
public function createHeader()
272-
{
273-
return $this->addHeader();
274-
}
275-
276-
/**
277-
* Create footer.
278-
*
279-
* @deprecated 0.10.0
280-
*
281-
* @return Footer
282-
*
283-
* @codeCoverageIgnore
284-
*/
285-
public function createFooter()
286-
{
287-
return $this->addFooter();
288-
}
289-
290-
/**
291-
* Get footer.
292-
*
293-
* @deprecated 0.10.0
294-
*
295-
* @return Footer
296-
*
297-
* @codeCoverageIgnore
298-
*/
299-
public function getFooter()
300-
{
301-
if (empty($this->footers)) {
302-
return null;
303-
}
304-
305-
return $this->footers[1];
306-
}
307219
}

0 commit comments

Comments
 (0)