/** * Shorthand for generating a Backtrace and returning the last caller * * @return array|null */ public static function lastCaller() { $backtrace = new Backtrace(); return $backtrace->extractCaller(); }
/** * Generic call for a type of provider * * @param string $type * @param string $caller Caller module name * * @return Provider */ public function provider($type, $caller = null) { $salt = 'provider.' . $type; if (!($bit = $this->registry->bit($salt))) { S::halt(500, 'provider does not exist: ' . $type); } if (empty($caller)) { $caller = $this->modules->finder->find(Backtrace::lastCaller(), $salt); } return $this->modules->finder->provider($bit, $caller, $type); }