Completed
Push — master ( ab9622...fc618d )
by Patrick
05:38
created

Email/Route/class.SimpleAlias.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Email\Route;
3
4
/**
5
 * An class to represent an Email Router
6
 */
7
class SimpleAlias extends Route
8
{
9
    public function route($destination, $message)
10
    {
11
        $alias = $this->data['aliasTo'];
0 ignored issues
show
$alias is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
12
        return false;
13
    }
14
}
15
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
16
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
17