Created
November 26, 2012 16:30
-
-
Save frastel/4149171 to your computer and use it in GitHub Desktop.
Don't pull your dependencies 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace frastel\BlogPlaygroundBundle\Container; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpKernel\Log\LoggerInterface; | |
class DependencyPuller | |
{ | |
private $logger; | |
private $mailer; | |
public function __construct(LoggerInterface $logger, \Swift_Mailer $mailer) | |
{ | |
$this->logger = $logger; | |
$this->mailer = $mailer; | |
} | |
public function doSomething() | |
{ | |
$result = false; | |
// do some fency stuff here | |
$result = true; | |
$this->logger->debug('before sending mail'); | |
$message = \Swift_Message::newInstance() | |
->setSubject('Some subject') | |
->setTo('[email protected]') | |
->setBody('Some body'); | |
$this->mailer->send($message); | |
$this->logger->debug('after sending mail'); | |
return $result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment