Skip to content

Commit a320c33

Browse files
refactor!: Drop PHP 8.1 support (#177)
Closes: #144
2 parents f953237 + 30ea4af commit a320c33

File tree

238 files changed

+423
-578
lines changed

Some content is hidden

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

238 files changed

+423
-578
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The set provides best practices to make development more fun and classes/service
1212
|--------------|---------------------|------------------|
1313
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
1414
| | `^8.2` | `HEAD ⋯ 2.0.0` |
15-
| | `^8.1` | `HEAD ⋯ 2.0.0` |
15+
| | `^8.1` | `6.4.1 ⋯ 2.0.0` |
1616
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
1717
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
1818
| | `>=8.0.0` | `0.11.0 ⋯ 0.4.0` |

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
3333
},
3434
"require": {
35-
"php": "^8.1|^8.2|^8.3",
35+
"php": "^8.2|^8.3",
3636
"ext-bcmath": "*",
3737
"ext-dom": "*",
3838
"ext-filter": "*",
@@ -43,7 +43,7 @@
4343
"ext-xmlreader": "*",
4444
"composer/semver": "^3.2",
4545
"doctrine/sql-formatter": "^1.1",
46-
"guzzlehttp/psr7": "^1.9.1|^2.4.5",
46+
"guzzlehttp/psr7": "^2.4.5",
4747
"http-interop/http-factory-guzzle": "^1.0.0",
4848
"illuminate/collections": "^10.34.0|^11.0.0",
4949
"illuminate/conditionable": "^10.34.0|^11.0.0",
@@ -62,7 +62,7 @@
6262
"illuminate/translation": "^10.34.0|^11.0.0",
6363
"illuminate/validation": "^10.34.0|^11.0.0",
6464
"league/commonmark": "^2.4",
65-
"mockery/mockery": "^1.6.2",
65+
"mockery/mockery": "^1.6.5",
6666
"nikic/php-parser": "^4.18|^5.0",
6767
"nuwave/lighthouse": "^6.5.0",
6868
"opis/json-schema": "^2.3.0",

docs/Shared/Upgrade/FromV6.md

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.
2+
13
* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).

