Skip to content

Commit

Permalink
Merge pull request #33 from ebln/bump-dep
Browse files Browse the repository at this point in the history
Update dependencies & maintenance
  • Loading branch information
ebln committed Apr 21, 2023
2 parents 30c5ac9 + 43e7d51 commit bebe1fb
Show file tree
Hide file tree
Showing 34 changed files with 1,822 additions and 1,185 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Require php-cs-fixer
run: |
mkdir --parents ./tools/php-cs-fixer
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer "friendsofphp/php-cs-fixer:3.0.0" --prefer-dist --no-progress
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer "friendsofphp/php-cs-fixer:3.15.1" --prefer-dist --no-progress
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Unit tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
/app/phpunit.xml
/composer.phar
/coverage/
/.phpunit.result.cache
68 changes: 45 additions & 23 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,60 @@

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
/*
* @see https://mlocati.github.io/php-cs-fixer-configurator/#version:3.15
* @see https://cs.symfony.com/doc/rules/index.html
* @see https://cs.symfony.com/doc/ruleSets/index.html
*/

$finder = \PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('mock')
->exclude('DNC')
->notPath('phpstan-baseline.php')
->in(__DIR__);

$config = new PhpCsFixer\Config();
$config = new \PhpCsFixer\Config();
$config->setRiskyAllowed(true)
->setRules( // @see https://mlocati.github.io/php-cs-fixer-configurator/#version:3.2
->setRules(
[
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit75Migration:risky' => true,
'@PHP73Migration' => true,
'@PHP71Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'phpdoc_summary' => false,
'cast_spaces' => ['space' => 'none'],
'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal']],
'php_unit_test_class_requires_covers' => false,
'@PER' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit100Migration:risky' => true,
// '@PHP80Migration:risky' => true,
'@PHP82Migration' => true,
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => ['comment_types' => [ /* 'hash' */],],
'phpdoc_summary' => false,
'cast_spaces' => ['space' => 'none'],
'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal_by_scope']],
'no_unused_imports' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']],
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'date_time_create_from_format_call' => true,
'date_time_immutable' => true,
'nullable_type_declaration_for_default_null_value' => true,
'phpdoc_line_span' => ['const' => 'single', 'method' => 'single', 'property' => 'single'],
'simplified_null_return' => true,
'statement_indentation' => true,
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'require', 'require_once', 'return', 'switch']],
]
)
->setFinder($finder);

if (false) {
$resolver = new \PhpCsFixer\Console\ConfigurationResolver($config, [], '', new \PhpCsFixer\ToolInfo());
echo "\n\n# DUMPING EFFECTIVE RULES #################\n";
var_export($resolver->getRules());
echo "\n\n###########################################\n";

die();
}

return $config;
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,36 @@ Intended to follow [«Keep a Changelog»](https://keepachangelog.com/en/)

### TODO

- IMPORTANT: add `psr/http-message` as a direct dependency!
- Monitor [PHP RFC: Server-Side Request and Response Objects](https://wiki.php.net/rfc/request_response)
- Cookies: Write to response
- Cookies: Read from request
- Cookies: write and overwrite to request
- Refactor `Request::withUri` to be closer to PSR-7
- Refactor `BodyStreamHook::addBodyFromResponse` using WeakMap for a PHP >=8.0 (or with [polyfill](https://github.com/BenMorel/weakmap-polyfill))
- Remove `mock/guzzle-psr7` when `php-http/psr7-integration-tests` supports `GuzzleHttp\Psr7 ^2.0`
- Allow configurable StreamFactory instead of hardcoded used
- or try `php-http/discovery`
- Bump dependencies
- Support `psr/http-message ^2`
- Bump `guzzlehttp/psr7` [Changelog](https://github.com/guzzle/psr7/blob/2.5/CHANGELOG.md)

----

## [1.5.0] - 2023-04-21

### Changed
- Code
- fixed `getRequestTarget` due to `RequestIntegrationTest::testGetRequestTargetInOriginFormNormalizesUriWithMultipleLeadingSlashesInPath`
- Signature of `Factory\DecoyHttpFactory::createUploadedFile` changed slightly
- `withRequestTarget` not accepting mixed anymore
- Remove `mock/guzzle-psr7` as `php-http/psr7-integration-tests` supports `GuzzleHttp\Psr7 ^2.0`
- Updated dev dependencies
- Update code style

### Fixed

- downstream vulnerabilities by bumping `guzzlehttp/psr7`

## [1.4.0] - 2021-10-19

### Added
Expand Down
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "brnc/psr7-symfony1-adapter",
"description": "Partial PSR-7 Adapters for Symfony 1.5",
"license": "MIT",
"keywords": [
"symfony1",
"http-message",
"http",
"message",
"psr-7"
],
"license": "MIT",
"authors": [
{
"name": "ebln",
Expand All @@ -17,20 +17,20 @@
],
"require": {
"php": "^7.4 || ^8.0",
"guzzlehttp/psr7": "^1.7 || ^2.0",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"psr/http-factory": "^1.0",
"webmozart/assert": "^1.6"
"webmozart/assert": "^1.10"
},
"require-dev": {
"composer/package-versions-deprecated": "^1.11",
"ergebnis/composer-normalize": "^2.15",
"php-http/psr7-integration-tests": "^1.1",
"phpmd/phpmd": "^2.10.1",
"phpstan/phpstan": "^0.12.90",
"phpstan/phpstan-webmozart-assert": "^0.12.12",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^9.6.7",
"roave/security-advisories": "dev-master",
"vimeo/psalm": "^4.8"
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {
Expand All @@ -45,8 +45,7 @@
"mock/sfWebRequest.php",
"mock/sfWebResponse.php",
"mock/sfEventDispatcher.php",
"mock/sfEvent.php",
"mock/guzzle-psr7/function_include.php"
"mock/sfEvent.php"
]
},
"archive": {
Expand All @@ -59,6 +58,11 @@
"coverage/"
]
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
},
"scripts": {
"coverage": "XDEBUG_MODE=coverage phpunit --coverage-html coverage --coverage-text --colors=auto && chown -R 1000:1000 coverage",
"quality": [
Expand Down
Loading

0 comments on commit bebe1fb

Please sign in to comment.