Download the PHP package jonpemby/phlash without Composer
On this page you can find all versions of the php package jonpemby/phlash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jonpemby/phlash
More information about jonpemby/phlash
Files in jonpemby/phlash
Package phlash
Short Description Lodash inspired helper functions for PHP
License MIT
Informations about the package phlash
A lodash inspired library of helper functions for PHP.
Fits Into Your Existing Code
Phlash is meant to be a helpful addition to your code. Phlash adheres directly to your coding style with the help of PHP's dynamic __call
method. Phlash automatically checks for a function signature matching the one you called for a myriad of styles. While Phlash is written in the camelCased
style, it will work with any style.
For example:
Will all work!
Immutability
Every Phlash collection method returns a new collection. No collection will ever be mutated.
Phlash takes advantage of PHP's copy-on-write principle and assigns the current value to a new variable before mutating it. Nice!
Check it out with PsySh:
Object Oriented With Functional Support
Phlash supports a variety of paradigms but most importantly the OO and functional paradigms. Methods can easily be chained from a new object. If you would rather call a function without having to deal with an object you can!
For example:
While under the hood Phlash uses objects, Phlash supports your favorite paradigm as best it can.
Higher Order Property Accessors
Phlash supports higher order property accessors for collections. For example:
And yes, this method is chainable to other methods of the same collection. This makes it so much easier to map collections of objects to properties without having to write a map function to handle it for you.
Learn More
Documentation site is coming soon!
Thanks
- Nan Pemberton for supporting my dream to become a programmer and for being by my side no matter what!
- Taylor Otwell for writing Laravel and inspiring me to be awesome
- You for reading this and showing interest in Phlash. Even if you don't use Phlash, writing PHP keeps the project alive! Thanks for being awesome.