original_string: public function getCapabilitiesForSite($idSite)
      {
          $result = [];
          foreach ($this->capabilityProvider->getAllCapabilityIds() as $capabilityId) {
              if (empty($this->idsitesByAccess[$capabilityId])) {
                  continue;
              }
  
              if (in_array($idSite, $this->idsitesByAccess[$capabilityId])) {
                  $result[] = $capabilityId;
              }
          }
          return $result;
      }
code: public function getCapabilitiesForSite($idSite)
      {
          $result = [];
          foreach ($this->capabilityProvider->getAllCapabilityIds() as $capabilityId) {
              if (empty($this->idsitesByAccess[$capabilityId])) {
                  continue;
              }
  
              if (in_array($idSite, $this->idsitesByAccess[$capabilityId])) {
                  $result[] = $capabilityId;
              }
          }
          return $result;
      }
code_tokens: public function getCapabilitiesForSite ( $ idSite ) { $ result = [ ] ; foreach ( $ this -> capabilityProvider -> getAllCapabilityIds ( ) as $ capabilityId ) { if ( empty ( $ this -> idsitesByAccess [ $ capabilityId ] ) ) { continue ; } if ( in_array ( $ idSite , $ this -> idsitesByAccess [ $ capabilityId ] ) ) { $ result [ ] = $ capabilityId ; } } return $ result ; }
docstring: Returns the capabilities the current user has for a given site.
  
  @param int $idSite The site to check.
  @return string[] The capabilities the user has.
docstring_tokens: Returns the capabilities the current user has for a given site .