some more Form tests and some patches proposals

Le 09/09/2014 20:46, Richard Griffith a écrit :
>
> In htdocs/xoops_lib/Xoops/Form/Password.php:
>
> > @@ -90,21 +90,21 @@ public function __construct(
> >      /**
> >       * Get the field size
> >       *
> > -     * @return string
> > +     * @return int
>
> While this seems like an int, it is treated exclusively as a string. 
> It is just a string value that will be used to concatenate with other 
> strings. All of these, in this and related files, were very 
> deliberate, so the callers do not have to explicitly coerce the values 
> into strings to prevent other issues and/or warnings from QA tools.
>
> Same applies to similar changes in Select.php, Text.php and TextArea.php
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/XOOPS/XoopsCore/pull/214/files#r17319373>.
>


thank you for this precision.

For me, as a getter (get field size) could you say the way that this 
getter will be use as a public method ? the size argument is given in 
construct as an Int, and the coercion is made to transform it as a 
string. For me, when this method is used in a string, php transform 
automatically the value int to string, but there is a possibility for 
programmer to access at the real vale (an int). That's why an propose to 
cast an int. And it would be great to have also a specific setter (setSize).

Available for all similar situation in other files.

Alain91