aboutsummaryrefslogtreecommitdiff
path: root/lib/FormatAbstract.php
diff options
context:
space:
mode:
authorGravatar Jan Tojnar <jtojnar@gmail.com> 2022-06-07 18:05:33 +0200
committerGravatar GitHub <noreply@github.com> 2022-06-07 18:05:33 +0200
commitfb501652d5ef8519470fa1faa585b3668ebd2a34 (patch)
treea9603f0c09d6f4b710fbde1c10297330bac87ad1 /lib/FormatAbstract.php
parente85932b1a524f88db6af66d4c3aac3a7983c169b (diff)
downloadrss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.tar.gz
rss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.tar.zst
rss-bridge-fb501652d5ef8519470fa1faa585b3668ebd2a34.zip
Formats: Remove display & related method (#2776)
Format should not be responsible for sending HTTP response.
Diffstat (limited to 'lib/FormatAbstract.php')
-rw-r--r--lib/FormatAbstract.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/FormatAbstract.php b/lib/FormatAbstract.php
index cbc7dc97..5514b0b5 100644
--- a/lib/FormatAbstract.php
+++ b/lib/FormatAbstract.php
@@ -24,9 +24,6 @@ abstract class FormatAbstract implements FormatInterface {
/** MIME type of format output */
const MIME_TYPE = 'text/plain';
- /** @var string|null $contentType The content type */
- protected $contentType = null;
-
/** @var string $charset The charset */
protected $charset;
@@ -66,18 +63,6 @@ abstract class FormatAbstract implements FormatInterface {
}
/**
- * Set the content type
- *
- * @param string $contentType The content type
- * @return self The format object
- */
- protected function setContentType($contentType){
- $this->contentType = $contentType;
-
- return $this;
- }
-
- /**
* Set the last modified time
*
* @param int $lastModified The last modified time
@@ -88,34 +73,6 @@ abstract class FormatAbstract implements FormatInterface {
}
/**
- * Send header with the currently specified content type
- *
- * @throws \LogicException if the content type is not set
- * @throws \LogicException if the content type is not a string
- *
- * @return void
- */
- protected function callContentType(){
- if(empty($this->contentType))
- throw new \LogicException('Content-Type is not set!');
-
- if(!is_string($this->contentType))
- throw new \LogicException('Content-Type must be a string!');
-
- header('Content-Type: ' . $this->contentType);
- }
-
- /** {@inheritdoc} */
- public function display(){
- if ($this->lastModified) {
- header('Last-Modified: ' . gmdate('D, d M Y H:i:s ', $this->lastModified) . 'GMT');
- }
- echo $this->stringify();
-
- return $this;
- }
-
- /**
* {@inheritdoc}
*
* @param array $items {@inheritdoc}