Moved login parameter fetching to the service itself
This commit is contained in:
parent
aaf9b24174
commit
eba3ecd63d
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user