@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | 136 | if ($parameters['signature'] !== self::VALID_FONT_SIGNATURE) { |
| 137 | - throw new \InvalidArgumentException('Invalid font file signature: ' . $parameters['signature']); |
|
| 137 | + throw new \InvalidArgumentException('Invalid font file signature: '.$parameters['signature']); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | return $parameters; |
@@ -161,10 +161,10 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function getFileName($fontName, $fontDirectory) |
| 163 | 163 | { |
| 164 | - $fileName = $fontDirectory . $fontName . '.' . self::FIGLET_FORMAT; |
|
| 164 | + $fileName = $fontDirectory.$fontName.'.'.self::FIGLET_FORMAT; |
|
| 165 | 165 | |
| 166 | 166 | if (false === file_exists($fileName)) { |
| 167 | - throw new \Exception('Could not open ' . $fileName); |
|
| 167 | + throw new \Exception('Could not open '.$fileName); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | return $fileName; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function __construct() |
| 74 | 74 | { |
| 75 | - $this->fontDir = __DIR__ . DIRECTORY_SEPARATOR . 'fonts' . DIRECTORY_SEPARATOR; |
|
| 75 | + $this->fontDir = __DIR__.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR; |
|
| 76 | 76 | $this->fontName = 'big'; |
| 77 | 77 | $this->stretching = 0; |
| 78 | 78 | } |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | for ($line = 0; $line < $height; $line++) { |
| 268 | 268 | $singleLine = ''; |
| 269 | 269 | foreach ($figletCharacters as $charactersLines) { |
| 270 | - $singleLine .= $charactersLines[$line] . $this->addStretching(); |
|
| 270 | + $singleLine .= $charactersLines[$line].$this->addStretching(); |
|
| 271 | 271 | } |
| 272 | 272 | $singleLine = $this->removeNewlines($singleLine); |
| 273 | - $figletText .= $singleLine . "\n"; |
|
| 273 | + $figletText .= $singleLine."\n"; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return $figletText; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $coloredText = $this->colorizeBackground($backgroundColor, $coloredText); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $coloredText .= $text . "\033[0m"; |
|
| 76 | + $coloredText .= $text."\033[0m"; |
|
| 77 | 77 | |
| 78 | 78 | return $coloredText; |
| 79 | 79 | } |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | return $coloredText; |
| 96 | 96 | } else { |
| 97 | 97 | throw new \InvalidArgumentException( |
| 98 | - 'Font color "' . $fontColor . '" doesn\'t exist' . PHP_EOL . |
|
| 99 | - 'Available font colors: ' . implode(',', $this->getFontColors()) |
|
| 98 | + 'Font color "'.$fontColor.'" doesn\'t exist'.PHP_EOL. |
|
| 99 | + 'Available font colors: '.implode(',', $this->getFontColors()) |
|
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | return $coloredText; |
| 119 | 119 | } else { |
| 120 | 120 | throw new \InvalidArgumentException( |
| 121 | - 'Background color "' . $backgroundColor . '" doesn\'t exist ' . PHP_EOL . |
|
| 122 | - 'Available background colors: ' . implode(',', $this->getBackgroundColors()) |
|
| 121 | + 'Background color "'.$backgroundColor.'" doesn\'t exist '.PHP_EOL. |
|
| 122 | + 'Available background colors: '.implode(',', $this->getBackgroundColors()) |
|
| 123 | 123 | ); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | private function addColorCode($coloredText, $color) |
| 154 | 154 | { |
| 155 | - $coloredText .= "\033[" . $color . 'm'; |
|
| 155 | + $coloredText .= "\033[".$color.'m'; |
|
| 156 | 156 | |
| 157 | 157 | return $coloredText; |
| 158 | 158 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $figlet = new Figlet(); |
| 76 | 76 | |
| 77 | 77 | $figlet |
| 78 | - ->setFontDir(__DIR__ .'/font/') |
|
| 78 | + ->setFontDir(__DIR__.'/font/') |
|
| 79 | 79 | ->setFont('slant'); |
| 80 | 80 | |
| 81 | 81 | $output = $figlet->render('Test'); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $figlet = new Figlet(); |
| 92 | 92 | |
| 93 | 93 | $figlet |
| 94 | - ->setFontDir(__DIR__ .'/font/') |
|
| 94 | + ->setFontDir(__DIR__.'/font/') |
|
| 95 | 95 | ->setFont('badfile'); |
| 96 | 96 | |
| 97 | 97 | $figlet->render('Test'); |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | private function getDefaultBigFontText() |
| 104 | 104 | { |
| 105 | 105 | return |
| 106 | - ' _______ _ ' . "\n" . |
|
| 107 | - ' |__ __| | | ' . "\n" . |
|
| 108 | - ' | | ___ ___ | |_ ' . "\n" . |
|
| 109 | - ' | | / _ \ / __| | __|' . "\n" . |
|
| 110 | - ' | | | __/ \__ \ | |_ ' . "\n" . |
|
| 111 | - ' |_| \___| |___/ \__|' . "\n" . |
|
| 112 | - ' ' . "\n" . |
|
| 113 | - ' ' . "\n"; |
|
| 106 | + ' _______ _ '."\n". |
|
| 107 | + ' |__ __| | | '."\n". |
|
| 108 | + ' | | ___ ___ | |_ '."\n". |
|
| 109 | + ' | | / _ \ / __| | __|'."\n". |
|
| 110 | + ' | | | __/ \__ \ | |_ '."\n". |
|
| 111 | + ' |_| \___| |___/ \__|'."\n". |
|
| 112 | + ' '."\n". |
|
| 113 | + ' '."\n"; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -119,27 +119,27 @@ discard block |
||
| 119 | 119 | private function getModifiedDefaultBigFontText($fontColor, $backgroundColor) |
| 120 | 120 | { |
| 121 | 121 | return |
| 122 | - "\033[" . $fontColor . 'm' . "\033[" . $backgroundColor . 'm' . |
|
| 123 | - ' _______ _ ' . "\n" . |
|
| 124 | - ' |__ __| | | ' . "\n" . |
|
| 125 | - ' | | ___ ___ | |_ ' . "\n" . |
|
| 126 | - ' | | / _ \ / __| | __| ' . "\n" . |
|
| 127 | - ' | | | __/ \__ \ | |_ ' . "\n" . |
|
| 128 | - ' |_| \___| |___/ \__| ' . "\n" . |
|
| 129 | - ' ' . "\n" . |
|
| 130 | - ' ' . "\n" . |
|
| 122 | + "\033[".$fontColor.'m'."\033[".$backgroundColor.'m'. |
|
| 123 | + ' _______ _ '."\n". |
|
| 124 | + ' |__ __| | | '."\n". |
|
| 125 | + ' | | ___ ___ | |_ '."\n". |
|
| 126 | + ' | | / _ \ / __| | __| '."\n". |
|
| 127 | + ' | | | __/ \__ \ | |_ '."\n". |
|
| 128 | + ' |_| \___| |___/ \__| '."\n". |
|
| 129 | + ' '."\n". |
|
| 130 | + ' '."\n". |
|
| 131 | 131 | "\033[0m"; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | private function getSlantFontText() |
| 135 | 135 | { |
| 136 | 136 | return |
| 137 | - ' ______ __ ' . "\n" . |
|
| 138 | - ' /_ __/ ___ _____ / /_' . "\n" . |
|
| 139 | - ' / / / _ \ / ___/ / __/' . "\n" . |
|
| 140 | - ' / / / __/ (__ ) / /_ ' . "\n" . |
|
| 141 | - '/_/ \___/ /____/ \__/ ' . "\n" . |
|
| 142 | - ' ' . "\n"; |
|
| 137 | + ' ______ __ '."\n". |
|
| 138 | + ' /_ __/ ___ _____ / /_'."\n". |
|
| 139 | + ' / / / _ \ / ___/ / __/'."\n". |
|
| 140 | + ' / / / __/ (__ ) / /_ '."\n". |
|
| 141 | + '/_/ \___/ /____/ \__/ '."\n". |
|
| 142 | + ' '."\n"; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | } |