Skip to content

Commit 2eb243a

Browse files
committed
Remove getters from authentication methods
1 parent 30084fb commit 2eb243a

File tree

11 files changed

+18
-127
lines changed

11 files changed

+18
-127
lines changed

spec/Authentication/BasicAuthSpec.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ function it_is_initializable()
1919
$this->shouldHaveType('Http\Message\Authentication\BasicAuth');
2020
}
2121

22-
function it_has_a_username()
23-
{
24-
$this->getUsername()->shouldReturn('john.doe');
25-
}
26-
27-
function it_has_a_password()
28-
{
29-
$this->getPassword()->shouldReturn('secret');
30-
}
31-
3222
function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
3323
{
3424
$request->withHeader('Authorization', 'Basic '.base64_encode('john.doe:secret'))->willReturn($newRequest);

spec/Authentication/BearerSpec.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ function it_is_initializable()
1919
$this->shouldHaveType('Http\Message\Authentication\Bearer');
2020
}
2121

22-
function it_has_a_token()
23-
{
24-
$this->getToken()->shouldReturn('token');
25-
}
26-
2722
function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
2823
{
2924
$request->withHeader('Authorization', 'Bearer token')->willReturn($newRequest);

spec/Authentication/ChainSpec.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ function it_is_initializable()
1515
$this->shouldHaveType('Http\Message\Authentication\Chain');
1616
}
1717

18-
function it_accepts_an_authentication_chain_in_the_constructor(Authentication $auth1, Authentication $auth2)
19-
{
20-
$chain = [$auth1, $auth2];
21-
22-
$this->beConstructedWith($chain);
23-
24-
$this->getAuthenticationChain()->shouldReturn($chain);
25-
}
26-
2718
function it_throws_an_exception_when_non_authentication_is_passed()
2819
{
2920
$this->beConstructedWith(['authentication']);

spec/Authentication/MatchingSpec.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ function it_is_initializable()
2424
$this->shouldHaveType('Http\Message\Authentication\Matching');
2525
}
2626

27-
function it_has_an_authentication(Authentication $authentication)
28-
{
29-
$this->getAuthentication()->shouldReturn($authentication);
30-
}
31-
32-
function it_has_a_matcher()
33-
{
34-
$this->getMatcher()->shouldReturn($this->matcher);
35-
}
36-
3727
function it_authenticates_a_request(Authentication $authentication, RequestInterface $request, RequestInterface $newRequest)
3828
{
3929
$authentication->authenticate($request)->willReturn($newRequest);

spec/Authentication/WsseSpec.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ function it_is_initializable()
2020
$this->shouldHaveType('Http\Message\Authentication\Wsse');
2121
}
2222

23-
function it_has_a_username()
24-
{
25-
$this->getUsername()->shouldReturn('john.doe');
26-
}
27-
28-
function it_has_a_password()
29-
{
30-
$this->getPassword()->shouldReturn('secret');
31-
}
32-
3323
function it_authenticates_a_request(
3424
RequestInterface $request,
3525
RequestInterface $newRequest,

src/Authentication/BasicAuth.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@
1212
*/
1313
final class BasicAuth implements Authentication
1414
{
15-
use UserPasswordPair;
15+
/**
16+
* @var string
17+
*/
18+
private $username;
19+
20+
/**
21+
* @var string
22+
*/
23+
private $password;
1624

1725
/**
1826
* @param string $username

src/Authentication/Bearer.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ public function __construct($token)
2525
$this->token = $token;
2626
}
2727

28-
/**
29-
* Returns the token.
30-
*
31-
* @return string
32-
*/
33-
public function getToken()
34-
{
35-
return $this->token;
36-
}
37-
3828
/**
3929
* {@inheritdoc}
4030
*/

src/Authentication/Chain.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ public function __construct(array $authenticationChain = [])
3333
$this->authenticationChain = $authenticationChain;
3434
}
3535

36-
/**
37-
* Returns the current authentication chain.
38-
*
39-
* @return Authentication[]
40-
*/
41-
public function getAuthenticationChain()
42-
{
43-
return $this->authenticationChain;
44-
}
45-
4636
/**
4737
* {@inheritdoc}
4838
*/

src/Authentication/Matching.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,6 @@ public function __construct(Authentication $authentication, callable $matcher =
3838
$this->matcher = $matcher;
3939
}
4040

41-
/**
42-
* Returns the authentication.
43-
*
44-
* @return string
45-
*/
46-
public function getAuthentication()
47-
{
48-
return $this->authentication;
49-
}
50-
51-
/**
52-
* Returns the matcher.
53-
*
54-
* @return callable
55-
*/
56-
public function getMatcher()
57-
{
58-
return $this->matcher;
59-
}
60-
6141
/**
6242
* {@inheritdoc}
6343
*/

src/Authentication/UserPasswordPair.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Authentication/Wsse.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@
1212
*/
1313
final class Wsse implements Authentication
1414
{
15-
use UserPasswordPair;
15+
/**
16+
* @var string
17+
*/
18+
private $username;
19+
20+
/**
21+
* @var string
22+
*/
23+
private $password;
1624

1725
/**
1826
* @param string $username

0 commit comments

Comments
 (0)