<commit_before><?php

namespace MogileFs\File;

use MogileFs\Exception;

class ResourceFile implements FileInterface
{
    /**
     * @var int
     */
    protected $length = 0;

    /**
     * @var resource
     */
    protected $payload;

    /**
     * @var string
     */
    protected $class;

    /**
     * ResourceFile constructor.
     * @param resource $payload
     * @param string $class
     */
    public function __construct($payload, $class)
    {
        if (!(is_resource($this->payload) && get_resource_type($this->payload) == 'stream')) {
            throw new Exception("Invalid payload. Should be stream or file handle");
        }

        $this->payload = $payload;
        $this->class = $class;
    }

    /**<commit_msg>fix ResourceFile construct<commit_after><?php

namespace MogileFs\File;

use MogileFs\Exception;

class ResourceFile implements FileInterface
{
    /**
     * @var int
     */
    protected $length = 0;

    /**
     * @var resource
     */
    protected $payload;

    /**
     * @var string
     */
    protected $class;

    /**
     * ResourceFile constructor.
     * @param resource $payload
     * @param string $class
     */
    public function __construct($payload, $class)
    {
        if (!(is_resource($payload) && get_resource_type($payload) == 'stream')) {
            throw new Exception("Invalid payload. Should be stream or file handle");
        }

        $this->payload = $payload;
        $this->class = $class;
    }

    /**
{'fraction_non_alphanumeric': 0.13377926421404682, 'fraction_numerical': 0.0013377926421404682, 'mean_word_length': 2.1231732776617953, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3276377', 'n_tokens_mistral': 440, 'n_tokens_neox': 425, 'n_words': 106}