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

Chained function (faker or native) does not work #842

Closed
Divi opened this issue Dec 13, 2017 · 4 comments
Closed

Chained function (faker or native) does not work #842

Divi opened this issue Dec 13, 2017 · 4 comments
Milestone

Comments

@Divi
Copy link

Divi commented Dec 13, 2017

Hello, if I use this example :

nestedFunctionValue: '<strtolower(<(implode(" ", ["HELLO", "WORLD", \<foo()>]))>)> \<bar()>'

I got this error :

[Nelmio\Alice\Throwable\Exception\FixtureBuilder\ExpressionLanguage\MalformedFunctionException]     
  The value "<(implode(__ARG_TOKEN__7215ee9c7d9dc229d2921a40e899ec5f" contains an unclosed function. 

Version : v3.1.2

@theofidry
Copy link
Member

I think this example was a bit too wild, in practice the lexer is not good enough and there is still limitations...

@Divi
Copy link
Author

Divi commented Dec 13, 2017

My first try was using native function ucfirst() with Faker words() function and native rand(), like <ucfirst(words(rand(1, 3)))> but I couldn't manage to do it.

@theofidry
Copy link
Member

This one looks simple enough to make it work, but the alternative in the meantime is to leverage faker providers

@theofidry theofidry added this to the 3.x milestone Dec 17, 2017
@theofidry
Copy link
Member

I've had a quick look but didn't find a satisfying solution. I'll close however as to me it's part of #601. The current in-house system is to have something somewhat working, but switching to a proper lexer/parser like HoaCompiler with a defined grammar is the way to go to avoid those issues.

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

No branches or pull requests

2 participants