@@ -21,10 +21,10 @@ |
||
| 21 | 21 | ->highlight(); |
| 22 | 22 | |
| 23 | 23 | // Highlight file |
| 24 | -echo Highlighter::for(__FILE__)->highlight(); |
|
| 24 | +echo Highlighter::for (__FILE__)->highlight(); |
|
| 25 | 25 | |
| 26 | 26 | // Export highlighted file as image |
| 27 | -Exporter::for(__FILE__)->export(__DIR__ . '/example.png'); |
|
| 27 | +Exporter::for (__FILE__)->export(__DIR__ . '/example.png'); |
|
| 28 | 28 | |
| 29 | 29 | // Magic string works too: |
| 30 | 30 | echo new Highlighter('<?php echo "Hello Again!";' . PHP_EOL); |
@@ -21,10 +21,14 @@ |
||
| 21 | 21 | ->highlight(); |
| 22 | 22 | |
| 23 | 23 | // Highlight file |
| 24 | -echo Highlighter::for(__FILE__)->highlight(); |
|
| 24 | +echo Highlighter::for(__FILE__) { |
|
| 25 | + ->highlight(); |
|
| 26 | +} |
|
| 25 | 27 | |
| 26 | 28 | // Export highlighted file as image |
| 27 | -Exporter::for(__FILE__)->export(__DIR__ . '/example.png'); |
|
| 29 | +Exporter::for(__FILE__) { |
|
| 30 | + ->export(__DIR__ . '/example.png'); |
|
| 31 | +} |
|
| 28 | 32 | |
| 29 | 33 | // Magic string works too: |
| 30 | 34 | echo new Highlighter('<?php echo "Hello Again!";' . PHP_EOL); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $this->code = $code ?? ''; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public static function for(string $file): self |
|
| 29 | + public static function for (string $file): self |
|
| 30 | 30 | { |
| 31 | 31 | if (!\is_file($file)) { |
| 32 | 32 | throw new \InvalidArgumentException('The given file doesnot exist or is unreadable.'); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $code = $io->readPiped(function ($reader) use ($io) { |
|
| 51 | + $code = $io->readPiped(function($reader) use ($io) { |
|
| 52 | 52 | $io->warn('Type in or paste PHP Code below, Press Ctrl+D when done.', true); |
| 53 | 53 | $io->warn('(Opening tag `<?php` will be prepended as required):', true); |
| 54 | 54 | |