Returns the set of selectors as an array.

@param  Project $p
@throws BuildException
@return array of selectors in this container
494736
public function getSelectors(Project $p)
    {
        if ($this->isReference()) {
            return $this->getRef($p)->getSelectors($p);
        } else {
            // *copy* selectors
            $result = [];
            for ($i = 0, $size = count($this->selectorsList); $i < $size; $i++) {
                $result[] = clone $this->selectorsList[$i];
            }

            return $result;
        }
    }
299646
public function selectorElements()
    {
        if ($this->isReference() && $this->getProject() !== null) {
            return $this->getRef($this->getProject())->selectorElements();
        }

        return $this->selectorsList;
    }
1070026
public function getAll()
    {
        $query = 'SELECT * FROM `project` ORDER BY `title` ASC';
        $stmt = Database::getConnection('read')->prepare($query);

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return new Project($item);
            };
            $rtn = array_map($map, $res);

            $count = count($rtn);


            return array('items' => $rtn, 'count' => $count);
        } else {
            return array('items' => array(), 'count' => 0);
        }
    }
911396
public function getBuildList(
        $buildFile,
        $level = 0,
        $parent = '',
        &$buildList = array()
    ) {

        if (is_file($buildFile)) {
            $buildFileXml = simplexml_load_file($buildFile);
            $buildFileName = $buildFileXml->xpath('//project/@name');
            $buildFileDescription = $buildFileXml->xpath('//project/@description');

            if (isset($buildFileName[0]) && isset($buildFileDescription[0])) {
                $buildList[$buildFile] = array(
                    'level'       => $level,
                    'parent'      => $parent,
                    'name'        => (string) $buildFileName[0],
                    'description' => (string) $buildFileDescription[0],
                );

                foreach ($buildFileXml->xpath('//import[@file]') as $import) {
                    $importFile = (string) $import->attributes()->file;

                    // Replace tokens.
                    if (preg_match_all('/\$\{(.*?)\}/s', $importFile, $matches)) {
                        foreach ($matches[0] as $key => $match) {
                            if (is_object($this->getProject())) {
                                $tokenText  = $this->getProject()->getProperty(
                                    $matches[1][$key]
                                );
                                $importFile = str_replace(
                                    $match,
                                    $tokenText,
                                    $importFile
                                );
                            }
                        }
                    }

                    PhingHelpTask::getBuildList(
                        $importFile,
                        ($level + 1),
                        $buildFile,
                        $buildList
                    );
                }
            }//end if

            return $buildList;
        }//end if

    }
348685
private function selection(string $path) : array
    {
        $modules = $this->getModules($path);
        if (empty($modules)) {
            $this->abort('Aborting, system modules not found.');
        }

        $result[] = $this->in('Please select first related module:', $modules);
        $result[] = $this->in('Please select second related module:', $modules);
        while ('y' === $this->in('Would you like to select more modules?', ['y', 'n'])) {
            $result[] = $this->in('Please select another related module:', $modules);
        }

        return $result;
    }
113631
public static function translatePath(Project $project, $source)
    {
        $result = [];
        if ($source == null) {
            return "";
        }

        $tok = new PathTokenizer($source);
        while ($tok->hasMoreTokens()) {
            $pathElement = $tok->nextToken();
            try {
                $element = self::resolveFile($project, $pathElement);
                for ($i = 0, $_i = strlen($element); $i < $_i; $i++) {
                    self::translateFileSep($element, $i);
                }
                $result[] = $element;
            } catch (BuildException $e) {
                $project->log(
                    "Dropping path element " . $pathElement
                    . " as it is not valid relative to the project",
                    Project::MSG_VERBOSE
                );
            }
        }

        return $result;
    }
567384
private function getTree(Project $project)
    {
        $key = $project->getBuildDir();
        if (!isset($this->cachedTree[$key])) {
            $this->cachedTree[$key] = $this->tree->getTree($project);
        }

        return $this->cachedTree[$key];
    }
35087
public static function build($p)
    {
        if (is_object($p)) {
            if ($p instanceof PosMap) {
                return $p;
            }
            $generated = isset($p->generated) ? $p->generated : null;
            $source = isset($p->source) ? $p->source : null;
        } elseif (is_array($p)) {
            $generated = isset($p['generated']) ? $p['generated'] : null;
            $source = isset($p['source']) ? $p['source'] : null;
        } else {
            $generated = null;
            $source = null;
        }
        return new PosMap($generated, $source);
    }
334380
public function xpath($query)
    {
        $nodes = [];
        /**
         * @var \DOMNode $node
         */
        foreach ($this->_document->getQuery()->xpath($query, $this->_node) as $node) {
            $nodes[$node->getNodePath()] = $node;
        }
        return new SelectorList($this->_document, $nodes);
    }
