How can I reduce these two lines
$foo = new Bar();
$baz = $foo->methodOne('param')->methodTwo('param');
to
$baz = Bar::methodOne('param')->methodTwo('param');
I´ve seen this specially in Laravel and it´s nice readable Code. But I stuck getting this to work with some custom Helper-Classes. It feels like mixing static + nonstatic functions which is confusing for now ...
For everyone passing by: Laravel offers a design pattern called Facades to achieve that effect. http://laravel.com/docs/5.1/facades
If you want to build your own Helper-Class there are four things need: