php design patterns with sample codes