TASK: Simplfy feature support trait
This commit is contained in:
parent
e4f26abe71
commit
cecfe983e0
1 changed files with 4 additions and 6 deletions
|
@ -28,13 +28,11 @@ use PHP_CodeSniffer_File as PhpCsFile;
|
||||||
trait FeaturesSupport
|
trait FeaturesSupport
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Features
|
* @return Features
|
||||||
*/
|
*/
|
||||||
protected $features;
|
protected function getFeatures()
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
{
|
||||||
$this->features = new Features($this);
|
return new Features($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +44,7 @@ trait FeaturesSupport
|
||||||
*/
|
*/
|
||||||
public function processFeatures(PhpCsFile $phpcsFile, $stackPtr, $content)
|
public function processFeatures(PhpCsFile $phpcsFile, $stackPtr, $content)
|
||||||
{
|
{
|
||||||
foreach ($this->features as $featureClassName) {
|
foreach ($this->getFeatures() as $featureClassName) {
|
||||||
$feature = $this->createFeature($featureClassName);
|
$feature = $this->createFeature($featureClassName);
|
||||||
$feature->process($phpcsFile, $stackPtr, $content);
|
$feature->process($phpcsFile, $stackPtr, $content);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue