Differential D19741 Diff 48927 src/lint/linter/xhpast/rules/__tests__/self-class-reference/self-class-references.lint-test
Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/__tests__/self-class-reference/self-class-references.lint-test
<?php | <?php | ||||
class Foo extends Bar { | class Foo extends Bar { | ||||
public static function newInstance() { | public static function newInstance() { | ||||
return new Foo(); | return new Foo(); | ||||
} | } | ||||
public static function init() { | public static function init() { | ||||
return new self(); | return new self(); | ||||
} | } | ||||
} | } | ||||
$c = new class { | |||||
public function newInstance() { | |||||
return new self(); | |||||
} | |||||
}; | |||||
~~~~~~~~~~ | ~~~~~~~~~~ | ||||
warning:5:16 | warning:5:16 | ||||
~~~~~~~~~~ | ~~~~~~~~~~ | ||||
<?php | <?php | ||||
class Foo extends Bar { | class Foo extends Bar { | ||||
public static function newInstance() { | public static function newInstance() { | ||||
return new self(); | return new self(); | ||||
} | } | ||||
public static function init() { | public static function init() { | ||||
return new self(); | return new self(); | ||||
} | } | ||||
} | } | ||||
$c = new class { | |||||
public function newInstance() { | |||||
return new self(); | |||||
} | |||||
}; |