I wanted to format all my contoller's code with a single phpcs command. But i'm not getting any suitable code/command to do it. I have one command which is used to format single file's code -
If you code untidy, that's a sign of being muddled, and in amongst the muddle you'll find mistakes. Poorly named objects and classes, irregular indentation - all add to the confusion.
I'm in a job where I need PR before my code goes out and that has raised my code quality hugely. I realise not everyone doesn't have that but it doesn't stop me formatting my code for my personal projects.
Getting perfect can be tedious, I think my code without auto format is acceptably neat. :)
I mean, I take the effort to format my markdown in most of my posts here on Laracast.
I need code to be perfect or should I say, absolutely consistent so that I don't get unnecessary Git whitespace changes.
@laracoft I'm not objecting to linting and I definitely agree there is benefits to it. I'm just saying you should manually run the linter and that will help you learn what has been changed so you can get better at it next time.
It also allows you to make exceptions. For example, whilst I am a fan of phpdoc and return types, not everyone is. Sometimes its cleaner to do without them.
I guess anyone who is bothering to set up code sniffing and linting is already on board with the benefits of clean code, so we're preaching to the converted.