[Phpmyadmin-devel] CheckStyle violations in export files

Dieter Adriaenssens dieter.adriaenssens at gmail.com
Sat Jul 30 01:52:43 CEST 2011


2011/7/22 Madhura Jayaratne <madhura.cj at gmail.com>:
> Hi all,
> Looking at the CheckStyle reports from the CI, all the export files show
> very high counts of indentation rule violations.
> The code in the 'else' block of 'if (isset($plugin_list))' condition is
> wrongly indented in all of these files.
> There are two possible ways to correct this.
> 1) Correctly indent the 'else' block
> 2) Add 'return' statement to the end of 'if' block and remove 'else {' part.
> Which one if preferred?

Looking at the code (I only checked sql.php and xml.php) I wonder why
the different functions are defined within the 'else' block. This
doesn't seem right to me. There must be cleaner ways of conditionally
defining a function than putting them in an if/else block. I'm not
sure even how the php compiler parses this? Anyway I don't think we
can rely on the behaviour of the php compiler to not define these
functions.

Kind regards,

Dieter




More information about the Developers mailing list