<commit_before><?php

namespace Thruway\Peer;

use Thruway\Manager\ManagerInterface;
use Thruway\Message\Message;
use Thruway\Transport\AbstractTransportProvider;
use Thruway\Transport\TransportInterface;

abstract class AbstractPeer
{
    /**
     * @var ManagerInterface
     */
    protected $manager;

    public function onRawMessage(TransportInterface $transport, $msg)
    {
        if ($this->manager instanceof ManagerInterface) {
            $this->manager->logDebug("Raw message: (" . $msg . ")");
        }

        $msgObj = Message::createMessageFromRaw($msg);

        $this->onMessage($transport, $msgObj);
    }

    abstract public function onMessage(TransportInterface $transport, Message $msg);

    abstract public function onOpen(TransportInterface $transport);

    abstract public function addTransportProvider(AbstractTransportProvider $transportProvider);

    abstract public function setManager($manager);

    abstract public function start($startEventLoop = true);

}<commit_msg>Fixed AbstractPeer so that it won't break code that overrides start without an argument<commit_after><?php

namespace Thruway\Peer;

use Thruway\Manager\ManagerInterface;
use Thruway\Message\Message;
use Thruway\Transport\AbstractTransportProvider;
use Thruway\Transport\TransportInterface;

abstract class AbstractPeer
{
    /**
     * @var ManagerInterface
     */
    protected $manager;

    public function onRawMessage(TransportInterface $transport, $msg)
    {
        if ($this->manager instanceof ManagerInterface) {
            $this->manager->logDebug("Raw message: (" . $msg . ")");
        }

        $msgObj = Message::createMessageFromRaw($msg);

        $this->onMessage($transport, $msgObj);
    }

    abstract public function onMessage(TransportInterface $transport, Message $msg);

    abstract public function onOpen(TransportInterface $transport);

    abstract public function addTransportProvider(AbstractTransportProvider $transportProvider);

    abstract public function setManager($manager);

    // start can take an argument of $runLoop = true
    // not added here because it would break other people's stuff who
    // don't implement that
    abstract public function start();

}
{'fraction_non_alphanumeric': 0.09590274651058082, 'fraction_numerical': 0.0, 'mean_word_length': 3.937777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1765035', 'n_tokens_mistral': 562, 'n_tokens_neox': 543, 'n_words': 154}