@@ -101,7 +101,10 @@ public function create(array $params = array())
101101 'mail ' => null ,
102102 // 'auth_source_id' => null,
103103 );
104- $ params = array_filter (array_merge ($ defaults , $ params ));
104+ $ params = array_filter (
105+ array_merge ($ defaults , $ params ),
106+ array ($ this , 'isNotNull ' )
107+ );
105108 if (
106109 !isset ($ params ['login ' ])
107110 || !isset ($ params ['lastname ' ])
@@ -110,7 +113,6 @@ public function create(array $params = array())
110113 ) {
111114 throw new \Exception ('Missing mandatory parameters ' );
112115 }
113-
114116 $ xml = new SimpleXMLElement ('<?xml version="1.0"?><user></user> ' );
115117 foreach ($ params as $ k => $ v ) {
116118 if ('custom_fields ' === $ k ) {
@@ -142,7 +144,10 @@ public function update($id, array $params)
142144 'mail ' => null ,
143145 // 'auth_source_id' => null,
144146 );
145- $ params = array_filter (array_merge ($ defaults , $ params ));
147+ $ params = array_filter (
148+ array_merge ($ defaults , $ params ),
149+ array ($ this , 'isNotNull ' )
150+ );
146151
147152 $ xml = new SimpleXMLElement ('<?xml version="1.0"?><user></user> ' );
148153 foreach ($ params as $ k => $ v ) {
0 commit comments