I envisage developing an API client library which may use many small utility classes. Do I have to have a separate file for each class if using PSR-4? Is my approach sound, and if so how can I achieve it?
Edit in response to answers: I didn't understand the range of autoloading strategies in Composer particularly classmap autoloading and how that can better manage my own codebase.
Useful knowledge from Evert and Jeto.
Sample project layout:
src
myproject
client
apilib.php
apilib.php includes:
class Connection {}
class Statistics {}
class SomeOtherThing {}
Or am I stuck with creating these files?
client/apilib/Connection.php
client/apilib/Statistics.php
client/apilib/SomeOtherThing.php
What namespaces will my classes use?
PSR-4 maps classes and namespaces to file and directory paths, but you are not required to follow PSR-4.