-
Notifications
You must be signed in to change notification settings - Fork 85
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
Argument appScope is not required and does not define a default value. #50
Comments
You are saying CFLint is not firing a ARG_DEFAULT_MISSING message, correct? |
Yes, apparently I misread the warning. As soon as I added a blank default the warning went away: However from reading the documentation I'm not clear on what a reasonable default for the Application scope argument would be. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d40.html In their examples they have it both ways but they don't say what a reasonable default should be. |
ARG_DEFAULT_MISSING is an attempt to help ensure your API doesn't do something unexpected when the caller doesn't pass all the arguments. We could disable this rule for the onXXX callback functions in Application.cfc. Especially given the example in the Adobe docs.. What do you think? |
Honestly my preference would be to keep flagging the error, but just get some clarification from Adobe on what a reasonable default for the AppScope parameter actually is. Unfortunately the docs for 11 don't seem to be much better: https://wikidocs.adobe.com/wiki/display/coldfusionen/onSessionEnd |
I agree with keeping the flag as is. I would argue that you should just make it required="true", instead of trying to figure out what a good default value would be. This is a callback function from the system, and the system probably is going to be sending that 2nd parameter all of the time. It's going to be consistent anyway. |
I'm running the latest CFLint built from the source of the master branch. Here is my code from my Application.cfc.
The text was updated successfully, but these errors were encountered: