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!
- Host: GitHub
- URL: https://github.com/developer239/future
- Owner: developer239
- Created: 2016-07-14T18:33:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-24T01:19:26.000Z (almost 9 years ago)
- Last Synced: 2025-01-04T21:41:48.547Z (about 1 year ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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!