summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-26 17:59:53 +0000
committerAndres Rey <[email protected]>2017-11-26 17:59:53 +0000
commit0f2f71da0c3447cf70a15fa5c2c73636e069e015 (patch)
tree89c829d7f433030a6f65027d58ee61e4353a884a
parentef8f655579393229e86c112745c79922a37bc23b (diff)
New Readability class
-rw-r--r--src/Readability.php113
1 files changed, 113 insertions, 0 deletions
diff --git a/src/Readability.php b/src/Readability.php
index e69de29..92d3f2b 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -0,0 +1,113 @@
+<?php
+
+use andreskrey\Readability\Configuration;
+
+/**
+ * Class Readability
+ */
+class Readability
+{
+ /**
+ * @var string|null
+ */
+ protected $title = null;
+ /**
+ * @var string|null
+ */
+ protected $content = null;
+ /**
+ * @var string|null
+ */
+ protected $image = null;
+ /**
+ * @var string|null
+ */
+ protected $author = null;
+ /**
+ * @var Configuration
+ */
+ private $configuration;
+
+ /**
+ * Readability constructor.
+ *
+ * @param Configuration $configuration
+ */
+ public function __construct(Configuration $configuration)
+ {
+ $this->configuration = $configuration;
+ }
+
+ /**
+ * @return null|string
+ */
+ public function __toString()
+ {
+ return $this->getContent();
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getTitle()
+ {
+ return $this->title;
+ }
+
+ /**
+ * @param null $title
+ */
+ protected function setTitle($title)
+ {
+ $this->title = $title;
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getContent()
+ {
+ return $this->content;
+ }
+
+ /**
+ * @param null $content
+ */
+ protected function setContent($content)
+ {
+ $this->content = $content;
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getImage()
+ {
+ return $this->image;
+ }
+
+ /**
+ * @param null $image
+ */
+ protected function setImage($image)
+ {
+ $this->image = $image;
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+
+ /**
+ * @param null $author
+ */
+ protected function setAuthor($author)
+ {
+ $this->author = $author;
+ }
+
+} \ No newline at end of file