Adam Wathan
Refactoring to Collections

Refactoring to Collections

Adam Wathan2016
This book teaches you how to apply functional programming principles to write clean, maintainable PHP. It guides you to use collection pipelines to break down ugly, complex functions into a series of simple transformations, free of loops, complex conditionals, and temporary variables. The first section of the book focuses on teaching you the theory and fundamentals you need to to start applying functional programming principles to your code. You'll learn about the difference between imperative and declarative code, how to use higher order functions to remove duplication, and how to implement fundamental operations like map, reduce, and filter from first principles. The second section of the book and the companion screencasts are a deep dive into problem solving with Laravel's Collection library. Through 16 in-depth examples, we walk through everything from beginner to expert level problems, using advanced operations like zip and transpose, and even extending the library with our own custom transformations.
Sign up to use

Reviews

Photo of Matt Stein
Matt Stein@mattstein
5 stars
Dec 11, 2023