laravel-6 support

This commit is contained in:
RafficMohammed
2023-01-08 01:17:22 +05:30
parent 1a5c16ae4b
commit 774eed8b0e
4962 changed files with 279380 additions and 297961 deletions

View File

@@ -30,7 +30,7 @@ class ElementParser implements ParserInterface
/**
* {@inheritdoc}
*/
public function parse($source)
public function parse(string $source): array
{
// Matches an optional namespace, required element or `*`
// $source = 'testns|testel';
@@ -39,9 +39,9 @@ class ElementParser implements ParserInterface
// 1 => string 'testns' (length=6)
// 2 => string 'testel' (length=6)
if (preg_match('/^(?:([a-z]++)\|)?([\w-]++|\*)$/i', trim($source), $matches)) {
return array(new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2])));
return [new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2]))];
}
return array();
return [];
}
}