Skip to content

Cleanup build #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Checks
on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
Expand All @@ -13,18 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Composer normalize
uses: docker://ergebnis/composer-normalize-action

roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
13 changes: 5 additions & 8 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Static analysis
on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
Expand All @@ -13,10 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install legacy zend diactoros as we reference that as well
run: composer require "zendframework/zend-diactoros:2.2.1" --no-interaction --no-update
uses: actions/checkout@v3

- name: PHPStan
uses: docker://oskarstark/phpstan-ga
Expand All @@ -31,9 +28,9 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --dry-run --diff-format udiff
args: --dry-run --diff
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: CI
name: tests

on:
push:
branches:
- '*.x'
pull_request:

jobs:
Expand All @@ -10,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -23,12 +25,6 @@ jobs:
tools: composer
coverage: none

- name: Require PHPSpec 7.1 dependencies
run: |
composer require "phpspec/phpspec:^7.1@dev" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress --ignore-platform-req=php
if: "matrix.php == '8.1'"

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

Expand All @@ -44,7 +40,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -67,7 +63,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.php_cs
.php_cs.cache
.php-cs-fixer.php
.php-cs-fixer.cache
/build/
/composer.lock
/phpspec.yml
Expand Down
18 changes: 18 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/spec')
->name('*.php')
;

$config = new PhpCsFixer\Config();

return $config
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'single_line_throw' => false,
])
->setFinder($finder)
;
17 changes: 0 additions & 17 deletions .php_cs.dist

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![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)
[![tests](https://github.com/php-http/message/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/message/actions/workflows/ci.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message)

**HTTP Message related tools.**
Expand Down
5 changes: 0 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@
"ergebnis/composer-normalize": true
}
},
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"autoload": {
"psr-4": {
"Http\\Message\\": "src/"
Expand Down
20 changes: 5 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ parameters:
count: 1
path: src/CookieJar.php

-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:findMatchingCookies\\(\\) should return array\\<Http\\\\Message\\\\Cookie\\> but returns array\\<int, object\\>\\.$#"
count: 1
path: src/CookieJar.php

-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:setCookies\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -115,11 +110,6 @@ parameters:
count: 1
path: src/CookieJar.php

-
message: "#^Method Http\\\\Message\\\\CookieJar\\:\\:getIterator\\(\\) return type has no value type specified in iterable type Traversable\\<mixed, mixed\\>\\.$#"
count: 1
path: src/CookieJar.php

-
message: "#^Property Http\\\\Message\\\\CookieUtil\\:\\:\\$dateFormats type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -130,11 +120,6 @@ parameters:
count: 1
path: src/Encoding/ChunkStream.php

-
message: "#^Access to an undefined property object\\:\\:\\$datalen\\.$#"
count: 2
path: src/Encoding/Filter/Chunk.php

-
message: "#^Method Http\\\\Message\\\\Encoding\\\\FilteredStream\\:\\:fill\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -264,3 +249,8 @@ parameters:
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: src/UriFactory/SlimUriFactory.php

-
message: "#^Call to function array_key_exists\\(\\) with 'chunk' and array<int, string> will always evaluate to false\\.$#"
count: 1
path: src/filters.php
5 changes: 5 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ parameters:
level: max
paths:
- src
excludePaths:
analyse:
- %currentWorkingDirectory%/src/MessageFactory/*
- %currentWorkingDirectory%/src/StreamFactory/*
- %currentWorkingDirectory%/src/UriFactory/*
13 changes: 6 additions & 7 deletions spec/Authentication/AutoBasicAuthSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
namespace spec\Http\Message\Authentication;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\UriInterface;

class AutoBasicAuthSpec extends ObjectBehavior
{
function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('Http\Message\Authentication\AutoBasicAuth');
}

function it_is_an_authentication()
public function it_is_an_authentication()
{
$this->shouldImplement('Http\Message\Authentication');
}

function it_authenticates_a_request(
public function it_authenticates_a_request(
RequestInterface $request,
UriInterface $uri,
UriInterface $uriWithoutUserInfo,
Expand All @@ -38,7 +37,7 @@ function it_authenticates_a_request(
$this->authenticate($request)->shouldReturn($authenticatedRequest);
}

function it_authenticates_a_request_without_password(
public function it_authenticates_a_request_without_password(
RequestInterface $request,
UriInterface $uri,
UriInterface $uriWithoutUserInfo,
Expand All @@ -57,15 +56,15 @@ function it_authenticates_a_request_without_password(
$this->authenticate($request)->shouldReturn($authenticatedRequest);
}

function it_does_not_authenticate_a_request(RequestInterface $request, UriInterface $uri)
public function it_does_not_authenticate_a_request(RequestInterface $request, UriInterface $uri)
{
$request->getUri()->willReturn($uri);
$uri->getUserInfo()->willReturn('');

$this->authenticate($request)->shouldReturn($request);
}

function it_authenticates_a_request_without_user_info_removal(
public function it_authenticates_a_request_without_user_info_removal(
RequestInterface $request,
UriInterface $uri,
RequestInterface $authenticatedRequest
Expand Down
10 changes: 5 additions & 5 deletions spec/Authentication/BasicAuthSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

namespace spec\Http\Message\Authentication;

use Psr\Http\Message\RequestInterface;
use PhpSpec\ObjectBehavior;
use Psr\Http\Message\RequestInterface;

class BasicAuthSpec extends ObjectBehavior
{
function let()
public function let()
{
$this->beConstructedWith('john.doe', 'secret');
}

function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('Http\Message\Authentication\BasicAuth');
}

function it_is_an_authentication()
public function it_is_an_authentication()
{
$this->shouldImplement('Http\Message\Authentication');
}

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

Expand Down
10 changes: 5 additions & 5 deletions spec/Authentication/BearerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

namespace spec\Http\Message\Authentication;

use Psr\Http\Message\RequestInterface;
use PhpSpec\ObjectBehavior;
use Psr\Http\Message\RequestInterface;

class BearerSpec extends ObjectBehavior
{
function let()
public function let()
{
$this->beConstructedWith('token');
}

function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('Http\Message\Authentication\Bearer');
}

function it_is_an_authentication()
public function it_is_an_authentication()
{
$this->shouldImplement('Http\Message\Authentication');
}

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

Expand Down
10 changes: 5 additions & 5 deletions spec/Authentication/ChainSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
namespace spec\Http\Message\Authentication;

use Http\Message\Authentication;
use Psr\Http\Message\RequestInterface;
use PhpSpec\ObjectBehavior;
use Psr\Http\Message\RequestInterface;

class ChainSpec extends ObjectBehavior
{
function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('Http\Message\Authentication\Chain');
}

function it_is_an_authentication()
public function it_is_an_authentication()
{
$this->shouldImplement('Http\Message\Authentication');
}

function it_throws_an_exception_when_non_authentication_is_passed()
public function it_throws_an_exception_when_non_authentication_is_passed()
{
$this->beConstructedWith(['authentication']);

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

function it_authenticates_a_request(
public function it_authenticates_a_request(
Authentication $auth1,
Authentication $auth2,
RequestInterface $originalRequest,
Expand Down
Loading