diff --git a/src/InmailAnalyzerResult.php b/src/InmailAnalyzerResult.php new file mode 100644 index 0000000..c7a1f5c --- /dev/null +++ b/src/InmailAnalyzerResult.php @@ -0,0 +1,221 @@ +sender = $sender; + } + + /** + * {@inheritdoc} + */ + public function getSender() { + return $this->sender; + } + + /** + * {@inheritdoc} + */ + public function setUser($user) { + $this->user = $user; + } + + /** + * {@inheritdoc} + */ + public function getUser() { + return $this->user; + } + + /** + * {@inheritdoc} + */ + public function isUserAuthenticated() { + return $this->user ? $this->user->isAuthenticated() : FALSE; + } + + /** + * {@inheritdoc} + */ + public function summarize() { + $summary = []; + if ($this->getSender()) { + $summary['sender'] = $this->getSender(); + } + if ($this->getSubject()) { + $summary['subject'] = $this->getSubject(); + } + + return $summary; + } + + /** + * {@inheritdoc} + */ + public function getBody() { + return $this->body; + } + + /** + * {@inheritdoc} + */ + public function setBody($body) { + $this->body = $body; + } + + /** + * {@inheritdoc} + */ + public function getFooter() { + return $this->footer; + } + + /** + * {@inheritdoc} + */ + public function setFooter($footer) { + $this->footer = $footer; + } + + /** + * @inheritDoc + */ + public function getSubject() { + return $this->subject; + } + + /** + * @inheritDoc + */ + public function setSubject($subject) { + $this->subject = $subject; + } + + /** + * @inheritDoc + */ + public function addContext($name, ContextInterface $context) { + $this->contexts[$name] = $context; + } + + /** + * @inheritDoc + */ + public function getContexts() { + return $this->contexts; + } + + /** + * @inheritDoc + */ + public function hasContext($name) { + $contexts = $this->getContexts(); + return isset($contexts[$name]) ? TRUE : FALSE; + } + + /** + * @inheritDoc + */ + public function getContext($name) { + $contexts = $this->getContexts(); + if (isset($contexts[$name])) { + return $contexts[$name]; + } + return NULL; + } + +} diff --git a/src/InmailAnalyzerResultInterface.php b/src/InmailAnalyzerResultInterface.php new file mode 100644 index 0000000..3bb02e4 --- /dev/null +++ b/src/InmailAnalyzerResultInterface.php @@ -0,0 +1,143 @@ +