-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
fix when include used with ternary operator #78
Conversation
fix when include used with ternary operator like: https://github.com/yiisoft/yii2-framework/blob/master/yii/helpers/SecurityBase.php#L123
Does this expression work in current version? |
It's would be great to solve this in any way, because I'm trying to write the post about Yii2 for almost a week now :( |
Yes, it works
Not know exactly, but I have a feeling that I saw this expression early, so this is the case.
No, this will make things much worse... Unfortunately, there is no reliable way to cover all the cases, because expression can be any valid expression with ternary operators, brackets, parenthesis, etc. It's pitty, but Go! will support only restricted sets of |
Oh, ok, thanks anyway. |
Done :) |
This is a very tiny patch that changes nothing in code logic, but is required to get [AspectMock](https://github.com/Codeception/AspectMock) and Go Aop working with Yii2. Go Aop is processing all `include` and `require` directives, replacing them with its filters. Unfortunately it doesn't play well with one-liners. So I had to break the code into few lines to get that working. I was trying to fix this issue in [Go Aop](goaop/framework#78) but looks like, the only option is to fix that in Yii2. AspectMock can dramaticly improve unit testing in Yii2, and I plan to do a blogpost with tutorial about it.
This is a very tiny patch that changes nothing in code logic, but is required to get [AspectMock](https://github.com/Codeception/AspectMock) and Go Aop working with Yii2. Go Aop is processing all `include` and `require` directives, replacing them with its filters. Unfortunately it doesn't play well with one-liners. So I had to break the code into few lines to get that working. I was trying to fix this issue in [Go Aop](goaop/framework#78) but looks like, the only option is to fix that in Yii2. AspectMock can dramaticly improve unit testing in Yii2, and I plan to do a blogpost with tutorial about it.
fix for "$xx = ? include(xx) : 'yy'" thing (Yii2)
fix when include used with ternary operator like: https://github.com/yiisoft/yii2-framework/blob/master/yii/helpers/SecurityBase.php#L123
Yep, Go AOP was patching easier then Yii2