thyseus / yii-user-management

a user management module collection for the yii framework
185 stars 122 forks source link

why not return value in setter of UserModule (UserModule::__set()) as CComponent::__set() does #196

Open abos5 opened 10 years ago

abos5 commented 10 years ago
public function __set($name,$value) {
    if(substr($name,-3)==='Url') {
      if(isset($this->_urls[substr($name,0,-3)]))
        $this->_urls[substr($name,0,-3)]=$value;
    }
    if(substr($name,-4)==='View') {
      if(isset($this->_views[substr($name,0,-4)]))
        $this->_views[substr($name,0,-4)]=$value;
    }

    //parent::__set($name,$value);
  }

could be :

public function __set($name,$value) {
    if(substr($name,-3)==='Url') {
      if(isset($this->_urls[substr($name,0,-3)]))
        return $this->_urls[substr($name,0,-3)]=$value;
    }
    if(substr($name,-4)==='View') {
      if(isset($this->_views[substr($name,0,-4)]))
        return $this->_views[substr($name,0,-4)]=$value;
    }

    return parent::__set($name,$value);
  }