-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
How do I assign a literal value? #424
Comments
Hmm, that is a bit of a problem. The issue is the string |
One way to force the string would be to do: $fm->define('Resume')->setDefinitions([
'salary' => function () { return 'd'; },
]); |
That would work but it is a bit verbose. As a user I would expect a literal string to assign a literal string. It would be a breaking change but maybe in the future it could be changed so that if you want to call a $fm->define('Foo')->setDefinitions([
'bar' => $fm->call('myCallable'),
]); |
I wonder if I could refactor the generator stuff so that people could choose to disable callables. Would that work for you. In other words, only support closures rather than callables, as an option. |
That would work. If callables were disabled I still like the idea of having a helper method that you could pass a string and it would return a closure that calls the callable. Like the |
I'll have a think how I can make this work so it's really nice to use. |
I want to hard code a literal value. Here is a minimal example:
The problem is I also have a global function
d()
and it calls thed()
function instead of just using the literal value 'd'. Is there a way to assign literal string values?The text was updated successfully, but these errors were encountered: