private function areMultipleNamespacesInFile()
    {
        if (count($this->objects) === 0) {
            return false;
        }

        $foundNamespaces = array();
        foreach ($this->objects as $object) {
            $ns = $object->getNamespace();
            if ($ns !== null) {
                $foundNamespaces[$ns] = $ns;
            }
        }

        $foundNamespacesCount = count($foundNamespaces);

        if ($foundNamespacesCount === 0) {
            return false;
        } elseif ($foundNamespacesCount > 1) {
            return true;
        } else {
            return !isset($foundNamespaces[$this->getNamespace()]);
        }
    }
private function areMultipleNamespacesInFile()
    {
        if (count($this->objects) === 0) {
            return false;
        }

        $foundNamespaces = array();
        foreach ($this->objects as $object) {
            $ns = $object->getNamespace();
            if ($ns !== null) {
                $foundNamespaces[$ns] = $ns;
            }
        }

        $foundNamespacesCount = count($foundNamespaces);

        if ($foundNamespacesCount === 0) {
            return false;
        } elseif ($foundNamespacesCount > 1) {
            return true;
        } else {
            return !isset($foundNamespaces[$this->getNamespace()]);
        }
    }
private function areMultipleNamespacesInFile ( ) { if ( count ( $ this -> objects ) === 0 ) { return false ; } $ foundNamespaces = array ( ) ; foreach ( $ this -> objects as $ object ) { $ ns = $ object -> getNamespace ( ) ; if ( $ ns !== null ) { $ foundNamespaces [ $ ns ] = $ ns ; } } $ foundNamespacesCount = count ( $ foundNamespaces ) ; if ( $ foundNamespacesCount === 0 ) { return false ; } elseif ( $ foundNamespacesCount > 1 ) { return true ; } else { return ! isset ( $ foundNamespaces [ $ this -> getNamespace ( ) ] ) ; } }
Check if there are multiple namespaces in the file.

If an object has no namespace defined it will not be considered as different than the file namespace.

@return boolean
Check if there are multiple namespaces in the file .