116867
protected function getProjectStructureXml($project, $ref = null)
    {
        if(!$project instanceof Project){
            $project = $this->codex->projects->get($project);
        }

        $ref = $ref === null ? $project->refs->getDefaultName() : $ref;

        $xmlPath = path_join($ref, $project->config('phpdoc.xml_path'));
        return $project->getFiles()->get($xmlPath);
    }
182607
function getSelectorsFromProps(selectors, node) {
  const props = typeof node.props === 'function' ? node.props() : node.props
  if (!props) return []
  const className = props.className || props.class
  if (className) {
    selectors = selectors.concat(
      className
        .toString()
        .split(' ')
        .map(cn => `.${cn}`),
    )
  }
  const dataProps = Object.keys(props).reduce((dProps, key) => {
    if (key.startsWith('data-')) {
      dProps.push(`[${key}]`)
    }
    return dProps
  }, [])
  if (dataProps.length) {
    selectors = selectors.concat(dataProps)
  }
  return selectors
}
1289518
private function getActualStrategyBy(BuildPlan $p)
    {
        try {
            return $this->strategyByBuildPlan->fetchValueByObjects([$p]);
        } catch (ValueNotFound $e) {
            throw new UnableToBuild();
        }
    }
1231527
public function getListFile(Project $p)
    {
        if ($this->isReference()) {
            $ref = $this->getRef($p);

            return $ref->getListFile($p);
        }

        return $this->listfile;
    }
1131379
public function folder_selector($p = array())
    {
        $realnames = $this->config->get('show_real_foldernames');
        $p += array('maxlength' => 100, 'realnames' => $realnames, 'is_escaped' => true);
        $a_mailboxes = array();
        $storage = $this->get_storage();

        if (empty($p['folder_name'])) {
            $p['folder_name'] = '*';
        }

        if ($p['unsubscribed']) {
            $list = $storage->list_folders('', $p['folder_name'], $p['folder_filter'], $p['folder_rights']);
        }
        else {
            $list = $storage->list_folders_subscribed('', $p['folder_name'], $p['folder_filter'], $p['folder_rights']);
        }

        $delimiter = $storage->get_hierarchy_delimiter();

        if (!empty($p['exceptions'])) {
            $list = array_diff($list, (array) $p['exceptions']);
        }

        if (!empty($p['additional'])) {
            foreach ($p['additional'] as $add_folder) {
                $add_items = explode($delimiter, $add_folder);
                $folder    = '';
                while (count($add_items)) {
                    $folder .= array_shift($add_items);

                    // @TODO: sorting
                    if (!in_array($folder, $list)) {
                        $list[] = $folder;
                    }

                    $folder .= $delimiter;
                }
            }
        }

        foreach ($list as $folder) {
            $this->build_folder_tree($a_mailboxes, $folder, $delimiter);
        }

        $select = new html_select($p);

        if ($p['noselection']) {
            $select->add(html::quote($p['noselection']), '');
        }

        $this->render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p);

        return $select;
    }
856670
protected function joinSelectors($parent, $child) {
        $setSelf = false;
        $out = array();
        foreach ($child as $part) {
            $newPart = array();
            foreach ($part as $p) {
                if ($p == self::$selfSelector) {
                    $setSelf = true;
                    foreach ($parent as $i => $parentPart) {
                        if ($i > 0) {
                            $out[] = $newPart;
                            $newPart = array();
                        }

                        foreach ($parentPart as $pp) {
                            $newPart[] = $pp;
                        }
                    }
                } else {
                    $newPart[] = $p;
                }
            }

            $out[] = $newPart;
        }

        return $setSelf ? $out : array_merge($parent, $child);
    }
82248
public function getExcludePatterns(Project $p)
    {
        if ($this->isReference()) {
            $o = $this->getRef($p);

            return $o->getExcludePatterns($p);
        } else {
            $this->readFiles($p);

            return $this->makeArray($this->excludeList, $p);
        }
    }
697070
private function readListFile(Project $p)
    {
        $listReader = null;
        try {
            // Get a FileReader
            $listReader = new BufferedReader(new FileReader($this->listfile));

            $line = $listReader->readLine();
            while ($line !== null) {
                if (!empty($line)) {
                    $line = $p->replaceProperties($line);
                    $this->filenames[] = trim($line);
                }
                $line = $listReader->readLine();
            }
        } catch (Exception $e) {
            if ($listReader) {
                $listReader->close();
            }
            throw new BuildException(
                "An error occurred while reading from list file " . $this->listfile->__toString() . ": " . $e->getMessage()
            );
        }

        $listReader->close();
    }