Don't do only coding, craft your code (Part-1)
Beautify your PHP Code (PSR-2)
The intent of this guide is to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code.
The style rules herein are derived from commonalities among the various member projects. When various authors collaborate across multiple projects, it helps to have one set of guidelines to be used for all those projects. Thus, the benefit of this guide is not in the rules themselves, but in the sharing of those rules.
Write and beautify your code in such a manner that, programmer or collaborate can identify easily and understand that how's your code works and what is the purpose of your code in your application.
Please refer below articles and follow as much as possible.