From 04a1b860a6e29716a932ff9db511b8f516eef60a Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 9 Mar 2017 08:48:27 +0100 Subject: [PATCH] TASK: Adjust visibility of trait members * As they are internal API and even protected is published to the using classes as this is a trait. --- .../LegacyClassnames/ClassnameCheckerTrait.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Standards/Typo3Update/Sniffs/LegacyClassnames/ClassnameCheckerTrait.php b/src/Standards/Typo3Update/Sniffs/LegacyClassnames/ClassnameCheckerTrait.php index ef11c38..b3f05fa 100644 --- a/src/Standards/Typo3Update/Sniffs/LegacyClassnames/ClassnameCheckerTrait.php +++ b/src/Standards/Typo3Update/Sniffs/LegacyClassnames/ClassnameCheckerTrait.php @@ -31,12 +31,12 @@ trait ClassnameCheckerTrait * Contains mapping from old -> new class names. * @var array */ - protected $legacyClassnames = []; + private $legacyClassnames = []; /** * @param string $mappingFile File containing php array for mapping. */ - public function initialize($mappingFile = __DIR__ . '/../../../../../LegacyClassnames.php') + private function initialize($mappingFile = __DIR__ . '/../../../../../LegacyClassnames.php') { if ($this->legacyClassnames !== []) { return; @@ -47,10 +47,13 @@ trait ClassnameCheckerTrait } /** + * Checks whether a mapping exists for the given $classname, + * indicating it's legacy. + * * @param string $classname * @return bool */ - public function isLegacyClassname($classname) + private function isLegacyClassname($classname) { $this->initialize(); return isset($this->legacyClassnames[strtolower($classname)]); @@ -60,7 +63,7 @@ trait ClassnameCheckerTrait * @param string $classname * @return string */ - public function getNewClassname($classname) + private function getNewClassname($classname) { $this->initialize(); return $this->legacyClassnames[strtolower($classname)]; @@ -101,7 +104,7 @@ trait ClassnameCheckerTrait * @param string $classname * @return string */ - public function getTokenForReplacement($classname) + private function getTokenForReplacement($classname) { return $classname; }