From d0a9aeaf80510cdbbf4f4e461798ae9c36ace420 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Apr 2019 08:51:17 +0300 Subject: move readability library to af_readability/vendor out of global vendor directory af_redditimgur: use HOOK_GET_FULL_TEXT instead of invoking readability directly --- .../andreskrey/Readability/Configuration.php | 374 +++++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 plugins/af_readability/vendor/andreskrey/Readability/Configuration.php (limited to 'plugins/af_readability/vendor/andreskrey/Readability/Configuration.php') diff --git a/plugins/af_readability/vendor/andreskrey/Readability/Configuration.php b/plugins/af_readability/vendor/andreskrey/Readability/Configuration.php new file mode 100644 index 000000000..6c17bc757 --- /dev/null +++ b/plugins/af_readability/vendor/andreskrey/Readability/Configuration.php @@ -0,0 +1,374 @@ + $value) { + $setter = sprintf('set%s', $key); + if (method_exists($this, $setter)) { + call_user_func([$this, $setter], $value); + } + } + } + + /** + * Returns an array-representation of configuration. + * + * @return array + */ + public function toArray() + { + $out = []; + foreach ($this as $key => $value) { + $getter = sprintf('get%s', $key); + if (!is_object($value) && method_exists($this, $getter)) { + $out[$key] = call_user_func([$this, $getter]); + } + } + + return $out; + } + + /** + * @return LoggerInterface + */ + public function getLogger() + { + // If no logger has been set, just return a null logger + if ($this->logger === null) { + return new NullLogger(); + } + + return $this->logger; + } + + /** + * @param LoggerInterface $logger + * + * @return Configuration + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + + return $this; + } + + /** + * @return int + */ + public function getMaxTopCandidates() + { + return $this->maxTopCandidates; + } + + /** + * @param int $maxTopCandidates + * + * @return $this + */ + public function setMaxTopCandidates($maxTopCandidates) + { + $this->maxTopCandidates = $maxTopCandidates; + + return $this; + } + + /** + * @return int + */ + public function getCharThreshold() + { + return $this->charThreshold; + } + + /** + * @param int $charThreshold + * + * @return $this + */ + public function setCharThreshold($charThreshold) + { + $this->charThreshold = $charThreshold; + + return $this; + } + + /** + * @deprecated Use getCharThreshold. Will be removed in version 2.0 + * + * @return int + */ + public function getWordThreshold() + { + @trigger_error('getWordThreshold was replaced with getCharThreshold and will be removed in version 3.0', E_USER_DEPRECATED); + + return $this->charThreshold; + } + + /** + * @param int $charThreshold + * + * @return $this + */ + public function setWordThreshold($charThreshold) + { + @trigger_error('setWordThreshold was replaced with setCharThreshold and will be removed in version 3.0', E_USER_DEPRECATED); + + $this->charThreshold = $charThreshold; + + return $this; + } + + /** + * @return bool + */ + public function getArticleByLine() + { + return $this->articleByLine; + } + + /** + * @param bool $articleByLine + * + * @return $this + */ + public function setArticleByLine($articleByLine) + { + $this->articleByLine = $articleByLine; + + return $this; + } + + /** + * @return bool + */ + public function getStripUnlikelyCandidates() + { + return $this->stripUnlikelyCandidates; + } + + /** + * @param bool $stripUnlikelyCandidates + * + * @return $this + */ + public function setStripUnlikelyCandidates($stripUnlikelyCandidates) + { + $this->stripUnlikelyCandidates = $stripUnlikelyCandidates; + + return $this; + } + + /** + * @return bool + */ + public function getCleanConditionally() + { + return $this->cleanConditionally; + } + + /** + * @param bool $cleanConditionally + * + * @return $this + */ + public function setCleanConditionally($cleanConditionally) + { + $this->cleanConditionally = $cleanConditionally; + + return $this; + } + + /** + * @return bool + */ + public function getWeightClasses() + { + return $this->weightClasses; + } + + /** + * @param bool $weightClasses + * + * @return $this + */ + public function setWeightClasses($weightClasses) + { + $this->weightClasses = $weightClasses; + + return $this; + } + + /** + * @return bool + */ + public function getFixRelativeURLs() + { + return $this->fixRelativeURLs; + } + + /** + * @param bool $fixRelativeURLs + * + * @return $this + */ + public function setFixRelativeURLs($fixRelativeURLs) + { + $this->fixRelativeURLs = $fixRelativeURLs; + + return $this; + } + + /** + * @return bool + */ + public function getSubstituteEntities() + { + return $this->substituteEntities; + } + + /** + * @param bool $substituteEntities + * + * @return $this + */ + public function setSubstituteEntities($substituteEntities) + { + $this->substituteEntities = $substituteEntities; + + return $this; + } + + /** + * @return bool + */ + public function getNormalizeEntities() + { + return $this->normalizeEntities; + } + + /** + * @param bool $normalizeEntities + * + * @return $this + */ + public function setNormalizeEntities($normalizeEntities) + { + $this->normalizeEntities = $normalizeEntities; + + return $this; + } + + /** + * @return string + */ + public function getOriginalURL() + { + return $this->originalURL; + } + + /** + * @param string $originalURL + * + * @return $this + */ + public function setOriginalURL($originalURL) + { + $this->originalURL = $originalURL; + + return $this; + } + + /** + * @return bool + */ + public function getSummonCthulhu() + { + return $this->summonCthulhu; + } + + /** + * @param bool $summonCthulhu + * + * @return $this + */ + public function setSummonCthulhu($summonCthulhu) + { + $this->summonCthulhu = $summonCthulhu; + + return $this; + } +} -- cgit v1.2.3