@@ -159,7 +159,7 @@ public function getObjIdsByRefIds(string $sid, array $ref_ids)
159
159
/**
160
160
* @return soap_fault|SoapFault|string|null
161
161
*/
162
- public function getObjectByReference (string $ sid , int $ a_ref_id , int $ user_id )
162
+ public function getObjectByReference (string $ sid , int $ a_ref_id , ? int $ user_id = null )
163
163
{
164
164
$ this ->initAuth ($ sid );
165
165
$ this ->initIlias ();
@@ -178,7 +178,7 @@ public function getObjectByReference(string $sid, int $a_ref_id, int $user_id)
178
178
179
179
$ xml_writer = new ilObjectXMLWriter ();
180
180
$ xml_writer ->enablePermissionCheck (true );
181
- if ($ user_id ) {
181
+ if (is_int ( $ user_id) ) {
182
182
$ xml_writer ->setUserId ($ user_id );
183
183
$ xml_writer ->enableOperations (true );
184
184
}
@@ -192,7 +192,7 @@ public function getObjectByReference(string $sid, int $a_ref_id, int $user_id)
192
192
/**
193
193
* @return soap_fault|SoapFault|string|null
194
194
*/
195
- public function getObjectsByTitle (string $ sid , string $ a_title , int $ user_id )
195
+ public function getObjectsByTitle (string $ sid , string $ a_title , ? int $ user_id = null )
196
196
{
197
197
$ this ->initAuth ($ sid );
198
198
$ this ->initIlias ();
@@ -251,7 +251,7 @@ public function getObjectsByTitle(string $sid, string $a_title, int $user_id)
251
251
252
252
$ xml_writer = new ilObjectXMLWriter ();
253
253
$ xml_writer ->enablePermissionCheck (true );
254
- if ($ user_id ) {
254
+ if (is_int ( $ user_id) ) {
255
255
$ xml_writer ->setUserId ($ user_id );
256
256
$ xml_writer ->enableOperations (true );
257
257
}
@@ -265,7 +265,7 @@ public function getObjectsByTitle(string $sid, string $a_title, int $user_id)
265
265
/**
266
266
* @return soap_fault|SoapFault|string|null
267
267
*/
268
- public function searchObjects (string $ sid , array $ types , string $ key , string $ combination , int $ user_id )
268
+ public function searchObjects (string $ sid , ? array $ types , string $ key , string $ combination , ? int $ user_id = null )
269
269
{
270
270
$ this ->initAuth ($ sid );
271
271
$ this ->initIlias ();
@@ -344,7 +344,7 @@ public function searchObjects(string $sid, array $types, string $key, string $co
344
344
$ object_search = new ilLikeObjectSearch ($ query_parser );
345
345
$ object_search ->setFilter ($ types );
346
346
$ res = $ object_search ->performSearch ();
347
- if ($ user_id ) {
347
+ if (is_int ( $ user_id) ) {
348
348
$ res ->setUserId ($ user_id );
349
349
}
350
350
$ res ->setMaxHits (100 );
@@ -389,7 +389,7 @@ public function searchObjects(string $sid, array $types, string $key, string $co
389
389
/**
390
390
* @return soap_fault|SoapFault|string|null
391
391
*/
392
- public function getTreeChilds (string $ sid , int $ ref_id , array $ types , int $ user_id )
392
+ public function getTreeChilds (string $ sid , int $ ref_id , ? array $ types , ? int $ user_id = null )
393
393
{
394
394
$ this ->initAuth ($ sid );
395
395
$ this ->initIlias ();
@@ -417,7 +417,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_
417
417
);
418
418
}
419
419
420
- if (!$ types ) {
420
+ if (!is_array ( $ types) ) {
421
421
$ all = true ;
422
422
}
423
423
@@ -436,7 +436,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_
436
436
$ xml_writer ->enablePermissionCheck (true );
437
437
$ xml_writer ->setObjects ($ objs );
438
438
$ xml_writer ->enableOperations (true );
439
- if ($ user_id ) {
439
+ if (is_int ( $ user_id) ) {
440
440
$ xml_writer ->setUserId ($ user_id );
441
441
}
442
442
@@ -449,7 +449,7 @@ public function getTreeChilds(string $sid, int $ref_id, array $types, int $user_
449
449
/**
450
450
* @return soap_fault|SoapFault|string|null
451
451
*/
452
- public function getXMLTree (string $ sid , int $ ref_id , array $ types , int $ user_id )
452
+ public function getXMLTree (string $ sid , int $ ref_id , ? array $ types , ? int $ user_id = null )
453
453
{
454
454
$ this ->initAuth ($ sid );
455
455
$ this ->initIlias ();
@@ -489,7 +489,7 @@ public function getXMLTree(string $sid, int $ref_id, array $types, int $user_id)
489
489
$ xml_writer ->setObjects ($ nodes );
490
490
$ xml_writer ->enableOperations (false );
491
491
492
- if ($ user_id ) {
492
+ if (is_int ( $ user_id) ) {
493
493
$ xml_writer ->setUserId ($ user_id );
494
494
}
495
495
0 commit comments