-
Notifications
You must be signed in to change notification settings - Fork 264
Fix wrong data type in codec tutorial #1194
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
Conversation
@alcaeus the phpcs job should run on this PHP file. |
Should it be renamed then? - DateTimeCodec
- DateTimeImmutableCodec |
Immutability should be the default and |
Well if I have to deal with external objects which are using DateTime, I would end up having a DateTimeCodec and a DateTimeImmuatableCodec. I agree that immutability is recommended and would always use it, but maybe I am not in charge of this 🤷♂️ |
It's a tutorial, I like that it teaches good practices more broadly than the subject covered. |
I totally agree, but would change the name anyway to |
I deferred this on purpose so that I can use PHP 8.1 syntax in the codec tutorial. If we want to run phpcs, I'll have to change it back to PHP 7.4 syntax. I decided to ignore the naming discussion as this is just supposed to be inspiration for people. I did however add a note about the codec accepting any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
* v1.17: PHPLIB-1315: Fix psalm errors (mongodb#1198) Fix wrong data type in codec tutorial (mongodb#1194)
As is, the example would cause a type error. Thanks @OskarStark for bringing this to our attention!