Skip to content

Commit 9f7f2e9

Browse files
committed
cs fixer update
1 parent 1b3063e commit 9f7f2e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+398
-408
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ jobs:
3131
uses: actions/checkout@v3
3232

3333
- name: PHP-CS-Fixer
34-
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
34+
uses: docker://oskarstark/php-cs-fixer-ga
3535
with:
3636
args: --dry-run --diff-format udiff

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.php_cs
2-
.php_cs.cache
1+
.php-cs-fixer.php
2+
.php-cs-fixer.cache
33
/build/
44
/composer.lock
55
/phpspec.yml

.php-cs-fixer.dist.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/spec')
6+
->name('*.php')
7+
;
8+
9+
$config = new PhpCsFixer\Config();
10+
11+
return $config
12+
->setRiskyAllowed(true)
13+
->setRules([
14+
'@Symfony' => true,
15+
'single_line_throw' => false,
16+
])
17+
->setFinder($finder)
18+
;

.php_cs.dist

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

spec/Authentication/AutoBasicAuthSpec.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
namespace spec\Http\Message\Authentication;
44

55
use PhpSpec\ObjectBehavior;
6-
use Prophecy\Argument;
76
use Psr\Http\Message\RequestInterface;
87
use Psr\Http\Message\UriInterface;
98

