Skip to content

Commit f79d50b

Browse files
committed
Generators: remove deprecated methods
These methods were _soft_ deprecated in PHPCS 3.12.0 via PR 755 and hard deprecated in PHPCS 3.x via PR 889. Includes removing the associated tests which verified the deprecation notice was being thrown. Related to 6
1 parent 265359c commit f79d50b

File tree

7 files changed

+24
-459
lines changed

7 files changed

+24
-459
lines changed

src/Generators/HTML.php

+10-114
Original file line numberDiff line numberDiff line change
@@ -153,31 +153,11 @@ public function generate()
153153
}//end generate()
154154

155155

156-
/**
157-
* Print the header of the HTML page.
158-
*
159-
* @deprecated 3.12.0 Use HTML::getFormattedHeader() instead.
160-
*
161-
* @codeCoverageIgnore
162-
*
163-
* @return void
164-
*/
165-
protected function printHeader()
166-
{
167-
trigger_error(
168-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedHeader()" instead.',
169-
E_USER_DEPRECATED
170-
);
171-
172-
echo $this->getFormattedHeader();
173-
174-
}//end printHeader()
175-
176-
177156
/**
178157
* Format the header of the HTML page.
179158
*
180-
* @since 3.12.0 Replaces the deprecated HTML::printHeader() method.
159+
* @since 3.12.0 Replaces the HTML::printHeader() method,
160+
* which was deprecated in 3.12.0 and removed in 4.0.0.
181161
*
182162
* @return string
183163
*/
@@ -202,33 +182,13 @@ protected function getFormattedHeader()
202182
}//end getFormattedHeader()
203183

204184

205-
/**
206-
* Print the table of contents for the standard.
207-
*
208-
* @deprecated 3.12.0 Use HTML::getFormattedToc() instead.
209-
*
210-
* @codeCoverageIgnore
211-
*
212-
* @return void
213-
*/
214-
protected function printToc()
215-
{
216-
trigger_error(
217-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedToc()" instead.',
218-
E_USER_DEPRECATED
219-
);
220-
221-
echo $this->getFormattedToc();
222-
223-
}//end printToc()
224-
225-
226185
/**
227186
* Format the table of contents for the standard.
228187
*
229188
* The TOC is just an unordered list of bookmarks to sniffs on the page.
230189
*
231-
* @since 3.12.0 Replaces the deprecated HTML::printToc() method.
190+
* @since 3.12.0 Replaces the HTML::printToc() method,
191+
* which was deprecated in 3.12.0 and removed in 4.0.0.
232192
*
233193
* @return string
234194
*/
@@ -259,31 +219,11 @@ protected function getFormattedToc()
259219
}//end getFormattedToc()
260220

261221

262-
/**
263-
* Print the footer of the HTML page.
264-
*
265-
* @deprecated 3.12.0 Use HTML::getFormattedFooter() instead.
266-
*
267-
* @codeCoverageIgnore
268-
*
269-
* @return void
270-
*/
271-
protected function printFooter()
272-
{
273-
trigger_error(
274-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedFooter()" instead.',
275-
E_USER_DEPRECATED
276-
);
277-
278-
echo $this->getFormattedFooter();
279-
280-
}//end printFooter()
281-
282-
283222
/**
284223
* Format the footer of the HTML page.
285224
*
286-
* @since 3.12.0 Replaces the deprecated HTML::printFooter() method.
225+
* @since 3.12.0 Replaces the HTML::printFooter() method,
226+
* which was deprecated in 3.12.0 and removed in 4.0.0.
287227
*
288228
* @return string
289229
*/
@@ -369,35 +309,13 @@ private function titleToAnchor($title)
369309
}//end titleToAnchor()
370310

371311

372-
/**
373-
* Print a text block found in a standard.
374-
*
375-
* @param \DOMNode $node The DOMNode object for the text block.
376-
*
377-
* @deprecated 3.12.0 Use HTML::getFormattedTextBlock() instead.
378-
*
379-
* @codeCoverageIgnore
380-
*
381-
* @return void
382-
*/
383-
protected function printTextBlock(DOMNode $node)
384-
{
385-
trigger_error(
386-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedTextBlock()" instead.',
387-
E_USER_DEPRECATED
388-
);
389-
390-
echo $this->getFormattedTextBlock($node);
391-
392-
}//end printTextBlock()
393-
394-
395312
/**
396313
* Format a text block found in a standard.
397314
*
398315
* @param \DOMNode $node The DOMNode object for the text block.
399316
*
400-
* @since 3.12.0 Replaces the deprecated HTML::printTextBlock() method.
317+
* @since 3.12.0 Replaces the HTML::printTextBlock() method,
318+
* which was deprecated in 3.12.0 and removed in 4.0.0.
401319
*
402320
* @return string
403321
*/
@@ -444,35 +362,13 @@ protected function getFormattedTextBlock(DOMNode $node)
444362
}//end getFormattedTextBlock()
445363

446364

447-
/**
448-
* Print a code comparison block found in a standard.
449-
*
450-
* @param \DOMNode $node The DOMNode object for the code comparison block.
451-
*
452-
* @deprecated 3.12.0 Use HTML::getFormattedCodeComparisonBlock() instead.
453-
*
454-
* @codeCoverageIgnore
455-
*
456-
* @return void
457-
*/
458-
protected function printCodeComparisonBlock(DOMNode $node)
459-
{
460-
trigger_error(
461-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedCodeComparisonBlock()" instead.',
462-
E_USER_DEPRECATED
463-
);
464-
465-
echo $this->getFormattedCodeComparisonBlock($node);
466-
467-
}//end printCodeComparisonBlock()
468-
469-
470365
/**
471366
* Format a code comparison block found in a standard.
472367
*
473368
* @param \DOMNode $node The DOMNode object for the code comparison block.
474369
*
475-
* @since 3.12.0 Replaces the deprecated HTML::printCodeComparisonBlock() method.
370+
* @since 3.12.0 Replaces the HTML::printCodeComparisonBlock() method,
371+
* which was deprecated in 3.12.0 and removed in 4.0.0.
476372
*
477373
* @return string
478374
*/

src/Generators/Markdown.php

+8-92
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,11 @@ public function generate()
4646
}//end generate()
4747

4848

49-
/**
50-
* Print the markdown header.
51-
*
52-
* @deprecated 3.12.0 Use Markdown::getFormattedHeader() instead.
53-
*
54-
* @codeCoverageIgnore
55-
*
56-
* @return void
57-
*/
58-
protected function printHeader()
59-
{
60-
trigger_error(
61-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedHeader()" instead.',
62-
E_USER_DEPRECATED
63-
);
64-
65-
echo $this->getFormattedHeader();
66-
67-
}//end printHeader()
68-
69-
7049
/**
7150
* Format the markdown header.
7251
*
73-
* @since 3.12.0 Replaces the deprecated Markdown::printHeader() method.
52+
* @since 3.12.0 Replaces the Markdown::printHeader() method,
53+
* which was deprecated in 3.12.0 and removed in 4.0.0.
7454
*
7555
* @return string
7656
*/
@@ -83,31 +63,11 @@ protected function getFormattedHeader()
8363
}//end getFormattedHeader()
8464

8565

86-
/**
87-
* Print the markdown footer.
88-
*
89-
* @deprecated 3.12.0 Use Markdown::getFormattedFooter() instead.
90-
*
91-
* @codeCoverageIgnore
92-
*
93-
* @return void
94-
*/
95-
protected function printFooter()
96-
{
97-
trigger_error(
98-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedFooter()" instead.',
99-
E_USER_DEPRECATED
100-
);
101-
102-
echo $this->getFormattedFooter();
103-
104-
}//end printFooter()
105-
106-
10766
/**
10867
* Format the markdown footer.
10968
*
110-
* @since 3.12.0 Replaces the deprecated Markdown::printFooter() method.
69+
* @since 3.12.0 Replaces the Markdown::printFooter() method,
70+
* which was deprecated in 3.12.0 and removed in 4.0.0.
11171
*
11272
* @return string
11373
*/
@@ -154,35 +114,13 @@ protected function processSniff(DOMNode $doc)
154114
}//end processSniff()
155115

156116

157-
/**
158-
* Print a text block found in a standard.
159-
*
160-
* @param \DOMNode $node The DOMNode object for the text block.
161-
*
162-
* @deprecated 3.12.0 Use Markdown::getFormattedTextBlock() instead.
163-
*
164-
* @codeCoverageIgnore
165-
*
166-
* @return void
167-
*/
168-
protected function printTextBlock(DOMNode $node)
169-
{
170-
trigger_error(
171-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedTextBlock()" instead.',
172-
E_USER_DEPRECATED
173-
);
174-
175-
echo $this->getFormattedTextBlock($node);
176-
177-
}//end printTextBlock()
178-
179-
180117
/**
181118
* Format a text block found in a standard.
182119
*
183120
* @param \DOMNode $node The DOMNode object for the text block.
184121
*
185-
* @since 3.12.0 Replaces the deprecated Markdown::printTextBlock() method.
122+
* @since 3.12.0 Replaces the Markdown::printTextBlock() method,
123+
* which was deprecated in 3.12.0 and removed in 4.0.0.
186124
*
187125
* @return string
188126
*/
@@ -227,35 +165,13 @@ protected function getFormattedTextBlock(DOMNode $node)
227165
}//end getFormattedTextBlock()
228166

229167

230-
/**
231-
* Print a code comparison block found in a standard.
232-
*
233-
* @param \DOMNode $node The DOMNode object for the code comparison block.
234-
*
235-
* @deprecated 3.12.0 Use Markdown::getFormattedCodeComparisonBlock() instead.
236-
*
237-
* @codeCoverageIgnore
238-
*
239-
* @return void
240-
*/
241-
protected function printCodeComparisonBlock(DOMNode $node)
242-
{
243-
trigger_error(
244-
'The '.__METHOD__.'() method is deprecated. Use "echo '.__CLASS__.'::getFormattedCodeComparisonBlock()" instead.',
245-
E_USER_DEPRECATED
246-
);
247-
248-
echo $this->getFormattedCodeComparisonBlock($node);
249-
250-
}//end printCodeComparisonBlock()
251-
252-
253168
/**
254169
* Format a code comparison block found in a standard.
255170
*
256171
* @param \DOMNode $node The DOMNode object for the code comparison block.
257172
*
258-
* @since 3.12.0 Replaces the deprecated Markdown::printCodeComparisonBlock() method.
173+
* @since 3.12.0 Replaces the Markdown::printCodeComparisonBlock() method,
174+
* which was deprecated in 3.12.0 and removed in 4.0.0.
259175
*
260176
* @return string
261177
*/

0 commit comments

Comments
 (0)