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

Function_Call   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A to_csv_array() 0 9 1
A type() 0 3 1
A display_name() 0 3 1
1
<?php
2
3
namespace Automattic\Jetpack\Analyzer\Invocations;
4
5
use Automattic\Jetpack\Analyzer\PersistentList\Item as PersistentListItem;
6
7
/**
8
 * Invocations of a function
9
 *
10
 * TODO: detect dynamic invocations like `$function_name( 'hi' )`
11
 */
12
class Function_Call extends PersistentListItem {
13
	public $path;
14
	public $line;
15
	public $func_name;
16
17
	public function __construct( $path, $line, $func_name ) {
18
		$this->path = $path;
19
		$this->line = $line;
20
		$this->func_name = $func_name;
21
	}
22
23
	public function to_csv_array() {
24
		return array(
25
			$this->type(),
26
			$this->path,
27
			$this->line,
28
			'',
29
			$this->func_name
30
		);
31
	}
32
33
	function type() {
34
		return 'function_call';
35
	}
36
37
	function display_name() {
38
		return $this->func_name;
39
	}
40
}