<commit_before><?php

namespace Nats;

/**
 * StreamWrapper class.
 */
class StreamWrapper
{
    /**
     * Wrapper for stream_socket_client
     *
     * @param string  $address    Address to connect the socket.
     * @param integer $errno      Number of error.
     * @param string  $errstr     Description of error.
     * @param integer $timeout    Timeout.
     * @param integer $typeStream Type of stream.
     *
     * @return stream
     */
    public function getStreamSocketClient($address, &$errno, &$errstr, $timeout, $typeStream)
    {
        return stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
    }
    
    /**
     * Wrapper for stream_set_timeout
     *
     * @param mixed   $stream  Stream.
     * @param integer $seconds Seconds for timeout.
     *
     * @return boolean
     *
    */
    public function setStreamTimeout($stream, $seconds)
    {
        return stream_set_timeout($stream, $seconds);
    }
}
<commit_msg>BUGFIX: Without calling stream_set_timeout the timeout is not respected<commit_after><?php

namespace Nats;

/**
 * StreamWrapper class.
 */
class StreamWrapper
{
    /**
     * Wrapper for stream_socket_client
     *
     * @param string  $address    Address to connect the socket.
     * @param integer $errno      Number of error.
     * @param string  $errstr     Description of error.
     * @param integer $timeout    Timeout.
     * @param integer $typeStream Type of stream.
     *
     * @return resource
     */
    public function getStreamSocketClient($address, &$errno, &$errstr, $timeout, $typeStream)
    {
        $stream = stream_socket_client($address, $errno, $errstr, $timeout, $typeStream);
        stream_set_timeout($stream, $timeout);
        return $stream;
    }
    
    /**
     * Wrapper for stream_set_timeout
     *
     * @param mixed   $stream  Stream.
     * @param integer $seconds Seconds for timeout.
     *
     * @return boolean
     *
    */
    public function setStreamTimeout($stream, $seconds)
    {
        return stream_set_timeout($stream, $seconds);
    }
}

{'fraction_non_alphanumeric': 0.1053897978825794, 'fraction_numerical': 0.0, 'mean_word_length': 2.453488372093023, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4972618', 'n_tokens_mistral': 602, 'n_tokens_neox': 598, 'n_words': 166}