File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,15 @@ public function getUniqueId(): string
6666 }
6767
6868
69- protected function createComponent (string $ name ): ?Nette \ComponentModel \IComponent
70- {
71- $ res = parent ::createComponent ($ name );
72- if ($ res && !$ res instanceof SignalReceiver && !$ res instanceof StatePersistent) {
73- $ type = $ res ::class;
74- trigger_error ("It seems that component ' $ name' of type $ type is not intended to be used in the Presenter. " , E_USER_NOTICE );
69+ public function addComponent (
70+ Nette \ComponentModel \IComponent $ component ,
71+ ?string $ name ,
72+ string $ insertBefore = null ,
73+ ): static {
74+ if (!$ component instanceof SignalReceiver && !$ component instanceof StatePersistent) {
75+ throw new Nette \InvalidStateException ("Component ' $ name' of type " . gettype ($ component ) . ' is not intended to be used in the Presenter. ' );
7576 }
76- return $ res ;
77+ return parent :: addComponent ( $ component , $ name , $ insertBefore = null ) ;
7778 }
7879
7980
You can’t perform that action at this time.
0 commit comments