2525 * @property string $view
2626 * @property string|bool $layout
2727 * @property-read \stdClass $payload
28- * @property-read Nette\DI\Container $context
2928 * @property-read Nette\Http\Session $session
3029 * @property-read Nette\Security\User $user
3130 */
@@ -109,9 +108,6 @@ abstract class Presenter extends Control implements Application\IPresenter
109108 /** @var array|null */
110109 private $ lastCreatedRequestFlag ;
111110
112- /** @var Nette\DI\Container */
113- private $ context ;
114-
115111 /** @var Nette\Http\IRequest */
116112 private $ httpRequest ;
117113
@@ -164,7 +160,6 @@ final public function getPresenterIfExists(): self
164160 }
165161
166162
167- /** @deprecated */
168163 final public function hasPresenter (): bool
169164 {
170165 return true ;
@@ -1348,7 +1343,6 @@ public function getFlashSession(): Http\SessionSection
13481343
13491344
13501345 final public function injectPrimary (
1351- ?Nette \DI \Container $ context ,
13521346 ?Application \IPresenterFactory $ presenterFactory ,
13531347 ?Nette \Routing \Router $ router ,
13541348 Http \IRequest $ httpRequest ,
@@ -1361,7 +1355,6 @@ final public function injectPrimary(
13611355 throw new Nette \InvalidStateException ('Method ' . __METHOD__ . ' is intended for initialization and should not be called more than once. ' );
13621356 }
13631357
1364- $ this ->context = $ context ;
13651358 $ this ->presenterFactory = $ presenterFactory ;
13661359 $ this ->router = $ router ;
13671360 $ this ->httpRequest = $ httpRequest ;
@@ -1372,20 +1365,6 @@ final public function injectPrimary(
13721365 }
13731366
13741367
1375- /**
1376- * Gets the context.
1377- * @deprecated
1378- */
1379- public function getContext (): Nette \DI \Container
1380- {
1381- if (!$ this ->context ) {
1382- throw new Nette \InvalidStateException ('Context has not been set. ' );
1383- }
1384- trigger_error (__METHOD__ . '() is deprecated, use dependency injection. ' , E_USER_DEPRECATED );
1385- return $ this ->context ;
1386- }
1387-
1388-
13891368 final public function getHttpRequest (): Http \IRequest
13901369 {
13911370 return $ this ->httpRequest ;
0 commit comments