[horde] PHP ERROR: Declaration of Horde_Form_Type

Ralf Lang lang at b1-systems.de
Wed Feb 19 16:54:26 UTC 2020


Hallo,

Am 26.01.20 um 19:38 schrieb Ferdinand Gruber:
> Hi,
>
> I see a lot of errors:
>
> PHP ERROR: Declaration of Horde_Form_Type_matrix::init($cols, $rows =
> Array, $matrix = Array, $new_input = false) should be compatible with
> Horde_Form_Type::init() [pid 12516 on line 2165 of
> "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_enum::init($values, $prompt
> = NULL) should be compatible with Horde_Form_Type::init() [pid 12516
> on line 2335 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_mlenum::init(&$values,
> $prompts = NULL) should be compatible with Horde_Form_Type::init()
> [pid 12516 on line 2411 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_mlenum::onSubmit(&$var,
> &$vars) should be compatible with Horde_Form_Type::onSubmit() [pid
> 12516 on line 2411 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_set::init($values, $checkAll
> = false) should be compatible with Horde_Form_Type::init() [pid 12516
> on line 2569 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_sorter::init($values, $size
> = 8, $header = '') should be compatible with Horde_Form_Type::init()
> [pid 12516 on line 3400 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_selectfiles::init($selectid,
> $link_text = NULL, $link_style = '', $icon = false) should be
> compatible with Horde_Form_Type::init() [pid 12516 on line 3470 of
> "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_assign::init($leftValues,
> $rightValues, $leftHeader = '', $rightHeader = '', $size = 8, $width =
> '200px') should be compatible with Horde_Form_Type::init() [pid 12516
> on line 3600 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_assign::getValues($side)
> should be compatible with Horde_Form_Type::getValues() [pid 12516 on
> line 3600 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_dblookup::init($db, $sql,
> $prompt = NULL) should be compatible with
> Horde_Form_Type_enum::init($values, $prompt = NULL) [pid 12516 on line
> 3751 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_figlet::init($text, $font)
> should be compatible with Horde_Form_Type::init() [pid 12516 on line
> 3804 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_invalid::init($message)
> should be compatible with Horde_Form_Type::init() [pid 12516 on line
> 3873 of "/usr/share/php7/PEAR/Horde/Form/Type.php"]
> PHP ERROR: Declaration of Horde_Form_Type_country::init($prompt =
> NULL) should be compatible with Horde_Form_Type_enum::init($values,
> $prompt = NULL) [pid 12516 on line 923 of
> "/usr/share/php7/PEAR/Horde/Form/Type.php"]
>
> What's that?
>
These are, at least for now, harmless. You can ignore/filter these.

Horde_Form is used in many, many places in the Horde apps. The way
constructors of various Horde_Form_Type descendants are defined, they
are not compatible with the definition of the Horde_Form_Type base type.
This is a formal violation of the Liskov principle but it's not a real
issue. It will not break any existing use case of Horde_Form.

In earlier PHPs, this was a valid way to do it. Horde_Form is a pretty
long-living library. Changing the way it works is not easily possible
without a BC break and quite frankly, it's probably more worthwile to do
away with Horde_Form and redesign pages/apps which use it.
This would be, among others, the config screen.

The API of Horde_Form is very influenced by the way things were done in
PHP 4. Another issue is the relatively tight coupling of presentation
issues (like injecting helper js code for some form elements) with input
validation, data formats etc.



-- 
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2220 bytes
Desc: not available
URL: <https://lists.horde.org/archives/horde/attachments/20200219/111201fd/attachment.key>


More information about the horde mailing list