Skip to content

Commit

Permalink
Chore/upstream updates (#8)
Browse files Browse the repository at this point in the history
* Support for Symfony 6

* TASK: Cleanup GitHub workflows

* FIX: Allow phpstan/extension-install composer plugin

* Cleanup .gitattributes with export-ignore

* TASK: Use composer-install action for workflows

* TASK: Apply codestyle fixes

* FIX: Fix scrutinizer workflow action uploading

* TASK: Added php-xdebug ext to workspace docker container

* FEATURE: Allow lower versions of symfony/event-dispatcher

* TASK: Ignore phpstan error

* FEATURE: Upgrade phpstan

* TASK: Refactor GitHub workflow

* FEATURE: Workspace docker image for php 8.1 added

* FEATURE: Test against php 8.1 with GitHub workflows

* FIX: Fixed several issues with occurred with php >= 8.1

* TASK: Disable failing fast while running phpunit tests

* FIX: Fix phpstan issues and invalid BlackholeTest

* FIX: Raise minimum version of phpunit

* FEATURE: Restructure GitHub Workflow

* FEATURE: Added editorconfig checker

* FIX: Fix editorconfig violations

* TASK: Added .editorconfig to export-ignore via .gitattributes

* FEATURE: Install editorconfig-checker wrapper for php

* TASK: Fix export-ignore for phpstan in .gitattributes

* TASK: Do not exclude defaults for editorconfig checker

* Rework php-vcr#161. Manage request index state in Videorecorder. Enable Cassette to playback and record request/responses at a given index. Do not require Cassette to manage index state.

* $index should not be a required parameter on record(). Avoid unecessary API changes.

* Ensure that the cassette indexes are reset when the cassette is ejected or inserted.

* Use equals not identical operator when comparing the request index to the recording index.

* Spport legacy cassettes. Create a recording index of 0 if no index key exists in the cassette.

* Add comment punctuation.

* Add testPlaybackLegacyCassette() to ensure that legacy cassettes with no index keys playback.

* Add tests ensuring that both legacy (non-indexed) cassettes and indexed cassettes playback multiple identical requests correctly.

* Modify testInsertCassetteEjectExisting() to ensure that resetIndex() is called as part of eject() and insertCassette().

* Remove redundant testPlaybackLegacyCassette().

* Fix indents.

* FEATURE: Added testcase for mixed cassettes

(with and without legacy entries)

* FIX: Fixed remaining phpstan errors

* FIX: Indentions

* FIX: Videorecorder always raised index for identical requests, Cassette have to handle legacy entries

Because the Videorecorder increments the index for each identical requests it also passes it to the cassette,
so the cassette have to handle legacy stored entries. So if no index is present while loading recorded requests
we have to set the index to searched one (instead of zero) to always match (disabled the feature), when all
other matchers match.

* Revert "FEATURE: Added testcase for mixed cassettes"

This reverts commit ce1471b.

* FIX: Fixed remaining phpstan errors

* FIX: README.md badge

* Add CURLINFO_APPCONNECT_TIME to CurlHelper

Fixes php-vcr#309

* Fix CurlHookTest.php

* FIX: Read the whole stream and perform code transformations

First read the whole stream and afterwards perform code transformations.
This will ensure to also replace code, which is divided into chunks while
reading a file.

Fixes php-vcr#268

* FIX: Codestyle

* FIX: Codestyle

* TASK: Update README.md

* TASK: Drop support for php 8.2

Currently, the php-vcr library does not work well with php 8.2
so we drop the support for now until it is fixed.

* TASK: Apply codestyle

* FEATURE: Fix/review phpstan errors

* FEATURE: Custom workspace docker file for php 8.2 added

* FEATURE: Added php 8.2 to GitHub workflow

* TASK: Add support for php 8.2

* TASK: Added support for php greater than 8.2.9

* FIX: Initialized typed property

* Add SOAP extension requirement for running tests

* (tech) add PHP 8.3 support

* FIX: Fixed nullable types

* TASK: Fix phpstan error (by generating new baseline)

* FEATURE: Added php 8.3 workspace docker image

* Add support Symfony 7

* Remove trailing semicolon in Content-Type header

* Adjust SOAP v1.1 header expectation in test

* Fix PHPUnit deprecations

* Fix set_stream_options arguments

* TASK: Apply code style fixes

* FIX: Added new baseline

* FIX: Removed phpstan ignore (there is no error to ignore)

* FIX: Gnerated phpstan baseline

* add PHP 8.4 support

* add support

* fix cs

* skip soap tests due to problem with them

* phpstan, cs

* remove scruitinizer reports

---------

Co-authored-by: nicodemuz <[email protected]>
Co-authored-by: Daniel Hürtgen <[email protected]>
Co-authored-by: Daniel Hürtgen <[email protected]>
Co-authored-by: Brian Wood <[email protected]>
Co-authored-by: oranges13 <[email protected]>
Co-authored-by: Peter <[email protected]>
Co-authored-by: ecourtial <[email protected]>
Co-authored-by: yethee <[email protected]>
Co-authored-by: alexzabolotny <[email protected]>
Co-authored-by: Lars Strojny <[email protected]>
Co-authored-by: Masaki Kawaguchi <[email protected]>
  • Loading branch information
12 people authored Jan 6, 2025
1 parent 092de06 commit 37bd234
Show file tree
Hide file tree
Showing 57 changed files with 814 additions and 366 deletions.
12 changes: 12 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Verbose": true,
"IgnoreDefaults": false,
"Exclude": [
".phpunit.result.cache",
".php-cs-fixer.cache",
".idea",
".git",
"vendor/",
"tests/fixtures"
]
}
9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml,neon}]
indent_size = 2
[*.neon]
indent_style = tab
19 changes: 12 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.editorconfig export-ignore
/.ecrc export-ignore
/docker-compose.yaml export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/resources export-ignore
142 changes: 142 additions & 0 deletions .github/workflows/continuous integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: "Continuous Integration"

