-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made it easier to customize the spinner and table rendering
- Loading branch information
Showing
8 changed files
with
337 additions
and
78 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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Frederic G. Østby | ||
* @license http://www.makoframework.com/license | ||
*/ | ||
|
||
namespace mako\cli\output\helpers\spinner; | ||
|
||
/** | ||
* Ascii frames. | ||
*/ | ||
class AsciiFrames extends Frames | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const int TIME_BETWEEN_REDRAW = 200000; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const array FRAMES = [')', '|', '(']; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Frederic G. Østby | ||
* @license http://www.makoframework.com/license | ||
*/ | ||
|
||
namespace mako\cli\output\helpers\spinner; | ||
|
||
/** | ||
* Frames. | ||
*/ | ||
class Frames | ||
{ | ||
/** | ||
* Time between redraw in microseconds. | ||
*/ | ||
protected const int TIME_BETWEEN_REDRAW = 100000; | ||
|
||
/** | ||
* Spinner frames. | ||
*/ | ||
protected const array FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']; | ||
|
||
/** | ||
* Returns the spinner frames. | ||
*/ | ||
public function getFrames(): array | ||
{ | ||
return static::FRAMES; | ||
} | ||
|
||
/** | ||
* Returns the time between redraw in microseconds. | ||
*/ | ||
public function getTimeBetweenRedraw(): int | ||
{ | ||
return static::TIME_BETWEEN_REDRAW; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Frederic G. Østby | ||
* @license http://www.makoframework.com/license | ||
*/ | ||
|
||
namespace mako\cli\output\helpers\table; | ||
|
||
/** | ||
* Ascii border. | ||
*/ | ||
class AsciiBorder extends Border | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string HORIZONTAL_LINE = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string VERTICAL_LINE = '|'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string CORNER_TOP_LEFT = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string CORNER_TOP_RIGHT = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string T_JUNCTION_DOWN = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string T_JUNCTION_UP = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string T_JUNCTION_LEFT = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string T_JUNCTION_RIGHT = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string JUNCTION = '|'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string CORNER_BOTTOM_LEFT = '-'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected const string CORNER_BOTTOM_RIGHT = '-'; | ||
} |
Oops, something went wrong.