Closed alies-dev closed 3 years ago
Hey, I think it would be more neat to do these checks inline with ternaries, eg:
return $frame->shortPath ? preg_match('#^/storage/framework/views/[a-z0-9]+\.php$#', $frame->shortPath) : false;
@itsgoingd
Hey, I think it would be more neat to do these checks inline with ternaries, eg:
Thanks for the quick response! Honestly, I think early return is more readable and maintainable, but I'll apply your proposal just to merge this PR ASAP. One note: I think it's better to return null instead of false
- $viewFrame
string|null is better than string|false (nullable scalar vs mixed type):
return $frame->shortPath ? preg_match('#^/storage/framework/views/[a-z0-9]+\.php$#', $frame->shortPath) : null;
@itsgoingd
BTW, I was really surprised that the repo uses tabs for indent. Are e going to continue to use it? If so - I would recommend to add .editorconfig
file:
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
Is not - I can create another PR to automate coding style fixing (via phpcs or php-cs-fixer) to fallow PSR standards
Thanks. The closure is a filter function that says whether a value should be returned, that's why false
is more appropriate. I will tweak that myself tho.
Yes we are intentionally using tabs and not following all PSR recommendations. I'll accept an .editorconfig
PR if you would like to send one.
is fixes 2 deprecated notes: