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.
This commit is contained in:
Daniel Siepmann 2017-03-09 08:48:27 +01:00
parent 56f3bdf245
commit 04a1b860a6

View file

@ -31,12 +31,12 @@ trait ClassnameCheckerTrait
* Contains mapping from old -> new class names. * Contains mapping from old -> new class names.
* @var array * @var array
*/ */
protected $legacyClassnames = []; private $legacyClassnames = [];
/** /**
* @param string $mappingFile File containing php array for mapping. * @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 !== []) { if ($this->legacyClassnames !== []) {
return; return;
@ -47,10 +47,13 @@ trait ClassnameCheckerTrait
} }
/** /**
* Checks whether a mapping exists for the given $classname,
* indicating it's legacy.
*
* @param string $classname * @param string $classname
* @return bool * @return bool
*/ */
public function isLegacyClassname($classname) private function isLegacyClassname($classname)
{ {
$this->initialize(); $this->initialize();
return isset($this->legacyClassnames[strtolower($classname)]); return isset($this->legacyClassnames[strtolower($classname)]);
@ -60,7 +63,7 @@ trait ClassnameCheckerTrait
* @param string $classname * @param string $classname
* @return string * @return string
*/ */
public function getNewClassname($classname) private function getNewClassname($classname)
{ {
$this->initialize(); $this->initialize();
return $this->legacyClassnames[strtolower($classname)]; return $this->legacyClassnames[strtolower($classname)];
@ -101,7 +104,7 @@ trait ClassnameCheckerTrait
* @param string $classname * @param string $classname
* @return string * @return string
*/ */
public function getTokenForReplacement($classname) private function getTokenForReplacement($classname)
{ {
return $classname; return $classname;
} }