Guard.php 750 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the overtrue/wechat.
  4. *
  5. * (c) overtrue <i@overtrue.me>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace EasyWeChat\Work\Server;
  11. use EasyWeChat\Kernel\ServerGuard;
  12. /**
  13. * Class Guard.
  14. *
  15. * @author overtrue <i@overtrue.me>
  16. */
  17. class Guard extends ServerGuard
  18. {
  19. /**
  20. * @return $this
  21. */
  22. public function validate()
  23. {
  24. return $this;
  25. }
  26. /**
  27. * Check the request message safe mode.
  28. */
  29. protected function isSafeMode(): bool
  30. {
  31. return true;
  32. }
  33. protected function shouldReturnRawResponse(): bool
  34. {
  35. return !is_null($this->app['request']->get('echostr'));
  36. }
  37. }