PHP 8.1 Compatibility
Running garden-cli with PHP 8.1.5 gives me:
Deprecated: Return type of Garden\Cli\Schema\OptSchema::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Schema\OptSchema.php on line 231
Deprecated: Return type of Garden\Cli\Args::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Args.php on line 219
Deprecated: Return type of Garden\Cli\Args::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Args.php on line 236
Deprecated: Return type of Garden\Cli\Args::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Args.php on line 247
Deprecated: Return type of Garden\Cli\Args::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Args.php on line 259
Deprecated: Return type of Garden\Cli\Args::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in D:_pro\Target\target_web\vendor\vanilla\garden-cli\src\Args.php on line 270
I can not push to new branch or create pull request. So... If okay, please help me doing these: src\Schema\OptSchema.php Line 231: Add return type: mixed public function jsonSerialize() : mixed {
src\Args.php Line 219: Add return type: mixed public function jsonSerialize() : mixed { Line 236: Add return type: bool public function offsetExists($offset) : bool { Line 247: Add return type: mixed public function offsetGet($offset) : mixed { Line 259: Add return type: void public function offsetSet($offset, $value) : void { Line 270: Add return type: void public function offsetUnset($offset) : void {
Doing this will break compatibility with PHP below Version 7. But since the requirement for garden-cli is PHP 7 or above, then i think it's safe to do above changes.
Hi, when will this fix be released officially?
There is a small issue in the REAMD.md in this pull request:
The documentation says the following about the setTimeFormat method for the StreamLogger class.
| Method | Default | Notes |
| ------ | ------- |------------------------------------------------------------------------------------------------------------------------|
| `setTimeFormat` | `'%F %T'` | Set the time format. This can be a `date` string or a callback. |
The %F and %T formats will not work as the date() function is now used instead of strftime() (which has been deprecated in PHP 8.1). The documentation should say:
| Method | Default | Notes |
| ------ | --------------- |------------------------------------------------------------------------------------------------------------------------|
| `setTimeFormat` | `'Y-m-d H:i:s'` | Set the time format. This can be a `date` string or a callback. |