-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Useful Common Code
Squirt provides a number of helper class in Squirt\Common.
This interface should be used in classes to mark them as squirt-compatible. Note that Squirt does not enforce this interface, it merely looks for a static factory method. Rather, this interface will help in your own code so that PHP checks for proper method signature declarations.
This trait assists in defining the "simple" static factory method which just calls the constructor method with all parameters. When writing your own classes from scratch, use this trait and make the __construct(array $params) method protected for maximum flexibility/compatibility.
This interface and trait work similarly to the above, only these help to facilitate the injection of a PSR Log logger instance. Note that if you use these, there is no need to also use the SquirtableInterface and SquirtableTrait.
This class contains static methods useful in reading and validating values passed into your functions in associative parameter arrays. These methods all encapsulate a pattern which is idiomatic to squirt. For details refer to the source code and unit tests
This class is used internally by Squirt, but can be used to provide a simple squirt-compatible class which just stores all of its parameters as key/value pairs, and which then makes those accessible in an array-like manner.