<commit_before><?php

namespace Thruway\Message;


class PublishMessage extends Message {
    const MSG_CODE = Message::MSG_PUBLISH;

    private $options;
    private $topicName;
    private $arguments;
    private $argumentsKw;

    function __construct($requestId, $options, $topicName, $arguments = null, $argumentsKw = null)
    {
        parent::__construct();

        $this->setRequestId($requestId);

        $this->arguments = $arguments;
        $this->argumentsKw = $argumentsKw;
        $this->options = $options;
        $this->topicName = $topicName;
    }


    /**
     * @return int
     */
    public function getMsgCode() { return static::MSG_CODE; }

    /**
     * This is used by get message parts to get the parts of the message beyond
     * the message code
     *
     * @return array
     */
    public function getAdditionalMsgFields()
    {
        $a = array($this->getRequestId(), $this->getOptions(), $this->getTopicName());

        if ($this->getArguments() != null) {
            $a = array_merge($a, array($this->getArguments()));
            if ($this->getArgumentsKw() != null) {
                $a = array_merge($a, array($this->getArgumentsKw()));
            }
        }

        return $a;
    }

    /**
     * @param mixed $arguments
     */
    public function setArguments($arguments)
    {
        $this->arguments = $arguments;
    }

    /**
     * @return mixed
     */
    public function getArguments()
    {
        return $this->arguments;
    }

    /**
     * @param mixed $argumentsKw
     */
    public function setArgumentsKw($argumentsKw)
    {
        $this->argumentsKw = $argumentsKw;
    }

    /**
     * @return mixed
     */
    public function getArgumentsKw()
    {
        return $this->argumentsKw;
    }

    /**
     * @param mixed $options
     */
    public function setOptions($options)
    {
        $this->options = $options;
    }

    /**
     * @return mixed
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * @param mixed $topicName
     */
    public function setTopicName($topicName)
    {
        $this->topicName = $topicName;
    }

    /**
     * @return mixed
     */
    public function getTopicName()
    {
        return $this->topicName;
    }


} <commit_msg>Prevent Publish message from sending null options<commit_after><?php

namespace Thruway\Message;


class PublishMessage extends Message
{
    const MSG_CODE = Message::MSG_PUBLISH;

    private $options;
    private $topicName;
    private $arguments;
    private $argumentsKw;

    function __construct($requestId, $options, $topicName, $arguments = null, $argumentsKw = null)
    {
        parent::__construct();

        $this->setRequestId($requestId);

        $this->arguments = $arguments;
        $this->argumentsKw = $argumentsKw;
        $this->options = $options;
        $this->topicName = $topicName;
    }


    /**
     * @return int
     */
    public function getMsgCode()
    {
        return static::MSG_CODE;
    }

    /**
     * This is used by get message parts to get the parts of the message beyond
     * the message code
     *
     * @return array
     */
    public function getAdditionalMsgFields()
    {
        if ($this->getOptions() === null) {
            $this->setOptions(new \stdClass());
        }

        $a = array($this->getRequestId(), $this->getOptions(), $this->getTopicName());

        if ($this->getArguments() != null) {
            $a = array_merge($a, array($this->getArguments()));
            if ($this->getArgumentsKw() != null) {
                $a = array_merge($a, array($this->getArgumentsKw()));
            }
        }

        return $a;
    }

    /**
     * @param mixed $arguments
     */
    public function setArguments($arguments)
    {
        $this->arguments = $arguments;
    }

    /**
     * @return mixed
     */
    public function getArguments()
    {
        return $this->arguments;
    }

    /**
     * @param mixed $argumentsKw
     */
    public function setArgumentsKw($argumentsKw)
    {
        $this->argumentsKw = $argumentsKw;
    }

    /**
     * @return mixed
     */
    public function getArgumentsKw()
    {
        return $this->argumentsKw;
    }

    /**
     * @param mixed $options
     */
    public function setOptions($options)
    {
        $this->options = $options;
    }

    /**
     * @return mixed
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
     * @param mixed $topicName
     */
    public function setTopicName($topicName)
    {
        $this->topicName = $topicName;
    }

    /**
     * @return mixed
     */
    public function getTopicName()
    {
        return $this->topicName;
    }


} 
{'fraction_non_alphanumeric': 0.13463558076034446, 'fraction_numerical': 0.0, 'mean_word_length': 1.9376927822331893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '5614241', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1381, 'n_words': 299}