Completed
Push — try/code-signature-diff ( 5d24fe...2d24ed )
by
unknown
107:52 queued 99:19
created

Declaration::type()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 1
c 0
b 0
f 0
1
<?php
2
3
namespace Automattic\Jetpack\Analyzer\Declarations;
4
5
abstract class Declaration {
6
	public $path;
7
	public $line;
8
9
	function __construct( $path, $line ) {
10
		$this->path = $path;
11
		$this->line = $line;
12
	}
13
14
	function match( $other ) {
15
		return get_class( $other ) === get_class( $this )
16
			&& $other->name === $this->name
0 ignored issues
show
Bug introduced by
The property name does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
17
			&& $other->path === $this->path;
18
	}
19
20
	// a simple name, like 'method'
21
	abstract function type();
22
23
	// e.g. Jetpack::get_file_url_for_environment()
24
	abstract function display_name();
25
}