metadata.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
],
1111
"php": [
1212
"^8.3",
13-
"^8.2",
14-
"^8.1"
13+
"^8.2"
1514
]
1615
},
1716
"6.4.1": {

packages/core/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This package contains useful utilities and classes.
1212
|--------------|---------------------|------------------|
1313
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
1414
| | `^8.2` | `HEAD ⋯ 2.0.0` |
15-
| | `^8.1` | `HEAD ⋯ 2.0.0` |
15+
| | `^8.1` | `6.4.1 ⋯ 2.0.0` |
1616
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
1717
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
1818
| | `>=8.0.0` | `0.11.0 ⋯ 0.4.0` |

packages/core/UPGRADE.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
3333
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
3434
[//]: # (warning: Generated automatically. Do not edit.)
3535

36+
* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.
37+
3638
* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).
3739

3840
[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)

packages/core/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
1919
},
2020
"require": {
21-
"php": "^8.1|^8.2|^8.3",
21+
"php": "^8.2|^8.3",
2222
"illuminate/console": "^10.34.0|^11.0.0",
2323
"illuminate/container": "^10.34.0|^11.0.0",
2424
"illuminate/contracts": "^10.34.0|^11.0.0",
@@ -30,7 +30,7 @@
3030
"require-dev": {
3131
"phpunit/phpunit": "^10.1.0|^11.0.0",
3232
"lastdragon-ru/lara-asp-testing": "self.version",
33-
"mockery/mockery": "^1.6.2",
33+
"mockery/mockery": "^1.6.5",
3434
"orchestra/testbench": "^8.0.0|^9.0.0"
3535
},
3636
"autoload": {

packages/core/metadata.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
],
1111
"php": [
1212
"^8.3",
13-
"^8.2",
14-
"^8.1"
13+
"^8.2"
1514
]
1615
},
1716
"6.4.1": {

packages/core/src/Helpers/Translator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract protected function getName(): string;
2929
* @param list<string>|string $key
3030
* @param array<string, mixed> $replace
3131
*/
32-
public function get(array|string $key, array $replace = [], string $locale = null): string {
32+
public function get(array|string $key, array $replace = [], ?string $locale = null): string {
3333
return $this->translate($key, function (string $key) use ($replace, $locale): string {
3434
return Cast::toString($this->translator->get($this->key($key), $replace, $locale));
3535
});
@@ -44,7 +44,7 @@ public function choice(
4444
array|string $key,
4545
Countable|array|int $number,
4646
array $replace = [],
47-
string $locale = null,
47+
?string $locale = null,
4848
): string {
4949
return $this->translate($key, function (string $key) use ($number, $replace, $locale): string {
5050
return $this->translator->choice($this->key($key), $number, $replace, $locale);

packages/dev/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Various internal tools and helpers to develop the package itself.
1212
|--------------|---------------------|------------------|
1313
| PHP | `^8.3` | `HEAD ⋯ 6.2.0` |
1414
| | `^8.2` | `HEAD ⋯ 6.2.0` |
15-
| | `^8.1` | `HEAD ⋯ 6.2.0` |
15+
| | `^8.1` | `6.4.1 ⋯ 6.2.0` |
1616
| PHPStan | `^1.10` | `HEAD ⋯ 6.2.0` |
1717

1818
[//]: # (end: 0f999169cbabc32d4f47c79c31d74f8b4066c685962719bae5df3c63a08ea382)

packages/dev/UPGRADE.md

+12
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,15 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
2626
|:--:|:--------------------------------------------------------------------------------------------------------------------|
2727

2828
[//]: # (end: 8e89e65b3785cb5b41f28a4f3c5b7e0db0110d8047852d71cd99b2cdffd8f57c)
29+
30+
# Upgrade from v6
31+
32+
[include:file]: ../../docs/Shared/Upgrade/FromV6.md
33+
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
34+
[//]: # (warning: Generated automatically. Do not edit.)
35+
36+
* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.
37+
38+
* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).
39+
40+
[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)

packages/dev/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
1919
},
2020
"require": {
21-
"php": "^8.1|^8.2|^8.3",
21+
"php": "^8.2|^8.3",
2222
"illuminate/contracts": "^10.34.0|^11.0.0",
2323
"illuminate/support": "^10.34.0|^11.0.0",
2424
"larastan/larastan": "^2.8.1",

packages/dev/metadata.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"HEAD": {
1010
"php": [
1111
"^8.3",
12-
"^8.2",
13-
"^8.1"
12+
"^8.2"
1413
],
1514
"phpstan/phpstan": [
1615
"^1.10"

packages/dev/src/App/Example.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public function __invoke(File $file): ?string {
9191
return $result;
9292
}
9393

94-
public static function dump(mixed $value, string $expression = null): void {
94+
public static function dump(mixed $value, ?string $expression = null): void {
9595
self::getDumper()->dump($value, $expression ?? self::getExpression(__FUNCTION__));
9696
}
9797

98-
public static function raw(Stringable|string $value, string $type, string $expression = null): void {
98+
public static function raw(Stringable|string $value, string $type, ?string $expression = null): void {
9999
self::getDumper()->raw($value, $expression ?? self::getExpression(__FUNCTION__), $type);
100100
}
101101

packages/documentator/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This package provides various utilities for documentation generation such as Mar
1212
|--------------|---------------------|------------------|
1313
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
1414
| | `^8.2` | `HEAD ⋯ 5.0.0-beta.1` |
15-
| | `^8.1` | `HEAD ⋯ 5.0.0-beta.1` |
15+
| | `^8.1` | `6.4.1 ⋯ 5.0.0-beta.1` |
1616
| Laravel | `^11.0.0` | `HEAD ⋯ 6.2.0` |
1717
| | `^10.34.0` | `HEAD ⋯ 6.2.0` |
1818
| | `^10.0.0` | `6.1.0 ⋯ 5.0.0-beta.1` |

packages/documentator/UPGRADE.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
3333
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
3434
[//]: # (warning: Generated automatically. Do not edit.)
3535

36+
* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.
37+
3638
* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).
3739

3840
[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)

packages/documentator/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
1919
},
2020
"require": {
21-
"php": "^8.1|^8.2|^8.3",
21+
"php": "^8.2|^8.3",
2222
"ext-mbstring": "*",
2323
"composer/semver": "^3.2",
2424
"illuminate/contracts": "^10.34.0|^11.0.0",
@@ -41,7 +41,7 @@
4141
},
4242
"require-dev": {
4343
"lastdragon-ru/lara-asp-testing": "self.version",
44-
"mockery/mockery": "^1.6.2",
44+
"mockery/mockery": "^1.6.5",
4545
"orchestra/testbench": "^8.0.0|^9.0.0",
4646
"phpunit/phpunit": "^10.1.0|^11.0.0",
4747
"webonyx/graphql-php": "^15.4.0"

packages/documentator/metadata.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
],
1111
"php": [
1212
"^8.3",
13-
"^8.2",
14-
"^8.1"
13+
"^8.2"
1514
]
1615
},
1716
"6.4.1": {

packages/documentator/src/PackageException.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Throwable;
77

88
abstract class PackageException extends Exception {
9-
public function __construct(string $message, Throwable $previous = null) {
9+
public function __construct(string $message, ?Throwable $previous = null) {
1010
parent::__construct($message, 0, $previous);
1111
}
1212
}

packages/documentator/src/Processor/Exceptions/CircularDependency.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
protected readonly File $target,
2020
protected readonly File $dependency,
2121
protected readonly array $stack,
22-
Throwable $previous = null,
22+
?Throwable $previous = null,
2323
) {
2424
parent::__construct(
2525
sprintf(

packages/documentator/src/Processor/Exceptions/DependencyNotFound.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
* @var Dependency<*>
1919
*/
2020
protected readonly Dependency $dependency,
21-
Throwable $previous = null,
21+
?Throwable $previous = null,
2222
) {
2323
parent::__construct(
2424
sprintf(

packages/documentator/src/Processor/Exceptions/FileSaveFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FileSaveFailed extends ProcessorError {
1212
public function __construct(
1313
protected Directory $root,
1414
protected readonly File $target,
15-
Throwable $previous = null,
15+
?Throwable $previous = null,
1616
) {
1717
parent::__construct(
1818
sprintf(

packages/documentator/src/Processor/Exceptions/FileTaskFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function __construct(
1414
protected Directory $root,
1515
protected readonly File $target,
1616
protected readonly Task $task,
17-
Throwable $previous = null,
17+
?Throwable $previous = null,
1818
) {
1919
parent::__construct(
2020
sprintf(

packages/documentator/src/Processor/Exceptions/ProcessingFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class ProcessingFailed extends ProcessorError {
1111
public function __construct(
1212
protected Directory $root,
13-
Throwable $previous = null,
13+
?Throwable $previous = null,
1414
) {
1515
parent::__construct(
1616
sprintf(

packages/documentator/src/Processor/Tasks/Preprocess/Exceptions/DependencyIsMissing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DependencyIsMissing extends InstructionFailed {
1414
public function __construct(
1515
Context $context,
1616
private readonly string $class,
17-
Throwable $previous = null,
17+
?Throwable $previous = null,
1818
) {
1919
parent::__construct(
2020
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Exceptions/InstructionFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ abstract class InstructionFailed extends PreprocessError {
99
public function __construct(
1010
private readonly Context $context,
1111
string $message,
12-
Throwable $previous = null,
12+
?Throwable $previous = null,
1313
) {
1414
parent::__construct($message, $previous);
1515
}

packages/documentator/src/Processor/Tasks/Preprocess/Exceptions/PreprocessFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class PreprocessFailed extends PreprocessError {
88
public function __construct(
9-
Throwable $previous = null,
9+
?Throwable $previous = null,
1010
) {
1111
parent::__construct(
1212
'Preprocessing failed.',

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeArtisan/Exceptions/ArtisanCommandError.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ArtisanCommandError extends InstructionFailed {
1212
public function __construct(
1313
Context $context,
14-
Throwable $previous = null,
14+
?Throwable $previous = null,
1515
) {
1616
parent::__construct(
1717
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeArtisan/Exceptions/ArtisanCommandFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ArtisanCommandFailed extends InstructionFailed {
1212
public function __construct(
1313
Context $context,
1414
private readonly int $result,
15-
Throwable $previous = null,
15+
?Throwable $previous = null,
1616
) {
1717
parent::__construct(
1818
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeDocBlock/Exceptions/TargetIsNotValidPhpFile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use function sprintf;
1010

1111
class TargetIsNotValidPhpFile extends InstructionFailed {
12-
public function __construct(Context $context, Throwable $previous = null) {
12+
public function __construct(Context $context, ?Throwable $previous = null) {
1313
parent::__construct(
1414
$context,
1515
sprintf(

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeDocumentList/Exceptions/DocumentTitleIsMissing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DocumentTitleIsMissing extends InstructionFailed {
1313
public function __construct(
1414
Context $context,
1515
private readonly File $document,
16-
Throwable $previous = null,
16+
?Throwable $previous = null,
1717
) {
1818
parent::__construct(
1919
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeExample/Exceptions/ExampleFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ExampleFailed extends InstructionFailed {
1313
public function __construct(
1414
Context $context,
1515
private readonly File $example,
16-
Throwable $previous = null,
16+
?Throwable $previous = null,
1717
) {
1818
parent::__construct(
1919
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeExec/Exceptions/TargetExecFailed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use function sprintf;
1010

1111
class TargetExecFailed extends InstructionFailed {
12-
public function __construct(Context $context, Throwable $previous = null) {
12+
public function __construct(Context $context, ?Throwable $previous = null) {
1313
parent::__construct(
1414
$context,
1515
sprintf(

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeGraphqlDirective/Exceptions/TargetIsNotDirective.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use function sprintf;
1010

1111
class TargetIsNotDirective extends InstructionFailed {
12-
public function __construct(Context $context, Throwable $previous = null) {
12+
public function __construct(Context $context, ?Throwable $previous = null) {
1313
parent::__construct(
1414
$context,
1515
sprintf(

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludePackageList/Exceptions/PackageComposerJsonIsMissing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class PackageComposerJsonIsMissing extends InstructionFailed {
1313
public function __construct(
1414
Context $context,
1515
private readonly Directory $package,
16-
Throwable $previous = null,
16+
?Throwable $previous = null,
1717
) {
1818
parent::__construct(
1919
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludePackageList/Exceptions/PackageReadmeIsEmpty.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(
1515
Context $context,
1616
private readonly Directory $package,
1717
private readonly File $readme,
18-
Throwable $previous = null,
18+
?Throwable $previous = null,
1919
) {
2020
parent::__construct(
2121
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludePackageList/Exceptions/PackageReadmeTitleIsMissing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(
1515
Context $context,
1616
private readonly Directory $package,
1717
private readonly File $readme,
18-
Throwable $previous = null,
18+
?Throwable $previous = null,
1919
) {
2020
parent::__construct(
2121
$context,

packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeTemplate/Exceptions/TemplateDataMissed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use function sprintf;
1010

1111
class TemplateDataMissed extends InstructionFailed {
12-
public function __construct(Context $context, Throwable $previous = null) {
12+
public function __construct(Context $context, ?Throwable $previous = null) {
1313
parent::__construct(
1414
$context,
1515
sprintf(

0 commit comments

Comments
 (0)