Passed
Pull Request — master (#17)
by
unknown
02:07
created

i18.php (1 issue)

Severity

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
/**
3
 * This file is part of the Subway WordPress Plugin Package.
4
 *
5
 * (c) Joseph Gabito <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 * 
10
 * PHP Version 5.4
11
 * 
12
 * @category Subway\i18
13
 * @package  Subway
14
 * @author   Joseph G. <[email protected]>
15
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
16
 * @version  GIT:github.com/codehaiku/subway
17
 * @link     github.com/codehaiku/subway The Plugin Repository
18
 */
19
20
namespace Subway;
21
22
if (! defined('ABSPATH') ) {
23
    return;
24
}
25
26
/**
27
 * Register Plugin i18 (internationalization)
28
 *
29
 * @category Subway\i18
30
 * @package  Subway
31
 * @author   Joseph G. <[email protected]>
32
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
33
 * @link     github.com/codehaiku/subway The Plugin Repository
34
 * @since    1.0  
35
 */
36
final class I18
37
{
38
39
    /**
40
     * Class Constructor.
41
     *
42
     * @return void
43
     */
44
    public function __construct() 
45
    {
46
47
        add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' ));
48
49
        return;
50
    }
51
52
    /**
53
     * Subway l8n callback.
54
     *
55
     * @return void
56
     */
57
    public function subwayLocalizePlugin() 
58
    {
59
60
        $rel_path = 'subway/languages';
61
62
        $res = load_plugin_textdomain('subway', false, $rel_path);
0 ignored issues
show
$res 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...
63
        return;
64
    }
65
66
}
67
68
$subwayi18 = new I18();
69