From 70337bd867f892d4b0d048fe03929f8c06dcc6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentinas=20Bartusevi=C4=8Dius?= Date: Mon, 8 Mar 2021 16:17:46 +0200 Subject: [PATCH] Added `Entity/File` fo represent a file --- .travis.yml | 5 +-- CHANGELOG.md | 4 +++ src/Entity/File.php | 81 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 src/Entity/File.php diff --git a/.travis.yml b/.travis.yml index ef19d44..cea1337 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,7 @@ dist: trusty matrix: include: - php: 5.5 - - php: 5.6 - php: 7.0 - - php: 7.1 - - php: 7.2 + - php: 7.4 install: - composer install - diff --git a/CHANGELOG.md b/CHANGELOG.md index 24d34d8..21f0d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 2.5.0 +### Added +- Added `Entity/File` to represent a file. + ## 2.4.2 ### Fixed - Throws `RuntimeException` when trying to create `RequestException` and response body is not seekable diff --git a/src/Entity/File.php b/src/Entity/File.php new file mode 100644 index 0000000..e6911de --- /dev/null +++ b/src/Entity/File.php @@ -0,0 +1,81 @@ +get('name'); + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @return string|null + */ + public function getMimeType() + { + return $this->get('mime_type'); + } + + /** + * @return int|null + */ + public function getSize() + { + return $this->get('size'); + } + + /** + * @param string|null $name + * @return $this + */ + public function setName($name) + { + $this->set('name', $name); + return $this; + } + + /** + * @param string $content + * @return $this + */ + public function setContent($content) + { + $this->set('content', $content); + return $this; + } + + /** + * @param string|null $mimeType + * @return $this + */ + public function setMimeType($mimeType) + { + $this->set('mime_type', $mimeType); + return $this; + } + + /** + * @param int|null $size + * @return $this + */ + public function setSize($size) + { + $this->set('size', $size); + return $this; + } +}