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

Model's set method should accept not only string #2570

Merged
merged 5 commits into from
Feb 23, 2020

Conversation

nowackipawel
Copy link
Contributor

I think someone adds casting here by mistake

I think someone adds casting here by mistake
@MGatner
Copy link
Member

MGatner commented Feb 18, 2020

Model::set() should share the same signature with Builder::set(), which also only takes string values for input. The handling of the value type happens in a few different places, but ultimately the value is concatenated so safer to remain a string. Actually though, it should be of type ?string since you can pass an array of values for $key and leave $value out altogether.

@nowackipawel
Copy link
Contributor Author

@MGatner ;-) thank you for pointing this out. updated. and yes you are right about the rest.

@MGatner
Copy link
Member

MGatner commented Feb 21, 2020

You still have string|int for the docs. I don't know if inline docs care about things like "4" but this will always need to take a string or null for input.

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

Please change the signature and inline docs to match BaseBuilder::set()

@MGatner
Copy link
Member

MGatner commented Feb 23, 2020

Looks correct, thank you!

@MGatner MGatner merged commit 11c6008 into codeigniter4:develop Feb 23, 2020
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.

2 participants