I haven't looked into this component so I can't say if these are
errors or not, but they aren't necessarily wrong depending on the
intent.

if ($this->getUseTranslator() && $t = $this->getTranslator()) {

is the same as

$t = $this->getTranslator();
if ($this->getUseTranslator() && $t) {

So whether or not it is wrong depends. Are we comparing $t to
$this->getTranslator() or are we assigning  $this->getTranslator() to
$t and checking if $t is true or not empty? Some people would argue
that you should never assign a value to a variable inside an IF but it
still works.

Anyways, take a deeper look at the code and see what exactly is going on.


Mark

On Tue, Apr 14, 2009 at 3:41 PM, SirEdward <[email protected]> wrote:

> 3) I can't help but think there are a few errors in the code. I may be
> totally wrong as I've only skimmed though, but I've come across bits like
> this in Menu.php: Line #249
>
> if ($this->getUseTranslator() && $t = $this->getTranslator()) {
>
> Should it be
>
> if ($this->getUseTranslator() && $t == $this->getTranslator()) {
>
> #266
>
> if ($href = $page->getHref()) {
>
> or
>
> if ($href == $page->getHref()) {
>
> #346
>
> if (!$found = $this->findActive($container, $minDepth, $maxDepth)) {
>
> or
>
> if (!$found == $this->findActive($container, $minDepth, $maxDepth)) {
>
> #401
>
> if ($found = $this->findActive($container, $minDepth, $maxDepth)) {
>
> or if ($found == $this->findActive($container, $minDepth, $maxDepth)) { #663
>
> if ($partial = $this->getPartial()) {
>
> be
>
> if ($partial == $this->getPartial()) {
>
> If I am right then Breadcrumbs.php (the only other page I've looked through)
> has similar possible errors.
>



-- 
Have fun or die trying - but try not to actually die.

Reply via email to