updated packages
This commit is contained in:
@@ -28,7 +28,7 @@ abstract class AbstractExtension implements ExtensionInterface
|
||||
*/
|
||||
public function getNodeTranslators()
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ abstract class AbstractExtension implements ExtensionInterface
|
||||
*/
|
||||
public function getCombinationTranslators()
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ abstract class AbstractExtension implements ExtensionInterface
|
||||
*/
|
||||
public function getFunctionTranslators()
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ abstract class AbstractExtension implements ExtensionInterface
|
||||
*/
|
||||
public function getPseudoClassTranslators()
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +60,6 @@ abstract class AbstractExtension implements ExtensionInterface
|
||||
*/
|
||||
public function getAttributeMatchingTranslators()
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,16 +31,16 @@ class AttributeMatchingExtension extends AbstractExtension
|
||||
*/
|
||||
public function getAttributeMatchingTranslators()
|
||||
{
|
||||
return array(
|
||||
'exists' => array($this, 'translateExists'),
|
||||
'=' => array($this, 'translateEquals'),
|
||||
'~=' => array($this, 'translateIncludes'),
|
||||
'|=' => array($this, 'translateDashMatch'),
|
||||
'^=' => array($this, 'translatePrefixMatch'),
|
||||
'$=' => array($this, 'translateSuffixMatch'),
|
||||
'*=' => array($this, 'translateSubstringMatch'),
|
||||
'!=' => array($this, 'translateDifferent'),
|
||||
);
|
||||
return [
|
||||
'exists' => [$this, 'translateExists'],
|
||||
'=' => [$this, 'translateEquals'],
|
||||
'~=' => [$this, 'translateIncludes'],
|
||||
'|=' => [$this, 'translateDashMatch'],
|
||||
'^=' => [$this, 'translatePrefixMatch'],
|
||||
'$=' => [$this, 'translateSuffixMatch'],
|
||||
'*=' => [$this, 'translateSubstringMatch'],
|
||||
'!=' => [$this, 'translateDifferent'],
|
||||
];
|
||||
}
|
||||
|
||||
public function translateExists(XPathExpr $xpath, string $attribute, ?string $value): XPathExpr
|
||||
|
||||
@@ -30,12 +30,12 @@ class CombinationExtension extends AbstractExtension
|
||||
*/
|
||||
public function getCombinationTranslators(): array
|
||||
{
|
||||
return array(
|
||||
' ' => array($this, 'translateDescendant'),
|
||||
'>' => array($this, 'translateChild'),
|
||||
'+' => array($this, 'translateDirectAdjacent'),
|
||||
'~' => array($this, 'translateIndirectAdjacent'),
|
||||
);
|
||||
return [
|
||||
' ' => [$this, 'translateDescendant'],
|
||||
'>' => [$this, 'translateChild'],
|
||||
'+' => [$this, 'translateDirectAdjacent'],
|
||||
'~' => [$this, 'translateIndirectAdjacent'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,14 +35,14 @@ class FunctionExtension extends AbstractExtension
|
||||
*/
|
||||
public function getFunctionTranslators()
|
||||
{
|
||||
return array(
|
||||
'nth-child' => array($this, 'translateNthChild'),
|
||||
'nth-last-child' => array($this, 'translateNthLastChild'),
|
||||
'nth-of-type' => array($this, 'translateNthOfType'),
|
||||
'nth-last-of-type' => array($this, 'translateNthLastOfType'),
|
||||
'contains' => array($this, 'translateContains'),
|
||||
'lang' => array($this, 'translateLang'),
|
||||
);
|
||||
return [
|
||||
'nth-child' => [$this, 'translateNthChild'],
|
||||
'nth-last-child' => [$this, 'translateNthLastChild'],
|
||||
'nth-of-type' => [$this, 'translateNthOfType'],
|
||||
'nth-last-of-type' => [$this, 'translateNthLastOfType'],
|
||||
'contains' => [$this, 'translateContains'],
|
||||
'lang' => [$this, 'translateLang'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ class FunctionExtension extends AbstractExtension
|
||||
$expr .= ' - '.$b;
|
||||
}
|
||||
|
||||
$conditions = array(sprintf('%s %s 0', $expr, $sign));
|
||||
$conditions = [sprintf('%s %s 0', $expr, $sign)];
|
||||
|
||||
if (1 !== $a && -1 !== $a) {
|
||||
$conditions[] = sprintf('(%s) mod %d = 0', $expr, $a);
|
||||
|
||||
@@ -41,16 +41,16 @@ class HtmlExtension extends AbstractExtension
|
||||
*/
|
||||
public function getPseudoClassTranslators()
|
||||
{
|
||||
return array(
|
||||
'checked' => array($this, 'translateChecked'),
|
||||
'link' => array($this, 'translateLink'),
|
||||
'disabled' => array($this, 'translateDisabled'),
|
||||
'enabled' => array($this, 'translateEnabled'),
|
||||
'selected' => array($this, 'translateSelected'),
|
||||
'invalid' => array($this, 'translateInvalid'),
|
||||
'hover' => array($this, 'translateHover'),
|
||||
'visited' => array($this, 'translateVisited'),
|
||||
);
|
||||
return [
|
||||
'checked' => [$this, 'translateChecked'],
|
||||
'link' => [$this, 'translateLink'],
|
||||
'disabled' => [$this, 'translateDisabled'],
|
||||
'enabled' => [$this, 'translateEnabled'],
|
||||
'selected' => [$this, 'translateSelected'],
|
||||
'invalid' => [$this, 'translateInvalid'],
|
||||
'hover' => [$this, 'translateHover'],
|
||||
'visited' => [$this, 'translateVisited'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,9 +58,9 @@ class HtmlExtension extends AbstractExtension
|
||||
*/
|
||||
public function getFunctionTranslators()
|
||||
{
|
||||
return array(
|
||||
'lang' => array($this, 'translateLang'),
|
||||
);
|
||||
return [
|
||||
'lang' => [$this, 'translateLang'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,17 +64,17 @@ class NodeExtension extends AbstractExtension
|
||||
*/
|
||||
public function getNodeTranslators()
|
||||
{
|
||||
return array(
|
||||
'Selector' => array($this, 'translateSelector'),
|
||||
'CombinedSelector' => array($this, 'translateCombinedSelector'),
|
||||
'Negation' => array($this, 'translateNegation'),
|
||||
'Function' => array($this, 'translateFunction'),
|
||||
'Pseudo' => array($this, 'translatePseudo'),
|
||||
'Attribute' => array($this, 'translateAttribute'),
|
||||
'Class' => array($this, 'translateClass'),
|
||||
'Hash' => array($this, 'translateHash'),
|
||||
'Element' => array($this, 'translateElement'),
|
||||
);
|
||||
return [
|
||||
'Selector' => [$this, 'translateSelector'],
|
||||
'CombinedSelector' => [$this, 'translateCombinedSelector'],
|
||||
'Negation' => [$this, 'translateNegation'],
|
||||
'Function' => [$this, 'translateFunction'],
|
||||
'Pseudo' => [$this, 'translatePseudo'],
|
||||
'Attribute' => [$this, 'translateAttribute'],
|
||||
'Class' => [$this, 'translateClass'],
|
||||
'Hash' => [$this, 'translateHash'],
|
||||
'Element' => [$this, 'translateElement'],
|
||||
];
|
||||
}
|
||||
|
||||
public function translateSelector(Node\SelectorNode $node, Translator $translator): XPathExpr
|
||||
|
||||
@@ -31,16 +31,16 @@ class PseudoClassExtension extends AbstractExtension
|
||||
*/
|
||||
public function getPseudoClassTranslators()
|
||||
{
|
||||
return array(
|
||||
'root' => array($this, 'translateRoot'),
|
||||
'first-child' => array($this, 'translateFirstChild'),
|
||||
'last-child' => array($this, 'translateLastChild'),
|
||||
'first-of-type' => array($this, 'translateFirstOfType'),
|
||||
'last-of-type' => array($this, 'translateLastOfType'),
|
||||
'only-child' => array($this, 'translateOnlyChild'),
|
||||
'only-of-type' => array($this, 'translateOnlyOfType'),
|
||||
'empty' => array($this, 'translateEmpty'),
|
||||
);
|
||||
return [
|
||||
'root' => [$this, 'translateRoot'],
|
||||
'first-child' => [$this, 'translateFirstChild'],
|
||||
'last-child' => [$this, 'translateLastChild'],
|
||||
'first-of-type' => [$this, 'translateFirstOfType'],
|
||||
'last-of-type' => [$this, 'translateLastOfType'],
|
||||
'only-child' => [$this, 'translateOnlyChild'],
|
||||
'only-of-type' => [$this, 'translateOnlyOfType'],
|
||||
'empty' => [$this, 'translateEmpty'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user