diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-07-10 13:03:11 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2017-07-10 16:28:52 +0300 |
commit | cd5837d5a8e24cc10f493c7526743fd11d5bf86f (patch) | |
tree | 7e1aad84f39fe8ce41f588d263223fe33550f5a7 /lib/AppInfo | |
parent | 480fc19f01d398fb1a9928d00af51c46692e0c3f (diff) |
Refactor message transmission code
* Move sending logic from controller into its own serivce
* Create service contract/interface to decouple HTTP controller from service implementation
* Decompose logic into multiple small, readable methods
* Wrap data in immutable data classes/objects to prevent long parameter lists and easy testing
* Add basic unit tests that cover the main code paths
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/AppInfo')
-rw-r--r-- | lib/AppInfo/Application.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 7d55dcac2..8e2b06229 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -23,7 +23,9 @@ namespace OCA\Mail\AppInfo; use OCA\Mail\Contracts\IMailManager; +use OCA\Mail\Contracts\IMailTransmission; use OCA\Mail\Service\MailManager; +use OCA\Mail\Service\MailTransmission; use OCP\AppFramework\App; use OCP\Util; @@ -42,6 +44,7 @@ class Application extends App { $testSmtp = $transport === 'smtp'; $container->registerAlias(IMailManager::class, MailManager::class); + $container->registerAlias(IMailTransmission::class, MailTransmission::class); $container->registerService('OCP\ISession', function ($c) { return $c->getServer()->getSession(); }); |