on:
push:
pull_request:

jobs:
phpstan:
name: "PHPStan"
runs-on: "ubuntu-latest"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
extensions: "curl, soap"
tools: "composer:v2"

- name: "Enforce using stable dependencies"
run: "composer config minimum-stability stable"

- name: "Check Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist -o"

- name: "Run PHPStan"
run: "composer run-script phpstan"

editorconfig-checker:
name: EditorConfig Checker
runs-on: "ubuntu-latest"

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

- name: "Install EditorConfig Checker"
uses: "editorconfig-checker/action-editorconfig-checker@main"

- name: "Run EditorConfig Checker"
run: "editorconfig-checker"

codestyle:
name: "PHP-CS-Fixer"
runs-on: "ubuntu-latest"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
extensions: "curl, soap"
tools: "composer:v2"

- name: "Enforce using stable dependencies"
run: "composer config minimum-stability stable"

- name: "Check Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist -o"

- name: "Run PHP-CS-Fixer"
run: "composer run-script cs"

phpunit:
name: "PHPUnit Test"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "lowest"
- "highest"
stability:
- "stable"

steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
extensions: "curl, soap"
tools: "composer:v2"
coverage: "pcov"

- name: "Enforce using stable dependencies"
run: "composer config minimum-stability stable"
if: "${{ matrix.stability == 'stable' }}"

- name: "Check Composer configuration"
run: "composer validate --strict"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist -o"

- name: "Run PHPUnit Test"
run: "vendor/bin/phpunit --coverage-clover=coverage.clover --log-junit=phpunit.xml"

