Forms marks for articles.

@param string $sCurrentMark Current mark.

@return array
543562
private function _formMarks($sCurrentMark)
    {
        $oBasket = $this->_getBasket();
        $aMarks = [];
        if ($oBasket->hasSkipedDiscount()) {
            $aMarks['skippedDiscount'] = $sCurrentMark;
            $sCurrentMark .= '*';
        }
        if ($oBasket->hasArticlesWithDownloadableAgreement()) {
            $aMarks['downloadable'] = $sCurrentMark;
            $sCurrentMark .= '*';
        }
        if ($oBasket->hasArticlesWithIntangibleAgreement()) {
            $aMarks['intangible'] = $sCurrentMark;
        }

        return $aMarks;
    }
1180330
public function getModifiers()
    {
        $lastIndent = null;
        $modifiers = array();

        if ($modiferComment = $this->getModifiersComment()) {
            $modifierLines = explode("\n", $modiferComment);
            foreach ($modifierLines as $line) {
                if (empty($line)) {
                    continue;
                }

                preg_match('/^\s*/', $line, $matches);
                $indent = strlen($matches[0]);

                if ($lastIndent && $indent > $lastIndent) {
                    $modifier = end($modifiers);
                    $modifier->setDescription($modifier->getDescription() + trim($line));
                } else {
                    $lineParts = explode(' - ', $line);

                    $name = trim(array_shift($lineParts));

                    $description = '';
                    if (!empty($lineParts)) {
                        $description = trim(implode(' - ', $lineParts));
                    }
                    $modifier = new Modifier($name, $description);

                    // If the CSS has a markup, pass it to the modifier for the example HTML
                    if ($markup = $this->getMarkup()) {
                        $modifier->setMarkup($markup);
                    }
                    $modifiers[] = $modifier;
                }
            }
        }

        return $modifiers;
    }
372653
public function markingClasses() {
        $classes='';
        if(!$this->isExpanded()) {
            $classes .= " unexpanded jstree-closed";
        }
        if($this->isTreeOpened()) {
            if($this->numChildren() > 0) $classes .= " jstree-open";
        } else {
            $classes .= " closed";
        }
        return $classes;
    }
164336
def get_section_marks(self):
        """"""
        return [abc if s in self.sec2chr else "." for s, abc in self.datobj.sec2chr.items()]
809117
public function toXmlLines($indenter = '  ')
    {
        if ($this->isSkip()) {
            $result = null;
        } else {
            if ($indenter) {
                $prefix = $indenter;
                $prefix2 = $indenter . $indenter;
            } else {
                $prefix = '';
                $prefix2 = '';
            }
            $loc = h((string) $this->getUrl());
            $result = [
                "{$prefix}<url>",
                "{$prefix2}<loc>{$loc}</loc>",
            ];
            $lastModifiedAt = $this->getLastModifiedAt();
            if ($lastModifiedAt !== null) {
                $lastModifiedAt = $lastModifiedAt->format(DateTime::ATOM);
                $result[] = "{$prefix2}<lastmod>{$lastModifiedAt}</lastmod>";
            }
            $changeFrequency = $this->getChangeFrequency();
            if ($changeFrequency !== '') {
                $result[] = "{$prefix2}<changefreq>{$changeFrequency}</changefreq>";
            }
            $priority = $this->getPriority();
            if ($priority !== '') {
                $result[] = "{$prefix2}<priority>{$priority}</priority>";
            }
            foreach ($this->getAlternativeLanguages() as $alternativeLanguage) {
                $result = array_merge($result, $alternativeLanguage->toXmlLines($indenter));
            }
            $result[] = "{$prefix}</url>";
        }

        return $result;
    }
817080
private function Annotations()
    {
        $annotations = [];

        while (null !== $this->lexer->lookahead) {
            if (DocLexer::T_AT !== $this->lexer->lookahead['type']) {
                $this->lexer->moveNext();
                continue;
            }

            // make sure the @ is preceded by non-catchable pattern
            if (null !== $this->lexer->token && $this->lexer->lookahead['position'] === $this->lexer->token['position'] + strlen($this->lexer->token['value'])) {
                $this->lexer->moveNext();
                continue;
            }

            // make sure the @ is followed by either a namespace separator, or
            // an identifier token
            if ((null === $peek = $this->lexer->glimpse())
                || (DocLexer::T_NAMESPACE_SEPARATOR !== $peek['type'] && !in_array($peek['type'], self::$classIdentifiers, true))
                || $peek['position'] !== $this->lexer->lookahead['position'] + 1) {
                $this->lexer->moveNext();
                continue;
            }

            $this->isNestedAnnotation = false;
            if (false !== $annot = $this->Annotation()) {
                $annotations[] = $annot;
            }
        }

        return $annotations;
    }
591218
public function getMarkers($marker = NULL)
	{
		if($marker !== NULL && $this->markers !== NULL)
		{
			$result = [];
			
			foreach($this->markers as $check)
			{
				if($check instanceof $marker)
				{
					$result[] = $check;
				}
			}
			
			return $result;
		}
		
		return (array)$this->markers;
	}
919507
private function getPluralForms()
    {
        // lets assume message number 0 is header
        // this is true, right?

        // cache header field for plural forms
        if (is_null($this->pluralequation)) {
            if (isset($this->cache_translations[''])) {
                $header = $this->cache_translations[''];
            } else {
                $header = '';
            }
            $expr = $this->extractPluralsForms($header);
            $this->pluralequation = $this->sanitizePluralExpression($expr);
            $this->pluralcount = $this->extractPluralCount($expr);
        }

        return $this->pluralequation;
    }
1366005
public function getHTMLFragments($gridField)
    {
        $forTemplate = new ArrayData([]);

        if (!$this->canFilterAnyColumns($gridField)) {
            return null;
        }

        if ($this->useLegacyFilterHeader) {
            $fieldsList = $this->getLegacyFilterHeader($gridField);
            $forTemplate->Fields = $fieldsList;
            $filterTemplates = SSViewer::get_templates_by_class($this, '_Row', __CLASS__);
            return ['header' => $forTemplate->renderWith($filterTemplates)];
        } else {
            $fieldSchema = $this->getSearchFieldSchema($gridField);
            $forTemplate->SearchFieldSchema = $fieldSchema;
            $searchTemplates = SSViewer::get_templates_by_class($this, '_Search', __CLASS__);
            return [
                'before' => $forTemplate->renderWith($searchTemplates),
                'buttons-before-right' => sprintf(
                    '<button type="button" name="showFilter" aria-label="%s" title="%s"' .
                    ' class="btn btn-secondary font-icon-search btn--no-text btn--icon-large grid-field__filter-open"></button>',
                    _t('SilverStripe\\Forms\\GridField\\GridField.OpenFilter', "Open search and filter"),
                    _t('SilverStripe\\Forms\\GridField\\GridField.OpenFilter', "Open search and filter")
                )
            ];
        }
    }
13701
protected function getFormattedReplacements()
    {
        $time = $this->getMembers();

        $negative = $this->isNegative();

        return [
            self::HOUR_FORMAT          => sprintf('%02d', $time['hours']),
            self::MINUTE_FORMAT        => sprintf('%02d', $time['minutes']),
            self::SECOND_FORMAT        => sprintf('%02d', $time['seconds']),
            self::TOTAL_MINUTES_FORMAT => sprintf('%02d', $time['total_minutes']),
            self::SIGN_ANY             => $negative ? '-' : '+',
            self::SIGN_NEGATIVE        => $negative ? '-'  : '',
        ];
    }
1255719
public function getFrequentSearchTerms() : array
    {
        $frequentSearchConfiguration = $this->configuration->getSearchFrequentSearchesConfiguration();

        $identifier = $this->getCacheIdentifier($frequentSearchConfiguration);

        if ($this->cache->has($identifier)) {
            $terms = $this->cache->get($identifier);
        } else {
            $terms = $this->getFrequentSearchTermsFromStatistics($frequentSearchConfiguration);

            if ($frequentSearchConfiguration['sortBy'] === 'hits') {
                arsort($terms);
            } else {
                ksort($terms);
            }

            $lifetime = null;
            if (isset($frequentSearchConfiguration['cacheLifetime'])) {
                $lifetime = intval($frequentSearchConfiguration['cacheLifetime']);
            }

            $this->cache->set($identifier, $terms, [], $lifetime);
        }

        return $terms;
    }
703443
protected function getSignaturesRegexp()
	{
		$signatures = array_map('preg_quote', array_keys($this->markupElements));

		$signaturesRegexp = '(?:' . join(')|(?:', $signatures) . ')';

		return $signaturesRegexp;
	}
160642
private function getAllUseStatementsMarkedAsAnnotation(\ReflectionClass $class): array
    {
        $tokens = \token_get_all(\file_get_contents($class->getFileName()));

        $uses = [];
        $buffer = '';
        $startUseParse = false;

        foreach ($tokens as $token) {
            if (\is_scalar($token)) {
                // Single element
                if ($token == ';' || $token = ',') {
                    if ($startUseParse) {
                        // Add "use" statement to collection
                        $uses[] = trim($buffer);
                        // Clear buffer
                        $buffer = ''; // Clear buffer

                        if ($token == ';') {
                            // Stop parse "use"
                            $startUseParse = false;
                        }
                    }
                }

                continue;
            }

            $type = $token[0];
            $value = $token[1];

            if (\in_array($type, [T_ABSTRACT, T_CLASS, T_INTERFACE, T_TRAIT])) {
                // Start class or interface or trait
                break;
            }

            if ($type == T_USE) {
                $startUseParse = true;
                continue;
            }

            if ($startUseParse) {
                $buffer .= $value;
            }
        }

        $useFiltering = function ($class, $searchChild = true) use (&$useFiltering) {
            if (!$class) {
                return false;
            }

            $parts = \explode(' as ', $class, 2);
            $class = $parts[0];

            try {
                $reflection = new \ReflectionClass($class);
            } catch (\ReflectionException $e) {
                if ($searchChild) {
                    foreach (\get_declared_classes() as $declaredClass) {
                        if (\strpos($declaredClass, $class) === 0) {
                            if (true === $useFiltering($declaredClass, false)) {
                                return true;
                            }
                        }
                    }
                }

                return false;
            }

            if ($reflection->getName() == Transactional::class) {
                return false;
            }

            return \strpos($reflection->getDocComment(), '@Annotation') !== false;
        };

        $uses = \array_filter($uses, $useFiltering);

        return $uses;
    }
1373630
private function tags($event)
    {
        return array_merge([
            $this->formatNotifiable($event->notifiable),
        ], ExtractTags::from($event->notification));
    }
1323212
private function countLinesBetweenAnnotations(Annotation $current, Annotation $previous)
    {
        $tokens = $this->tokens;

        \preg_match('~(\\s+)$~', $tokens[$previous->getEndPointer()]['content'], $matches);

        $lines = $matches[1] ?? '';
        $lines .= TokenHelper::getContent(
            $this->phpcsFile,
            $previous->getEndPointer() + 1,
            $current->getStartPointer() - 1
        );

        return $this->countLines($lines);
    }
551799
public function getWritableValues(): array
    {
        $result = array();

        foreach ($this->_definition as $key => $value) {
            if ($this->isWritable($key)) {
                $result[$key] = $this->$key;
            }
        }

        return $result;
    }
272812
public function getCatArticleCount($sCatId)
    {
        // current status unique ident
        $sActIdent = $this->_getUserViewId();

        // loading from cache
        $aCatData = $this->_getCatCache();

        if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) {
            $iCnt = $this->setCatArticleCount($aCatData, $sCatId, $sActIdent);
        } else {
            $iCnt = $aCatData[$sCatId][$sActIdent];
        }

        return $iCnt;
    }