Generate a set of rules for a single TemplateInspector instance

@param  TemplateInspector $srcInspector  Source of the rules
@param  array             $trgInspectors Array of [tagName => TemplateInspector]
@return array
553086
protected function generateRuleset(TemplateInspector $srcInspector, array $trgInspectors)
	{
		$rules = [];
		foreach ($this->collection as $rulesGenerator)
		{
			if ($rulesGenerator instanceof BooleanRulesGenerator)
			{
				foreach ($rulesGenerator->generateBooleanRules($srcInspector) as $ruleName => $bool)
				{
					$rules[$ruleName] = $bool;
				}
			}

			if ($rulesGenerator instanceof TargetedRulesGenerator)
			{
				foreach ($trgInspectors as $tagName => $trgInspector)
				{
					$targetedRules = $rulesGenerator->generateTargetedRules($srcInspector, $trgInspector);
					foreach ($targetedRules as $ruleName)
					{
						$rules[$ruleName][] = $tagName;
					}
				}
			}
		}

		return $rules;
	}
1359483
def _parseSelectorPseudo(self, src, selector):
        
        ctxsrc = src
        if not src.startswith(':'):
            raise self.ParseError('Selector Pseudo \':\' not found', src, ctxsrc)
        src = re.search('^:{1,2}(.*)', src, re.M | re.S).group(1)

        name, src = self._getIdent(src)
        if not name:
            raise self.ParseError('Selector Pseudo identifier not found', src, ctxsrc)

        if src.startswith('('):
            # function
            src = src[1:].lstrip()
            src, term = self._parseExpression(src, True)
            if not src.startswith(')'):
                raise self.ParseError('Selector Pseudo Function closing \')\' not found', src, ctxsrc)
            src = src[1:]
            selector.addPseudoFunction(name, term)
        else:
            selector.addPseudo(name)

        return src, selector
880162
protected function addRuleRenderer(AbstractRenderer $ruleRenderer) {
        $ruleRenderer->setRendererSet($this);

        $this->ruleRenderers[] = $ruleRenderer;

        return $this;
    }
457972
public function dragAndDropToObject($sSelector, $sContainer)
    {
        $oElement = $this->getElementLazy($sSelector);
        $oContainer = $this->getElementLazy($sContainer);

        $oElement->dragTo($oContainer);
    }
1060010
protected function _getElementByIdOrName($sSelector)
    {
        $sSelector = str_replace(array('name=', 'id='), array('', ''), $sSelector);

        if (strpos($sSelector, '.') || strpos($sSelector, '[')) {
            $oElement = $this->_getElementByIdOrNameXpath($sSelector);
        } else {
            $oElement = $this->_getElementByIdOrNameCSS($sSelector);
        }

        return $oElement;
    }
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;
        }
    }
170741
protected function mapReflectorToDescriptor(Method $reflector, MethodDescriptor $descriptor): void
    {
        $descriptor->setFullyQualifiedStructuralElementName($reflector->getFqsen());
        $descriptor->setName($reflector->getName());
        $descriptor->setVisibility((string) $reflector->getVisibility() ?: 'public');
        $descriptor->setFinal($reflector->isFinal());
        $descriptor->setAbstract($reflector->isAbstract());
        $descriptor->setStatic($reflector->isStatic());
        $descriptor->setLine($reflector->getLocation()->getLineNumber());
        $descriptor->setReturnType($reflector->getReturnType());
    }
1352854
public function doubleclick($cssSelector)
    {
        $element = $this->getElementByCssSelector($cssSelector);

        $this->assert($element != null, "{$cssSelector} not found on the page");

        $element->doubleClick();
    }
1236921
protected function widgetSelector(\Psc\HTML\Tag $tag = NULL, $subSelector = NULL) {
    $jQuery = \Psc\JS\jQuery::getClassSelector($tag ?: $this->html);
    
    if (isset($subSelector)) {
      $jQuery .= sprintf(".find(%s)", \Psc\JS\Helper::convertString($subSelector));
    }
    
    return $this->jsExpr($jQuery);
  }
404228
function createSelectorList() {
        var doc = DocumentManager.getCurrentDocument();
        if (!doc) {
            return;
        }

        var docText = doc.getText();
        return CSSUtils.extractAllSelectors(docText, doc.getLanguage().getMode());
    }
517038
protected function _templates($customTemplate = null, $customTemplateSuffix = null)
    {
        $templates = SSViewer::get_templates_by_class(static::class, $customTemplateSuffix, __CLASS__);
        // Prefer any custom template
        if ($customTemplate) {
            // Prioritise direct template
            array_unshift($templates, $customTemplate);
        }
        return $templates;
    }
339643
public function calculateSpecificityBasedOnASelector($selector)
    {
        $idSelectorsPattern = "  \#";
        $classAttributesPseudoClassesSelectorsPattern = "  (\.[\w]+)                     # classes
                        |
                        \[(\w+)                       # attributes
                        |
                        (\:(                          # pseudo classes
                          link|visited|active
                          |hover|focus
                          |lang
                          |target
                          |enabled|disabled|checked|indeterminate
                          |root
                          |nth-child|nth-last-child|nth-of-type|nth-last-of-type
                          |first-child|last-child|first-of-type|last-of-type
                          |only-child|only-of-type
                          |empty|contains
                        ))";

        $typePseudoElementsSelectorPattern = "  ((^|[\s\+\>\~]+)[\w]+       # elements
                        |
                        \:{1,2}(                    # pseudo-elements
                          after|before
                          |first-letter|first-line
                          |selection
                        )
                      )";

        return new Specificity(
            preg_match_all("/{$idSelectorsPattern}/ix", $selector, $matches),
            preg_match_all("/{$classAttributesPseudoClassesSelectorsPattern}/ix", $selector, $matches),
            preg_match_all("/{$typePseudoElementsSelectorPattern}/ix", $selector, $matches)
        );
    }
858442
public function check(TypoScriptFrontendController $frontendController, string $uri, array $explanation, bool $skipProcessing): array
    {
        $this->checkRule($frontendController, $uri, $explanation, $skipProcessing);

        return [
            'frontendController' => $frontendController,
            'uri' => $uri,
            'explanation' => $explanation,
            'skipProcessing' => $skipProcessing,
        ];
    }
889606
public function getSelectors(){
		$list	= array();
		foreach( $this->rules as $rule )
			$list[]	= $rule->getSelector();
		return $list;
	}
1128415
def _parseRuleset(self, src):
        
        src, selectors = self._parseSelectorGroup(src)
        src, properties = self._parseDeclarationGroup(src.lstrip())
        result = self.cssBuilder.ruleset(selectors, properties)
        return src, result
335070
public function getVisitor(ValidationContext $context)
    {
        return [
            NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) {
                if ($node->operation === 'subscription') {
                    if (count($node->selectionSet->selections) !== 1) {
                        $context->reportError(
                            new Error(
                                $this->singleFieldOnlyMessage($node->name ? $node->name->value : null),
                                array_slice($node->selectionSet->selections, 1)
                            )
                        );
                    }
                }
            }
        ];
    }
146600
public function getViewHelpers()
    {
        return [
            'aliases' => [
                'tssFlashMessenger' => View\Helper\FlashMessenger::class,
                'tssFormRow' => Form\View\Helper\FormRow::class,
                'tssPaginator' => View\Helper\Paginator::class,
                'tssReferer' => View\Helper\Referer::class,
            ],
            'factories' => [
                Form\View\Helper\FormRow::class => InvokableFactory::class,
                View\Helper\FlashMessenger::class => InvokableFactory::class,
                View\Helper\Paginator::class => View\Helper\PaginatorFactory::class,
                View\Helper\Referer::class => View\Helper\RefererFactory::class,
            ],
        ];
    }