109
class AutoBasicAuthSpec extends ObjectBehavior
1110
{
12-
function it_is_initializable()
11+
public function it_is_initializable()
1312
{
1413
$this->shouldHaveType('Http\Message\Authentication\AutoBasicAuth');
1514
}
1615

17-
function it_is_an_authentication()
16+
public function it_is_an_authentication()
1817
{
1918
$this->shouldImplement('Http\Message\Authentication');
2019
}
2120

22-
function it_authenticates_a_request(
21+
public function it_authenticates_a_request(
2322
RequestInterface $request,
2423
UriInterface $uri,
2524
UriInterface $uriWithoutUserInfo,
@@ -38,7 +37,7 @@ function it_authenticates_a_request(
3837
$this->authenticate($request)->shouldReturn($authenticatedRequest);
3938
}
4039

41-
function it_authenticates_a_request_without_password(
40+
public function it_authenticates_a_request_without_password(
4241
RequestInterface $request,
4342
UriInterface $uri,
4443
UriInterface $uriWithoutUserInfo,
@@ -57,15 +56,15 @@ function it_authenticates_a_request_without_password(
5756
$this->authenticate($request)->shouldReturn($authenticatedRequest);
5857
}
5958

60-
function it_does_not_authenticate_a_request(RequestInterface $request, UriInterface $uri)
59+
public function it_does_not_authenticate_a_request(RequestInterface $request, UriInterface $uri)
6160
{
6261
$request->getUri()->willReturn($uri);
6362
$uri->getUserInfo()->willReturn('');
6463

6564
$this->authenticate($request)->shouldReturn($request);
6665
}
6766

68-
function it_authenticates_a_request_without_user_info_removal(
67+
public function it_authenticates_a_request_without_user_info_removal(
6968
RequestInterface $request,
7069
UriInterface $uri,
7170
RequestInterface $authenticatedRequest

spec/Authentication/BasicAuthSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
namespace spec\Http\Message\Authentication;
44

5-
use Psr\Http\Message\RequestInterface;
65
use PhpSpec\ObjectBehavior;
6+
use Psr\Http\Message\RequestInterface;
77

88
class BasicAuthSpec extends ObjectBehavior
99
{
10-
function let()
10+
public function let()
1111
{
1212
$this->beConstructedWith('john.doe', 'secret');
1313
}
1414

15-
function it_is_initializable()
15+
public function it_is_initializable()
1616
{
1717
$this->shouldHaveType('Http\Message\Authentication\BasicAuth');
1818
}
1919

20-
function it_is_an_authentication()
20+
public function it_is_an_authentication()
2121
{
2222
$this->shouldImplement('Http\Message\Authentication');
2323
}
2424

25-
function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
25+
public function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
2626
{
2727
$request->withHeader('Authorization', 'Basic '.base64_encode('john.doe:secret'))->willReturn($newRequest);
2828

spec/Authentication/BearerSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
namespace spec\Http\Message\Authentication;
44

5-
use Psr\Http\Message\RequestInterface;
65
use PhpSpec\ObjectBehavior;
6+
use Psr\Http\Message\RequestInterface;
77

88
class BearerSpec extends ObjectBehavior
99
{
10-
function let()
10+
public function let()
1111
{
1212
$this->beConstructedWith('token');
1313
}
1414

15-
function it_is_initializable()
15+
public function it_is_initializable()
1616
{
1717
$this->shouldHaveType('Http\Message\Authentication\Bearer');
1818
}
1919

20-
function it_is_an_authentication()
20+
public function it_is_an_authentication()
2121
{
2222
$this->shouldImplement('Http\Message\Authentication');
2323
}
2424

25-
function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
25+
public function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
2626
{
2727
$request->withHeader('Authorization', 'Bearer token')->willReturn($newRequest);
2828

spec/Authentication/ChainSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
namespace spec\Http\Message\Authentication;
44

55
use Http\Message\Authentication;
6-
use Psr\Http\Message\RequestInterface;
76
use PhpSpec\ObjectBehavior;
7+
use Psr\Http\Message\RequestInterface;
88

99
class ChainSpec extends ObjectBehavior
1010
{
11-
function it_is_initializable()
11+
public function it_is_initializable()
1212
{
1313
$this->shouldHaveType('Http\Message\Authentication\Chain');
1414
}
1515

16-
function it_is_an_authentication()
16+
public function it_is_an_authentication()
1717
{
1818
$this->shouldImplement('Http\Message\Authentication');
1919
}
2020

21-
function it_throws_an_exception_when_non_authentication_is_passed()
21+
public function it_throws_an_exception_when_non_authentication_is_passed()
2222
{
2323
$this->beConstructedWith(['authentication']);
2424

2525
$this->shouldThrow('InvalidArgumentException')->duringInstantiation();
2626
}
2727

28-
function it_authenticates_a_request(
28+
public function it_authenticates_a_request(
2929
Authentication $auth1,
3030
Authentication $auth2,
3131
RequestInterface $originalRequest,

spec/Authentication/HeaderSpec.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77

88
class HeaderSpec extends ObjectBehavior
99
{
10-
function let()
10+
public function let()
1111
{
1212
$this->beConstructedWith('X-AUTH-TOKEN', 'REAL');
1313
}
1414

15-
function it_is_initializable()
15+
public function it_is_initializable()
1616
{
1717
$this->shouldHaveType('Http\Message\Authentication\Header');
1818
}
1919

20-
function it_is_an_authentication()
20+
public function it_is_an_authentication()
2121
{
2222
$this->shouldImplement('Http\Message\Authentication');
2323
}
2424

25-
function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
25+
public function it_authenticates_a_request(RequestInterface $request, RequestInterface $newRequest)
2626
{
2727
$request->withHeader('X-AUTH-TOKEN', 'REAL')->willReturn($newRequest);
2828

spec/Authentication/MatchingSpec.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@
33
namespace spec\Http\Message\Authentication;
44

55
use Http\Message\Authentication;
6-
use Psr\Http\Message\RequestInterface;
76
use PhpSpec\ObjectBehavior;
7+
use Psr\Http\Message\RequestInterface;
88

99
class MatchingSpec extends ObjectBehavior
1010
{
11-
function let(Authentication $authentication)
11+
public function let(Authentication $authentication)
1212
{
13-
$matcher = function($request) { return true; };
13+
$matcher = function ($request) { return true; };
1414

1515
$this->beConstructedWith($authentication, $matcher);
1616
}
1717

18-
function it_is_initializable()
18+
public function it_is_initializable()
1919
{
2020
$this->shouldHaveType('Http\Message\Authentication\Matching');
2121
}
2222

23-
function it_is_an_authentication()
23+
public function it_is_an_authentication()
2424
{
2525
$this->shouldImplement('Http\Message\Authentication');
2626
}
2727

28-
function it_authenticates_a_request(Authentication $authentication, RequestInterface $request, RequestInterface $newRequest)
28+
public function it_authenticates_a_request(Authentication $authentication, RequestInterface $request, RequestInterface $newRequest)
2929
{
3030
$authentication->authenticate($request)->willReturn($newRequest);
3131

3232
$this->authenticate($request)->shouldReturn($newRequest);
3333
}
3434

35-
function it_does_not_authenticate_a_request(Authentication $authentication, RequestInterface $request)
35+
public function it_does_not_authenticate_a_request(Authentication $authentication, RequestInterface $request)
3636
{
37-
$matcher = function($request) { return false; };
37+
$matcher = function ($request) { return false; };
3838

3939
$this->beConstructedWith($authentication, $matcher);
4040

@@ -43,7 +43,7 @@ function it_does_not_authenticate_a_request(Authentication $authentication, Requ
4343
$this->authenticate($request)->shouldReturn($request);
4444
}
4545

46-
function it_creates_a_matcher_from_url(Authentication $authentication)
46+
public function it_creates_a_matcher_from_url(Authentication $authentication)
4747
{
4848
$this->createUrlMatcher($authentication, 'url')->shouldHaveType('Http\Message\Authentication\Matching');
4949
}

spec/Authentication/QueryParamSpec.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
namespace spec\Http\Message\Authentication;
44

5+
use PhpSpec\ObjectBehavior;
56
use Psr\Http\Message\RequestInterface;
67
use Psr\Http\Message\UriInterface;
7-
use PhpSpec\ObjectBehavior;
88

99
class QueryParamSpec extends ObjectBehavior
1010
{
11-
function let()
11+
public function let()
1212
{
1313
$this->beConstructedWith([
1414
'username' => 'username',
1515
'password' => 'password',
1616
]);
1717
}
1818

19-
function it_is_initializable()
19+
public function it_is_initializable()
2020
{
2121
$this->shouldHaveType('Http\Message\Authentication\QueryParam');
2222
}
2323

24-
function it_is_an_authentication()
24+
public function it_is_an_authentication()
2525
{
2626
$this->shouldImplement('Http\Message\Authentication');
2727
}
2828

29-
function it_authenticates_a_request(
29+
public function it_authenticates_a_request(
3030
RequestInterface $request,
3131
UriInterface $uri,
3232
RequestInterface $newRequest,

spec/Authentication/RequestConditionalSpec.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55
use Http\Message\Authentication;
66
use Http\Message\RequestMatcher;
7-
use Psr\Http\Message\RequestInterface;
87
use PhpSpec\ObjectBehavior;
8+
use Psr\Http\Message\RequestInterface;
99

1010
class RequestConditionalSpec extends ObjectBehavior
1111
{
12-
function let(RequestMatcher $requestMatcher, Authentication $authentication)
12+
public function let(RequestMatcher $requestMatcher, Authentication $authentication)
1313
{
1414
$this->beConstructedWith($requestMatcher, $authentication);
1515
}
1616

17-
function it_is_initializable()
17+
public function it_is_initializable()
1818
{
1919
$this->shouldHaveType('Http\Message\Authentication\RequestConditional');
2020
}
2121

22-
function it_is_an_authentication()
22+
public function it_is_an_authentication()
2323
{
2424
$this->shouldImplement('Http\Message\Authentication');
2525
}
2626

27-
function it_authenticates_a_request(
27+
public function it_authenticates_a_request(
2828
Authentication $authentication,
2929
RequestMatcher $requestMatcher,
3030
RequestInterface $request,
@@ -36,7 +36,7 @@ function it_authenticates_a_request(
3636
$this->authenticate($request)->shouldReturn($newRequest);
3737
}
3838

39-
function it_does_not_authenticate_a_request(
39+
public function it_does_not_authenticate_a_request(
4040
Authentication $authentication,
4141
RequestMatcher $requestMatcher,
4242
RequestInterface $request

0 commit comments

Comments
 (0)