The following scripts are intended as complete and concise examples of possible coding scenarios. The aim is to illustrate the standard of coding that simpler solutions provides and are not necessarily to be seen as real world coding solutions (more complex examples can be found here).
The examples given below are to give an indication of how we pride ourselves on producing well structured, well documented PHP code that is efficient and elegant as well as being readable and re-usable.
The signature verifier script provides a simple way to validate the arguments passed to a function. Most functions sanitize their arguments before proceeding. Often this is via a set of repeated checks ie checking that a required field is not null or that it is the correct data type (array or int for example). If a function requires many arguments then this can result in a lot of code before the function can start it's actual work. The aim of this class is to abstract out as much of this as possible to improve readability and cut down on code duplication.
The literal handling script illustrates a simple way of providing multi lingual capabilities to a website. Instead of having hard coded string literals within scripts, a simple call can be made to the literals class which will look for a match for the requested literal and the particular language it was requested in. The base literals class is extensible so that each site script can abstract it's own literals away into a seperate literal handling class.