A PHP trait that can be used to add automatic memoization to a class