1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* \AppserverIo\Doppelgaenger\Parser\AspectParser |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Bernhard Wick <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
18
|
|
|
* @link http://www.appserver.io/ |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Doppelgaenger\Parser; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Doppelgaenger\Entities\Definitions\AspectDefinition; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Parser for classes which are used as aspects |
27
|
|
|
* |
28
|
|
|
* @author Bernhard Wick <[email protected]> |
29
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
30
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
31
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
32
|
|
|
* @link http://www.appserver.io/ |
33
|
|
|
*/ |
34
|
|
|
class AspectParser extends ClassParser |
35
|
|
|
{ |
36
|
|
|
/** |
37
|
|
|
* Returns a AspectDefinition from a token array. |
38
|
|
|
* |
39
|
|
|
* This method will use a set of other methods to parse a token array and retrieve any |
40
|
|
|
* possible information from it. |
41
|
|
|
* This information will be entered into a AspectDefinition object. |
42
|
|
|
* |
43
|
|
|
* @param array $tokens The token array containing structure tokens |
44
|
|
|
* @param boolean $getRecursive Do we have to get the ancestral conditions as well? |
45
|
|
|
* |
46
|
|
|
* @return \AppserverIo\Doppelgaenger\Interfaces\StructureDefinitionInterface |
47
|
|
|
*/ |
48
|
|
|
protected function getDefinitionFromTokens($tokens, $getRecursive = true) |
49
|
|
|
{ |
50
|
|
|
// First of all we need a new AspectDefinition to fill |
51
|
|
|
$this->currentDefinition = new AspectDefinition(); |
52
|
|
|
|
53
|
|
|
$this->currentDefinition = parent::getDefinitionFromTokens($tokens, $getRecursive); |
54
|
|
|
|
55
|
|
|
return $this->currentDefinition; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|