<commit_before><?php
/**
 * BaconQrCode
 *
 * @link      http://github.com/Bacon/BaconQrCode For the canonical source repository
 * @copyright 2013 Ben 'DASPRiD' Scholzen
 * @license   http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
 */

namespace BaconQrCode;

use BaconQrCode\Common\ErrorCorrectionLevel;
use BaconQrCode\Encoder\Encoder;
use BaconQrCode\Exception;
use BaconQrCode\Renderer\RendererInterface;

/**
 * QR code writer.
 */
class Writer
{
    /**
     * Renderer instance.
     *
     * @var RendererInterface
     */
    protected $renderer;

    /**
     * Creates a new writer with a specific renderer.
     *
     * @param RendererInterface $renderer
     */
    public function __construct(RendererInterface $renderer)
    {
        $this->renderer = $renderer;
    }

    /**
     * Sets the renderer used to create a byte stream.
     *
     * @param  RendererInterface $renderer
     * @return Writer
     */
    public function setRenderer(RendererInterface $renderer)
    {
        $this->renderer = $renderer;
        return $this;
    }

    /**
     * Gets the renderer used to create a byte stream.
     *
     * @return RendererInterface
     */
    public function getRenderer()
    {
        return $this->renderer;
    }

    /**
     * Writes QR code into a string or file.
     *
     * Content is a string which *should* be encoded in UTF-8, in case there are
     * non ASCII-characters present.
     *
     * The return value depends on whether a filename is supplied. If a filename
     * is supplied, nothing will be returned. Else the byte stream of the
     * renderer will be returned
     *
     * @param  string  $content
     * @param  string  $filename
     * @param  array   $hints
     * @return string|null
     * @throws Exception\InvalidArgumentException
     */
    public function write(<commit_msg>Fix docblock.<commit_after><?php
/**
 * BaconQrCode
 *
 * @link      http://github.com/Bacon/BaconQrCode For the canonical source repository
 * @copyright 2013 Ben 'DASPR<NAME>
 * @license   http://opensource.org/licenses/BSD-2-Clause Simplified BSD License
 */

namespace BaconQrCode;

use BaconQrCode\Common\ErrorCorrectionLevel;
use BaconQrCode\Encoder\Encoder;
use BaconQrCode\Exception;
use BaconQrCode\Renderer\RendererInterface;

/**
 * QR code writer.
 */
class Writer
{
    /**
     * Renderer instance.
     *
     * @var RendererInterface
     */
    protected $renderer;

    /**
     * Creates a new writer with a specific renderer.
     *
     * @param RendererInterface $renderer
     */
    public function __construct(RendererInterface $renderer)
    {
        $this->renderer = $renderer;
    }

    /**
     * Sets the renderer used to create a byte stream.
     *
     * @param  RendererInterface $renderer
     * @return Writer
     */
    public function setRenderer(RendererInterface $renderer)
    {
        $this->renderer = $renderer;
        return $this;
    }

    /**
     * Gets the renderer used to create a byte stream.
     *
     * @return RendererInterface
     */
    public function getRenderer()
    {
        return $this->renderer;
    }

    /**
     * Writes QR code into a string or file.
     *
     * Content is a string which *should* be encoded in UTF-8, in case there are
     * non ASCII-characters present.
     *
     * The return value depends on whether a filename is supplied. If a filename
     * is supplied, nothing will be returned. Else the byte stream of the
     * renderer will be returned
     *
     * @param  string $content
     * @param  string $filename
     * @param  string  $encoding
     * @param  int     $ecLevel
     * @throws Exception\InvalidArgumentException
     * @internal param array $hints
     * @return string|null
     */
    public function write(
{'fraction_non_alphanumeric': 0.09246125558182296, 'fraction_numerical': 0.0031520882584712374, 'mean_word_length': 2.3669319186560567, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7558571', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1094, 'n_words': 336}