Completed
Pull Request — master (#7)
by lee
36s
created
src/Figlet/FontManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
tests/FigletTest.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Figlet/Command/FigletCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,15 +69,15 @@
 block discarded – undo
69 69
       $figlet
70 70
          ->setFont($input->getOption('font'));
71 71
 
72
-      if(null !== $input->getOption('color')){
72
+      if (null !== $input->getOption('color')) {
73 73
          $figlet->setFontColor($input->getOption('color'));
74 74
       }
75 75
 
76
-      if(null !== $input->getOption('bg-color')){
76
+      if (null !== $input->getOption('bg-color')) {
77 77
          $figlet->setBackgroundColor($input->getOption('bg-color'));
78 78
       }
79 79
 
80
-      if(null !== $input->getOption('stretching')){
80
+      if (null !== $input->getOption('stretching')) {
81 81
          $figlet->setFontStretching($input->getOption('stretching'));
82 82
       }
83 83
 
Please login to merge, or discard this patch.
src/Figlet/ColorManager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             $coloredText = $this->colorizeBackground($backgroundColor, $coloredText);
72 72
         }
73 73
 
74
-        $coloredText .= $text . "\033[0m";
74
+        $coloredText .= $text."\033[0m";
75 75
 
76 76
         return $coloredText;
77 77
     }
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
            return $this->addColorCode($coloredText, $this->fontColors[$fontColor]);
90 90
         } else {
91 91
             throw new \InvalidArgumentException(
92
-                'Font color "' . $fontColor . '" doesn\'t exist' . PHP_EOL .
93
-                'Available font colors: ' . implode(',', $this->getFontColors())
92
+                'Font color "'.$fontColor.'" doesn\'t exist'.PHP_EOL.
93
+                'Available font colors: '.implode(',', $this->getFontColors())
94 94
             );
95 95
         }
96 96
     }
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
            return $this->addColorCode($coloredText, $this->backgroundColors[$backgroundColor]);
109 109
         } else {
110 110
             throw new \InvalidArgumentException(
111
-                'Background color "' . $backgroundColor . '" doesn\'t exist ' . PHP_EOL .
112
-                'Available background colors: ' . implode(',', $this->getBackgroundColors())
111
+                'Background color "'.$backgroundColor.'" doesn\'t exist '.PHP_EOL.
112
+                'Available background colors: '.implode(',', $this->getBackgroundColors())
113 113
             );
114 114
         }
115 115
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     private function addColorCode($coloredText, $color)
144 144
     {
145
-        $coloredText .= "\033[" . $color . 'm';
145
+        $coloredText .= "\033[".$color.'m';
146 146
 
147 147
         return $coloredText;
148 148
     }
Please login to merge, or discard this patch.
src/Figlet/Figlet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
     public function __construct()
71 71
     {
72
-        $this->fontDir = __DIR__ . DIRECTORY_SEPARATOR . 'fonts' . DIRECTORY_SEPARATOR;
72
+        $this->fontDir = __DIR__.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR;
73 73
         $this->fontName = 'big';
74 74
         $this->stretching = 0;
75 75
     }
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
         for ($line = 0; $line < $height; $line++) {
243 243
             $singleLine = '';
244 244
             foreach ($figletCharacters as $charactersLines) {
245
-                $singleLine .= $charactersLines[$line] . $this->addStretching();
245
+                $singleLine .= $charactersLines[$line].$this->addStretching();
246 246
             }
247 247
             $singleLine = $this->removeNewlines($singleLine);
248
-            $figletText .= $singleLine . "\n";
248
+            $figletText .= $singleLine."\n";
249 249
         }
250 250
 
251 251
         return $figletText;
Please login to merge, or discard this patch.