@@ -267,101 +267,132 @@ private function descendXml(\SimpleXmlIterator $iterator, $keys, \SimpleXmlEleme
267
267
*/
268
268
public function IsPortalReadOnly ()
269
269
{
270
- $ localInfo = $ this ->GetLocalInfoXML ();
271
- if (strtolower ($ localInfo -> read_only ) == 'true ' ) {
270
+ $ portalReadOnly = ( string ) $ this ->GetLocalInfoXML ()-> read_only ;
271
+ if (strtolower ($ portalReadOnly ) == 'true ' ) {
272
272
return true ;
273
273
}
274
274
275
275
return false ;
276
276
}
277
+
277
278
/**
278
279
* returns the url of the Acceptable Use Policy for display on the landing page
279
280
* @return string
280
281
*/
281
282
public function getAUP ()
282
283
{
283
- return $ this ->GetLocalInfoXML ()->aup ;
284
+ $ aup = (string ) $ this ->GetLocalInfoXML ()->aup ;
285
+
286
+ return $ aup ;
284
287
}
288
+
285
289
/**
286
290
* returns the title string describing the Acceptable Use Policy for display on the landing page
287
291
* @return string
288
292
*/
289
293
public function getAUPTitle ()
290
294
{
291
- return $ this ->GetLocalInfoXML ()->aup_title ;
295
+ $ aupTitle = (string ) $ this ->GetLocalInfoXML ()->aup_title ;
296
+
297
+ return $ aupTitle ;
292
298
}
299
+
293
300
/**
294
301
* returns the url of the Privacy Notice for display on the landing page
295
302
* @return string
296
303
*/
297
304
public function getPrivacyNotice ()
298
305
{
299
- return $ this ->GetLocalInfoXML ()->privacy_notice ;
306
+ $ privacyNotice = (string ) $ this ->GetLocalInfoXML ()->privacy_notice ;
307
+
308
+ return $ privacyNotice ;
300
309
}
310
+
301
311
/**
302
312
* returns the title string describing the Privacy Notice for display on the landing page
303
313
* @return string
304
314
*/
305
315
public function getPrivacyNoticeTitle ()
306
316
{
307
- return $ this ->GetLocalInfoXML ()->privacy_notice_title ;
317
+ $ privacyNoticeTitle = (string ) $ this ->GetLocalInfoXML ()->privacy_notice_title ;
318
+
319
+ return $ privacyNoticeTitle ;
308
320
}
321
+
309
322
/**
310
323
* returns true if the given menu is to be shown according to local_info.xml
311
324
* @return boolean
312
325
*/
313
326
public function showMenu ($ menuName )
314
327
{
315
-
316
- if (empty ($ this -> GetLocalInfoXML ()-> menus -> $ menuName )) {
328
+ $ menuItem = ( string ) $ this -> GetLocalInfoXML ()-> menus -> $ menuName ;
329
+ if (empty ($ menuItem )) {
317
330
return true ;
318
331
}
319
332
320
- switch (strtolower (( string ) $ this -> GetLocalInfoXML ()-> menus -> $ menuName )) {
333
+ switch (strtolower ($ menuItem )) {
321
334
case 'false ' :
322
335
case 'hide ' :
323
336
case 'no ' :
324
337
return false ;
325
338
}
326
339
return true ;
327
340
}
341
+
328
342
/**
329
343
* returns the relevant name mapping according to local_info.xml
330
344
* @return string
331
345
*/
332
346
public function getNameMapping ($ entityType , $ key )
333
347
{
334
- if (empty ($ this ->GetLocalInfoXML ()->name_mapping ->$ entityType )) {
348
+ $ nameMapping = (string ) $ this ->GetLocalInfoXML ()->name_mapping ->$ entityType ;
349
+ if (empty ($ nameMapping )) {
335
350
return $ key ;
336
351
}
337
352
switch ($ entityType ) {
338
353
case 'Service ' :
339
- return $ this ->GetLocalInfoXML ()->name_mapping ->$ entityType ->{str_replace (' ' , '' , $ key )};
354
+ $ service = (string ) $ this ->GetLocalInfoXML ()->name_mapping ->$ entityType ->{str_replace (' ' , '' , $ key )};
355
+ return $ service ;
340
356
}
341
357
}
358
+
342
359
/**
343
360
* accessor function for css colour values from local_info.xml
344
361
* @return string
345
362
*/
346
363
public function getBackgroundDirection ()
347
364
{
348
- return $ this ->GetLocalInfoXML ()->css ->backgroundDirection ;
365
+ $ backgroundDirection = (string ) $ this ->GetLocalInfoXML ()->css ->backgroundDirection ;
366
+
367
+ return $ backgroundDirection ;
349
368
}
369
+
350
370
public function getBackgroundColour1 ()
351
371
{
352
- return $ this ->GetLocalInfoXML ()->css ->backgroundColour1 ;
372
+ $ backgroundColour1 = (string ) $ this ->GetLocalInfoXML ()->css ->backgroundColour1 ;
373
+
374
+ return $ backgroundColour1 ;
353
375
}
376
+
354
377
public function getBackgroundColour2 ()
355
378
{
356
- return $ this ->GetLocalInfoXML ()->css ->backgroundColour2 ;
379
+ $ backgroundColour2 = (string ) $ this ->GetLocalInfoXML ()->css ->backgroundColour2 ;
380
+
381
+ return $ backgroundColour2 ;
357
382
}
383
+
358
384
public function getBackgroundColour3 ()
359
385
{
360
- return $ this ->GetLocalInfoXML ()->css ->backgroundColour3 ;
386
+ $ backgroundColour3 = (string ) $ this ->GetLocalInfoXML ()->css ->backgroundColour3 ;
387
+
388
+ return $ backgroundColour3 ;
361
389
}
390
+
362
391
public function getHeadingTextColour ()
363
392
{
364
- return $ this ->GetLocalInfoXML ()->css ->headingTextColour ;
393
+ $ headingTextColour = $ this ->GetLocalInfoXML ()->css ->headingTextColour ;
394
+
395
+ return $ headingTextColour ;
365
396
}
366
397
367
398
/**
@@ -372,9 +403,8 @@ public function getHeadingTextColour()
372
403
*/
373
404
public function IsOptionalFeatureSet ($ featureName )
374
405
{
375
- $ localInfo = $ this ->GetLocalInfoXML ();
376
- $ feature = $ localInfo ->optional_features ->$ featureName ;
377
- if ((string ) $ feature == "true " ) {
406
+ $ feature = (string ) $ this ->GetLocalInfoXML ()->optional_features ->$ featureName ;
407
+ if ($ feature == "true " ) {
378
408
return true ;
379
409
} else {
380
410
return false ;
@@ -388,9 +418,8 @@ public function IsOptionalFeatureSet($featureName)
388
418
*/
389
419
public function GetPortalURL ()
390
420
{
391
- $ localInfo = $ this ->GetLocalInfoXML ();
392
- $ url = $ localInfo ->web_portal_url ;
393
- return strval ($ url );
421
+ $ portalUrl = (string ) $ this ->GetLocalInfoXML ()->web_portal_url ;
422
+ return $ portalUrl ;
394
423
}
395
424
/**
396
425
* How Personal Data is restricted;
@@ -404,9 +433,8 @@ public function isRestrictPDByRole($forceStrict = false)
404
433
if ($ forceStrict === true )
405
434
return true ;
406
435
407
- $ localInfo = $ this ->GetLocalInfoXML ();
408
- $ value = $ localInfo ->restrict_personal_data ;
409
- if ((string ) $ value == "true " ) {
436
+ $ value = (string ) $ this ->GetLocalInfoXML ()->restrict_personal_data ;
437
+ if ($ value == "true " ) {
410
438
return true ;
411
439
} else {
412
440
return false ;
@@ -417,9 +445,9 @@ public function isRestrictPDByRole($forceStrict = false)
417
445
*/
418
446
public function getPiUrl ()
419
447
{
420
- $ localInfo = $ this ->GetLocalInfoXML ();
421
- $ url = $ localInfo -> pi_url ;
422
- return strval ( $ url ) ;
448
+ $ piUrl = ( string ) $ this ->GetLocalInfoXML ()-> pi_url ;
449
+
450
+ return $ piUrl ;
423
451
}
424
452
425
453
/**
@@ -428,9 +456,9 @@ public function getPiUrl()
428
456
*/
429
457
public function getServerBaseUrl ()
430
458
{
431
- $ localInfo = $ this ->GetLocalInfoXML ();
432
- $ url = $ localInfo -> server_base_url ;
433
- return strval ( $ url ) ;
459
+ $ serverBaseUrl = ( string ) $ this ->GetLocalInfoXML ()-> server_base_url ;
460
+
461
+ return $ serverBaseUrl ;
434
462
}
435
463
436
464
/**
@@ -439,32 +467,32 @@ public function getServerBaseUrl()
439
467
*/
440
468
public function getWriteApiDocsUrl ()
441
469
{
442
- $ localInfo = $ this ->GetLocalInfoXML ();
443
- $ url = $ localInfo -> write_api_user_docs_url ;
444
- return strval ( $ url ) ;
470
+ $ writeApiDocsUrl = ( string ) $ this ->GetLocalInfoXML ()-> write_api_user_docs_url ;
471
+
472
+ return $ writeApiDocsUrl ;
445
473
}
446
474
447
475
public function getDefaultScopeName ()
448
476
{
449
- //$scopeName = $this->GetLocalInfoXML()->local_info->default_scope->name;
450
- $ scopeName = $ this ->GetLocalInfoXML ()->default_scope ->name ;
477
+ //$scopeName = (string) $this->GetLocalInfoXML()->local_info->default_scope->name;
478
+ $ scopeName = ( string ) $ this ->GetLocalInfoXML ()->default_scope ->name ;
451
479
452
480
if (empty ($ scopeName )) {
453
481
$ scopeName = '' ;
454
482
}
455
483
456
- return strval ( $ scopeName) ;
484
+ return $ scopeName ;
457
485
}
458
486
459
487
public function getDefaultScopeMatch ()
460
488
{
461
- $ scopeMatch = $ this ->GetLocalInfoXML ()->default_scope_match ;
489
+ $ scopeMatch = ( string ) $ this ->GetLocalInfoXML ()->default_scope_match ;
462
490
463
491
if (empty ($ scopeMatch )) {
464
492
$ scopeMatch = 'all ' ;
465
493
}
466
494
467
- return strval ( $ scopeMatch) ;
495
+ return $ scopeMatch ;
468
496
}
469
497
470
498
public function getMinimumScopesRequired ($ entityType )
@@ -475,13 +503,13 @@ public function getMinimumScopesRequired($entityType)
475
503
throw new \LogicException ("Function does not support entity type " );
476
504
}
477
505
478
- $ numScopesRequired = $ this ->GetLocalInfoXML ()->minimum_scopes ->$ entityType ;
506
+ $ numScopesRequired = ( int ) $ this ->GetLocalInfoXML ()->minimum_scopes ->$ entityType ;
479
507
480
508
if (empty ($ numScopesRequired )) {
481
509
$ numScopesRequired = 0 ;
482
510
}
483
511
484
- return intval ( $ numScopesRequired) ;
512
+ return $ numScopesRequired ;
485
513
}
486
514
487
515
public function getDefaultFilterByScope ()
@@ -496,7 +524,7 @@ public function getDefaultFilterByScope()
496
524
497
525
public function getShowMapOnStartPage ()
498
526
{
499
- $ showMapString = $ this ->GetLocalInfoXML ()->show_map_on_start_page ;
527
+ $ showMapString = ( string ) $ this ->GetLocalInfoXML ()->show_map_on_start_page ;
500
528
501
529
if (empty ($ showMapString )) {
502
530
$ showMap = false ;
@@ -511,13 +539,15 @@ public function getShowMapOnStartPage()
511
539
512
540
public function getExtensionsLimit ()
513
541
{
514
- return $ this ->GetLocalInfoXML ()->extensions ->max ;
542
+ $ extensionsLimit = (int ) $ this ->GetLocalInfoXML ()->extensions ->max ;
543
+
544
+ return $ extensionsLimit ;
515
545
}
516
546
517
547
518
548
public function getSendEmails ()
519
549
{
520
- $ sendEmailString = $ this ->GetLocalInfoXML ()->send_email ;
550
+ $ sendEmailString = ( string ) $ this ->GetLocalInfoXML ()->send_email ;
521
551
if (empty ($ sendEmailString )) {
522
552
$ sendEmail = false ;
523
553
} elseif (strtolower ($ sendEmailString ) == 'true ' ) {
@@ -538,21 +568,21 @@ public function getAPIAllAuthRealms()
538
568
539
569
public function getPageBanner ()
540
570
{
541
- $ bannerText = $ this ->GetLocalInfoXML ()->page_banner ;
571
+ $ bannerText = ( string ) $ this ->GetLocalInfoXML ()->page_banner ;
542
572
543
573
return $ bannerText ;
544
574
}
545
575
546
576
public function getEmailFrom ()
547
577
{
548
- $ emailFrom = $ this ->GetLocalInfoXML ()->email_from ;
578
+ $ emailFrom = ( string ) $ this ->GetLocalInfoXML ()->email_from ;
549
579
550
580
return $ emailFrom ;
551
581
}
552
582
553
583
public function getEmailTo ()
554
584
{
555
- $ emailTo = $ this ->GetlocalInfoXML ()->email_to ;
585
+ $ emailTo = ( string ) $ this ->GetlocalInfoXML ()->email_to ;
556
586
557
587
return $ emailTo ;
558
588
}
0 commit comments