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 Oct 15, 2020
1 parent a95acad commit 939a4e7
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 @@ -1301,11 +1301,12 @@ final public function injectPrimary(?Nette\DI\Container $context, ?Application\I
* 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 939a4e7

Please sign in to comment.