Exemplo n.º 1
0
 /**
  * @param string               $expected
  * @param AbstractStreamWriter $actual
  * @param string               $message
  */
 public static function assertContentsEquals($expected, $actual, $message = '')
 {
     $stream = $actual->getStream();
     rewind($stream);
     $actual = stream_get_contents($stream);
     self::assertEquals($expected, $actual, $message);
 }
Exemplo n.º 2
0
 /**
  * @param string   $delimiter    The delimiter
  * @param string   $enclosure    The enclosure
  * @param resource $stream
  * @param bool     $utf8Encoding
  */
 public function __construct($delimiter = ';', $enclosure = '"', $stream = null, $utf8Encoding = false, $prependHeaderRow = false)
 {
     parent::__construct($stream);
     $this->delimiter = $delimiter;
     $this->enclosure = $enclosure;
     $this->utf8Encoding = $utf8Encoding;
     $this->prependHeaderRow = $prependHeaderRow;
 }
Exemplo n.º 3
0
 /**
  * JsonWriter constructor.
  * @param Configuration $config
  */
 public function __construct(Configuration $config)
 {
     parent::__construct();
     if ($config->get(array('pretty')) == true) {
         $this->options |= JSON_PRETTY_PRINT;
     }
     if ($config->get(array('unicode')) == true) {
         $this->options |= JSON_UNESCAPED_UNICODE;
     }
 }