Skip to content

Commit 2fa54e2

Browse files
committed
Drop PHP 7.4 support
1 parent beec466 commit 2fa54e2

File tree

7 files changed

+21
-24
lines changed

7 files changed

+21
-24
lines changed

Diff for: .github/workflows/tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
strategy:
2525
matrix:
26-
php: [7.4]
26+
php: [8.0]
2727
dependencies: [locked]
2828

2929
steps:
@@ -76,7 +76,7 @@ jobs:
7676

7777
strategy:
7878
matrix:
79-
php: [7.4,8.0, 8.1]
79+
php: [8.0, 8.1]
8080

8181
dependencies: [locked]
8282

@@ -134,7 +134,7 @@ jobs:
134134

135135
strategy:
136136
matrix:
137-
php: [7.4, 8.0, 8.1]
137+
php: [8.0, 8.1]
138138

139139
dependencies:
140140
- "lowest"
@@ -185,7 +185,7 @@ jobs:
185185

186186
strategy:
187187
matrix:
188-
php: [7.4, 8.0, 8.1]
188+
php: [8.0, 8.1]
189189

190190
dependencies:
191191
- "locked"
@@ -239,7 +239,7 @@ jobs:
239239

240240
strategy:
241241
matrix:
242-
php: [7.4, 8.0]
242+
php: [8.0]
243243

244244
dependencies:
245245
- "locked"

Diff for: CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [2.0.0] - 2022-08-23
10+
11+
### Changed
12+
- Dropped PHP 7.4 support
13+
914
## [1.0.0] - 2021-11-19
1015

1116
### Changed
@@ -43,7 +48,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4348

4449
Initial release!
4550

46-
[Unreleased]: https://github.com/canvural/php-openapi-faker/compare/1.0.0...HEAD
51+
[Unreleased]: https://github.com/canvural/php-openapi-faker/compare/2.0.0...HEAD
52+
[2.0.0]: https://github.com/canvural/php-openapi-faker/compare/1.0.0...2.0.0
4753
[1.0.0]: https://github.com/canvural/php-openapi-faker/compare/0.1.5...1.0.0
4854
[0.1.5]: https://github.com/canvural/php-openapi-faker/compare/0.1.4...0.1.5
4955
[0.1.4]: https://github.com/canvural/php-openapi-faker/compare/0.1.3...0.1.4

Diff for: composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.4",
13+
"php": "^8.0 || ^8.1",
1414
"ext-json": "*",
1515
"cebe/php-openapi": "^1.7",
1616
"fakerphp/faker": "^1.20",
1717
"league/openapi-psr7-validator": "^0.18",
18-
"thecodingmachine/safe": "^1.3"
18+
"thecodingmachine/safe": "^2.2"
1919
},
2020
"require-dev": {
2121
"doctrine/coding-standard": "^9",
2222
"ergebnis/composer-normalize": "^2.27",
23-
"infection/infection": "^0.25",
23+
"infection/infection": "^0.26",
2424
"phpstan/extension-installer": "^1.1",
2525
"phpstan/phpstan": "^1.7",
2626
"phpstan/phpstan-phpunit": "^1",

Diff for: infection.json.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"logs": {
88
"text": ".build/infection/infection-log.txt",
9-
"badge": {
9+
"stryker": {
1010
"branch": "master"
1111
}
1212
},

Diff for: src/OpenAPIFaker.php

+3-9
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,14 @@ public static function createFromYaml(string $yaml): self
6060
}
6161

6262
/**
63-
* @return mixed
64-
*
6563
* @throws NoPath
6664
* @throws NoRequest
6765
*/
6866
public function mockRequest(
6967
string $path,
7068
string $method,
7169
string $contentType = 'application/json'
72-
) {
70+
): mixed {
7371
$operation = $this->findOperation($path, $method);
7472

7573
if ($operation->requestBody === null) {
@@ -88,8 +86,6 @@ public function mockRequest(
8886
}
8987

9088
/**
91-
* @return mixed
92-
*
9389
* @throws NoPath
9490
* @throws NoResponse
9591
*/
@@ -98,7 +94,7 @@ public function mockResponse(
9894
string $method,
9995
string $statusCode = '200',
10096
string $contentType = 'application/json'
101-
) {
97+
): mixed {
10298
$operation = $this->findOperation($path, $method);
10399

104100
if ($operation->responses === null) {
@@ -124,11 +120,9 @@ public function mockResponse(
124120
}
125121

126122
/**
127-
* @return mixed
128-
*
129123
* @throws Exception
130124
*/
131-
public function mockComponentSchema(string $schemaName)
125+
public function mockComponentSchema(string $schemaName): mixed
132126
{
133127
if ($this->openAPISchema->components === null) {
134128
throw NoSchema::forZeroComponents();

Diff for: src/SchemaFaker/NumberFaker.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
*/
1515
final class NumberFaker
1616
{
17-
/**
18-
* @return int|float
19-
*/
20-
public static function generate(Schema $schema)
17+
public static function generate(Schema $schema): int|float
2118
{
2219
if ($schema->enum !== null) {
2320
return Base::randomElement($schema->enum);

Diff for: src/SchemaFaker/SchemaFaker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Schema $schema, Options $options, bool $request = fa
3636
/**
3737
* @return array<mixed>|string|bool|int|float
3838
*/
39-
public function generate()
39+
public function generate(): array|string|bool|int|float
4040
{
4141
if ($this->schema->type === 'array') {
4242
return ArrayFaker::generate($this->schema, $this->options);

0 commit comments

Comments
 (0)