diff --git a/spec/Authentication/BasicAuthSpec.php b/spec/Authentication/BasicAuthSpec.php index 79aabaf..55d77a4 100644 --- a/spec/Authentication/BasicAuthSpec.php +++ b/spec/Authentication/BasicAuthSpec.php @@ -19,16 +19,6 @@ function it_is_initializable() $this->shouldHaveType('Http\Message\Authentication\BasicAuth'); } - function it_has_a_username() - { - $this->getUsername()->shouldReturn('john.doe'); - } - - function it_has_a_password() - { - $this->getPassword()->shouldReturn('secret'); - } - function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest) { $request->withHeader('Authorization', 'Basic '.base64_encode('john.doe:secret'))->willReturn($newRequest); diff --git a/spec/Authentication/BearerSpec.php b/spec/Authentication/BearerSpec.php index b053bed..ef1e571 100644 --- a/spec/Authentication/BearerSpec.php +++ b/spec/Authentication/BearerSpec.php @@ -19,11 +19,6 @@ function it_is_initializable() $this->shouldHaveType('Http\Message\Authentication\Bearer'); } - function it_has_a_token() - { - $this->getToken()->shouldReturn('token'); - } - function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest) { $request->withHeader('Authorization', 'Bearer token')->willReturn($newRequest); diff --git a/spec/Authentication/ChainSpec.php b/spec/Authentication/ChainSpec.php index aa12747..9c74a94 100644 --- a/spec/Authentication/ChainSpec.php +++ b/spec/Authentication/ChainSpec.php @@ -15,15 +15,6 @@ function it_is_initializable() $this->shouldHaveType('Http\Message\Authentication\Chain'); } - function it_accepts_an_authentication_chain_in_the_constructor(Authentication $auth1, Authentication $auth2) - { - $chain = [$auth1, $auth2]; - - $this->beConstructedWith($chain); - - $this->getAuthenticationChain()->shouldReturn($chain); - } - function it_throws_an_exception_when_non_authentication_is_passed() { $this->beConstructedWith(['authentication']); diff --git a/spec/Authentication/MatchingSpec.php b/spec/Authentication/MatchingSpec.php index 33306d7..e717b2f 100644 --- a/spec/Authentication/MatchingSpec.php +++ b/spec/Authentication/MatchingSpec.php @@ -24,16 +24,6 @@ function it_is_initializable() $this->shouldHaveType('Http\Message\Authentication\Matching'); } - function it_has_an_authentication(Authentication $authentication) - { - $this->getAuthentication()->shouldReturn($authentication); - } - - function it_has_a_matcher() - { - $this->getMatcher()->shouldReturn($this->matcher); - } - function it_authenticates_a_request(Authentication $authentication, RequestInterface $request, RequestInterface $newRequest) { $authentication->authenticate($request)->willReturn($newRequest); diff --git a/spec/Authentication/WsseSpec.php b/spec/Authentication/WsseSpec.php index 4a68521..049764e 100644 --- a/spec/Authentication/WsseSpec.php +++ b/spec/Authentication/WsseSpec.php @@ -20,16 +20,6 @@ function it_is_initializable() $this->shouldHaveType('Http\Message\Authentication\Wsse'); } - function it_has_a_username() - { - $this->getUsername()->shouldReturn('john.doe'); - } - - function it_has_a_password() - { - $this->getPassword()->shouldReturn('secret'); - } - function it_authenticates_a_request( RequestInterface $request, RequestInterface $newRequest, diff --git a/src/Authentication/BasicAuth.php b/src/Authentication/BasicAuth.php index 2d8d81f..23618a5 100644 --- a/src/Authentication/BasicAuth.php +++ b/src/Authentication/BasicAuth.php @@ -12,7 +12,15 @@ */ final class BasicAuth implements Authentication { - use UserPasswordPair; + /** + * @var string + */ + private $username; + + /** + * @var string + */ + private $password; /** * @param string $username diff --git a/src/Authentication/Bearer.php b/src/Authentication/Bearer.php index acd052a..a8fb21a 100644 --- a/src/Authentication/Bearer.php +++ b/src/Authentication/Bearer.php @@ -25,16 +25,6 @@ public function __construct($token) $this->token = $token; } - /** - * Returns the token. - * - * @return string - */ - public function getToken() - { - return $this->token; - } - /** * {@inheritdoc} */ diff --git a/src/Authentication/Chain.php b/src/Authentication/Chain.php index eeb0745..71002bb 100644 --- a/src/Authentication/Chain.php +++ b/src/Authentication/Chain.php @@ -33,16 +33,6 @@ public function __construct(array $authenticationChain = []) $this->authenticationChain = $authenticationChain; } - /** - * Returns the current authentication chain. - * - * @return Authentication[] - */ - public function getAuthenticationChain() - { - return $this->authenticationChain; - } - /** * {@inheritdoc} */ diff --git a/src/Authentication/Matching.php b/src/Authentication/Matching.php index ff9bb9b..4cca37f 100644 --- a/src/Authentication/Matching.php +++ b/src/Authentication/Matching.php @@ -38,26 +38,6 @@ public function __construct(Authentication $authentication, callable $matcher = $this->matcher = $matcher; } - /** - * Returns the authentication. - * - * @return string - */ - public function getAuthentication() - { - return $this->authentication; - } - - /** - * Returns the matcher. - * - * @return callable - */ - public function getMatcher() - { - return $this->matcher; - } - /** * {@inheritdoc} */ diff --git a/src/Authentication/UserPasswordPair.php b/src/Authentication/UserPasswordPair.php deleted file mode 100644 index 77113c2..0000000 --- a/src/Authentication/UserPasswordPair.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -trait UserPasswordPair -{ - /** - * @var string - */ - private $username; - - /** - * @var string - */ - private $password; - - /** - * Returns the username. - * - * @return string - */ - public function getUsername() - { - return $this->username; - } - - /** - * Returns the password. - * - * @return string - */ - public function getPassword() - { - return $this->password; - } -} diff --git a/src/Authentication/Wsse.php b/src/Authentication/Wsse.php index d371b6e..fbbde33 100644 --- a/src/Authentication/Wsse.php +++ b/src/Authentication/Wsse.php @@ -12,7 +12,15 @@ */ final class Wsse implements Authentication { - use UserPasswordPair; + /** + * @var string + */ + private $username; + + /** + * @var string + */ + private $password; /** * @param string $username