Demo::install()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * Controller of the plugin Demo
5
 *
6
 * @category  	Venus\src
7
 * @package   	Venus\src\plugins\Demo\Controller
8
 * @author    	Judicaël Paquet <[email protected]>
9
 * @copyright 	Copyright (c) 2013-2015 PAQUET Judicaël FR Inc. (https://github.com/las93)
10
 * @license   	https://github.com/las93/uranium/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
11
 * @version   	Release: 1.0.0
12
 * @filesource	https://github.com/las93/uranium
13
 * @link      	https://github.com/las93
14
 * @since     	1.0
15
 */
16
namespace Venus\src\plugins\Demo\Controller;
17
18
use \Venus\src\plugins\common\Controller as Controller;
19
20
/**
21
 * Controller to test
22
 *
23
 * @category    Venus\src
24
 * @package     Venus\src\plugins\Demo\Controller
25
 * @author      Judicaël Paquet <[email protected]>
26
 * @copyright   Copyright (c) 2013-2015 PAQUET Judicaël FR Inc. (https://github.com/las93)
27
 * @license     https://github.com/las93/uranium/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
28
 * @version     Release: 1.0.0
29
 * @filesource  https://github.com/las93/uranium
30
 * @link        https://github.com/las93
31
 * @since       1.0
32
 */
33
class Demo extends Controller
34
{
35
    /**
36
     * Constructor
37
     *
38
     * @access public
39
     * @return Demo
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
40
     */
41
    public function __construct()
42
    {
43
        parent::__construct();
44
    }
45
46
    /**
47
     * bootstrap
48
     *
49
     * @access public
50
     * @return void
51
     */
52
    public function bootstrap()
53
    {
54
        ;
55
    }
56
57
    /**
58
     * install method
59
     *
60
     * @access public
61
     * @param  string $sPortal
62
     * @return void
63
     */
64
    public function install($sPortal)
0 ignored issues
show
Unused Code introduced by
The parameter $sPortal is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
65
    {
66
        $this->installDb;
0 ignored issues
show
Documentation introduced by
The property installDb does not exist on object<Venus\src\plugins\Demo\Controller\Demo>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
67
    }
68
}
69