Skip to content

Commit 37bd234

Browse files
specialtacticsnicodemuzhigidibwoodoranges13
authored
Chore/upstream updates (#8)
* 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]>
1 parent 092de06 commit 37bd234

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+814
-366
lines changed

.ecrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"Verbose": true,
3+
"IgnoreDefaults": false,
4+
"Exclude": [
5+
".phpunit.result.cache",
6+
".php-cs-fixer.cache",
7+
".idea",
8+
".git",
9+
"vendor/",
10+
"tests/fixtures"
11+
]
12+
}

.editorconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ charset = utf-8
55
end_of_line = lf
66
insert_final_newline = true
77
indent_style = space
8-
indent_size = 4
8+
indent_size = 2
99
trim_trailing_whitespace = true
1010

11+
[*.php]
12+
indent_size = 4
13+
1114
[*.md]
1215
trim_trailing_whitespace = false
1316

14-
[*.{yml,yaml,neon}]
15-
indent_size = 2
17+
[*.neon]
18+
indent_style = tab

.gitattributes

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
/docs export-ignore
2-
/tests export-ignore
3-
/.gitattributes export-ignore
4-
/.gitignore export-ignore
5-
/.travis.yml export-ignore
6-
/phpunit.xml export-ignore
7-
/phpunit.xml.dist export-ignore
1+
/docs export-ignore
2+
/tests export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/.php-cs-fixer.dist.php export-ignore
6+
/.editorconfig export-ignore
7+
/.ecrc export-ignore
8+
/docker-compose.yaml export-ignore
9+
/phpstan.neon export-ignore
10+
/phpstan-baseline.neon export-ignore
11+
/phpunit.xml.dist export-ignore
12+
/resources export-ignore
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
phpstan:
9+
name: "PHPStan"
10+
runs-on: "ubuntu-latest"
11+
12+
steps:
13+
- name: "Checkout code"
14+
uses: "actions/checkout@v2"
15+
16+
- name: "Install PHP"
17+
uses: "shivammathur/setup-php@v2"
18+
with:
19+
php-version: "8.0"
20+
extensions: "curl, soap"
21+
tools: "composer:v2"
22+
23+
- name: "Enforce using stable dependencies"
24+
run: "composer config minimum-stability stable"
25+
26+
- name: "Check Composer configuration"
27+
run: "composer validate --strict"
28+
29+
- name: "Install dependencies with Composer"
30+
uses: "ramsey/composer-install@v2"
31+
with:
32+
dependency-versions: "highest"
33+
composer-options: "--prefer-dist -o"
34+
35+
- name: "Run PHPStan"
36+
run: "composer run-script phpstan"
37+
38+
editorconfig-checker:
39+
name: EditorConfig Checker
40+
runs-on: "ubuntu-latest"
41+
42+
steps:
43+
- name: "Checkout code"
44+
uses: "actions/checkout@v2"
45+
46+
- name: "Install EditorConfig Checker"
47+
uses: "editorconfig-checker/action-editorconfig-checker@main"
48+
49+
- name: "Run EditorConfig Checker"
50+
run: "editorconfig-checker"
51+
52+
codestyle:
53+
name: "PHP-CS-Fixer"
54+
runs-on: "ubuntu-latest"
55+
56+
steps:
57+
- name: "Checkout code"
58+
uses: "actions/checkout@v2"
59+
60+
- name: "Install PHP"
61+
uses: "shivammathur/setup-php@v2"
62+
with:
63+
php-version: "8.0"
64+
extensions: "curl, soap"
65+
tools: "composer:v2"
66+
67+
- name: "Enforce using stable dependencies"
68+
run: "composer config minimum-stability stable"
69+
70+
- name: "Check Composer configuration"
71+
run: "composer validate --strict"
72+
73+
- name: "Install dependencies with Composer"
74+
uses: "ramsey/composer-install@v2"
75+
with:
76+
dependency-versions: "highest"
77+
composer-options: "--prefer-dist -o"
78+
79+
- name: "Run PHP-CS-Fixer"
80+
run: "composer run-script cs"
81+
82+
phpunit:
83+
name: "PHPUnit Test"
84+
runs-on: "ubuntu-latest"
85+
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
php:
90+
- "8.0"
91+
- "8.1"
92+
- "8.2"
93+
- "8.3"
94+
- "8.4"
95+
dependencies:
96+
- "lowest"
97+
- "highest"
98+
stability:
99+
- "stable"
100+
101+
steps:
102+
- name: "Checkout code"
103+
uses: "actions/checkout@v2"
104+
with:
105+
fetch-depth: 2
106+
107+
- name: "Install PHP"
108+
uses: "shivammathur/setup-php@v2"
109+
with:
110+
php-version: "${{ matrix.php }}"
111+
extensions: "curl, soap"
112+
tools: "composer:v2"
113+
coverage: "pcov"
114+
115+
- name: "Enforce using stable dependencies"
116+
run: "composer config minimum-stability stable"
117+
if: "${{ matrix.stability == 'stable' }}"
118+
119+
- name: "Check Composer configuration"
120+
run: "composer validate --strict"
121+
122+
- name: "Install dependencies with Composer"
123+
uses: "ramsey/composer-install@v2"
124+
with:
125+
dependency-versions: "${{ matrix.dependencies }}"
126+
composer-options: "--prefer-dist -o"
127+
128+
- name: "Run PHPUnit Test"
129+
run: "vendor/bin/phpunit --coverage-clover=coverage.clover --log-junit=phpunit.xml"
130+
131+
# - name: "Publish Test Report"
132+
# uses: "mikepenz/action-junit-report@v2"
133+
# if: "always()" # always run even if the previous step fails
134+
# with:
135+
# report_paths: "phpunit.xml"
136+
# check_name: "PHPUnit Test Report (${{ matrix.php }}, ${{ matrix.dependencies }}, ${{ matrix.stability }})"
137+
#
138+
# - name: "Publish Scrutinizer Coverage"
139+
# uses: "sudo-bot/action-scrutinizer@latest"
140+
# if: "always()" # always run even if the previous step fails
141+
# with:
142+
# cli-args: "--format=php-clover coverage.clover"

.github/workflows/tests.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
19+
THE SOFTWARE.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![PHP-VCR](https://user-images.githubusercontent.com/133832/27151811-0d95c6c4-514c-11e7-834e-eff1eec2ea16.png)
22

3-
[![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)
3+
[![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)
44
[![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/)
55
[![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/)
66

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

1515
* Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
1616
* Supports common http functions and extensions
17-
* 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)
17+
* 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))
1818
* [SoapClient](http://www.php.net/manual/en/soapclient.soapclient.php) by adding `\VCR\VCR::turnOn();` in your `tests/bootstrap.php`
1919
* curl(), by adding `\VCR\VCR::turnOn();` in your `tests/bootstrap.php`
2020
* The same request can receive different responses in different tests -- just use different cassettes.
@@ -121,7 +121,7 @@ composer test
121121
[Old changelog entries](docs/old-changelog.md)
122122

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

127127
<!--

composer.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"license": "MIT",
55
"scripts": {
66
"test": "./vendor/bin/phpunit",
7-
"lint": "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
8-
"fix": "./vendor/bin/php-cs-fixer fix --verbose --diff",
9-
"phpstan": "php -d memory_limit=-1 vendor/bin/phpstan analyse -c phpstan.neon --no-progress -vvv"
7+
"cs": "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
8+
"cs-fix": "./vendor/bin/php-cs-fixer fix --verbose --diff",
9+
"phpstan": "php -d memory_limit=-1 vendor/bin/phpstan analyse -c phpstan.neon --no-progress -vvv",
10+
"ec": "./vendor/bin/ec"
1011
},
1112
"authors": [
1213
{
@@ -18,22 +19,25 @@
1819
}
1920
],
2021
"require": {
21-
"php": "^8.0",
22+
"php": "^8,<8.2|>=8.2.9,<8.5",
2223
"ext-curl": "*",
2324
"beberlei/assert": "^3.2.5",
24-
"symfony/yaml": "^3.0|^4.0|^5.0|^6.0",
25-
"symfony/event-dispatcher": "^5.0|^6.0"
25+
"symfony/yaml": "^3|^4|^5|^6|^7",
26+
"symfony/event-dispatcher": "^4|^5|^6|^7",
27+
"symfony/event-dispatcher-contracts": "^1|^2|^3"
2628
},
2729
"require-dev": {
28-
"guzzlehttp/guzzle": "^7.0",
29-
"phpunit/phpunit": "^9.5.0",
30+
"ext-soap": "*",
31+
"guzzlehttp/guzzle": "^7",
32+
"phpunit/phpunit": "^9.5.10",
3033
"mikey179/vfsstream": "^1.6.10",
31-
"phpstan/phpstan": "^0.12.92",
32-
"phpstan/phpstan-beberlei-assert": "^0.12.0",
33-
"thecodingmachine/phpstan-strict-rules": "^0.12",
34+
"phpstan/phpstan": "^1",
35+
"phpstan/phpstan-beberlei-assert": "^1",
36+
"thecodingmachine/phpstan-strict-rules": "^1",
3437
"friendsofphp/php-cs-fixer": "^3.0",
35-
"phpstan/phpstan-phpunit": "^0.12.22",
36-
"phpstan/extension-installer": "^1.1"
38+
"phpstan/phpstan-phpunit": "^1",
39+
"phpstan/extension-installer": "^1.1",
40+
"editorconfig-checker/editorconfig-checker": "^10.3"
3741
},
3842
"autoload": {
3943
"psr-4": {

0 commit comments

Comments
 (0)