-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Detect class name usage inside that class declaration and suggest replacing it with self.
<?php
class TheExample
{
const EXAMPLE = 1;
public function createMe()
{
$instance = new TheExample();
$constant = TheExample::EXAMPLE;
}
}Original idea came from Phabricator Xphast, where sniff was called Self Class Reference and in there only new ClassName constructs were checked. Error message was:
Use `self` to instantiate the current class.