Skip to content

Commit

Permalink
feat: PHP 8.3 Support (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru authored Oct 20, 2023
2 parents 3d0d504 + cd78b23 commit 34296a9
Show file tree
Hide file tree
Showing 38 changed files with 65 additions and 31 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The set provides best practices to make development more fun and classes/service

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"ext-dom": "*",
"ext-intl": "*",
"ext-json": "*",
Expand Down
1 change: 1 addition & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package contains useful utilities and classes.

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"ext-mbstring": "*",
"laravel/framework": "^9.21.0|^10.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/documentator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides various utilities for documentation generation.

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD` , `5.0.0-beta.1` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD` , `5.0.0-beta.1` |
| | `^8.1` | `HEAD` , `5.0.0-beta.1` |
| Laravel | `^10.0.0` | `HEAD` , `5.0.0-beta.1` |
| | `^9.21.0` | `HEAD` , `5.0.0-beta.1` |
Expand Down
2 changes: 1 addition & 1 deletion 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",
"php": "^8.1|^8.2|^8.3",
"ext-mbstring": "*",
"composer/semver": "^3.2",
"laravel/framework": "^9.21.0|^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/documentator/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/eloquent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package contains useful extensions and mixins for [Eloquent](https://larave

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/eloquent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"laravel/framework": "^9.21.0|^10.0.0",
"lastdragon-ru/lara-asp-core": "self.version"
},
Expand Down
1 change: 1 addition & 0 deletions packages/eloquent/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/formatter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides a customizable wrapper around [Intl](https://www.php.net/m

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter/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",
"php": "^8.1|^8.2|^8.3",
"ext-intl": "*",
"ext-mbstring": "*",
"laravel/framework": "^9.21.0|^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/formatter/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
22 changes: 16 additions & 6 deletions packages/formatter/src/FormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use PHPUnit\Framework\Attributes\CoversClass;

use function config;
use function str_replace;

/**
* @internal
Expand Down Expand Up @@ -125,8 +126,11 @@ public function testDuration(): void {
public function testTime(): void {
$time = DateTime::createFromFormat('H:i:s', '23:24:59') ?: null;

self::assertEquals('11:24 PM', $this->formatter->time($time));
self::assertEquals('2:24 AM', $this->formatter->time($time, null, 'Europe/Moscow'));
self::assertEquals('11:24 PM', str_replace("\u{202F}", ' ', $this->formatter->time($time)));
self::assertEquals(
'2:24 AM',
str_replace("\u{202F}", ' ', $this->formatter->time($time, null, 'Europe/Moscow')),
);
}

public function testTimeConfig(): void {
Expand All @@ -136,7 +140,7 @@ public function testTimeConfig(): void {

$time = DateTime::createFromFormat('H:i:s', '23:24:59') ?: null;

self::assertEquals('11:24:59 PM', $this->formatter->time($time));
self::assertEquals('11:24:59 PM', str_replace("\u{202F}", ' ', $this->formatter->time($time)));
}

public function testTimeCustomFormat(): void {
Expand Down Expand Up @@ -185,8 +189,11 @@ public function testDateCustomFormat(): void {
public function testDatetime(): void {
$datetime = DateTime::createFromFormat('d.m.Y H:i:s', '12.05.2005 23:00:00') ?: null;

self::assertEquals('5/12/05, 11:00 PM', $this->formatter->datetime($datetime));
self::assertEquals('5/13/05, 3:00 AM', $this->formatter->datetime($datetime, null, 'Europe/Moscow'));
self::assertEquals('5/12/05, 11:00 PM', str_replace("\u{202F}", ' ', $this->formatter->datetime($datetime)));
self::assertEquals(
'5/13/05, 3:00 AM',
str_replace("\u{202F}", ' ', $this->formatter->datetime($datetime, null, 'Europe/Moscow')),
);
}

public function testDatetimeConfig(): void {
Expand All @@ -196,7 +203,10 @@ public function testDatetimeConfig(): void {

$datetime = DateTime::createFromFormat('d.m.Y H:i:s', '12.05.2005 23:00:00') ?: null;

self::assertEquals('May 12, 2005, 11:00:00 PM', $this->formatter->datetime($datetime));
self::assertEquals(
'May 12, 2005, 11:00:00 PM',
str_replace("\u{202F}", ' ', $this->formatter->datetime($datetime)),
);
}

public function testDatetimeCustomFormat(): void {
Expand Down
3 changes: 2 additions & 1 deletion packages/graphql-printer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Independent (from Laravel and Lighthouse) package that allow you to print GraphQ

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 3.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 3.0.0` |
| | `^8.1` | `HEAD ⋯ 3.0.0` |
| | `^8.0` | `4.6.0 ⋯ 3.0.0` |
| `webonyx/graphql-php` | `^15.4.0` | `HEAD ⋯ 4.2.1` |
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"ext-mbstring": "*",
"webonyx/graphql-php": "^15.4.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-printer/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"requirements": {
"HEAD": {
"php": [
"^8.3",
"^8.2",
"^8.1"
],
Expand Down
3 changes: 2 additions & 1 deletion packages/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides highly powerful `@searchBy` and `@sortBy` directives for

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/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",
"php": "^8.1|^8.2|^8.3",
"ext-mbstring": "*",
"composer/semver": "^3.2",
"laravel/framework": "^9.21.0|^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/graphql/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"^6.5.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/migrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ This package improves standard laravel migrations to add support for raw SQL fil

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/migrator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"ext-json": "*",
"composer/semver": "^3.2",
"laravel/framework": "^9.21.0|^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/migrator/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/queue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides additional capabilities for queued jobs and queued listene

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/queue/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",
"php": "^8.1|^8.2|^8.3",
"laravel/framework": "^9.21.0|^10.0.0",
"lastdragon-ru/lara-asp-core": "self.version"
},
Expand Down
1 change: 1 addition & 0 deletions packages/queue/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/serializer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides a customizable wrapper around the [Symfony Serializer Comp

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 5.0.0-beta.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 5.0.0-beta.0` |
| | `^8.1` | `HEAD ⋯ 5.0.0-beta.0` |
| Laravel | `^10.0.0` | `HEAD ⋯ 5.0.0-beta.0` |
| | `^9.21.0` | `HEAD` , `5.0.0-beta.1` |
Expand Down
2 changes: 1 addition & 1 deletion packages/serializer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"laravel/framework": "^9.21.0|^10.0.0",
"lastdragon-ru/lara-asp-core": "self.version",
"phpdocumentor/type-resolver": "^1.7",
Expand Down
1 change: 1 addition & 0 deletions packages/serializer/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/spa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/spa/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",
"php": "^8.1|^8.2|^8.3",
"ext-mbstring": "*",
"guzzlehttp/psr7": "^1.9.1|^2.4.5",
"laravel/framework": "^9.21.0|^10.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/spa/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
3 changes: 2 additions & 1 deletion packages/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This package provides various useful asserts for [PHPUnit](https://phpunit.de/)

| Requirement | Constraint | Supported by |
|--------------|---------------------|------------------|
| PHP | `^8.2` | `HEAD ⋯ 2.0.0` |
| PHP | `^8.3` | `HEAD` |
| | `^8.2` | `HEAD ⋯ 2.0.0` |
| | `^8.1` | `HEAD ⋯ 2.0.0` |
| | `^8.0` | `4.6.0 ⋯ 2.0.0` |
| | `^8.0.0` | `1.1.2 ⋯ 0.12.0` |
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"forum": "https://github.com/LastDragon-ru/lara-asp/discussions"
},
"require": {
"php": "^8.1|^8.2",
"php": "^8.1|^8.2|^8.3",
"ext-json": "*",
"ext-libxml": "*",
"ext-dom": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/testing/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"^9.21.0"
],
"php": [
"^8.3",
"^8.2",
"^8.1"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/src/Constraints/Json/Protocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function getUri(SplFileInfo $file, array $parameters = []): Uri {

// Build
$scheme = static::Scheme;
$query = http_build_query($parameters, encoding_type: PHP_QUERY_RFC3986);
$query = http_build_query($parameters, '', '&', PHP_QUERY_RFC3986);
$path = implode('/', array_map(rawurlencode(...), explode('/', ltrim($path, '/'))));
$uri = new Uri((array) parse_url("{$scheme}://{$host}/{$path}?{$query}"));

Expand Down

0 comments on commit 34296a9

Please sign in to comment.