Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #18 Fixing the boolean representation when using 1/0 (Vitor de So…
…uza) This PR was merged into the master branch. Discussion ---------- Fixing the boolean representation when using 1/0 Until now, if we had something like APP_DEBUG=0 in `.env.dist` file, it was displayed like: ``` > Companienv\Composer\ScriptHandler::run It looks like you are missing some configuration (1 variables). I will help you to sort this out. Let's fix this? (y) APP_DEBUG ? ``` So you have no idea what type of value you should place here (true? 1? something else?). There's no problems with using "true" and "false", however, since we can represent booleans with 1 and 0 as well, we need to display it properly, as in: ``` > Companienv\Composer\ScriptHandler::run It looks like you are missing some configuration (1 variables). I will help you to sort this out. Let's fix this? (y) APP_DEBUG ? (0) ``` So now you know you should place either "0" or "1" here. The problem was actually just checking the if($variable) instead of comparing using "!== ''", so it was considering the string "0" as false and thus not display properly the default value after the question mark. I've also added a test for checking this behaviour and added parenthesis some lines up the "if" I've changed, for clarity of the null-coalesce/ternary precedence. Commits ------- 80497db Fixing the boolean representation when using 1/0
- Loading branch information