Skip to content

Commit 824b90e

Browse files
Merge pull request php-vcr#340 from php-vcr/2021-update
2021 update
2 parents ddabff2 + 620269f commit 824b90e

Some content is hidden

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

65 files changed

+559
-512
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ tests/fixtures/cassette*
77
/.php_cs.cache
88
/.php_cs
99
composer.lock
10+
.phpunit.result.cache

.php_cs.dist

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
return PhpCsFixer\Config::create()
44
->setRules([
5-
'@PSR2' => true,
5+
'@PSR12' => true,
66
'@Symfony' => true,
77
'@Symfony:risky' => true,
8-
'@PHPUnit60Migration:risky' => true
8+
'@PHP71Migration' => true,
9+
'@PHP71Migration:risky' => true,
10+
'@PHPUnit84Migration:risky' => true,
11+
// Causes too much problems for now, fix later
12+
'declare_strict_types' => false,
913
])
1014
->setFinder(
1115
PhpCsFixer\Finder::create()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"symfony/event-dispatcher": "^2.4|^3.0|^4.0|^5.0"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "^7.4.3",
25+
"phpunit/phpunit": "^8.4.0",
2626
"mikey179/vfsstream": "^1.6",
2727
"phpstan/phpstan": "^0.12",
2828
"phpstan/phpstan-beberlei-assert": "^0.12.0",

docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.8"
2+
services:
3+
workspace:
4+
tty: true
5+
build:
6+
context: resources/docker/workspace
7+
args:
8+
PUID: "${PUID:-1000}"
9+
PGID: "${PGID:-1000}"
10+
volumes:
11+
- .:/var/www/html
12+
- ~/.composer:/home/user/.composer
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM php:7.2-cli-alpine
2+
3+
ARG PUID=1000
4+
ARG PGID=1000
5+
6+
RUN apk add --no-cache --virtual .build-deps \
7+
# for extensions
8+
$PHPIZE_DEPS \
9+
# for soap
10+
libxml2-dev \
11+
&& \
12+
apk add --no-cache \
13+
bash \
14+
# for soap
15+
libxml2 \
16+
# for composer
17+
unzip \
18+
&& \
19+
docker-php-ext-install soap \
20+
&& \
21+
pecl install \
22+
# pcov for coverage runs
23+
pcov && docker-php-ext-enable pcov \
24+
&& \
25+
apk del .build-deps
26+
27+
COPY --from=composer /usr/bin/composer /usr/bin/composer
28+
29+
WORKDIR /var/www/html
30+
31+
# Add a non-root user to prevent files being created with root permissions on host machine.
32+
RUN addgroup -g ${PGID} user && \
33+
adduser -u ${PUID} -G user -D user
34+
35+
USER user

src/VCR/CodeTransform/AbstractCodeTransform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
abstract class AbstractCodeTransform extends \php_user_filter
1212
{
13-
const NAME = 'vcr_abstract_filter';
13+
public const NAME = 'vcr_abstract_filter';
1414

1515
/**
1616
* Attaches the current filter to a stream.
@@ -43,7 +43,7 @@ public function filter($in, $out, &$consumed, $closing)
4343
stream_bucket_append($out, $bucket);
4444
}
4545

46-
return PSFS_PASS_ON;
46+
return \PSFS_PASS_ON;
4747
}
4848

4949
/**

src/VCR/CodeTransform/CurlCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class CurlCodeTransform extends AbstractCodeTransform
88
{
9-
const NAME = 'vcr_curl';
9+
public const NAME = 'vcr_curl';
1010

1111
/**
1212
* @var array<string, string>

src/VCR/CodeTransform/SoapCodeTransform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class SoapCodeTransform extends AbstractCodeTransform
88
{
9-
const NAME = 'vcr_soap';
9+
public const NAME = 'vcr_soap';
1010

1111
/**
1212
* @var string[]

src/VCR/LibraryHooks/CurlHook.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public static function curlMultiExec($multiHandle, ?int &$stillRunning): int
281281
}
282282
}
283283

284-
return CURLM_OK;
284+
return \CURLM_OK;
285285
}
286286

287287
/**
@@ -295,9 +295,9 @@ public static function curlMultiInfoRead()
295295
{
296296
if (!empty(self::$multiExecLastChs)) {
297297
$info = [
298-
'msg' => CURLMSG_DONE,
298+
'msg' => \CURLMSG_DONE,
299299
'handle' => array_pop(self::$multiExecLastChs),
300-
'result' => CURLE_OK,
300+
'result' => \CURLE_OK,
301301
];
302302

303303
return $info;

src/VCR/LibraryHooks/LibraryHook.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ interface LibraryHook
1010
/**
1111
* @var string enabled status for a hook
1212
*/
13-
const ENABLED = 'ENABLED';
13+
public const ENABLED = 'ENABLED';
1414

1515
/**
1616
* @var string disabled status for a hook
1717
*/
18-
const DISABLED = 'DISABLED';
18+
public const DISABLED = 'DISABLED';
1919

2020
/**
2121
* Enables library hook which means that all of this library

0 commit comments

Comments
 (0)