Completed
Push — branch-7.5 ( a10aa7...4608de )
by Jeremy
121:44 queued 113:34
created

Static_Property::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Automattic\Jetpack\Analyzer\Invocations;
4
5
use Automattic\Jetpack\Analyzer\PersistentList\Item as PersistentListItem;
6
7
/**
8
 * Instantiation of a class
9
 *
10
 * TODO: detect dynamic instantiations like `$shape = new $class_name( $this->images )`
11
 */
12
class Static_Property extends PersistentListItem {
13
	public $path;
14
	public $line;
15
	public $class_name;
16
	public $prop_name;
17
18
	public function __construct( $path, $line, $class_name, $prop_name ) {
19
		$this->path = $path;
20
		$this->line = $line;
21
		$this->class_name = $class_name;
22
		$this->prop_name = $prop_name;
23
	}
24
25 View Code Duplication
	public function to_csv_array() {
26
		return array(
27
			$this->type(),
28
			$this->path,
29
			$this->line,
30
			$this->class_name,
31
			$this->prop_name
32
		);
33
	}
34
35
	function type() {
36
		return 'static_property';
37
	}
38
39
	function display_name() {
40
		return $this->class_name . '::$' . $this->prop_name;
41
	}
42
}