コード例 #1
0
 /**
  * @param UsageInterface $usage
  * @param PhpFileInfo    $file
  * @param $comment
  */
 public function __construct(UsageInterface $usage, PhpFileInfo $file, $comment)
 {
     $this->file = $file;
     $this->line = $usage->getLineNumber();
     $this->usage = $usage;
     $this->comment = $comment;
 }
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof SuperTypeUsage) {
         return '';
     }
     return sprintf('Extending deprecated class <info>%s</info> by class <info>%s</info>', $usage->name(), $usage->className());
 }
コード例 #3
0
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof DeprecatedLanguageUsage) {
         return '';
     }
     return sprintf('Using deprecated language feature <info>%s</info>', $usage->name());
 }
コード例 #4
0
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof ClassUsage) {
         return '';
     }
     return sprintf('Using deprecated class <info>%s</info>', $usage->name());
 }
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof MethodDefinition) {
         return '';
     }
     return sprintf('Overriding deprecated method <info>%s->%s()</info>', $usage->parentName(), $usage->name());
 }
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof InterfaceUsage) {
         return '';
     }
     $violationInfo = sprintf('Using deprecated interface <info>%s</info>', $usage->name());
     $className = $usage->className();
     return empty($className) ? $violationInfo : sprintf('%s by class <info>%s</info>', $violationInfo, $className);
 }
 public function message(UsageInterface $usage)
 {
     if (!$usage instanceof MethodUsage) {
         return '';
     }
     $message = $usage->isStatic() === true ? sprintf('static method <info>%s::%s()</info>', $usage->className(), $usage->name()) : sprintf('method <info>%s->%s()</info>', $usage->className(), $usage->name());
     $violationInfo = sprintf('Calling deprecated %s', $message);
     return $violationInfo;
 }