Commit 8701d7df by Carsten Brandt

more explicit comment in phpdoc, code style

parent 74c99dc9
...@@ -102,10 +102,11 @@ class Component extends Object ...@@ -102,10 +102,11 @@ class Component extends Object
*/ */
private $_events = []; private $_events = [];
/** /**
* @var Behavior[] the attached behaviors (behavior name => behavior) * @var Behavior[]|null the attached behaviors (behavior name => behavior). This is `null` when not initialized.
*/ */
private $_behaviors; private $_behaviors;
/** /**
* Returns the value of a component property. * Returns the value of a component property.
* This method will check in the following order and act accordingly: * This method will check in the following order and act accordingly:
...@@ -223,7 +224,6 @@ class Component extends Object ...@@ -223,7 +224,6 @@ class Component extends Object
} }
} }
} }
return false; return false;
} }
...@@ -244,7 +244,6 @@ class Component extends Object ...@@ -244,7 +244,6 @@ class Component extends Object
$setter = 'set' . $name; $setter = 'set' . $name;
if (method_exists($this, $setter)) { if (method_exists($this, $setter)) {
$this->$setter(null); $this->$setter(null);
return; return;
} else { } else {
// behavior property // behavior property
...@@ -252,7 +251,6 @@ class Component extends Object ...@@ -252,7 +251,6 @@ class Component extends Object
foreach ($this->_behaviors as $behavior) { foreach ($this->_behaviors as $behavior) {
if ($behavior->canSetProperty($name)) { if ($behavior->canSetProperty($name)) {
$behavior->$name = null; $behavior->$name = null;
return; return;
} }
} }
...@@ -281,7 +279,6 @@ class Component extends Object ...@@ -281,7 +279,6 @@ class Component extends Object
return call_user_func_array([$object, $name], $params); return call_user_func_array([$object, $name], $params);
} }
} }
throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()"); throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
} }
...@@ -343,7 +340,6 @@ class Component extends Object ...@@ -343,7 +340,6 @@ class Component extends Object
} }
} }
} }
return false; return false;
} }
...@@ -374,7 +370,6 @@ class Component extends Object ...@@ -374,7 +370,6 @@ class Component extends Object
} }
} }
} }
return false; return false;
} }
...@@ -401,7 +396,6 @@ class Component extends Object ...@@ -401,7 +396,6 @@ class Component extends Object
} }
} }
} }
return false; return false;
} }
...@@ -444,7 +438,6 @@ class Component extends Object ...@@ -444,7 +438,6 @@ class Component extends Object
public function hasEventHandlers($name) public function hasEventHandlers($name)
{ {
$this->ensureBehaviors(); $this->ensureBehaviors();
return !empty($this->_events[$name]) || Event::hasHandlers($this, $name); return !empty($this->_events[$name]) || Event::hasHandlers($this, $name);
} }
...@@ -517,7 +510,6 @@ class Component extends Object ...@@ -517,7 +510,6 @@ class Component extends Object
if ($removed) { if ($removed) {
$this->_events[$name] = array_values($this->_events[$name]); $this->_events[$name] = array_values($this->_events[$name]);
} }
return $removed; return $removed;
} }
} }
...@@ -562,7 +554,6 @@ class Component extends Object ...@@ -562,7 +554,6 @@ class Component extends Object
public function getBehavior($name) public function getBehavior($name)
{ {
$this->ensureBehaviors(); $this->ensureBehaviors();
return isset($this->_behaviors[$name]) ? $this->_behaviors[$name] : null; return isset($this->_behaviors[$name]) ? $this->_behaviors[$name] : null;
} }
...@@ -573,7 +564,6 @@ class Component extends Object ...@@ -573,7 +564,6 @@ class Component extends Object
public function getBehaviors() public function getBehaviors()
{ {
$this->ensureBehaviors(); $this->ensureBehaviors();
return $this->_behaviors; return $this->_behaviors;
} }
...@@ -595,7 +585,6 @@ class Component extends Object ...@@ -595,7 +585,6 @@ class Component extends Object
public function attachBehavior($name, $behavior) public function attachBehavior($name, $behavior)
{ {
$this->ensureBehaviors(); $this->ensureBehaviors();
return $this->attachBehaviorInternal($name, $behavior); return $this->attachBehaviorInternal($name, $behavior);
} }
...@@ -627,7 +616,6 @@ class Component extends Object ...@@ -627,7 +616,6 @@ class Component extends Object
$behavior = $this->_behaviors[$name]; $behavior = $this->_behaviors[$name];
unset($this->_behaviors[$name]); unset($this->_behaviors[$name]);
$behavior->detach(); $behavior->detach();
return $behavior; return $behavior;
} else { } else {
return null; return null;
...@@ -681,7 +669,6 @@ class Component extends Object ...@@ -681,7 +669,6 @@ class Component extends Object
$behavior->attach($this); $behavior->attach($this);
$this->_behaviors[$name] = $behavior; $this->_behaviors[$name] = $behavior;
} }
return $behavior; return $behavior;
} }
} }
...@@ -78,6 +78,7 @@ class TimestampBehavior extends AttributeBehavior ...@@ -78,6 +78,7 @@ class TimestampBehavior extends AttributeBehavior
*/ */
public $value; public $value;
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
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