Debian Codegraph @

vendor/mck89/peast/lib/Peast/Selector/Node/Part/Part.php

raw
1 <?php
2 /**
3 * This file is part of the Peast package
4 *
5 * (c) Marco Marchiò <[email protected]>
6 *
7 * For the full copyright and license information refer to the LICENSE file
8 * distributed with this source code
9 */
10 namespace Peast\Selector\Node\Part;
11
12 use Peast\Syntax\Node\Node;
13
14 /**
15 * Selector part base class
16 *
17 * @author Marco Marchiò <[email protected]>
18 *
19 * @abstract
20 */
21 abstract class Part
22 {
23 /**
24 * Priority
25 *
26 * @var int
27 */
28 protected $priority = 5;
29
30 public function getPriority()
31 {
32 return $this->priority;
33 }
34
35 /**
36 * Returns true if the selector part matches the given node,
37 * false otherwise
38 *
39 * @param Node $node Node
40 * @param Node $parent Parent node
41 *
42 * @return bool
43 *
44 * @abstract
45 */
46 abstract public function check(Node $node, $parent = null);
47 }