The original post: /r/php by /u/mapsedge on 2024-11-06 22:04:35.

In my program each controller begins with the same couple code blocks: check for valid credentials; check for valid access token; assemble the incoming data from php://input, and there’s enough of them that it makes sense to put those three operations into one file and just call the file.

My first thought was just to have a PHP file to include those functions, but maybe it should be a class rather than just functions?

To class or not to class…? What’s the current philosophy?