An open API service indexing awesome lists of open source software.

https://github.com/developer239/future

It can predict future!
https://github.com/developer239/future

Last synced: 11 months ago
JSON representation

It can predict future!

Awesome Lists containing this project

README

          

Imagine that you have something like this:

$start->yourSadMethod()->someRandomStuff()->yourColleaguesCoolMethod()->result();

Do you find yourself writing bad code too often? Are your colleagues angry at you because your code breaks their cool code?

Don't worry. Now you can adapt behaviour of your code according to the code that follows after your methods are executed.

public function yourSadMethod() {
$future = \MichalJarnot\Future::predictFuture(debug_backtrace());

// If there is your colleague's cool method about to be executed you can just omit your code
if (in_array("yourColleaguesCoolMethod", $future)) {
return $this;
} else {
// do the ugly stuff here
}
}

Happy debugging!