Skip to content

Commit a7f0cd0

Browse files
committed
updated ClientInterface: added delListener method
1 parent fa5c1ab commit a7f0cd0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lib/Bitbucket/API/Http/Client.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ public function addListener(ListenerInterface $listener)
7777
return $this;
7878
}
7979

80+
/**
81+
* {@inheritDoc}
82+
*/
83+
public function delListener($name)
84+
{
85+
if ($name instanceof ListenerInterface) {
86+
$name = $name->getName();
87+
}
88+
89+
if ($this->isListener($name) === true) {
90+
unset($this->listeners[$name]);
91+
}
92+
93+
return $this;
94+
}
95+
8096
/**
8197
* {@inheritDoc}
8298
*/

lib/Bitbucket/API/Http/ClientInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ public function getApiBaseUrl();
132132
*/
133133
public function addListener(ListenerInterface $listener);
134134

135+
/**
136+
* @access public
137+
* @param ListenerInterface|string $name
138+
* @return $this
139+
*/
140+
public function delListener($name);
141+
135142
/**
136143
* Get listener interface
137144
*

0 commit comments

Comments
 (0)