eliasdorneles / code-igniter-cas-library

CodeIgniter CAS library (UNMAINTAINED)
MIT License
9 stars 10 forks source link

Return user as array not object #1

Closed beardedlinuxgeek closed 11 years ago

beardedlinuxgeek commented 12 years ago

Line 84, you cast the user login and attributes array to an object. I don't see the reasoning behind this and also PHP 5.4 allows for array dereferencing (http://php.net/manual/en/language.types.array.php#example-87) which would make this class easier to use.

Would you please remove the object casting?

eliasdorneles commented 12 years ago

Thanks for reporting! I think I decided for the casting because I could do $CI->cas->user()->userlogin; instead of $user = $CI->cas->user(); $user['userlogin']; (I haven't upgraded to PHP 5.4 yet). Why does returning an array instead of an object makes it easier to use? If you explain, maybe I remove the cast or at least make it configurable. :)

beardedlinuxgeek commented 11 years ago

I forgot you could just do

$CI->cas->user()->userlogin;

which is easier than

$CI->cas->user()['userlogin']

so just ignore me. Great library though, I use it alot

eliasdorneles commented 11 years ago

Thanks, glad you found it useful. :)