ExitToTopFrames.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace League\CLImate\Tests;
  3. trait ExitToTopFrames
  4. {
  5. abstract protected function shouldWrite($content, $count = 1);
  6. abstract protected function blankLines($count = 1);
  7. protected function fullArtExitTop()
  8. {
  9. $this->shouldWrite("\e[m _ _ ___ _ _\e[0m")->ordered();
  10. $this->shouldWrite("\e[m | || | / _ \| || |\e[0m")->ordered();
  11. $this->shouldWrite("\e[m | || |_| | | | || |_\e[0m")->ordered();
  12. $this->shouldWrite("\e[m |__ _| | | |__ _|\e[0m")->ordered();
  13. $this->shouldWrite("\e[m | | | |_| | | |\e[0m")->ordered();
  14. $this->shouldWrite("\e[m |_| \___/ |_|\e[0m")->ordered();
  15. }
  16. protected function fullArtExitTopPlus($times = 1)
  17. {
  18. for ($i = 1; $i <= $times; $i++) {
  19. $this->shouldWrite("\e[m\e[6A\r\e[K _ _ ___ _ _\e[0m")->ordered();
  20. $this->shouldWrite("\e[m\r\e[K | || | / _ \| || |\e[0m")->ordered();
  21. $this->shouldWrite("\e[m\r\e[K | || |_| | | | || |_\e[0m")->ordered();
  22. $this->shouldWrite("\e[m\r\e[K |__ _| | | |__ _|\e[0m")->ordered();
  23. $this->shouldWrite("\e[m\r\e[K | | | |_| | | |\e[0m")->ordered();
  24. $this->shouldWrite("\e[m\r\e[K |_| \___/ |_|\e[0m")->ordered();
  25. }
  26. }
  27. protected function exitTopFrame1()
  28. {
  29. $this->shouldWrite("\e[m\e[6A\r\e[K | || | / _ \| || |\e[0m")->ordered();
  30. $this->shouldWrite("\e[m\r\e[K | || |_| | | | || |_\e[0m")->ordered();
  31. $this->shouldWrite("\e[m\r\e[K |__ _| | | |__ _|\e[0m")->ordered();
  32. $this->shouldWrite("\e[m\r\e[K | | | |_| | | |\e[0m")->ordered();
  33. $this->shouldWrite("\e[m\r\e[K |_| \___/ |_|\e[0m")->ordered();
  34. $this->blankLines(1);
  35. }
  36. protected function exitTopFrame2()
  37. {
  38. $this->shouldWrite("\e[m\e[6A\r\e[K | || |_| | | | || |_\e[0m")->ordered();
  39. $this->shouldWrite("\e[m\r\e[K |__ _| | | |__ _|\e[0m")->ordered();
  40. $this->shouldWrite("\e[m\r\e[K | | | |_| | | |\e[0m")->ordered();
  41. $this->shouldWrite("\e[m\r\e[K |_| \___/ |_|\e[0m")->ordered();
  42. $this->blankLines(2);
  43. }
  44. protected function exitTopFrame3()
  45. {
  46. $this->shouldWrite("\e[m\e[6A\r\e[K |__ _| | | |__ _|\e[0m")->ordered();
  47. $this->shouldWrite("\e[m\r\e[K | | | |_| | | |\e[0m")->ordered();
  48. $this->shouldWrite("\e[m\r\e[K |_| \___/ |_|\e[0m")->ordered();
  49. $this->blankLines(3);
  50. }
  51. protected function exitTopFrame4()
  52. {
  53. $this->shouldWrite("\e[m\e[6A\r\e[K | | | |_| | | |\e[0m")->ordered();
  54. $this->shouldWrite("\e[m\r\e[K |_| \___/ |_|\e[0m")->ordered();
  55. $this->blankLines(4);
  56. }
  57. protected function exitTopFrame5()
  58. {
  59. $this->shouldWrite("\e[m\e[6A\r\e[K |_| \___/ |_|\e[0m")->ordered();
  60. $this->blankLines(5);
  61. }
  62. protected function exitTopFrame6()
  63. {
  64. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  65. $this->blankLines(5);
  66. }
  67. }