Completed
Push — renovate/glob-7.x ( 697d78...f7fc07 )
by
unknown
18:21 queued 12:01
created

Class_Property   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A type() 0 3 1
A display_name() 0 4 2
A __construct() 0 6 1
A to_csv_array() 0 11 1
1
<?php
2
3
namespace Automattic\Jetpack\Analyzer\Declarations;
4
5
/**
6
 * We only log public class variables
7
 */
8
class Class_Property extends Declaration {
9
	public $class_name;
10
	public $prop_name;
11
	public $static;
12
13
	function __construct( $path, $line, $class_name, $prop_name, $static ) {
14
		$this->class_name = $class_name;
15
		$this->prop_name = $prop_name;
16
		$this->static = $static;
17
		parent::__construct( $path, $line );
18
	}
19
20
	function to_csv_array() {
21
		return array(
22
			$this->type(),
23
			$this->path,
24
			$this->line,
25
			$this->class_name,
26
			$this->prop_name,
27
			$this->static,
28
			''
29
		);
30
	}
31
32
	function type() {
33
		return 'property';
34
	}
35
36
	function display_name() {
37
		$sep = $this->static ? '::$' : '->';
38
		return $this->class_name . $sep . $this->prop_name;
39
	}
40
}