public function update($id, array $params)
    {
        $defaults = [
            'id' => $id,
            'login' => null,
            'password' => null,
            'lastname' => null,
            'firstname' => null,
            'mail' => null,
        ];
        $params = $this->sanitizeParams($defaults, $params);

        $xml = new \SimpleXMLElement('<?xml version="1.0"?><user></user>');
        foreach ($params as $k => $v) {
            if ('custom_fields' === $k) {
                $this->attachCustomFieldXML($xml, $v);
            } else {
                $xml->addChild($k, $v);
            }
        }

        return $this->put('/users/'.$id.'.xml', $xml->asXML());
    }
public function update($id, array $params)
    {
        $defaults = [
            'id' => $id,
            'login' => null,
            'password' => null,
            'lastname' => null,
            'firstname' => null,
            'mail' => null,
        ];
        $params = $this->sanitizeParams($defaults, $params);

        $xml = new \SimpleXMLElement('<?xml version="1.0"?><user></user>');
        foreach ($params as $k => $v) {
            if ('custom_fields' === $k) {
                $this->attachCustomFieldXML($xml, $v);
            } else {
                $xml->addChild($k, $v);
            }
        }

        return $this->put('/users/'.$id.'.xml', $xml->asXML());
    }
public function update ( $ id , array $ params ) { $ defaults = [ 'id' => $ id , 'login' => null , 'password' => null , 'lastname' => null , 'firstname' => null , 'mail' => null , ] ; $ params = $ this -> sanitizeParams ( $ defaults , $ params ) ; $ xml = new \ SimpleXMLElement ( '<?xml version="1.0"?><user></user>' ) ; foreach ( $ params as $ k => $ v ) { if ( 'custom_fields' === $ k ) { $ this -> attachCustomFieldXML ( $ xml , $ v ) ; } else { $ xml -> addChild ( $ k , $ v ) ; } } return $ this -> put ( '/users/' . $ id . '.xml' , $ xml -> asXML ( ) ) ; }
Update user's information.

@see http://www.redmine.org/projects/redmine/wiki/Rest_Users#PUT

@param string $id     the user id
@param array  $params

@return string|false
Update user s information .