Exemplo n.º 1
0
 /**
  * @param \TokenReflection\IReflectionMethod $method
  * @return string
  */
 private function writeVisibility(IReflectionMethod $method)
 {
     return $method->isPrivate() ? '-' : ($method->isProtected() ? '#' : '+');
 }
Exemplo n.º 2
0
 /**
  * Will test if a method's visibility has been opened
  *
  * @param \TokenReflection\IReflection       $structureReflection The current structure reflection to inspect
  * @param \TokenReflection\IReflectionMethod $currentMethod       The current method reflection to inspect
  * @param \TokenReflection\IReflectionMethod $formerMethod        The former method reflection to compare to
  *
  * @return boolean
  */
 protected function didOpenVisibility(IReflection $structureReflection, IReflectionMethod $currentMethod, IReflectionMethod $formerMethod)
 {
     if ($formerMethod && !$formerMethod->isPrivate() && !$formerMethod->isProtected()) {
         // the method has been public but isn't anymore
         $this->result->addReason(new Reason($structureReflection->getName(), $currentMethod->getName(), Reason::VISIBILITY_OPENED, $this->mapper));
         return true;
     } else {
         return false;
     }
 }