Skip to content

adjust to new cs rules #225

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 3 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
2 changes: 2 additions & 0 deletions .github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.yml]
indent_size = 2
6 changes: 3 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: static
on:
push:
branches:
- master
- '*.x'
pull_request:

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

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

- name: PHPStan
uses: OskarStark/[email protected]
Expand All @@ -28,7 +28,7 @@ jobs:

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

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: tests
on:
push:
branches:
- master
- '*.x'
pull_request:

jobs:
Expand All @@ -12,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 @@ -42,11 +42,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']
php: ['7.1', '7.4', '8.2']

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -68,16 +68,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
symfony: ['4', '5', '6']
include:
- symfony: '4'
php-version: '7.1'
- symfony: '5'
php-version: '7.4'
- symfony: '6'
php-version: '8.2'

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.1
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none

Expand All @@ -101,7 +107,7 @@ jobs:

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
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/client-common.svg?style=flat-square)](https://github.com/php-http/client-common/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/travis/php-http/client-common/master.svg?style=flat-square)](https://travis-ci.org/php-http/client-common)
[![Build Status](https://github.com/php-http/client-common/actions/workflows/tests.yml/badge.svg)](https://github.com/php-http/client-common/actions/workflows/tests.yml)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common)
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/client-common.svg?style=flat-square)](https://packagist.org/packages/php-http/client-common)
Expand Down
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"nyholm/psr7": "^1.2",
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
"phpspec/prophecy": "^1.10.2",
"phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3"
"phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7"
},
"suggest": {
"ext-json": "To detect JSON responses with the ContentTypePlugin",
Expand Down Expand Up @@ -58,10 +58,5 @@
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
}
}
4 changes: 1 addition & 3 deletions src/PluginChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Http\Client\Common;

use function array_reverse;

use Http\Client\Common\Exception\LoopException;
use Http\Promise\Promise;
use Psr\Http\Message\RequestInterface;
Expand Down Expand Up @@ -39,7 +37,7 @@ public function __construct(array $plugins, callable $clientCallable, array $opt
private function createChain(): callable
{
$lastCallable = $this->clientCallable;
$reversedPlugins = array_reverse($this->plugins);
$reversedPlugins = \array_reverse($this->plugins);

foreach ($reversedPlugins as $plugin) {
$lastCallable = function (RequestInterface $request) use ($plugin, $lastCallable) {
Expand Down
5 changes: 2 additions & 3 deletions tests/PluginClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace tests\Http\Client\Common;

use Closure;
use Http\Client\Common\Plugin;
use Http\Client\Common\PluginClient;
use Http\Client\Common\PluginClientBuilder;
Expand Down Expand Up @@ -32,7 +31,7 @@ public function testPriority(string $client): void
$client = $this->prophesize($client)->reveal();
$client = $builder->createClient($client);

$closure = Closure::bind(
$closure = \Closure::bind(
function (): array {
return $this->plugins;
},
Expand All @@ -58,7 +57,7 @@ public function testOptions(string $client): void
$client = $this->prophesize($client)->reveal();
$client = $builder->createClient($client);

$closure = Closure::bind(
$closure = \Closure::bind(
function (): array {
return $this->options;
},
Expand Down