Listener.php 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of Evenement.
  4. *
  5. * (c) Igor Wiedler <igor@wiedler.ch>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Evenement\Tests;
  11. class Listener
  12. {
  13. private $data = [];
  14. private $magicData = [];
  15. private static $staticData = [];
  16. public function onFoo($data)
  17. {
  18. $this->data[] = $data;
  19. }
  20. public function __invoke($data)
  21. {
  22. $this->magicData[] = $data;
  23. }
  24. public static function onBar($data)
  25. {
  26. self::$staticData[] = $data;
  27. }
  28. public function getData()
  29. {
  30. return $this->data;
  31. }
  32. public function getMagicData()
  33. {
  34. return $this->magicData;
  35. }
  36. public static function getStaticData()
  37. {
  38. return self::$staticData;
  39. }
  40. }