1 | <?php |
||
10 | trait DataStructureGuesser |
||
11 | { |
||
12 | /** |
||
13 | * @param ClassNode|ASTClass $node |
||
14 | * |
||
15 | * @return bool |
||
16 | */ |
||
17 | 24 | protected function isDataStructure(ClassNode $node) |
|
18 | { |
||
19 | 24 | if (!preg_match($this->getRegex('dataStructureNamespaceRegex'), $node->getNamespaceName())) { |
|
20 | 13 | return false; |
|
21 | } |
||
22 | |||
23 | 11 | if (!preg_match($this->getRegex('dataStructureClassNameRegex'), $node->getName())) { |
|
24 | 3 | return false; |
|
25 | } |
||
26 | |||
27 | 8 | return true; |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param string $name |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | abstract protected function getRegex($name); |
||
36 | } |
||
37 |