# - name: "Publish Test Report"
# uses: "mikepenz/action-junit-report@v2"
# if: "always()" # always run even if the previous step fails
# with:
# report_paths: "phpunit.xml"
# check_name: "PHPUnit Test Report (${{ matrix.php }}, ${{ matrix.dependencies }}, ${{ matrix.stability }})"
#
# - name: "Publish Scrutinizer Coverage"
# uses: "sudo-bot/action-scrutinizer@latest"
# if: "always()" # always run even if the previous step fails
# with:
# cli-args: "--format=php-clover coverage.clover"
91 changes: 0 additions & 91 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![PHP-VCR](https://user-images.githubusercontent.com/133832/27151811-0d95c6c4-514c-11e7-834e-eff1eec2ea16.png)

[![Build Status](https://github.com/php-vcr/php-vcr/actions/workflows/tests.yml/badge.svg)](https://github.com/php-vcr/php-vcr/actions/workflows/tests.yml)
[![Continuous Integration](https://github.com/php-vcr/php-vcr/actions/workflows/continuous%20integration.yml/badge.svg?branch=master)](https://github.com/php-vcr/php-vcr/actions/workflows/continuous%20integration.yml)
[![Code Coverage](https://scrutinizer-ci.com/g/php-vcr/php-vcr/badges/coverage.png?s=15cf1644c8cf37a868e03cfba809a5e24c78f285)](https://scrutinizer-ci.com/g/php-vcr/php-vcr/)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/php-vcr/php-vcr/badges/quality-score.png?s=4f638dbca5eb51fb9c87a1dd45c5df94687d85bd)](https://scrutinizer-ci.com/g/php-vcr/php-vcr/)

Expand All @@ -14,7 +14,7 @@ Disclaimer: Doing this in PHP is not as easy as in programming languages which s

* Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
* Supports common http functions and extensions
* everything using [streamWrapper](http://php.net/manual/en/class.streamwrapper.php): fopen(), fread(), file_get_contents(), ... without any modification (except `$http_response_header` see #96)
* everything using [streamWrapper](http://php.net/manual/en/class.streamwrapper.php): fopen(), fread(), file_get_contents(), ... without any modification (except `$http_response_header` see [#96](https://github.com/php-vcr/php-vcr/issues/96))
* [SoapClient](http://www.php.net/manual/en/soapclient.soapclient.php) by adding `\VCR\VCR::turnOn();` in your `tests/bootstrap.php`
* curl(), by adding `\VCR\VCR::turnOn();` in your `tests/bootstrap.php`
* The same request can receive different responses in different tests -- just use different cassettes.
Expand Down Expand Up @@ -121,7 +121,7 @@ composer test
[Old changelog entries](docs/old-changelog.md)

## Copyright
Copyright (c) 2013-2016 Adrian Philipp. Released under the terms of the MIT license. See LICENSE for details.
Copyright (c) 2013-2023 Adrian Philipp. Released under the terms of the MIT license. See LICENSE for details.
[Contributors](https://github.com/php-vcr/php-vcr/graphs/contributors)

<!--
Expand Down
30 changes: 17 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"license": "MIT",
"scripts": {
"test": "./vendor/bin/phpunit",
"lint": "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"fix": "./vendor/bin/php-cs-fixer fix --verbose --diff",
"phpstan": "php -d memory_limit=-1 vendor/bin/phpstan analyse -c phpstan.neon --no-progress -vvv"
"cs": "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"cs-fix": "./vendor/bin/php-cs-fixer fix --verbose --diff",
"phpstan": "php -d memory_limit=-1 vendor/bin/phpstan analyse -c phpstan.neon --no-progress -vvv",
"ec": "./vendor/bin/ec"
},
"authors": [
{
Expand All @@ -18,22 +19,25 @@
}
],
"require": {
"php": "^8.0",
"php": "^8,<8.2|>=8.2.9,<8.5",
"ext-curl": "*",
"beberlei/assert": "^3.2.5",
"symfony/yaml": "^3.0|^4.0|^5.0|^6.0",
"symfony/event-dispatcher": "^5.0|^6.0"
"symfony/yaml": "^3|^4|^5|^6|^7",
"symfony/event-dispatcher": "^4|^5|^6|^7",
"symfony/event-dispatcher-contracts": "^1|^2|^3"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.0",
"phpunit/phpunit": "^9.5.0",
"ext-soap": "*",
"guzzlehttp/guzzle": "^7",
"phpunit/phpunit": "^9.5.10",
"mikey179/vfsstream": "^1.6.10",
"phpstan/phpstan": "^0.12.92",
"phpstan/phpstan-beberlei-assert": "^0.12.0",
"thecodingmachine/phpstan-strict-rules": "^0.12",
"phpstan/phpstan": "^1",
"phpstan/phpstan-beberlei-assert": "^1",
"thecodingmachine/phpstan-strict-rules": "^1",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan-phpunit": "^0.12.22",
"phpstan/extension-installer": "^1.1"
"phpstan/phpstan-phpunit": "^1",
"phpstan/extension-installer": "^1.1",
"editorconfig-checker/editorconfig-checker": "^10.3"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 37bd234

Please sign in to comment.