Adds PCDATA areas.

@param  Project $project
@param  string $element
@param  string $text
@throws BuildException
170944
public function addText(Project $project, $element, $text)
    {
        if ($this->methodAddText === null) {
            $msg = $this->getElementName($project, $element) . " doesn't support nested text data.";
            throw new BuildException($msg);
        }
        try {
            $method = $this->methodAddText;
            $method->invoke($element, $text);
        } catch (Exception $exc) {
            throw new BuildException($exc->getMessage(), $exc);
        }
    }
699830
public function addElement($elementName, $content, $attributes = null)
    {
        $this->elements[$elementName]['name'] = $elementName;
        $this->elements[$elementName]['content'] = $content;
        $this->elements[$elementName]['attributes'] = $attributes;
    }
639058
protected function addAttributes($element, $data)
    {
        foreach ($data as $attrKey => $attrVal) {
            $element->setAttribute($attrKey, $attrVal);
        }
    }
943176
private function addProcessInfo(Process $process, Project $project)
    {
        $this->processes[$project->getName()] = [
            'process' => $process,
            'project' => $project,
        ];
    }
498053
protected void addElements(List<CmsContainerElementData> elements) {

        for (CmsContainerElementData element : elements) {
            m_elements.put(element.getClientId(), element);
        }
    }
664931
public void addDataElement(String elemName, String content, String attrName, String attrValue) {
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute("", attrName, "", "CDATA", attrValue);
        writeDataElement(elemName, attrs, content);
    }
933425
public function main()
    {
        $exc = null;

        if (empty($this->tryContainer)) {
            throw new BuildException('A nested <try> element is required');
        }

        try {
            $this->tryContainer->perform();
        } catch (BuildException $e) {
            if (!empty($this->propertyName)) {
                $this->project->setProperty($this->propertyName, $e->getMessage());
            }

            if (!empty($this->referenceName)) {
                $this->project->addReference($this->referenceName, $e);
            }

            if (!empty($this->catchContainer)) {
                $this->catchContainer->perform();
            } else {
                $exc = $e;
            }
        }

        if (!empty($this->finallyContainer)) {
            $this->finallyContainer->perform();
        }

        if (!empty($exc)) {
            throw $exc;
        }
    }
951666
private function refreshProjectSuites($data, $project)
    {
        $this->dataRepository->removeMissingSuites($suites = $data['suites'], $project);

        collect($suites)->map(function ($data, $name) use ($project) {
            $this->createSuite($name, $project, $data);
        });
    }
1130669
public function createProjectFiles($project)
    {
        $needConfigure = $this->checkKernelFiles();

        /**
         * project.c.
         */
        $content = $this->backend->getTemplateFileContents('project.c');
        if (empty($content)) {
            throw new Exception("Template project.c doesn't exist");
        }

        $includes = '';
        $reqInitializers = '';
        $reqDestructors = '';
        $prqDestructors = '';
        $modInitializers = '';
        $modDestructors = '';
        $glbInitializers = '';
        $glbDestructors = '';
        $files = array_merge($this->files, $this->anonymousFiles);

        /*
         * Round 1. Calculate the dependency rank
         */
        $this->calculateDependencies($files);

        $classEntries = [];
        $classInits = [];

        $interfaceEntries = [];
        $interfaceInits = [];

        /*
         * Round 2. Generate the ZEPHIR_INIT calls according to the dependency rank
         */
        foreach ($files as $file) {
            /** @var \Zephir\Compiler\FileInterface $file */
            if (!$file->isExternal()) {
                $classDefinition = $file->getClassDefinition();
                if ($classDefinition) {
                    $dependencyRank = $classDefinition->getDependencyRank();
                    if ('class' == $classDefinition->getType()) {
                        if (!isset($classInits[$dependencyRank])) {
                            $classEntries[$dependencyRank] = [];
                            $classInits[$dependencyRank] = [];
                        }
                        $classEntries[$dependencyRank][] =
                            'zend_class_entry *'.$classDefinition->getClassEntry().';';
                        $classInits[$dependencyRank][] =
                            'ZEPHIR_INIT('.$classDefinition->getCNamespace().'_'.
                             $classDefinition->getName().');';
                    } else {
                        if (!isset($interfaceInits[$dependencyRank])) {
                            $interfaceEntries[$dependencyRank] = [];
                            $interfaceInits[$dependencyRank] = [];
                        }
                        $interfaceEntries[$dependencyRank][] =
                            'zend_class_entry *'.$classDefinition->getClassEntry().';';
                        $interfaceInits[$dependencyRank][] =
                            'ZEPHIR_INIT('.$classDefinition->getCNamespace().'_'.
                            $classDefinition->getName().');';
                    }
                }
            }
        }

        krsort($classInits);
        krsort($classEntries);
        krsort($interfaceInits);
        krsort($interfaceEntries);

        $completeInterfaceInits = [];
        foreach ($interfaceInits as $rankInterfaceInits) {
            asort($rankInterfaceInits, SORT_STRING);
            $completeInterfaceInits = array_merge($completeInterfaceInits, $rankInterfaceInits);
        }

        $completeInterfaceEntries = [];
        foreach ($interfaceEntries as $rankInterfaceEntries) {
            asort($rankInterfaceEntries, SORT_STRING);
            $completeInterfaceEntries = array_merge($completeInterfaceEntries, $rankInterfaceEntries);
        }

        $completeClassInits = [];
        foreach ($classInits as $rankClassInits) {
            asort($rankClassInits, SORT_STRING);
            $completeClassInits = array_merge($completeClassInits, $rankClassInits);
        }

        $completeClassEntries = [];
        foreach ($classEntries as $rankClassEntries) {
            asort($rankClassEntries, SORT_STRING);
            $completeClassEntries = array_merge($completeClassEntries, $rankClassEntries);
        }

        /*
         * Round 3. Process extension globals
         */
        list($globalCode, $globalStruct, $globalsDefault, $initEntries) = $this->processExtensionGlobals($project);
        if ('zend' == $project) {
            $safeProject = 'zend_';
        } else {
            $safeProject = $project;
        }

        /**
         * Round 4. Process extension info.
         */
        $phpInfo = $this->processExtensionInfo();

        /*
         * Round 5. Generate Function entries (FE)
         */
        list($feHeader, $feEntries) = $this->generateFunctionInformation();

        /**
         * Check if there are module/request/global destructors.
         */
        $destructors = $this->config->get('destructors');
        if (\is_array($destructors)) {
            $invokeRequestDestructors = $this->processCodeInjection($destructors, 'request');
            $includes .= PHP_EOL.$invokeRequestDestructors[0];
            $reqDestructors = $invokeRequestDestructors[1];

            $invokePostRequestDestructors = $this->processCodeInjection($destructors, 'post-request');
            $includes .= PHP_EOL.$invokePostRequestDestructors[0];
            $prqDestructors = $invokePostRequestDestructors[1];

            $invokeModuleDestructors = $this->processCodeInjection($destructors, 'module');
            $includes .= PHP_EOL.$invokeModuleDestructors[0];
            $modDestructors = $invokeModuleDestructors[1];

            $invokeGlobalsDestructors = $this->processCodeInjection($destructors, 'globals');
            $includes .= PHP_EOL.$invokeGlobalsDestructors[0];
            $glbDestructors = $invokeGlobalsDestructors[1];
        }

        /**
         * Check if there are module/request/global initializers.
         */
        $initializers = $this->config->get('initializers');
        if (\is_array($initializers)) {
            $invokeRequestInitializers = $this->processCodeInjection($initializers, 'request');
            $includes .= PHP_EOL.$invokeRequestInitializers[0];
            $reqInitializers = $invokeRequestInitializers[1];

            $invokeModuleInitializers = $this->processCodeInjection($initializers, 'module');
            $includes .= PHP_EOL.$invokeModuleInitializers[0];
            $modInitializers = $invokeModuleInitializers[1];

            $invokeGlobalsInitializers = $this->processCodeInjection($initializers, 'globals');
            $includes .= PHP_EOL.$invokeGlobalsInitializers[0];
            $glbInitializers = $invokeGlobalsInitializers[1];
        }

        /**
         * Append extra details.
         */
        $extraClasses = $this->config->get('extra-classes');
        if (\is_array($extraClasses)) {
            foreach ($extraClasses as $value) {
                if (isset($value['init'])) {
                    $completeClassInits[] = 'ZEPHIR_INIT('.$value['init'].')';
                }

                if (isset($value['entry'])) {
                    $completeClassEntries[] = 'zend_class_entry *'.$value['entry'].';';
                }
            }
        }

        $toReplace = [
            '%PROJECT_LOWER_SAFE%' => strtolower($safeProject),
            '%PROJECT_LOWER%' => strtolower($project),
            '%PROJECT_UPPER%' => strtoupper($project),
            '%PROJECT_CAMELIZE%' => ucfirst($project),
            '%CLASS_ENTRIES%' => implode(
                PHP_EOL,
                array_merge($completeInterfaceEntries, $completeClassEntries)
            ),
            '%CLASS_INITS%' => implode(
                PHP_EOL."\t",
                array_merge($completeInterfaceInits, $completeClassInits)
            ),
            '%INIT_GLOBALS%' => implode(
                PHP_EOL."\t",
                array_merge((array) $globalsDefault[0], [$glbInitializers])
            ),
            '%INIT_MODULE_GLOBALS%' => $globalsDefault[1],
            '%DESTROY_GLOBALS%' => $glbDestructors,
            '%EXTENSION_INFO%' => $phpInfo,
            '%EXTRA_INCLUDES%' => implode(
                PHP_EOL,
                array_unique(explode(PHP_EOL, $includes))
            ),
            '%MOD_INITIALIZERS%' => $modInitializers,
            '%MOD_DESTRUCTORS%' => $modDestructors,
            '%REQ_INITIALIZERS%' => implode(
                PHP_EOL."\t",
                array_merge($this->internalInitializers, [$reqInitializers])
            ),
            '%REQ_DESTRUCTORS%' => $reqDestructors,
            '%POSTREQ_DESTRUCTORS%' => empty($prqDestructors) ? '' : implode(
                PHP_EOL,
                [
                    '#define ZEPHIR_POST_REQUEST 1',
                    'static PHP_PRSHUTDOWN_FUNCTION('.strtolower($project).')',
                    '{',
                    "\t".implode(
                        PHP_EOL."\t",
                        explode(PHP_EOL, $prqDestructors)
                    ),
                    '}',
                ]
            ),
            '%FE_HEADER%' => $feHeader,
            '%FE_ENTRIES%' => $feEntries,
            '%PROJECT_INI_ENTRIES%' => implode(PHP_EOL."\t", $initEntries),
        ];
        foreach ($toReplace as $mark => $replace) {
            $content = str_replace($mark, $replace, $content);
        }

        /*
         * Round 5. Generate and place the entry point of the project
         */
        file_put_contents_ex($content, 'ext/'.$safeProject.'.c');
        unset($content);

        /**
         * Round 6. Generate the project main header.
         */
        $content = $this->backend->getTemplateFileContents('project.h');
        if (empty($content)) {
            throw new Exception("Template project.h doesn't exists");
        }

        $includeHeaders = [];
        foreach ($this->compiledFiles as $file) {
            if ($file) {
                $fileH = str_replace('.c', '.zep.h', $file);
                $include = '#include "'.$fileH.'"';
                $includeHeaders[] = $include;
            }
        }

        /**
         * Append extra headers.
         */
        $extraClasses = $this->config->get('extra-classes');
        if (\is_array($extraClasses)) {
            foreach ($extraClasses as $value) {
                if (isset($value['header'])) {
                    $include = '#include "'.$value['header'].'"';
                    $includeHeaders[] = $include;
                }
            }
        }

        $toReplace = [
            '%INCLUDE_HEADERS%' => implode(PHP_EOL, $includeHeaders),
        ];

        foreach ($toReplace as $mark => $replace) {
            $content = str_replace($mark, $replace, $content);
        }

        file_put_contents_ex($content, 'ext/'.$safeProject.'.h');
        unset($content);

        /**
         * Round 7. Create php_project.h.
         */
        $content = $this->backend->getTemplateFileContents('php_project.h');
        if (empty($content)) {
            throw new Exception("Template php_project.h doesn't exist");
        }

        $toReplace = [
            '%PROJECT_LOWER_SAFE%' => strtolower($safeProject),
            '%PROJECT_LOWER%' => strtolower($project),
            '%PROJECT_UPPER%' => strtoupper($project),
            '%PROJECT_EXTNAME%' => strtolower($project),
            '%PROJECT_NAME%' => utf8_decode($this->config->get('name')),
            '%PROJECT_AUTHOR%' => utf8_decode($this->config->get('author')),
            '%PROJECT_VERSION%' => utf8_decode($this->config->get('version')),
            '%PROJECT_DESCRIPTION%' => utf8_decode($this->config->get('description')),
            '%PROJECT_ZEPVERSION%' => Zephir::VERSION,
            '%EXTENSION_GLOBALS%' => $globalCode,
            '%EXTENSION_STRUCT_GLOBALS%' => $globalStruct,
        ];

        foreach ($toReplace as $mark => $replace) {
            $content = str_replace($mark, $replace, $content);
        }

        file_put_contents_ex($content, 'ext/php_'.$safeProject.'.h');
        unset($content);

        return $needConfigure;
    }
