Completed
Push — try/code-signature-diff ( 313026...01fa4f )
by
unknown
08:13
created

Declaration   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A match() 0 4 2
A partial_match() 0 4 1
type() 0 1 ?
display_name() 0 1 ?
1
<?php
2
3
namespace Automattic\Jetpack\Analyzer\Declarations;
4
5
use Automattic\Jetpack\Analyzer\PersistentList\Item as PersistentListItem;
6
7
abstract class Declaration extends PersistentListItem {
8
	public $path;
9
	public $line;
10
11
	function __construct( $path, $line ) {
12
		$this->path = $path;
13
		$this->line = $line;
14
	}
15
16
	function match( $other ) {
17
		return get_class( $other ) === get_class( $this )
18
			&& $other->display_name() === $this->display_name(); // hack
19
	}
20
21
	function partial_match( $other ) {
22
		// TODO
23
		return false;
24
	}
25
26
	// a simple name, like 'method'
27
	abstract function type();
28
29
	// e.g. Jetpack::get_file_url_for_environment()
30
	abstract function display_name();
31
}