Completed
Pull Request — master (#596)
by Stig
04:09 queued 58s
created

DeployPlanDispatcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 5 1
A getModel() 0 3 1
1
<?php
2
3
4
class DeployPlanDispatcher extends Dispatcher {
5
6
	/**
7
	 * Render configuration form.
8
	 *
9
	 * @param \SS_HTTPRequest $request
10
	 *
11
	 * @return \HTMLText|\SS_HTTPResponse
12
	 */
13
	public function index(\SS_HTTPRequest $request) {
14
		return $this->customise([
15
			'Environment' => $this->environment
0 ignored issues
show
Documentation introduced by
The property environment does not exist on object<DeployPlanDispatcher>. 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...
16
		])->renderWith(['Plan', 'DNRoot']);
17
	}
18
19
	/**
20
	 * Generate the data structure used by the frontend component.
21
	 *
22
	 * @param string $name of the component
23
	 *
24
	 * @return array
25
	 */
26
	public function getModel($name) {
27
28
	}
29
}
30