Skip to content

Commit e542e6e

Browse files
authored
Merge pull request #151 from php-http/cleanup-build
Cleanup build
2 parents 7886e64 + 9682dad commit e542e6e

File tree

62 files changed

+423
-461
lines changed

Some content is hidden

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

62 files changed

+423
-461
lines changed

.github/workflows/checks.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Checks
33
on:
44
push:
55
branches:
6-
- master
6+
- '*.x'
77
pull_request:
88

99
jobs:
@@ -13,18 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Composer normalize
1919
uses: docker://ergebnis/composer-normalize-action
20-
21-
roave-bc-check:
22-
name: Roave BC Check
23-
runs-on: ubuntu-latest
24-
25-
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@v2
28-
29-
- name: Roave BC Check
30-
uses: docker://nyholm/roave-bc-check-ga

.github/workflows/static.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Static analysis
33
on:
44
push:
55
branches:
6-
- master
6+
- '*.x'
77
pull_request:
88

99
jobs:
@@ -13,10 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v2
17-
18-
- name: Install legacy zend diactoros as we reference that as well
19-
run: composer require "zendframework/zend-diactoros:2.2.1" --no-interaction --no-update
16+
uses: actions/checkout@v3
2017

2118
- name: PHPStan
2219
uses: docker://oskarstark/phpstan-ga
@@ -31,9 +28,9 @@ jobs:
3128

3229
steps:
3330
- name: Checkout code
34-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3532

3633
- name: PHP-CS-Fixer
37-
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
34+
uses: docker://oskarstark/php-cs-fixer-ga
3835
with:
39-
args: --dry-run --diff-format udiff
36+
args: --dry-run --diff

.github/workflows/ci.yml renamed to .github/workflows/tests.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
name: CI
1+
name: tests
22

33
on:
44
push:
5+
branches:
6+
- '*.x'
57
pull_request:
68

79
jobs:
@@ -10,11 +12,11 @@ jobs:
1012
runs-on: ubuntu-latest
1113
strategy:
1214
matrix:
13-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
15+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
1416

1517
steps:
1618
- name: Checkout code
17-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
1820

1921
- name: Setup PHP
2022
uses: shivammathur/setup-php@v2
@@ -23,12 +25,6 @@ jobs:
2325
tools: composer
2426
coverage: none
2527

26-
- name: Require PHPSpec 7.1 dependencies
27-
run: |
28-
composer require "phpspec/phpspec:^7.1@dev" --no-interaction --no-update
29-
composer update --prefer-dist --no-interaction --no-progress --ignore-platform-req=php
30-
if: "matrix.php == '8.1'"
31-
3228
- name: Install dependencies
3329
run: composer update --prefer-dist --no-interaction --no-progress
3430

@@ -44,7 +40,7 @@ jobs:
4440

4541
steps:
4642
- name: Checkout code
47-
uses: actions/checkout@v2
43+
uses: actions/checkout@v3
4844

4945
- name: Setup PHP
5046
uses: shivammathur/setup-php@v2
@@ -67,7 +63,7 @@ jobs:
6763

6864
steps:
6965
- name: Checkout code
70-
uses: actions/checkout@v2
66+
uses: actions/checkout@v3
7167

7268
- name: Setup PHP
7369
uses: shivammathur/setup-php@v2

.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.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
5-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)](https://github.com/php-http/message/actions?query=workflow%3ACI+branch%3Amaster)
5+
[![tests](https://github.com/php-http/message/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/message/actions/workflows/ci.yml)
66
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message)
77

88
**HTTP Message related tools.**

composer.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
"ergebnis/composer-normalize": true
4444
}
4545
},
46-
"extra": {
47-
"branch-alias": {
48-
"dev-master": "1.10-dev"
49-
}
50-
},
5146
"autoload": {
5247
"psr-4": {
5348
"Http\\Message\\": "src/"

phpstan-baseline.neon

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ parameters:
8080
count: 1
8181
path: src/CookieJar.php
8282

83-
-
84-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:findMatchingCookies\\(\\) should return array\\<Http\\\\Message\\\\Cookie\\> but returns array\\<int, object\\>\\.$#"
85-
count: 1
86-
path: src/CookieJar.php
87-
8883
-
8984
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:setCookies\\(\\) has no return type specified\\.$#"
9085
count: 1
@@ -115,11 +110,6 @@ parameters:
115110
count: 1
116111
path: src/CookieJar.php
117112

118-
-
119-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:getIterator\\(\\) return type has no value type specified in iterable type Traversable\\<mixed, mixed\\>\\.$#"
120-
count: 1
121-
path: src/CookieJar.php
122-
123113
-
124114
message: "#^Property Http\\\\Message\\\\CookieUtil\\:\\:\\$dateFormats type has no value type specified in iterable type array\\.$#"
125115
count: 1
@@ -130,11 +120,6 @@ parameters:
130120
count: 1
131121
path: src/Encoding/ChunkStream.php
132122

133-
-
134-
message: "#^Access to an undefined property object\\:\\:\\$datalen\\.$#"
135-
count: 2
136-
path: src/Encoding/Filter/Chunk.php
137-
138123
-
139124
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:fill\\(\\) has no return type specified\\.$#"
140125
count: 1
@@ -264,3 +249,8 @@ parameters:
264249
message: "#^Unreachable statement \\- code above always terminates\\.$#"
265250
count: 1
266251
path: src/UriFactory/SlimUriFactory.php
252+
253+
-
254+
message: "#^Call to function array_key_exists\\(\\) with 'chunk' and array<int, string> will always evaluate to false\\.$#"
255+
count: 1
256+
path: src/filters.php

phpstan.neon.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ parameters:
55
level: max
66
paths:
77
- src
8+
excludePaths:
9+
analyse:
10+
- %currentWorkingDirectory%/src/MessageFactory/*
11+
- %currentWorkingDirectory%/src/StreamFactory/*
12+
- %currentWorkingDirectory%/src/UriFactory/*

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,

0 commit comments

Comments
 (0)