Tustin / psn-php

A PHP wrapper for the PSN API
https://tustin.dev/psn-php/
MIT License
354 stars 73 forks source link

Problem when getting platform of trophy after update #231

Closed MnKashpour closed 1 year ago

MnKashpour commented 1 year ago

When trying to get the platform of a title, this error occurs Cannot instantiate enum Tustin\PlayStation\Enum\ConsoleType This error happens after I've updated to the last commit, I think it's because the ConsoleType enum is now using the native php8.1 enums which cannot be instantiated with the new keyword

MnKashpour commented 1 year ago

Same problem with TrophyType enum when I try to call type() on trophy

stipey commented 1 year ago

Getting the same at the moment.

stipey commented 1 year ago

I have just avoided the whole issue right now by doing public function type(): string and return $this->pluck('trophyType');

which works for my implementation right now. There's probably a preferred way to fix this, but I'll let the experts sort that out :)

Tustin commented 1 year ago

Apologies, maybe I should read how new PHP features work before I try to add them 😂