<commit_before><?php

namespace HumusAmqpModule\Controller;

use Zend\Console\ColorInterface;
use Zend\Mvc\Controller\AbstractConsoleController;
use Zend\Stdlib\RequestInterface;
use Zend\Stdlib\ResponseInterface;

class StdInProducerController extends AbstractConsoleController
{
    /**
     * {@inheritdoc}
     */
    public function dispatch(RequestInterface $request, ResponseInterface $response = null)
    {
        parent::dispatch($request, $response);
        /* @var $request \Zend\Console\Request */
        $producerName = $request->getParam('name');

        if (!$this->getServiceLocator()->has($producerName)) {
            return $this->getConsole()->writeLine(
                'ERROR: Producer "' . $producerName . '" not found',
                ColorInterface::RED
            );
        }

        $debug = $request->getParam('debug') || $request->getParam('d');

        if ($debug && !defined('AMQP_DEBUG')) {
            define('AMQP_DEBUG', true);
        }

        $producer = $this->getServiceLocator()->get($producerName);

        $route = $request->getParam('route', '');
        $msg = trim($request->getParam('msg'));

        $producer->publish($msg, $route);
    }
}<commit_msg>cleanup in stdin producer controller<commit_after><?php

namespace HumusAmqpModule\Controller;

use Zend\Console\ColorInterface;
use Zend\Mvc\Controller\AbstractConsoleController;
use Zend\Stdlib\RequestInterface;
use Zend\Stdlib\ResponseInterface;

class StdInProducerController extends AbstractConsoleController
{
    /**
     * {@inheritdoc}
     */
    public function dispatch(RequestInterface $request, ResponseInterface $response = null)
    {
        parent::dispatch($request, $response);
        /* @var $request \Zend\Console\Request */
        $producerName = $request->getParam('name');

        if (!$this->getServiceLocator()->has($producerName)) {
            $this->getConsole()->writeLine(
                'ERROR: Producer "' . $producerName . '" not found',
                ColorInterface::RED
            );

            return null;
        }

        $debug = $request->getParam('debug') || $request->getParam('d');

        if ($debug && !defined('AMQP_DEBUG')) {
            define('AMQP_DEBUG', true);
        }

        $producer = $this->getServiceLocator()->get($producerName);

        $route = $request->getParam('route', '');
        $msg = trim($request->getParam('msg'));

        $producer->publish($msg, $route);
    }
}
{'fraction_non_alphanumeric': 0.1527552674230146, 'fraction_numerical': 0.0, 'mean_word_length': 2.839813374805599, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '6611923', 'n_tokens_mistral': 699, 'n_tokens_neox': 674, 'n_words': 117}