We all know that fluent programming style rocks, and jQuery is a great example of that!
Wel also know that SQL is greatly simplified with fluent style interfaces!
And so are Regular Expressions!
Now it’s time for PHP to step in the world of fluency with pooQuery!
What is pooQuery?
pooQuery – PHP Object Oriented Query – is a mini-language inside PHP. It is designed to allow for a very fluent programming style; literally to revolutionarize the way you write PHP.
It already supports many PHP features, including working with variables, calling PHP functions and working with class methods. For example, you can easily bootstrap a Zend Framework application using pooQuery-style fluent PHP.
Write PHP without knowing PHP
pooQuery is all about letting people who don’t understand PHP to write PHP using PHP. It’s also about making PHP fluent.
Compare this ugly old PHP syntax to the great new fluent style:
//Old skool PHP $variable = 'Hello World'; $variable = substr($variable, 0, 5); echo $variable;
//Great new fluency! take('Hello World')->and->call('substr')->with(array(it(), 0, 5)) ->and->take(call()->result)->and->display();
Now isn’t that simply great? Compared to old, clunky and boring syntax, you can use the newest programming breakthrough, fluent-style!
Classes are so easy and intuitive as well:
//boo $instance = new MyClass(); $instance->method(); //yay take(new MyClass())->and->assign(it())->to('instance') ->and->call(its()->method('method'))->and->finish();
Have fun and enjoy the great fluentness!