ExitToBottomFrames.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace League\CLImate\Tests;
  3. trait ExitToBottomFrames
  4. {
  5. abstract protected function shouldWrite($content, $count = 1);
  6. abstract protected function blankLines($count = 1);
  7. protected function fullArtExitBottom()
  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 fullArtExitBottomPlus($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 exitBottomFrame1()
  28. {
  29. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m");
  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->shouldWrite("\e[m\r\e[K | | | |_| | | |\e[0m")->ordered();
  35. }
  36. protected function exitBottomFrame2()
  37. {
  38. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  39. $this->blankLines(1);
  40. $this->shouldWrite("\e[m\r\e[K _ _ ___ _ _\e[0m")->ordered();
  41. $this->shouldWrite("\e[m\r\e[K | || | / _ \| || |\e[0m")->ordered();
  42. $this->shouldWrite("\e[m\r\e[K | || |_| | | | || |_\e[0m")->ordered();
  43. $this->shouldWrite("\e[m\r\e[K |__ _| | | |__ _|\e[0m")->ordered();
  44. }
  45. protected function exitBottomFrame3()
  46. {
  47. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  48. $this->blankLines(2);
  49. $this->shouldWrite("\e[m\r\e[K _ _ ___ _ _\e[0m")->ordered();
  50. $this->shouldWrite("\e[m\r\e[K | || | / _ \| || |\e[0m")->ordered();
  51. $this->shouldWrite("\e[m\r\e[K | || |_| | | | || |_\e[0m")->ordered();
  52. }
  53. protected function exitBottomFrame4()
  54. {
  55. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  56. $this->blankLines(3);
  57. $this->shouldWrite("\e[m\r\e[K _ _ ___ _ _\e[0m")->ordered();
  58. $this->shouldWrite("\e[m\r\e[K | || | / _ \| || |\e[0m")->ordered();
  59. }
  60. protected function exitBottomFrame5()
  61. {
  62. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  63. $this->blankLines(4);
  64. $this->shouldWrite("\e[m\r\e[K _ _ ___ _ _\e[0m")->ordered();
  65. }
  66. protected function exitBottomFrame6()
  67. {
  68. $this->shouldWrite("\e[m\e[6A\r\e[K\e[0m")->ordered();
  69. $this->blankLines(5);
  70. }
  71. }