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

[5.7] Replace get_called_class() with static::class #27146

Merged
merged 1 commit into from Jan 12, 2019

Conversation

Projects
None yet
4 participants
@KennedyTedesco
Copy link
Contributor

KennedyTedesco commented Jan 12, 2019

get_called_class() can be securely replaced with static::class.

Also, this function will be marked as deprecated in PHP 7.4: https://wiki.php.net/rfc/deprecations_php_7_4#get_called_class_function

[5.7] Replace get_called_class()
`get_called_class()` can be securely replaced with `static::class`. Also, this function will be marked as deprecated in PHP 7.4:  https://wiki.php.net/rfc/deprecations_php_7_4#get_called_class_function

@taylorotwell taylorotwell merged commit a24a3db into laravel:5.7 Jan 12, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@KennedyTedesco KennedyTedesco deleted the KennedyTedesco:5.7-minor branch Jan 12, 2019

@carusogabriel

This comment has been minimized.

Copy link
Contributor

carusogabriel commented Jan 13, 2019

Note that the 7.4 Deprecations RFC haven't been voted yet, so

this function will be marked as deprecated in PHP 7.4

isn't true 😅

@KennedyTedesco

This comment has been minimized.

Copy link
Contributor Author

KennedyTedesco commented Jan 14, 2019

Sometimes we need to go further. hahaha Yeah, but it's an RFC from Nikita Popov, do you really believe that will not pass? Well, all open, but let's see.

Anyways, static::class is a way better in my opinion. :D

@javiercno

This comment has been minimized.

Copy link

javiercno commented Jan 16, 2019

Sometimes we need to go further. hahaha Yeah, but it's an RFC from Nikita Popov, do you really believe that will not pass? Well, all open, but let's see.

Anyways, self::class is a way better in my opinion. :D

self::class returns the parent class, the correct is static.

@KennedyTedesco

This comment has been minimized.

Copy link
Contributor Author

KennedyTedesco commented Jan 17, 2019

@javiercno I wrote it wrong. Just edited my previous comment. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment