From cecfe983e06d5ee39fe30e19cfdbc5f7a4a71020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hu=CC=88rtgen?= Date: Thu, 27 Apr 2017 10:17:05 +0200 Subject: [PATCH] TASK: Simplfy feature support trait --- src/Standards/Typo3Update/Feature/FeaturesSupport.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Standards/Typo3Update/Feature/FeaturesSupport.php b/src/Standards/Typo3Update/Feature/FeaturesSupport.php index 2f84bc7..26975c5 100644 --- a/src/Standards/Typo3Update/Feature/FeaturesSupport.php +++ b/src/Standards/Typo3Update/Feature/FeaturesSupport.php @@ -28,13 +28,11 @@ use PHP_CodeSniffer_File as PhpCsFile; trait FeaturesSupport { /** - * @var Features + * @return Features */ - protected $features; - - public function __construct() + protected function getFeatures() { - $this->features = new Features($this); + return new Features($this); } /** @@ -46,7 +44,7 @@ trait FeaturesSupport */ public function processFeatures(PhpCsFile $phpcsFile, $stackPtr, $content) { - foreach ($this->features as $featureClassName) { + foreach ($this->getFeatures() as $featureClassName) { $feature = $this->createFeature($featureClassName); $feature->process($phpcsFile, $stackPtr, $content); }