Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit 9a32fda

Browse files
committed
Updated to 1.0.9 version
1 parent 5a436d3 commit 9a32fda

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

src/Traits/ComplementAction.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ public function setAction($action) {
9898
* @since 1.0.9
9999
*
100100
* @param string $action → action hook to execute
101-
* @param string $state → complement state
102101
*
103102
* @uses object Complement::getInstance() → Complement instance
104103
* @uses string ComplementAction::setAction() → set complement action
105104
*
106105
* @return boolean
107106
*/
108-
public function doAction($action, $state) {
107+
public function doAction($action) {
109108

110109
$controller = $this->get('hooks-controller');
111110

@@ -151,7 +150,6 @@ private function _addActions() {
151150
* @since 1.0.9
152151
*
153152
* @param string $action → action hook to execute
154-
* @param string $state → complement state
155153
*
156154
* @uses string App::$id → application ID
157155
* @uses object Hook::getInstance → get Hook instance
@@ -160,7 +158,7 @@ private function _addActions() {
160158
*
161159
* @return void
162160
*/
163-
private function _doActions($action, $state) {
161+
private function _doActions($action) {
164162

165163
$type = self::_getType('strtolower', false);
166164

@@ -170,7 +168,7 @@ private function _doActions($action, $state) {
170168

171169
if (in_array($action, self::$hooks)) {
172170

173-
$this->doAction($action, $state);
171+
$this->doAction($action);
174172
}
175173
}
176174
}

src/Traits/ComplementHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private function _setComplement($complement, $path) {
184184

185185
$this->_addActions();
186186

187-
$this->_doActions($action, $state);
187+
$this->_doActions($action);
188188
}
189189
}
190190

src/Traits/ComplementState.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function changeState() {
124124

125125
$this->setState($newState);
126126

127-
$this->doAction($action, $newState);
127+
$this->doAction($action);
128128

129129
return $newState;
130130
}
@@ -182,9 +182,10 @@ public function getStates() {
182182
*
183183
* @since 1.0.9
184184
*
185-
* @uses string App::$id → application ID
186-
* @uses string Complement::$id → complement ID
187-
* @uses array Json::arrayToFile() → convert array to json file
185+
* @uses string App::$id → application ID
186+
* @uses string Complement::$id → complement ID
187+
* @uses array Json::arrayToFile() → convert array to json file
188+
* @uses callable Hook::doAction() → do action
188189
*
189190
* @return void
190191
*/
@@ -202,11 +203,7 @@ private function _setStates() {
202203

203204
Json::arrayToFile($states, $file);
204205

205-
Hook::doAction(
206-
207-
'Eliasis/Complement/after_set_states',
208-
[$file]
209-
);
206+
Hook::doAction('Eliasis/Complement/after_set_states',$states);
210207
}
211208
}
212209
}

0 commit comments

Comments
 (0)