733137
public function setElementValue($element, $value)
    {
        $node = $this->dom->createTextNode($value);
        $element->appendChild($node);
    }
1263331
private function setProjectPhpCsProfile(SimpleXMLElement $xml)
    {
        $node = $this->xmlAccessor->getDescendant(
            $xml,
            [
                ['profile'],
                ['inspection_tool', ['class' => 'PhpCSValidationInspection']],
                ['option', ['name' => 'CUSTOM_RULESET_PATH']]
            ]
        );
        $this->xmlAccessor->setAttributes(
            $node,
            ['value' => '$PROJECT_DIR$/' . self::PROJECT_PHPCS]
        );
    }
486147
public function setProject(Project $project)
    {
        $this->project = $project;
        if ($this->project != null) {
            $this->project->addBuildListener($this);
        }
    }
1191444
function addElement( $elementArray )
    {
        // Check if we're inside a list or table
        if ( $this->CurrentStackNumber == 0 )
        {
            $this->DocumentArray[] = $elementArray;
        }
        else
        {
            if ( $this->DocumentStack[$this->CurrentStackNumber]['Type'] == 'list' )
            {
                // Add the paragraph inside a list
                $currentChild = $this->DocumentStack[$this->CurrentStackNumber]['CurrentChild'];
                $this->DocumentStack[$this->CurrentStackNumber]['ChildArray'][$currentChild][] = $elementArray;
            }
            else
            {
                // Add the paragraph inside a table cell
                $currentRow = $this->DocumentStack[$this->CurrentStackNumber]['CurrentRow'];
                $currentCell = $this->DocumentStack[$this->CurrentStackNumber]['CurrentCell'];
                // Alex 2008-06-03 - Added isset()
                if ( isset( $this->DocumentStack[$this->CurrentStackNumber]['CurrentColSpan'] )
                     && is_numeric( $this->DocumentStack[$this->CurrentStackNumber]['CurrentColSpan'] ) )
                    $elementArray = array_merge( $elementArray, array( "ColSpan" => $this->DocumentStack[$this->CurrentStackNumber]['CurrentColSpan'] ) );
                $this->DocumentStack[$this->CurrentStackNumber]['ChildArray'][$currentRow][$currentCell][] = $elementArray;

            }
        }
    }
349673
protected function addCData($cdata_text)
    {
        $node = dom_import_simplexml($this);
        $no = $node->ownerDocument;
        $node->appendChild($no->createCDATASection($cdata_text));
    }
1365278
public void addTo(String section, Object element)
    {
        Composite s = (Composite)sections.get(section);
        if (s==null)
            add(element);
        else
            s.add(element);
    }
328195
public function addProject(Project $project)
    {
        $this->storage->updateProject($project);

        $this->projects[$project->getSlug()] = $project;
    }
826721
public final void writeXml(T property, Element element, WriteContext context) {
		XCalElement xcalElement = new XCalElement(element);
		_writeXml(property, xcalElement, context);
	}