I am currently writing a PHP / JavaScript application library, which I intend to use in the future for several other applications. The library includes functionality for handling a database, creating users / hashing and checking passwords, etc.
I am wondering whether there are any accepted best practices on how to organise PHP code in files, etc.? I have recently transitioned from C++ where I was quite content with the way I ordered my code, but since finding out PHP doesn't do the whole "header file" "content file" thing, I am left wondering whether there are any guidelines I should follow for clarity's sake. I am currently including all method definitions within the one class file, which feels messy and inelegant to me.
How do people do this? Separate methods into traits? Separate files for each methods? All the methods in one file but separate from class definition? Or just dump it all in the class declaration file?
Any imput on this (or any other code organisation best practices) much appreciated!