Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use property_exists instead of array_key_exists (continued) #515

Closed
wants to merge 1 commit into from

Conversation

darcywong00
Copy link
Contributor

Follows #513 and replaces the rest of the deprecated references of array_key_exists with property_exists.

Involves swapping parameters...

@darcywong00 darcywong00 added this to the A18S16 milestone Nov 29, 2024
@darcywong00 darcywong00 requested a review from mcdurdin December 4, 2024 01:35
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about any of these usages, sorry. I know the license one is incorrect.

return array_key_exists($s, $license_map) ? $license_map[$s] : $s;
return property_exists($license_map, $s) ? $license_map[$s] : $s;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect -- $license_map is an array not an object

@darcywong00
Copy link
Contributor Author

I see. for PHP 7.4 we can still use array_key_exists on arrays. The deprecation notice is on checking objects.

@darcywong00 darcywong00 closed this Dec 4, 2024
@mcdurdin mcdurdin deleted the fix/array-key-exists branch December 4, 2024 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants