@@ -35,7 +35,7 @@ protected function addExtraCompoValidation(Form $compo,FieldValidation $validati
3535 $ compo ->addFieldValidation ($ validation );
3636 }
3737
38- protected function _runValidationParams (Form &$ compo ,JsUtils $ js =NULL ){
38+ protected function _runValidationParams (Form &$ compo , ? JsUtils $ js =NULL ){
3939 $ form =$ this ->getForm ();
4040 $ params =$ form ->getValidationParams ();
4141 if (isset ($ params ["_ajaxSubmit " ])){
@@ -48,7 +48,7 @@ protected function _runValidationParams(Form &$compo,JsUtils $js=NULL){
4848 $ form ->addEventsOnRun ($ js );
4949 }
5050
51- protected function _compileAjaxSubmit ($ ajaxSubmit ,JsUtils $ js =null ){
51+ protected function _compileAjaxSubmit ($ ajaxSubmit , ? JsUtils $ js =null ){
5252 $ compilation ="" ;
5353 if (\is_array ($ ajaxSubmit )){
5454 foreach ($ ajaxSubmit as $ ajaxSubmitItem ){
@@ -90,10 +90,10 @@ public function jsState($state) {
9090 * @param string|BaseHtml $identifierOrElement
9191 * @param string $url
9292 * @param string $responseElement
93- * @param array $parameters
93+ * @param array|null $parameters
9494 * @return HtmlForm
9595 */
96- public function submitOn ($ event ,$ identifierOrElement ,$ url ,$ responseElement ,$ parameters =NULL ){
96+ public function submitOn (string $ event , BaseHtml | string $ identifierOrElement , string $ url , string $ responseElement , ? array $ parameters =NULL ): HtmlForm {
9797 $ form =$ this ->getForm ();
9898 if ($ identifierOrElement instanceof BaseHtml)
9999 $ elem =$ identifierOrElement ;
@@ -105,11 +105,11 @@ public function submitOn($event,$identifierOrElement,$url,$responseElement,$para
105105 return $ form ;
106106 }
107107
108- public function submitOnClick ($ identifier ,$ url ,$ responseElement ,$ parameters =NULL ){
108+ public function submitOnClick (string $ identifier ,string $ url ,string $ responseElement ,? array $ parameters =NULL ){
109109 return $ this ->submitOn ("click " , $ identifier , $ url , $ responseElement ,$ parameters );
110110 }
111111
112- public function addSubmit ($ identifier ,$ value ,$ cssStyle =NULL ,$ url =NULL ,$ responseElement =NULL ,$ parameters =NULL ){
112+ public function addSubmit ($ identifier ,$ value ,$ cssStyle =NULL ,$ url =NULL ,$ responseElement =NULL ,? array $ parameters =NULL ){
113113 $ bt =$ this ->getForm ()->addButton ($ identifier , $ value ,$ cssStyle );
114114 return $ this ->_buttonAsSubmit ($ bt , "click " ,$ url ,$ responseElement ,$ parameters );
115115 }
@@ -133,7 +133,7 @@ public function setSubmitParams($url,$responseElement=NULL,$parameters=NULL){
133133 return $ this ;
134134 }
135135
136- public function addReset ($ identifier ,$ value ,$ cssStyle =NULL ){
136+ public function addReset (string $ identifier ,string $ value ,? string $ cssStyle =NULL ){
137137 $ bt =$ this ->getForm ()->addButton ($ identifier , $ value ,$ cssStyle );
138138 $ bt ->setProperty ("type " , "reset " );
139139 return $ bt ;
@@ -144,7 +144,7 @@ public function addReset($identifier,$value,$cssStyle=NULL){
144144 * @param string $jsCode
145145 * @return \Ajax\semantic\html\collections\form\HtmlForm
146146 */
147- public function onValid ($ jsCode ){
147+ public function onValid (string $ jsCode ){
148148 $ form =$ this ->getForm ();
149149 $ form ->addValidationParam ("onValid " , "%function(){ " .$ jsCode ."}% " );
150150 return $ form ;
@@ -155,7 +155,7 @@ public function onValid($jsCode){
155155 * @param string $jsCode can use event and fields parameters
156156 * @return HtmlForm
157157 */
158- public function onSuccess ($ jsCode ){
158+ public function onSuccess (string $ jsCode ): HtmlForm {
159159 $ form =$ this ->getForm ();
160160 $ form ->addValidationParam ("onSuccess " , $ jsCode ,"%function(event,fields){ " ,"}% " );
161161 return $ form ;
@@ -169,13 +169,13 @@ public function addExtraFieldRules($fieldname,$rules){
169169 }
170170 }
171171
172- public function addExtraFieldRule ($ fieldname ,$ type ,$ prompt =NULL ,$ value =NULL ){
172+ public function addExtraFieldRule (string $ fieldname ,string $ type ,$ prompt =NULL ,$ value =NULL ){
173173 $ form =$ this ->getForm ();
174174 $ fv =$ form ->getExtraFieldValidation ($ fieldname );
175175 $ fv ->addRule ($ type ,$ prompt ,$ value );
176176 }
177177
178- public function setOptional ($ fieldname ,$ optional =true ){
178+ public function setOptional (string $ fieldname ,bool $ optional =true ){
179179 $ form =$ this ->getForm ();
180180 $ fv =$ form ->getExtraFieldValidation ($ fieldname );
181181 $ fv ->setOptional ($ optional );
0 commit comments