Wrong phpdocs for method `lookup` in interface UserProfileServiceInterface
rolandsusans opened this issue ยท 3 comments
The bug reported ๐
There is a typo in phpdocs here:
Because there is no class with name userProfile.
Seems like intention was to specify UserProfile or array instead.
Background
In some case insensitive file systems, like MacOS APFS (default). It's impossible to have userProfile.php and UserProfile.php in same directory. Meanwhile in case sensitive file systems it's possible.
In my use case specifying return type hint as userProfile (by sdk) is causing issues when trying to add ignore configuration to ignoreErrors in phpstan-baseline.neon. During the execution of phpstan on each filesystem, the error list is different - because of case insensitivity and type specified in phpdocs.
After thinking a while on this it's not actually clear what was the original intention of the phpdoc.
https://github.com/optimizely/php-sdk/blame/master/src/Optimizely/UserProfile/UserProfileServiceInterface.php#L26
was it array, UserProfile or UserProfile[] or array<string,UserProfile> ๐ค
Looking at https://github.com/optimizely/php-sdk/blame/master/src/Optimizely/UserProfile/UserProfileServiceInterface.php#L33 seems that it should be an array. Right @fullstack-devs?
Hi @rolandsusans, I just closed your PR since we published a patch version to Packagist.
Is this Issue resolved?