Base.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * This file is part of GameQ.
  4. *
  5. * GameQ is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GameQ is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. namespace GameQ\Filters;
  19. use GameQ\Server;
  20. /**
  21. * Abstract base class which all filters must inherit
  22. *
  23. * @author Austin Bischoff <[email protected]>
  24. */
  25. abstract class Base
  26. {
  27. /**
  28. * Holds the options for this instance of the filter
  29. *
  30. * @type array
  31. */
  32. protected $options = [];
  33. /**
  34. * Construct
  35. *
  36. * @param array $options
  37. */
  38. public function __construct(array $options = [])
  39. {
  40. $this->options = $options;
  41. }
  42. public function getOptions()
  43. {
  44. return $this->options;
  45. }
  46. /**
  47. * Apply the filter to the data
  48. *
  49. * @param array $result
  50. * @param \GameQ\Server $server
  51. *
  52. * @return mixed
  53. */
  54. abstract public function apply(array $result, Server $server);
  55. }