| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | final public function profile(): Profile |
||
| 34 | { |
||
| 35 | if (!$this->profiler) { |
||
| 36 | throw new \RuntimeException('The profiler has not been set. Is profiling enabled?'); |
||
| 37 | } |
||
| 38 | |||
| 39 | if (!$token = $this->inner()->getInternalResponse()->getHeader('x-debug-token')) { |
||
| 40 | throw new \RuntimeException('Profiling is not enabled for this request. You must enable profile collection globally when using the HttpBrowser.'); |
||
| 41 | } |
||
| 42 | |||
| 43 | if (!$profile = $this->profiler->loadProfile($token)) { |
||
|
|
|||
| 44 | throw new \RuntimeException('Could not find profile for this request.'); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $profile; |
||
| 48 | } |
||
| 50 |