ContextContextItemHandler.php 592 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: yf
  5. * Date: 2019-01-06
  6. * Time: 23:27
  7. */
  8. namespace EasySwoole\Component\Tests\Lib;
  9. use EasySwoole\Component\Context\ContextItemHandlerInterface;
  10. class ContextContextItemHandler implements ContextItemHandlerInterface
  11. {
  12. function onContextCreate()
  13. {
  14. // TODO: Implement onContextCreate() method.
  15. $stdClass = new \stdClass();
  16. $stdClass->text = 'handler';
  17. return $stdClass;
  18. }
  19. function onDestroy($context)
  20. {
  21. // TODO: Implement onDestroy() method.
  22. $context->destroy = true;
  23. }
  24. }