PDepend\Util\Type::isInternalType PHP Method

isInternalType() public static method

Returns true if the given type is internal or part of an extension.
public static isInternalType ( string $typeName ) : boolean
$typeName string The type name.
return boolean
    public static function isInternalType($typeName)
    {
        self::initTypeToExtension();
        $normalizedName = ltrim($typeName, '\\');
        $normalizedName = strtolower($normalizedName);
        return isset(self::$typeNameToExtension[$normalizedName]);
    }

Usage Example

Beispiel #1
0
 /**
  * Extracts the package name of a qualified PHP 5.3 class identifier.
  *
  * If the class name doesn't contain a package identifier this method will
  * return the default identifier.
  *
  * <code>
  *   $namespaceName = $this->extractPackageName('foo\bar\foobar');
  *   var_dump($namespaceName);
  *   // Results in:
  *   // string(8) "foo\bar"
  *
  *   $namespaceName = $this->extractPackageName('foobar');
  *   var_dump($namespaceName);
  *   // Results in:
  *   // string(6) "+global"
  * </code>
  *
  * @param string $qualifiedName The qualified PHP 5.3 class identifier.
  *
  * @return string
  */
 protected function extractNamespaceName($qualifiedName)
 {
     if (($pos = strrpos($qualifiedName, '\\')) !== false) {
         return ltrim(substr($qualifiedName, 0, $pos), '\\');
     } elseif (Type::isInternalType($qualifiedName)) {
         return Type::getTypePackage($qualifiedName);
     }
     return self::DEFAULT_NAMESPACE;
 }
All Usage Examples Of PDepend\Util\Type::isInternalType