PDepend\Source\Language\PHP\PHPBuilder::copyTypesWithPackage PHP Method

copyTypesWithPackage() private method

Creates a copy of the given input array, but skips all types that do not contain a parent package.
private copyTypesWithPackage ( array $originalTypes ) : array
$originalTypes array The original types created during the parsing process.
return array
    private function copyTypesWithPackage(array $originalTypes)
    {
        $copiedTypes = array();
        foreach ($originalTypes as $typeName => $namespaces) {
            foreach ($namespaces as $namespaceName => $types) {
                foreach ($types as $index => $type) {
                    if (is_object($type->getNamespace())) {
                        $copiedTypes[$typeName][$namespaceName][$index] = $type;
                    }
                }
            }
        }
        return $copiedTypes;
    }
PHPBuilder