original_string: public function getReachableCircles(User $user, Role $role, Center $center)
      {
          $scopes = array();
          
          foreach ($user->getGroupCenters() as $groupCenter){
              if ($center->getId() === $groupCenter->getCenter()->getId()) {
                  //iterate on permissionGroup
                  $permissionGroup = $groupCenter->getPermissionsGroup();
                  //iterate on roleScopes
                  foreach($permissionGroup->getRoleScopes() as $roleScope) {
                      //check that the role is in the reachable roles
                      if ($this->isRoleReached($role, 
                            new Role($roleScope->getRole()))) {
  
                          $scopes[] = $roleScope->getScope();
                      }
                  }
              }
          }
          
          return $scopes;
      }
code: public function getReachableCircles(User $user, Role $role, Center $center)
      {
          $scopes = array();
          
          foreach ($user->getGroupCenters() as $groupCenter){
              if ($center->getId() === $groupCenter->getCenter()->getId()) {
                  //iterate on permissionGroup
                  $permissionGroup = $groupCenter->getPermissionsGroup();
                  //iterate on roleScopes
                  foreach($permissionGroup->getRoleScopes() as $roleScope) {
                      //check that the role is in the reachable roles
                      if ($this->isRoleReached($role, 
                            new Role($roleScope->getRole()))) {
  
                          $scopes[] = $roleScope->getScope();
                      }
                  }
              }
          }
          
          return $scopes;
      }
code_tokens: public function getReachableCircles ( User $ user , Role $ role , Center $ center ) { $ scopes = array ( ) ; foreach ( $ user -> getGroupCenters ( ) as $ groupCenter ) { if ( $ center -> getId ( ) === $ groupCenter -> getCenter ( ) -> getId ( ) ) { //iterate on permissionGroup $ permissionGroup = $ groupCenter -> getPermissionsGroup ( ) ; //iterate on roleScopes foreach ( $ permissionGroup -> getRoleScopes ( ) as $ roleScope ) { //check that the role is in the reachable roles if ( $ this -> isRoleReached ( $ role , new Role ( $ roleScope -> getRole ( ) ) ) ) { $ scopes [ ] = $ roleScope -> getScope ( ) ; } } } } return $ scopes ; }
docstring: Return all reachable circle for a given user, center and role
  
  @param User $user
  @param Role $role
  @param Center $center
  @return Scope[]
docstring_tokens: Return all reachable circle for a given user center and role