jrdnull/phpwriter

View on GitHub
lib/PhpWriter/Io/StringWriter.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace PhpWriter\Io;

class StringWriter extends Writer
{
    protected $data = '';

    /**
     * Appends input to the writers string
     *
     * @param string $str
     */
    public function write($str)
    {
        $this->data .= $str;
    }

    /**
     * Does nothing
     */
    public function flush()
    {
    }

    /**
     * Does nothing
     */
    public function close()
    {
    }

    /**
     * Returns the built up string
     *
     * @return string
     */
    public function getString()
    {
        return $this->data;
    }
}