Commit bf73fe80 by Qiang Xue

Merge pull request #1703 from crtlib/patch-2

Removed redundant code in detachBehaviors()
parents 0766ddca ee81915a
...@@ -543,12 +543,9 @@ class Component extends Object ...@@ -543,12 +543,9 @@ class Component extends Object
public function detachBehaviors() public function detachBehaviors()
{ {
$this->ensureBehaviors(); $this->ensureBehaviors();
if ($this->_behaviors !== null) { foreach ($this->_behaviors as $name => $behavior) {
foreach ($this->_behaviors as $name => $behavior) { $this->detachBehavior($name);
$this->detachBehavior($name);
}
} }
$this->_behaviors = [];
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment