Skip to content

Commit 9f208d5

Browse files
committed
Move getPath and getAttributes to BaseToken
1 parent 3839f8e commit 9f208d5

File tree

10 files changed

+26
-209
lines changed

10 files changed

+26
-209
lines changed

src/AirBubble/Tokens/BaseToken.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,28 @@ public function setTemplate(Template &$template)
117117
$this->_template = &$template;
118118
}
119119

120+
/**
121+
* Gets the path to this token
122+
* in the DOM template.
123+
*
124+
* @return string
125+
*/
126+
public function getPath(): string
127+
{
128+
return $this->_path;
129+
}
130+
131+
/**
132+
* Gets the list of attributes in
133+
* this token.
134+
*
135+
* @return AttributesList
136+
*/
137+
public function getAttributes(): AttributesList
138+
{
139+
return $this->_attributes;
140+
}
141+
120142
/**
121143
* Replaces the current token's element
122144
* with a new one.

src/AirBubble/Tokens/BlockToken.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232

3333
namespace ElementaryFramework\AirBubble\Tokens;
3434

35-
use ElementaryFramework\AirBubble\Parser\AttributesList;
36-
3735
/**
3836
* Block Token
3937
*
@@ -84,28 +82,6 @@ public function getName(): string
8482
return self::NAME;
8583
}
8684

87-
/**
88-
* Gets the path to this token
89-
* in the DOM template.
90-
*
91-
* @return string
92-
*/
93-
public function getPath(): string
94-
{
95-
return $this->_path;
96-
}
97-
98-
/**
99-
* Gets the list of attributes in
100-
* this token.
101-
*
102-
* @return AttributesList
103-
*/
104-
public function getAttributes(): AttributesList
105-
{
106-
return $this->_attributes;
107-
}
108-
10985
/**
11086
* Parses the token.
11187
*

src/AirBubble/Tokens/ConditionToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use ElementaryFramework\AirBubble\Attributes\ConditionAttribute;
3636
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
3737
use ElementaryFramework\AirBubble\Exception\UnexpectedTokenException;
38-
use ElementaryFramework\AirBubble\Parser\AttributesList;
3938
use ElementaryFramework\AirBubble\Util\Utilities;
4039

4140
/**
@@ -102,28 +101,6 @@ public function getName(): string
102101
return self::NAME;
103102
}
104103

105-
/**
106-
* Gets the path to this token
107-
* in the DOM template.
108-
*
109-
* @return string
110-
*/
111-
public function getPath(): string
112-
{
113-
return $this->_path;
114-
}
115-
116-
/**
117-
* Gets the list of attributes in
118-
* this token.
119-
*
120-
* @return AttributesList
121-
*/
122-
public function getAttributes(): AttributesList
123-
{
124-
return $this->_attributes;
125-
}
126-
127104
/**
128105
* Parses the token.
129106
*

src/AirBubble/Tokens/DataTableToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use ElementaryFramework\AirBubble\Attributes\VarAttribute;
3838
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
3939
use ElementaryFramework\AirBubble\Exception\UnexpectedTokenException;
40-
use ElementaryFramework\AirBubble\Parser\AttributesList;
4140
use ElementaryFramework\AirBubble\Renderer\Template;
4241
use ElementaryFramework\AirBubble\Util\Utilities;
4342

@@ -120,28 +119,6 @@ public function getName(): string
120119
return self::NAME;
121120
}
122121

123-
/**
124-
* Gets the path to this token
125-
* in the DOM template.
126-
*
127-
* @return string
128-
*/
129-
public function getPath(): string
130-
{
131-
return $this->_path;
132-
}
133-
134-
/**
135-
* Gets the list of attributes in
136-
* this token.
137-
*
138-
* @return AttributesList
139-
*/
140-
public function getAttributes(): AttributesList
141-
{
142-
return $this->_attributes;
143-
}
144-
145122
/**
146123
* Parses the token.
147124
*

src/AirBubble/Tokens/ForToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use ElementaryFramework\AirBubble\Attributes\VarAttribute;
3838
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
3939
use ElementaryFramework\AirBubble\Exception\UnexpectedTokenException;
40-
use ElementaryFramework\AirBubble\Parser\AttributesList;
4140
use ElementaryFramework\AirBubble\Util\Utilities;
4241

4342
/**
@@ -83,28 +82,6 @@ public function getName(): string
8382
return self::NAME;
8483
}
8584

86-
/**
87-
* Gets the path to this token
88-
* in the DOM template.
89-
*
90-
* @return string
91-
*/
92-
public function getPath(): string
93-
{
94-
return $this->_path;
95-
}
96-
97-
/**
98-
* Gets the list of attributes in
99-
* this token.
100-
*
101-
* @return AttributesList
102-
*/
103-
public function getAttributes(): AttributesList
104-
{
105-
return $this->_attributes;
106-
}
107-
10885
/**
10986
* Parses the token.
11087
*

src/AirBubble/Tokens/ForeachToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
3939
use ElementaryFramework\AirBubble\Exception\InvalidDataException;
4040
use ElementaryFramework\AirBubble\Exception\UnexpectedTokenException;
41-
use ElementaryFramework\AirBubble\Parser\AttributesList;
4241
use ElementaryFramework\AirBubble\Renderer\Template;
4342
use ElementaryFramework\AirBubble\Util\Utilities;
4443

@@ -85,28 +84,6 @@ public function getName(): string
8584
return self::NAME;
8685
}
8786

88-
/**
89-
* Gets the path to this token
90-
* in the DOM template.
91-
*
92-
* @return string
93-
*/
94-
public function getPath(): string
95-
{
96-
return $this->_path;
97-
}
98-
99-
/**
100-
* Gets the list of attributes in
101-
* this token.
102-
*
103-
* @return AttributesList
104-
*/
105-
public function getAttributes(): AttributesList
106-
{
107-
return $this->_attributes;
108-
}
109-
11087
/**
11188
* Parses the token.
11289
*

src/AirBubble/Tokens/IncludeToken.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use ElementaryFramework\AirBubble\AirBubble;
3636
use ElementaryFramework\AirBubble\Attributes\GenericAttribute;
3737
use ElementaryFramework\AirBubble\Attributes\PathAttribute;
38-
use ElementaryFramework\AirBubble\Parser\AttributesList;
3938
use ElementaryFramework\AirBubble\Renderer\Template;
4039
use ElementaryFramework\AirBubble\Util\Utilities;
4140

@@ -102,28 +101,6 @@ public function getName(): string
102101
return self::NAME;
103102
}
104103

105-
/**
106-
* Gets the path to this token
107-
* in the DOM template.
108-
*
109-
* @return string
110-
*/
111-
public function getPath(): string
112-
{
113-
return $this->_path;
114-
}
115-
116-
/**
117-
* Gets the list of attributes in
118-
* this token.
119-
*
120-
* @return AttributesList
121-
*/
122-
public function getAttributes(): AttributesList
123-
{
124-
return $this->_attributes;
125-
}
126-
127104
/**
128105
* Parses the token.
129106
*
@@ -138,6 +115,10 @@ public function parse()
138115
* Render the token.
139116
*
140117
* @return \DOMNode|null
118+
*
119+
* @throws \ElementaryFramework\AirBubble\Exception\InvalidQueryException
120+
* @throws \ElementaryFramework\AirBubble\Exception\KeyNotFoundException
121+
* @throws \ElementaryFramework\AirBubble\Exception\PropertyNotFoundException
141122
*/
142123
public function render(): ?\DOMNode
143124
{

src/AirBubble/Tokens/InputLabelToken.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
use ElementaryFramework\AirBubble\Attributes\ForAttribute;
3636
use ElementaryFramework\AirBubble\Attributes\GenericAttribute;
3737
use ElementaryFramework\AirBubble\Attributes\ValueAttribute;
38-
use ElementaryFramework\AirBubble\Parser\AttributesList;
39-
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
4038

4139
/**
4240
* Input Label Token
@@ -102,28 +100,6 @@ public function getName(): string
102100
return self::NAME;
103101
}
104102

105-
/**
106-
* Gets the path to this token
107-
* in the DOM template.
108-
*
109-
* @return string
110-
*/
111-
public function getPath(): string
112-
{
113-
return $this->_path;
114-
}
115-
116-
/**
117-
* Gets the list of attributes in
118-
* this token.
119-
*
120-
* @return AttributesList
121-
*/
122-
public function getAttributes(): AttributesList
123-
{
124-
return $this->_attributes;
125-
}
126-
127103
/**
128104
* Parses the token.
129105
*

src/AirBubble/Tokens/SelectItemsToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use ElementaryFramework\AirBubble\Attributes\VarAttribute;
4040
use ElementaryFramework\AirBubble\Exception\ElementNotFoundException;
4141
use ElementaryFramework\AirBubble\Exception\InvalidDataException;
42-
use ElementaryFramework\AirBubble\Parser\AttributesList;
4342
use ElementaryFramework\AirBubble\Renderer\Template;
4443
use ElementaryFramework\AirBubble\Util\SelectItemsList;
4544
use ElementaryFramework\AirBubble\Util\Utilities;
@@ -87,28 +86,6 @@ public function getName(): string
8786
return self::NAME;
8887
}
8988

90-
/**
91-
* Gets the path to this token
92-
* in the DOM template.
93-
*
94-
* @return string
95-
*/
96-
public function getPath(): string
97-
{
98-
return $this->_path;
99-
}
100-
101-
/**
102-
* Gets the list of attributes in
103-
* this token.
104-
*
105-
* @return AttributesList
106-
*/
107-
public function getAttributes(): AttributesList
108-
{
109-
return $this->_attributes;
110-
}
111-
11289
/**
11390
* Parses the token.
11491
*

src/AirBubble/Tokens/TextToken.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use ElementaryFramework\AirBubble\Attributes\ElementAttribute;
3636
use ElementaryFramework\AirBubble\Attributes\GenericAttribute;
3737
use ElementaryFramework\AirBubble\Attributes\ValueAttribute;
38-
use ElementaryFramework\AirBubble\Parser\AttributesList;
3938

4039
/**
4140
* Text Token
@@ -101,28 +100,6 @@ public function getName(): string
101100
return self::NAME;
102101
}
103102

104-
/**
105-
* Gets the path to this token
106-
* in the DOM template.
107-
*
108-
* @return string
109-
*/
110-
public function getPath(): string
111-
{
112-
return $this->_path;
113-
}
114-
115-
/**
116-
* Gets the list of attributes in
117-
* this token.
118-
*
119-
* @return AttributesList
120-
*/
121-
public function getAttributes(): AttributesList
122-
{
123-
return $this->_attributes;
124-
}
125-
126103
/**
127104
* Parses the token.
128105
*

0 commit comments

Comments
 (0)