Skip to content

Commit

Permalink
Presenter::getContext() triggers error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 2, 2020
1 parent 1a7552a commit bb65d4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,11 +1343,12 @@ final public function injectPrimary(
* Gets the context.
* @deprecated
*/
final public function getContext(): Nette\DI\Container
public function getContext(): Nette\DI\Container
{
if (!$this->context) {
throw new Nette\InvalidStateException('Context has not been set.');
}
trigger_error(__METHOD__ . '() is deprecated, use dependency injection.', E_USER_DEPRECATED);
return $this->context;
}

Expand Down

0 comments on commit bb65d4c

Please sign in to comment.