laravel-mysql-spatial icon indicating copy to clipboard operation
laravel-mysql-spatial copied to clipboard

Does it work with PHP8.1 ?

Open smknstd opened this issue 3 years ago • 4 comments

Hello ! I'm trying this package with PHP8.1 and everything seems to work so far even if it doesn't look updated since PHP7.4 https://github.com/grimzy/laravel-mysql-spatial/blob/master/.travis.yml#L5

It seems there are some deprecations notices though. Ex:

PHP Deprecated: Return type of Grimzy\LaravelMysqlSpatial\Types\Point::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /vendor/grimzy/laravel-mysql-spatial/src/Types/Point.php on line 95

smknstd avatar Feb 06 '22 11:02 smknstd

@grimzy It would be great if you tagged a small update taking care of these deprecations before jumping on to the Laravel 9 release, which you already have a PR for. This is because a lot of users will be using Laravel 8 with PHP 8.1 for a long time still before upgrading to Laravel 9.

vesper8 avatar Feb 15 '22 14:02 vesper8

https://github.com/grimzy/laravel-mysql-spatial/blob/master/composer.json#L18

I think it would be good practice to change for bound php version ; something like :

"require": {
   "php": "^7.4|^8.0",
}

https://getcomposer.org/doc/faqs/why-are-unbound-version-constraints-a-bad-idea.md

smknstd avatar Feb 15 '22 15:02 smknstd

There’s a PR open for this: #189

macbookandrew avatar Aug 18 '22 19:08 macbookandrew

Have the same issue after switching to PHP8.1.

Return type of Grimzy\LaravelMysqlSpatial\Types\Point::jsonSerialize() should either be compatible with 
JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to
temporarily suppress the notice in vendor/grimzy/laravel-mysql-spatial/src/Types/Point.php on line 95

jangaraev avatar Sep 14 '22 09:09 jangaraev