Example #1
0
 /**
  * @param \EBT\ExtensionBuilder\Domain\Model\File $fileObject
  * @return array
  */
 public function getFileStatements(\EBT\ExtensionBuilder\Domain\Model\File $fileObject)
 {
     $stmts = array();
     if ($fileObject->hasNamespaces()) {
         foreach ($fileObject->getNamespaces() as $namespace) {
             $stmts[] = $this->buildNamespaceNode($namespace);
             foreach ($namespace->getAliasDeclarations() as $aliasDeclaration) {
                 $stmts[] = $this->buildUseStatementNode($aliasDeclaration['name'], $aliasDeclaration['alias']);
             }
             $stmts = array_merge($stmts, $this->getContainerStatements($namespace));
         }
     } else {
         $stmts = array_merge($stmts, $this->getContainerStatements($fileObject));
     }
     return $stmts;
 }