Phan\Issue::emit PHP Method

emit() public static method

public static emit ( string $type, string $file, integer $line, variadic $template_parameters ) : void
$type string The type of the issue
$file string The name of the file where the issue was found
$line integer The line number (start) where the issue was found
$template_parameters variadic Any template parameters required for the issue message
return void
    public static function emit(string $type, string $file, int $line, ...$template_parameters)
    {
        self::emitWithParameters($type, $file, $line, $template_parameters);
    }

Usage Example

コード例 #1
0
 /**
  * Check to see if the given Clazz is a duplicate
  *
  * @return null
  */
 public static function analyzeParentConstructorCalled(CodeBase $code_base, Clazz $clazz)
 {
     // Only look at classes configured to require a call
     // to its parent constructor
     if (!in_array($clazz->getName(), Config::get()->parent_constructor_required)) {
         return;
     }
     // Don't worry about internal classes
     if ($clazz->isInternal()) {
         return;
     }
     // Don't worry if there's no parent class
     if (!$clazz->hasParentClassFQSEN()) {
         return;
     }
     if (!$code_base->hasClassWithFQSEN($clazz->getParentClassFQSEN())) {
         // This is an error, but its caught elsewhere. We'll
         // just roll through looking for other errors
         return;
     }
     $parent_clazz = $code_base->getClassByFQSEN($clazz->getParentClassFQSEN());
     if (!$parent_clazz->isAbstract() && !$clazz->getIsParentConstructorCalled()) {
         Issue::emit(Issue::TypeParentConstructorCalled, $clazz->getContext()->getFile(), $clazz->getContext()->getLineNumberStart(), (string) $clazz->getFQSEN(), (string) $parent_clazz->getFQSEN());
     }
 }
All Usage Examples Of Phan\Issue::emit