benedmunds / CodeIgniter-Ion-Auth

Simple and Lightweight Auth System for CodeIgniter
http://benedmunds.com/ion_auth/
MIT License
2.35k stars 1.14k forks source link

Parse error unexpected '|' #1509

Closed matheuspelegrino closed 3 years ago

matheuspelegrino commented 3 years ago

Which branch are you using? 4

What CodeIgniter version are you using? v4

What PHP version are you using? 7.3

Describe the bug

Everything was fine, I updated branch 4 and I came across it.

image

dsivic commented 3 years ago

Me to.

ageir commented 3 years ago

I have the same issue. The problem is that someone used union return types in the code. Which is PHP 8.0+. If you need to solve it quickly you can change:

public function sendActivationEmail(string $identity): bool|array

to

public function sendActivationEmail(string $identity)

Someone should make a pull request to resolve this issue. I'd create one myself but I'm not familiar with the library and I'm not sure what the policy is for the library if it is supposed to require PHP8 or not.

benedmunds commented 3 years ago

I removed the typehint here, so it should work on PHP 7 now: https://github.com/benedmunds/CodeIgniter-Ion-Auth/commit/200b03d961602995939ab82f26afabb61b020028