Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4bf30e8
#23287 feat(*): update php version to 8.4 and config rector.php
tmArtemeon Jan 20, 2025
a0da7d9
#23287 feat(*): run rector
tmArtemeon Jan 20, 2025
f538328
style: Code Style
marcreichel Jan 24, 2025
55c64be
style: Code style
marcreichel Jan 24, 2025
4ddda60
fix: PHPStan
marcreichel Jan 24, 2025
d89846c
style: Code Style
marcreichel Jan 24, 2025
fdcdd64
fix: Tests
marcreichel Jan 24, 2025
bf0b6e9
#23287
tmArtemeon Jan 24, 2025
dc9fb10
#23284 feat(*): add github worklow and checks
tmArtemeon Jan 24, 2025
40df4f8
#23287 Revert "#23284 feat(*): add github worklow and checks"
tmArtemeon Jan 24, 2025
fae9c60
#23284 feat(*): revert github worklow and checks
tmArtemeon Jan 24, 2025
1fc6b54
#23284 feat(*): fix tests with rector
tmArtemeon Jan 24, 2025
de7e4bf
#23284 feat(*): fix tests
tmArtemeon Jan 24, 2025
7a234ee
#23284 feat(*): fix tests
tmArtemeon Jan 24, 2025
89648cb
#23284 feat(*): activate all tests
tmArtemeon Jan 24, 2025
87d3ab8
#23284 feat(*): convert tests from mock/php-mock-prophecy to mockery/…
tmArtemeon Jan 24, 2025
b68d12b
#23284 feat(*): run pint
tmArtemeon Jan 24, 2025
09a98fc
#23284 feat(*): update psr7-integration-tests 1.1 to 1.4
tmArtemeon Jan 27, 2025
2a0376a
#23284 feat(*): remove phpspec/prophecy-phpunit and use Mockery instead
tmArtemeon Jan 28, 2025
2fc4b6b
#23284 feat(*): fix unit Tests
tmArtemeon Jan 28, 2025
e8d898c
style: Fix code style
marcreichel Jan 28, 2025
ce10344
chore: Switch to Pest
marcreichel Jan 28, 2025
46851df
test: Code Coverage
marcreichel Jan 28, 2025
6a2f4cc
chore: Remove squizlabs/php_codesniffer
marcreichel Jan 28, 2025
6c7d6f3
#23284 feat(*): move tests from psr7-integration-tests and upgrade pe…
tmArtemeon Jan 29, 2025
54fc791
style: Code Style fixes
marcreichel Jan 29, 2025
6d8b356
chore: Decrease test:coverage minimum threshold
marcreichel Jan 29, 2025
f84eced
chore: Type Coverage
marcreichel Jan 29, 2025
dd0f934
chore: Disable PHPStan for tests directory
marcreichel Jan 29, 2025
a25591e
chore: PHPStan Level 2
marcreichel Jan 29, 2025
f4b4f04
chore: PHPStan Level 3
marcreichel Jan 29, 2025
5dd7782
chore: PHPStan Level 4
marcreichel Jan 29, 2025
f6b9b29
chore: PHPStan Level 5
marcreichel Jan 29, 2025
f93ed8c
fix: Tests
marcreichel Jan 29, 2025
71386cf
style: Code Style fixes
marcreichel Jan 29, 2025
126023b
chore: Clean up
marcreichel Jan 29, 2025
f29bc83
#23284 feat(*): mock incomplete tests
tmArtemeon Jan 29, 2025
843348c
#23284 feat(*): mock incomplete tests
tmArtemeon Jan 29, 2025
16c4cbd
style: Disable not_operator_with_successor_space rule
marcreichel Jan 31, 2025
e703bcd
style: Remove curly braces around @inheritDoc annotation
marcreichel Jan 31, 2025
d1155c4
style: Remove new lines
marcreichel Jan 31, 2025
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
9 changes: 9 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: PHPStan
on:
pull_request:
push:
branches:
- 1.x
jobs:
phpstan:
uses: artemeon/.shared/.github/workflows/phpstan-php84-upwards.yml@main
27 changes: 27 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pint

on:
- pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pint:
name: Pint (PHP-CS-Fixer)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run Pint
run: composer pint
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ on:
pull_request:
push:
branches:
- master
- 1.x
jobs:
phpstan:
name: PHPStan
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
php-version: 8.4
coverage: xdebug
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run PHPStan
run: composer run phpstan
phpunit:
name: PHPUnit
- name: Run Tests
run: composer test:coverage
type_coverage:
name: Type Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
php-version: 8.4
coverage: xdebug
- name: Composer install
run: composer install --no-interaction --no-ansi --no-progress
- name: Run PHPUnit
run: vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml
- name: Check Type Coverage
run: composer test:type-coverage
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0 - 2025-01-20
- Drop support for PHP 8.1, PHP 8.2 and PHP 8.3.
- Add Support for PHP 8.4.

## 0.1.0 - 2020-02-12
* Initial release

