<br><br><div class="gmail_quote">On Sat, Jul 30, 2011 at 5:22 AM, Dieter Adriaenssens <span dir="ltr"><<a href="mailto:dieter.adriaenssens@gmail.com">dieter.adriaenssens@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/7/22 Madhura Jayaratne <<a href="mailto:madhura.cj@gmail.com">madhura.cj@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi all,<br>
> Looking at the CheckStyle reports from the CI, all the export files show<br>
> very high counts of indentation rule violations.<br>
> The code in the 'else' block of 'if (isset($plugin_list))' condition is<br>
> wrongly indented in all of these files.<br>
> There are two possible ways to correct this.<br>
> 1) Correctly indent the 'else' block<br>
> 2) Add 'return' statement to the end of 'if' block and remove 'else {' part.<br>
> Which one if preferred?<br>
<br>
</div></div>Looking at the code (I only checked sql.php and xml.php) I wonder why<br>
the different functions are defined within the 'else' block. This<br>
doesn't seem right to me. There must be cleaner ways of conditionally<br>
defining a function than putting them in an if/else block. I'm not<br>
sure even how the php compiler parses this? Anyway I don't think we<br>
can rely on the behaviour of the php compiler to not define these<br>
functions.<br></blockquote></div><br clear="all">Since we did not have any bug reports about such a problem I believe most of the compilers, if not all, work as expected with the if/else block. But as you mentioned, it would be nice to have a cleaner mechanism to do this.<div>
<br></div><div>When I sent the earlier mail I was under the impression that a 'return' statement as the last line of the 'if' block would let me remove the else block, which would correct those CheckStyle violations. I was comparing this to the import plugins. However since export plugins contains methods in the 'else' blocks, this is not possible. It amounts to redefining, already defined methods and I have to give it up.</div>
<div><br>-- <br>Thanks and Regards,<div><br></div><div>Madhura Jayaratne<br><div><br></div></div><br>
</div>