<commit_before><?php

namespace Imagine;

class StandardImage implements Image {
    protected $name;
    protected $type;
    protected $contentType;
    protected $content;
    protected $height;
    protected $width;
    protected $top;
    protected $left;
    protected $path;
    protected $processedImage;

    public function  __construct($path) {
        $pathInfo = pathinfo($path);
        if (false === ($size = getimagesize($path))) {
            throw new \InvalidArgumentException('Could not determine image info');
        }
        $this->setWidth($size[0]);
        $this->setHeight($size[1]);
        $this->setType($size[2]);
        $this->setContentType($size['mime']);
        $this->path = realpath($path);
        $this->setName($pathInfo['filename']);
        $this->setContent(file_get_contents($path));
    }

    public function setName($name) {
        $this->name = $name;
    }
    public function getName() {
        return $this->name;
    }
    public function setType($type) {
        $this->type = $type;
    }
    public function getType() {
        return $this->type;
    }
    public function setContentType($contentType) {
        $this->contentType = $contentType;
    }
    public function getContentType() {
        return $this->contentType;
    }
    public function setContent($content) {
        $this->content = $content;
    }
    public function getContent() {
        return $this->content;
    }
    public function setHeight($height) {
        $this->height = $height;
    }
    public function getHeight() {
        return $this->height;
    }
    public function setWidth($width) {
        $this->width = $width;
    }
    public function getWidth() {
        return $this->width;
    }
    public function getPath() {
        return $this->path;
    }
    public function getProcessedImage() {
        return $this->processedImage;
    }
    public function getResource() {
        $content = $this->getContent();
        if (empty ($content)) {
            throw new \RuntimeException('Image was not instantiated or doesn\'t have content');
        }
        return imagecreatefromstring($this->getContent());
    }

    public function setSize($width, $height) {
        $this->setWidth($width);
        $this->setHeight($height);
    }

}<commit_msg>removed deprecated method<commit_after><?php

namespace Imagine;

class StandardImage implements Image {
    protected $name;
    protected $type;
    protected $contentType;
    protected $content;
    protected $height;
    protected $width;
    protected $top;
    protected $left;
    protected $path;

    public function  __construct($path) {
        $pathInfo = pathinfo($path);
        if (false === ($size = getimagesize($path))) {
            throw new \InvalidArgumentException('Could not determine image info');
        }
        $this->setWidth($size[0]);
        $this->setHeight($size[1]);
        $this->setType($size[2]);
        $this->setContentType($size['mime']);
        $this->path = realpath($path);
        $this->setName($pathInfo['filename']);
        $this->setContent(file_get_contents($path));
    }

    public function setName($name) {
        $this->name = $name;
    }
    public function getName() {
        return $this->name;
    }
    public function setType($type) {
        $this->type = $type;
    }
    public function getType() {
        return $this->type;
    }
    public function setContentType($contentType) {
        $this->contentType = $contentType;
    }
    public function getContentType() {
        return $this->contentType;
    }
    public function setContent($content) {
        $this->content = $content;
    }
    public function getContent() {
        return $this->content;
    }
    public function setHeight($height) {
        $this->height = $height;
    }
    public function getHeight() {
        return $this->height;
    }
    public function setWidth($width) {
        $this->width = $width;
    }
    public function getWidth() {
        return $this->width;
    }
    public function getPath() {
        return $this->path;
    }
    public function getResource() {
        $content = $this->getContent();
        if (empty ($content)) {
            throw new \RuntimeException('Image was not instantiated or doesn\'t have content');
        }
        return imagecreatefromstring($this->getContent());
    }

    public function setSize($width, $height) {
        $this->setWidth($width);
        $this->setHeight($height);
    }

}
{'fraction_non_alphanumeric': 0.1354881558556564, 'fraction_numerical': 0.0013283152534868275, 'mean_word_length': 2.430523917995444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, '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': '1980214', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1249, 'n_words': 289}