@@ -67,7 +67,7 @@ class AdapterLdap extends Adapter
6767
6868 public function __construct ($ configFileName = null )
6969 {
70- if (null === $ configFileName ) {
70+ if ($ configFileName === null ) {
7171 $ configFileName = self ::DEFAULT_CONFIG_FILE_NAME ;
7272 }
7373
@@ -248,7 +248,7 @@ public function getGroupByName($vo, $name)
248248 '(&(objectClass=perunGroup)(perunUniqueGroupName= ' . $ name . ')) ' ,
249249 ['perunGroupId ' , 'cn ' , 'perunUniqueGroupName ' , 'perunVoId ' , 'uuid ' , 'description ' ]
250250 );
251- if (null === $ group ) {
251+ if ($ group === null ) {
252252 throw new Exception ('Group with name: $name in VO: ' . $ vo ->getName () . ' does not exists in Perun LDAP. ' );
253253 }
254254
@@ -269,7 +269,7 @@ public function getVoByShortName($voShortName)
269269 '(&(objectClass=perunVo)(o= ' . $ voShortName . ')) ' ,
270270 ['perunVoId ' , 'o ' , 'description ' ]
271271 );
272- if (null === $ vo ) {
272+ if ($ vo === null ) {
273273 throw new Exception ('Vo with name: ' . $ voShortName . ' does not exists in Perun LDAP. ' );
274274 }
275275
@@ -284,7 +284,7 @@ public function getVoById($id)
284284 ['o ' , 'description ' ]
285285 );
286286
287- if (null === $ vo ) {
287+ if ($ vo === null ) {
288288 throw new Exception ('Vo with id: ' . $ id . ' does not exists in Perun LDAP. ' );
289289 }
290290
@@ -480,7 +480,7 @@ public function getUsersGroupsOnFacility($spEntityId, $userId)
480480
481481 public function getUsersGroupsOnSp ($ facility , $ userId )
482482 {
483- if (null === $ facility ) {
483+ if ($ facility === null ) {
484484 return [];
485485 }
486486 $ id = $ facility ->getId ();
@@ -492,7 +492,7 @@ public function getUsersGroupsOnSp($facility, $userId)
492492 );
493493 Logger::debug ('Resources - ' . json_encode ($ resources ));
494494
495- if (null === $ resources ) {
495+ if ($ resources === null ) {
496496 throw new Exception ('Service with ID: ' . $ id . ' hasn \'t assigned any resource. ' );
497497 }
498498 $ resourcesString = '(| ' ;
@@ -551,20 +551,20 @@ public function isUserInVo($user, $voShortName)
551551 }
552552
553553 $ vo = $ this ->getVoByShortName ($ voShortName );
554- if (null === $ vo ) {
554+ if ($ vo === null ) {
555555 Logger::debug ('isUserInVo - No VO found, returning false ' );
556556
557557 return false ;
558558 }
559559
560- return Member:: VALID === $ this ->getMemberStatusByUserAndVo ($ user , $ vo );
560+ return $ this ->getMemberStatusByUserAndVo ($ user , $ vo ) === Member:: VALID ;
561561 }
562562
563563 public function getResourceCapabilities ($ entityId , $ userGroups )
564564 {
565565 $ facility = $ this ->getFacilityByEntityId ($ entityId );
566566
567- if (null === $ facility ) {
567+ if ($ facility === null ) {
568568 return [];
569569 }
570570
@@ -620,7 +620,7 @@ public function getFacilityCapabilities($entityId)
620620
621621 private function mapUser ($ user )
622622 {
623- if (null === $ user ) {
623+ if ($ user === null ) {
624624 return null ;
625625 }
626626 if (isset ($ user ['displayName ' ][0 ])) {
@@ -637,19 +637,19 @@ private function mapUser($user)
637637 private function resolveAttrValue ($ attrsNameTypeMap , $ attrsFromLdap , $ attr )
638638 {
639639 if (!array_key_exists ($ attr , $ attrsFromLdap )) {
640- if (self :: TYPE_BOOL === $ attrsNameTypeMap [$ attr ][self ::TYPE ]) {
640+ if ($ attrsNameTypeMap [$ attr ][self ::TYPE ] === self :: TYPE_BOOL ) {
641641 return false ;
642642 }
643- if (self :: TYPE_MAP === $ attrsNameTypeMap [$ attr ][self ::TYPE ]
644- || self :: TYPE_DICTIONARY === $ attrsNameTypeMap [$ attr ][self ::TYPE ]
643+ if ($ attrsNameTypeMap [$ attr ][self ::TYPE ] === self :: TYPE_MAP
644+ || $ attrsNameTypeMap [$ attr ][self ::TYPE ] === self :: TYPE_DICTIONARY
645645 ) {
646646 return [];
647647 }
648648 } else {
649- if (self :: TYPE_MAP === $ attrsNameTypeMap [$ attr ][self ::TYPE ]) {
649+ if ($ attrsNameTypeMap [$ attr ][self ::TYPE ] === self :: TYPE_MAP ) {
650650 return $ attrsFromLdap [$ attr ];
651651 }
652- if (self :: TYPE_DICTIONARY === $ attrsNameTypeMap [$ attr ][self ::TYPE ]) {
652+ if ($ attrsNameTypeMap [$ attr ][self ::TYPE ] === self :: TYPE_DICTIONARY ) {
653653 return $ this ->convertToMap ($ attrsFromLdap [$ attr ]);
654654 }
655655
0 commit comments