Expand Down
30 changes: 18 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"name": "artemeon/http-client",
"version": "1.1.0",
"description": "Thin wrapper for external http client libraries.",
"homepage": "https://github.com/artemeon/http-client#readme",
"license": "MIT",
"type": "library",
"keywords": [
"php7",
"http",
"client"
],
"scripts": {
"phpstan": "php ./vendor/bin/phpstan analyse --memory-limit=4G"
"phpstan": "php ./vendor/bin/phpstan analyse --memory-limit=4G",
"pint": "./vendor/bin/pint --test -v",
"pint:fix": "./vendor/bin/pint",
"test": "./vendor/bin/pest",
"test:coverage": "XDEBUG_MODE=coverage ./vendor/bin/pest --coverage --min=67.3",
"test:type-coverage": "XDEBUG_MODE=coverage ./vendor/bin/pest --type-coverage --min=99.8"
},
"authors": [
{
Expand All @@ -20,7 +25,8 @@
],
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true
}
},
"autoload": {
Expand All @@ -34,22 +40,22 @@
}
},
"require": {
"php": ">=8.1",
"guzzlehttp/guzzle": "~7.4",
"php": ">=8.4",
"guzzlehttp/guzzle": "~7.9.2",
"ext-json": "*",
"ext-mbstring": "*",
"psr/log": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "9.*",
"phpspec/prophecy-phpunit": "v2.*",
"squizlabs/php_codesniffer": "3.*",
"php-mock/php-mock-prophecy": "0.1.0",
"laravel/pint": "^1.20.0",
"mockery/mockery": "^1.6",
"mikey179/vfsstream": "1.6.*",
"php-http/psr7-integration-tests": "1.1.*",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan": "^2.1.2",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-phpunit": "^1.3"
"phpstan/phpstan-phpunit": "^2.0.4",
"rector/rector": "^2.0.7",
"pestphp/pest": "^v3.7",
"pestphp/pest-plugin-type-coverage": "^3.2"
},
"minimum-stability": "stable"
}
3 changes: 1 addition & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ includes:
- phar://phpstan.phar/conf/bleedingEdge.neon

parameters:
level: 1
level: 5
paths:
- src
- tests
17 changes: 17 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
129 changes: 129 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_push": true,
"array_syntax": {
"syntax": "short"
},
"assign_null_coalescing_to_coalesce_equal": true,
"binary_operator_spaces": true,
"blank_line_before_statement": true,
"cast_spaces": true,
"clean_namespace": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
"compact_nullable_typehint": true,
"concat_space": {
"spacing": "one"
},
"fully_qualified_strict_types": true,
"function_to_constant": true,
"get_class_to_class_keyword": true,
"is_null": true,
"lambda_not_used_import": true,
"logical_operators": true,
"method_chaining_indentation": true,
"modernize_types_casting": true,
"multiline_whitespace_before_semicolons": true,
"no_empty_comment": true,
"no_empty_phpdoc": true,
"no_empty_statement": true,
"no_extra_blank_lines": {
"tokens": [
"attribute",
"break",
"case",
"continue",
"curly_brace_block",
"default",
"extra",
"parenthesis_brace_block",
"return",
"square_brace_block",
"switch",
"throw",
"use",
"use_trait"
]
},
"no_multiline_whitespace_around_double_arrow": true,
"no_short_bool_cast": true,
"no_singleline_whitespace_before_semicolons": true,
"no_superfluous_elseif": false,
"no_superfluous_phpdoc_tags": true,
"no_trailing_comma_in_singleline": true,
"no_unneeded_control_parentheses": true,
"no_useless_concat_operator": true,
"no_useless_else": true,
"no_useless_nullsafe_operator": true,
"no_useless_return": true,
"no_whitespace_before_comma_in_array": true,
"not_operator_with_successor_space": false,
"nullable_type_declaration": true,
"object_operator_without_whitespace": true,
"ordered_imports": {
"imports_order": [
"class",
"function",
"const"
],
"sort_algorithm": "alpha"
},
"ordered_interfaces": true,
"ordered_types": {
"null_adjustment": "always_last"
},
"phpdoc_align": {
"align": "left"
},
"phpdoc_indent": true,
"phpdoc_no_useless_inheritdoc": true,
"phpdoc_order": true,
"phpdoc_scalar": true,
"phpdoc_single_line_var_spacing": true,
"phpdoc_summary": true,
"phpdoc_tag_casing": true,
"phpdoc_trim": true,
"phpdoc_trim_consecutive_blank_line_separation": true,
"phpdoc_var_without_name": true,
"php_unit_construct": true,
"php_unit_dedicate_assert": true,
"php_unit_dedicate_assert_internal_type": true,
"php_unit_internal_class": true,
"php_unit_method_casing": true,
"return_assignment": true,
"return_type_declaration": true,
"short_scalar_cast": true,
"single_line_comment_spacing": true,
"single_line_comment_style": true,
"single_quote": true,
"single_space_around_construct": true,
"ternary_to_null_coalescing": true,
"trailing_comma_in_multiline": {
"elements": [
"arguments",
"arrays",
"match",
"parameters"
]
},
"trim_array_spaces": true,
"type_declaration_spaces": true,
"types_spaces": {
"space": "single"
},
"use_arrow_functions": false,
"void_return": true,
"whitespace_after_comma_in_array": {
"ensure_single_space": true
},
"yoda_style": {
"equal": false,
"identical": false,
"less_and_greater": false,
"always_move_variable": false
}
}
}
36 changes: 36 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;

return RectorConfig::configure()
->withPhpSets()
->withAttributesSets(phpunit: true)
->withRules([
Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class,
Rector\CodeQuality\Rector\NullsafeMethodCall\CleanupUnneededNullsafeOperatorRector::class,
Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector::class,
Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class,
Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictFluentReturnRector::class,
Rector\Php80\Rector\Class_\StringableForToStringRector::class,
Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector::class,
Rector\CodingStyle\Rector\Closure\StaticClosureRector::class,
Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector::class,
Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictScalarReturnsRector::class,
Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector::class,
Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class,
Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class,
Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector::class,
Rector\CodeQuality\Rector\BooleanAnd\RemoveUselessIsObjectCheckRector::class,
])
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withTypeCoverageLevel(0);
Loading