Moved login parameter fetching to the service itself

This commit is contained in:
Gergely POLONKAI 2012-11-04 15:14:27 +01:00
parent aaf9b24174
commit eba3ecd63d
2 changed files with 3 additions and 6 deletions

View File

@ -20,10 +20,7 @@ class SendCommand extends ContainerAwareCommand
$container = $this->getContainer(); $container = $this->getContainer();
$sender = $container->get('gergelypolonkai_smssender.sender'); $sender = $container->get('gergelypolonkai_smssender.sender');
$sender->login( $sender->login();
$container->getParameter('username'),
$container->getParameter('password')
);
$sender->sendMessage($input->getArgument('recipient'), $input->getArgument('message'), array()); $sender->sendMessage($input->getArgument('recipient'), $input->getArgument('message'), array());
$sender->logout(); $sender->logout();
} }

View File

@ -34,9 +34,9 @@ class Sender
); );
} }
public function login($username, $password) public function login()
{ {
if ($this->sender->login($username, $password) === true) { if ($this->sender->login($this->container->getParameter('username'), $this->container->getParameter('password')) === true) {
$this->loggedIn = true; $this->loggedIn = true;
} }
} }