CharsetEncoderAware.php 529 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace PhpXmlRpc\Traits;
  3. use PhpXmlRpc\Helper\Charset;
  4. trait CharsetEncoderAware
  5. {
  6. protected static $charsetEncoder;
  7. public function getCharsetEncoder()
  8. {
  9. if (self::$charsetEncoder === null) {
  10. self::$charsetEncoder = Charset::instance();
  11. }
  12. return self::$charsetEncoder;
  13. }
  14. /**
  15. * @param $charsetEncoder
  16. * @return void
  17. */
  18. public static function setCharsetEncoder($charsetEncoder)
  19. {
  20. self::$charsetEncoder = $charsetEncoder;
  21. }
  22. }