skiedude / evestructures

An ESI/SSO backed website enabling Eve Online Corporations to view and manage all their owned Structures in New Eden
https://structures.eveskillboard.com
MIT License
22 stars 12 forks source link

PHP7.4 support #23

Closed jamiew0w closed 4 years ago

jamiew0w commented 4 years ago

Hey Brock,

I'm aware this project is now in 'limited updates' mode but I figured it'd be good to open this issue to ensure the project can (hopefully) remain future-proof.

When using PHP7.4 we're running into this error:

2020-05-23 03:18:06] laravel.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at /var/www/bleh/app/Http/Controllers/WelcomeController.php:12)

As you correctly pointed out it's due to how PHP7.4 handles null values:

 $alert = $alert[0];

I tested with your suggested fix but no luck unfortunately, replacing the above with:

$alert = len($alert) > 0 ? $alert[0] : null;

If you need any further information I'm happy to switch PHP versions and report back with whatever you need. Thanks again for this awesome tool!