@@ -124,11 +124,11 @@ public function getConfigFile(): ConfigFile
124124 /**
125125 * Registers form in form manager
126126 *
127- * @param string $formName Form name
128- * @param array $form Form data
129- * @param int $serverId 0 if new server, validation; >= 1 if editing a server
127+ * @param string $formName Form name
128+ * @param array $form Form data
129+ * @param int|null $serverId 0 if new server, validation; >= 1 if editing a server
130130 */
131- public function registerForm ($ formName , array $ form , $ serverId = null ): void
131+ public function registerForm (string $ formName , array $ form , int | null $ serverId = null ): void
132132 {
133133 $ this ->forms [$ formName ] = new Form ($ formName , $ form , $ this ->configFile , $ serverId );
134134 $ this ->isValidated = false ;
@@ -148,7 +148,7 @@ public function registerForm($formName, array $form, $serverId = null): void
148148 * on failed validation
149149 * @param bool $checkFormSubmit whether check for $_POST['submit_save']
150150 */
151- public function process ($ allowPartialSave = true , $ checkFormSubmit = true ): bool
151+ public function process (bool $ allowPartialSave = true , bool $ checkFormSubmit = true ): bool
152152 {
153153 if ($ checkFormSubmit && ! isset ($ _POST ['submit_save ' ])) {
154154 return false ;
@@ -207,17 +207,17 @@ private function validate(): void
207207 /**
208208 * Outputs HTML for forms
209209 *
210- * @param bool $showButtons whether show submit and reset button
211- * @param string $formAction action attribute for the form
212- * @param array|null $hiddenFields array of form hidden fields (key: field
213- * name)
210+ * @param bool $showButtons whether show submit and reset button
211+ * @param string|null $formAction action attribute for the form
212+ * @param array|null $hiddenFields array of form hidden fields (key: field
213+ * name)
214214 *
215215 * @return string HTML for forms
216216 */
217217 public function getDisplay (
218- $ showButtons = true ,
219- $ formAction = null ,
220- $ hiddenFields = null ,
218+ bool $ showButtons = true ,
219+ string | null $ formAction = null ,
220+ array | null $ hiddenFields = null ,
221221 ): string {
222222 $ js = [];
223223 $ jsDefault = [];
@@ -325,11 +325,11 @@ public function getDisplay(
325325 */
326326 private function displayFieldInput (
327327 Form $ form ,
328- $ field ,
329- $ systemPath ,
330- $ workPath ,
331- $ translatedPath ,
332- $ userPrefsAllow ,
328+ string $ field ,
329+ string $ systemPath ,
330+ string $ workPath ,
331+ string $ translatedPath ,
332+ bool | null $ userPrefsAllow ,
333333 array &$ jsDefault ,
334334 ): string |null {
335335 $ name = Descriptions::get ($ systemPath );
@@ -514,7 +514,7 @@ public function fixErrors(): void
514514 * @param string|bool $value Current value
515515 * @param array $allowed List of allowed values
516516 */
517- private function validateSelect (&$ value , array $ allowed ): bool
517+ private function validateSelect (string | bool &$ value , array $ allowed ): bool
518518 {
519519 $ valueCmp = is_bool ($ value )
520520 ? (int ) $ value
@@ -717,7 +717,7 @@ public function hasErrors(): bool
717717 *
718718 * @param string $path Path to documentation
719719 */
720- public function getDocLink ($ path ): string
720+ public function getDocLink (string $ path ): string
721721 {
722722 $ test = mb_substr ($ path , 0 , 6 );
723723 if ($ test === 'Import ' || $ test === 'Export ' ) {
@@ -736,7 +736,7 @@ public function getDocLink($path): string
736736 *
737737 * @param string $path Path
738738 */
739- private function getOptName ($ path ): string
739+ private function getOptName (string $ path ): string
740740 {
741741 return str_replace (['Servers/1/ ' , '/ ' ], ['Servers/ ' , '_ ' ], $ path );
742742 }
@@ -764,7 +764,7 @@ private function loadUserprefsInfo(): void
764764 * @param string $systemPath Path to settings
765765 * @param array $opts Chosen options
766766 */
767- private function setComments ($ systemPath , array &$ opts ): void
767+ private function setComments (string $ systemPath , array &$ opts ): void
768768 {
769769 // RecodingEngine - mark unavailable types
770770 if ($ systemPath === 'RecodingEngine ' ) {
@@ -851,7 +851,7 @@ private function setComments($systemPath, array &$opts): void
851851 * @param array $postValues List of parameters
852852 * @param string $key Array key
853853 */
854- private function fillPostArrayParameters (array $ postValues , $ key ): void
854+ private function fillPostArrayParameters (array $ postValues , string $ key ): void
855855 {
856856 foreach ($ postValues as $ v ) {
857857 $ v = Util::requestString ($ v );
0 commit comments