Skip to content

Commit 4d06bc4

Browse files
committed
Renamed Event::add() -> append(); Event::unshift() -> prepend()
1 parent 9a08df4 commit 4d06bc4

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/Kdyby/Events/Event.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function dispatch($args = array())
130130
* @param callable $listener
131131
* @return Event
132132
*/
133-
public function add($listener)
133+
public function append($listener)
134134
{
135135
$this->listeners[] = callback($listener);
136136
return $this;
@@ -142,7 +142,7 @@ public function add($listener)
142142
* @param callable $listener
143143
* @return Event
144144
*/
145-
public function unshift($listener)
145+
public function prepend($listener)
146146
{
147147
array_unshift($this->listeners, callback($listener));
148148
return $this;
@@ -215,6 +215,22 @@ public static function parseName($name)
215215

216216

217217

218+
/** @deprecated */
219+
public function add($listener)
220+
{
221+
return $this->append($listener);
222+
}
223+
224+
225+
226+
/** @deprecated */
227+
public function unshift($listener)
228+
{
229+
return $this->prepend($listener);
230+
}
231+
232+
233+
218234
/********************* interface \Countable *********************/
219235

220236

0 commit comments

Comments
 (0)