Skip to content

Commit

Permalink
refactor: split into command classes
Browse files Browse the repository at this point in the history
  • Loading branch information
apple-x-co committed Apr 4, 2021
1 parent 3b65bdb commit a8aad64
Show file tree
Hide file tree
Showing 23 changed files with 1,002 additions and 699 deletions.
34 changes: 0 additions & 34 deletions src/ArchiverCommand.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/ArchiverInterface.php

This file was deleted.

40 changes: 0 additions & 40 deletions src/ArchiverZip.php

This file was deleted.

71 changes: 0 additions & 71 deletions src/Color.php

This file was deleted.

50 changes: 50 additions & 0 deletions src/ColorOutput.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace Rocket;

class ColorOutput implements OutputInterface
{
/**
* @param string $text
*/
public function plain($text)
{
echo $text . PHP_EOL;
}

/**
* @param string $text
*/
public function error($text)
{
$escapeSequence = new EscapeSequence('red', null, ['bold']);
echo $escapeSequence->apply($text) . PHP_EOL;
}

/**
* @param string $text
*/
public function warning($text)
{
$escapeSequence = new EscapeSequence('magenta', null, ['bold']);
echo $escapeSequence->apply($text) . PHP_EOL;
}

/**
* @param string $text
*/
public function info($text)
{
$escapeSequence = new EscapeSequence('cyan', null, ['bold']);
echo $escapeSequence->apply($text) . PHP_EOL;
}

/**
* @param string $text
*/
public function debug($text)
{
$escapeSequence = new EscapeSequence(null, null, ['underline', 'brink']);
echo $escapeSequence->apply($text) . PHP_EOL;
}
}
Loading

0 comments on commit a8aad64

Please sign in to comment.