Sharing/SharingManager.php
private function buildCacheRoleSharing(array $sharings, $id): void
    {
        $this->cacheRoleSharing[$id] = [];

        foreach ($sharings as $sharing) {
            foreach ($sharing->getRoles() as $role) {
                $this->cacheRoleSharing[$id][] = $role;
            }
        }

        $this->cacheRoleSharing[$id] = array_unique($this->cacheRoleSharing[$id]);
    }
private function buildCacheRoleSharing(array $sharings, $id): void
    {
        $this->cacheRoleSharing[$id] = [];

        foreach ($sharings as $sharing) {
            foreach ($sharing->getRoles() as $role) {
                $this->cacheRoleSharing[$id][] = $role;
            }
        }

        $this->cacheRoleSharing[$id] = array_unique($this->cacheRoleSharing[$id]);
    }
private function buildCacheRoleSharing ( array $ sharings , $ id ) : void { $ this -> cacheRoleSharing [ $ id ] = [ ] ; foreach ( $ sharings as $ sharing ) { foreach ( $ sharing -> getRoles ( ) as $ role ) { $ this -> cacheRoleSharing [ $ id ] [ ] = $ role ; } } $ this -> cacheRoleSharing [ $ id ] = array_unique ( $ this -> cacheRoleSharing [ $ id ] ) ; }
Build the cache role sharing.

@param SharingInterface[] $sharings The sharing instances
@param string             $id       The cache id
Build the cache role sharing .