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

[4.x] Use ::class constants where possible #199

Merged
merged 1 commit into from Jan 13, 2018

Conversation

mhujer
Copy link
Contributor

@mhujer mhujer commented Dec 23, 2017

It helps with refactorings and static analysis, because you can easily tell if the class is referenced or not.

It helps with refactorings and static analysis, because you can easily
tell if the class is missing or not.
@mabar
Copy link

mabar commented Jan 10, 2018

@mhujer It is possible to add ::class constants everywhere, as it depends only on use statements. Autoloading is not triggered and existence of these classes is not required.

Try it yourself:

use Foo\Bar;
echo Bar\Baz::class;

@ramsey
Copy link
Owner

ramsey commented Jan 13, 2018

The reason I didn't use ::class in pre-4.x versions of the library was because ::class was only introduced in PHP 5.5, and this library needed to work in version 5.4. Since ramsey/uuid 4.x will no longer support PHP 5.x, this breaking change is acceptable.

Thanks!

@ramsey ramsey merged commit 35838f1 into ramsey:4.x Jan 13, 2018
@mhujer mhujer deleted the mh-use-class-constant branch January 14, 2018 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants