-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generators/Text::printTitle(): minor tweaks
Just removing some duplicate function calls.
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,9 @@ | |
* Output is designed to be displayed in a terminal and is wrapped to 100 characters. | ||
* | ||
* @author Greg Sherwood <[email protected]> | ||
* @author Juliette Reinders Folmer <[email protected]> | ||
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) | ||
* @copyright 2024 PHPCSStandards and contributors | ||
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence | ||
*/ | ||
|
||
|
@@ -52,13 +54,15 @@ public function processSniff(DOMNode $doc) | |
*/ | ||
protected function printTitle(DOMNode $doc) | ||
{ | ||
$title = $this->getTitle($doc); | ||
$standard = $this->ruleset->name; | ||
$title = $this->getTitle($doc); | ||
$standard = $this->ruleset->name; | ||
$displayTitle = "$standard CODING STANDARD: $title"; | ||
$titleLength = strlen($displayTitle); | ||
|
||
echo PHP_EOL; | ||
echo str_repeat('-', (strlen("$standard CODING STANDARD: $title") + 4)); | ||
echo strtoupper(PHP_EOL."| $standard CODING STANDARD: $title |".PHP_EOL); | ||
echo str_repeat('-', (strlen("$standard CODING STANDARD: $title") + 4)); | ||
echo str_repeat('-', ($titleLength + 4)); | ||
echo strtoupper(PHP_EOL."| $displayTitle |".PHP_EOL); | ||
echo str_repeat('-', ($titleLength + 4)); | ||
echo PHP_EOL.PHP_EOL; | ||
|
||
}//end printTitle() | ||
|