Merge branch 'hotfix/#6548-peering-service-manager-shared-flag-checks'

Close #6548
replacing array_key_exists with faster isset calls

should we also change has checkers with isset() || array_key_exists() ?
fix trailing spaces on empty lines
Merge branch 'performance/#6562-isset-over-array-key-exists' into develop

Close #6562
Forward port #6562