Skip to content

Commit

Permalink
refactor!: Drop PHP 8.1 support (#177)
Browse files Browse the repository at this point in the history
Closes: #144
  • Loading branch information
LastDragon-ru authored Jul 20, 2024
2 parents f953237 + 30ea4af commit a320c33
Show file tree
Hide file tree
Showing 238 changed files with 423 additions and 578 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The set provides best practices to make development more fun and classes/service
|--------------|---------------------|------------------|
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `6.4.1 ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
| | `>=8.0.0` | `0.11.0 ⋯ 0.4.0` |
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2|^8.3",
"php": "^8.2|^8.3",
"ext-bcmath": "*",
"ext-dom": "*",
"ext-filter": "*",
Expand All @@ -43,7 +43,7 @@
"ext-xmlreader": "*",
"composer/semver": "^3.2",
"doctrine/sql-formatter": "^1.1",
"guzzlehttp/psr7": "^1.9.1|^2.4.5",
"guzzlehttp/psr7": "^2.4.5",
"http-interop/http-factory-guzzle": "^1.0.0",
"illuminate/collections": "^10.34.0|^11.0.0",
"illuminate/conditionable": "^10.34.0|^11.0.0",
Expand All @@ -62,7 +62,7 @@
"illuminate/translation": "^10.34.0|^11.0.0",
"illuminate/validation": "^10.34.0|^11.0.0",
"league/commonmark": "^2.4",
"mockery/mockery": "^1.6.2",
"mockery/mockery": "^1.6.5",
"nikic/php-parser": "^4.18|^5.0",
"nuwave/lighthouse": "^6.5.0",
"opis/json-schema": "^2.3.0",
Expand Down
2 changes: 2 additions & 0 deletions docs/Shared/Upgrade/FromV6.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.

* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).
3 changes: 1 addition & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
],
"php": [
"^8.3",
"^8.2",
"^8.1"
"^8.2"
]
},
"6.4.1": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This package contains useful utilities and classes.
|--------------|---------------------|------------------|
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `6.4.1 ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
| | `>=8.0.0` | `0.11.0 ⋯ 0.4.0` |
Expand Down
2 changes: 2 additions & 0 deletions packages/core/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
[//]: # (warning: Generated automatically. Do not edit.)

* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.

* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).

[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
Expand Down
4 changes: 2 additions & 2 deletions packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2|^8.3",
"php": "^8.2|^8.3",
"illuminate/console": "^10.34.0|^11.0.0",
"illuminate/container": "^10.34.0|^11.0.0",
"illuminate/contracts": "^10.34.0|^11.0.0",
Expand All @@ -30,7 +30,7 @@
"require-dev": {
"phpunit/phpunit": "^10.1.0|^11.0.0",
"lastdragon-ru/lara-asp-testing": "self.version",
"mockery/mockery": "^1.6.2",
"mockery/mockery": "^1.6.5",
"orchestra/testbench": "^8.0.0|^9.0.0"
},
"autoload": {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
],
"php": [
"^8.3",
"^8.2",
"^8.1"
"^8.2"
]
},
"6.4.1": {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Helpers/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract protected function getName(): string;
* @param list<string>|string $key
* @param array<string, mixed> $replace
*/
public function get(array|string $key, array $replace = [], string $locale = null): string {
public function get(array|string $key, array $replace = [], ?string $locale = null): string {
return $this->translate($key, function (string $key) use ($replace, $locale): string {
return Cast::toString($this->translator->get($this->key($key), $replace, $locale));
});
Expand All @@ -44,7 +44,7 @@ public function choice(
array|string $key,
Countable|array|int $number,
array $replace = [],
string $locale = null,
?string $locale = null,
): string {
return $this->translate($key, function (string $key) use ($number, $replace, $locale): string {
return $this->translator->choice($this->key($key), $number, $replace, $locale);
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Various internal tools and helpers to develop the package itself.
|--------------|---------------------|------------------|
| PHP | `^8.3` | `HEAD ⋯ 6.2.0` |
| | `^8.2` | `HEAD ⋯ 6.2.0` |
| | `^8.1` | `HEAD ⋯ 6.2.0` |
| | `^8.1` | `6.4.1 ⋯ 6.2.0` |
| PHPStan | `^1.10` | `HEAD ⋯ 6.2.0` |

[//]: # (end: 0f999169cbabc32d4f47c79c31d74f8b4066c685962719bae5df3c63a08ea382)
Expand Down
12 changes: 12 additions & 0 deletions packages/dev/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
|:--:|:--------------------------------------------------------------------------------------------------------------------|

[//]: # (end: 8e89e65b3785cb5b41f28a4f3c5b7e0db0110d8047852d71cd99b2cdffd8f57c)

# Upgrade from v6

[include:file]: ../../docs/Shared/Upgrade/FromV6.md
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
[//]: # (warning: Generated automatically. Do not edit.)

* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.

* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).

[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
2 changes: 1 addition & 1 deletion packages/dev/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2|^8.3",
"php": "^8.2|^8.3",
"illuminate/contracts": "^10.34.0|^11.0.0",
"illuminate/support": "^10.34.0|^11.0.0",
"larastan/larastan": "^2.8.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/dev/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"HEAD": {
"php": [
"^8.3",
"^8.2",
"^8.1"
"^8.2"
],
"phpstan/phpstan": [
"^1.10"
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/src/App/Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public function __invoke(File $file): ?string {
return $result;
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion packages/documentator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This package provides various utilities for documentation generation such as Mar
|--------------|---------------------|------------------|
| PHP | `^8.3` | `HEAD ⋯ 5.0.0` |
| | `^8.2` | `HEAD ⋯ 5.0.0-beta.1` |
| | `^8.1` | `HEAD ⋯ 5.0.0-beta.1` |
| | `^8.1` | `6.4.1 ⋯ 5.0.0-beta.1` |
| Laravel | `^11.0.0` | `HEAD ⋯ 6.2.0` |
| | `^10.34.0` | `HEAD ⋯ 6.2.0` |
| | `^10.0.0` | `6.1.0 ⋯ 5.0.0-beta.1` |
Expand Down
2 changes: 2 additions & 0 deletions packages/documentator/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Please also see [changelog](https://github.com/LastDragon-ru/lara-asp/releases)
[//]: # (start: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
[//]: # (warning: Generated automatically. Do not edit.)

* [ ] PHP 8.1 is not supported anymore. Migrate to the newer version.

* [ ] Direct usages of `Container::getInstances()` were replaced by explicit constructor parameters. You may need to update your code accordingly (#151).

[//]: # (end: 470dd21d18d5886f1873b1247130ac8173ed99258e41418c6bd32162325d628b)
Expand Down
4 changes: 2 additions & 2 deletions packages/documentator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2|^8.3",
"php": "^8.2|^8.3",
"ext-mbstring": "*",
"composer/semver": "^3.2",
"illuminate/contracts": "^10.34.0|^11.0.0",
Expand All @@ -41,7 +41,7 @@
},
"require-dev": {
"lastdragon-ru/lara-asp-testing": "self.version",
"mockery/mockery": "^1.6.2",
"mockery/mockery": "^1.6.5",
"orchestra/testbench": "^8.0.0|^9.0.0",
"phpunit/phpunit": "^10.1.0|^11.0.0",
"webonyx/graphql-php": "^15.4.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/documentator/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
],
"php": [
"^8.3",
"^8.2",
"^8.1"
"^8.2"
]
},
"6.4.1": {
Expand Down
2 changes: 1 addition & 1 deletion packages/documentator/src/PackageException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Throwable;

abstract class PackageException extends Exception {
public function __construct(string $message, Throwable $previous = null) {
public function __construct(string $message, ?Throwable $previous = null) {
parent::__construct($message, 0, $previous);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(
protected readonly File $target,
protected readonly File $dependency,
protected readonly array $stack,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(
* @var Dependency<*>
*/
protected readonly Dependency $dependency,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FileSaveFailed extends ProcessorError {
public function __construct(
protected Directory $root,
protected readonly File $target,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(
protected Directory $root,
protected readonly File $target,
protected readonly Task $task,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ProcessingFailed extends ProcessorError {
public function __construct(
protected Directory $root,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DependencyIsMissing extends InstructionFailed {
public function __construct(
Context $context,
private readonly string $class,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class InstructionFailed extends PreprocessError {
public function __construct(
private readonly Context $context,
string $message,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct($message, $previous);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PreprocessFailed extends PreprocessError {
public function __construct(
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
'Preprocessing failed.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class ArtisanCommandError extends InstructionFailed {
public function __construct(
Context $context,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ArtisanCommandFailed extends InstructionFailed {
public function __construct(
Context $context,
private readonly int $result,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use function sprintf;

class TargetIsNotValidPhpFile extends InstructionFailed {
public function __construct(Context $context, Throwable $previous = null) {
public function __construct(Context $context, ?Throwable $previous = null) {
parent::__construct(
$context,
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DocumentTitleIsMissing extends InstructionFailed {
public function __construct(
Context $context,
private readonly File $document,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExampleFailed extends InstructionFailed {
public function __construct(
Context $context,
private readonly File $example,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use function sprintf;

class TargetExecFailed extends InstructionFailed {
public function __construct(Context $context, Throwable $previous = null) {
public function __construct(Context $context, ?Throwable $previous = null) {
parent::__construct(
$context,
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use function sprintf;

class TargetIsNotDirective extends InstructionFailed {
public function __construct(Context $context, Throwable $previous = null) {
public function __construct(Context $context, ?Throwable $previous = null) {
parent::__construct(
$context,
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PackageComposerJsonIsMissing extends InstructionFailed {
public function __construct(
Context $context,
private readonly Directory $package,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(
Context $context,
private readonly Directory $package,
private readonly File $readme,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(
Context $context,
private readonly Directory $package,
private readonly File $readme,
Throwable $previous = null,
?Throwable $previous = null,
) {
parent::__construct(
$context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use function sprintf;

class TemplateDataMissed extends InstructionFailed {
public function __construct(Context $context, Throwable $previous = null) {
public function __construct(Context $context, ?Throwable $previous = null) {
parent::__construct(
$context,
sprintf(
Expand Down
Loading

0 comments on commit a320c33

Please sign in to comment.