<commit_before><?hh // strict

namespace hhpack\process;

final class WritablePipe implements WritableStream
{

    private bool $opened = true;

    public function __construct(
        private resource $handle
    )
    {
    }

    public function opened() : bool
    {
        return $this->opened;
    }

    public function write(string $output) : int
    {
        return (int) fwrite($this->handle, $output);
    }

    public function close() : void
    {
        fclose($this->handle);
        $this->opened = false;
    }

    public static function nullPipe() : WritablePipe
    {
        $handle = fopen('/dev/null', 'w');

        if (is_resource($handle) === false) {
            throw new RuntimeException();
        }
        return new WritablePipe($handle);
    }

}
<commit_msg>fix type check errors<commit_after><?hh // strict

namespace hhpack\process;

use RuntimeException;

final class WritablePipe implements WritableStream
{

    private bool $opened = true;

    public function __construct(
        private resource $handle
    )
    {
    }

    public function opened() : bool
    {
        return $this->opened;
    }

    public function write(string $output) : int
    {
        return (int) fwrite($this->handle, $output);
    }

    public function close() : void
    {
        fclose($this->handle);
        $this->opened = false;
    }

    public static function nullPipe() : WritablePipe
    {
        $handle = fopen('/dev/null', 'w');

        if (is_resource($handle) === false) {
            throw new RuntimeException();
        }
        return new WritablePipe($handle);
    }

}

{'fraction_non_alphanumeric': 0.11616472034419176, 'fraction_numerical': 0.0, 'mean_word_length': 2.1734892787524367, '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': '3582192', 'n_tokens_mistral': 484, 'n_tokens_neox': 465, 'n_words': 121}