File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,12 @@ public function getUniqueId(): string
6666 }
6767
6868
69- protected function createComponent ( string $ name ): ? Nette \ ComponentModel \ IComponent
69+ public function addComponent ( Nette \ ComponentModel \ IComponent $ component , ? string $ name, string $ insertBefore = null ): static
7070 {
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 );
71+ if (!$ component instanceof SignalReceiver && !$ component instanceof StatePersistent) {
72+ throw new Nette \InvalidStateException ("Component ' $ name' of type " . gettype ($ component ) . ' is not intended to be used in the Presenter. ' );
7573 }
76- return $ res ;
74+ return parent :: addComponent ( $ component , $ name , $ insertBefore = null ) ;
7775 }
7876
7977
You can’t perform that action at this time.
0 commit comments