original_string: public function getId($service): ?string
      {
          if ($this->serviceContainer === $service) {
              return 'service_container';
          }
  
          if (null === $id = ($this->getServiceId)($service)) {
              return null;
          }
  
          if ($this->serviceContainer->has($id) || $this->reversibleLocator->has($id)) {
              return $id;
          }
  
          return null;
      }
code: public function getId($service): ?string
      {
          if ($this->serviceContainer === $service) {
              return 'service_container';
          }
  
          if (null === $id = ($this->getServiceId)($service)) {
              return null;
          }
  
          if ($this->serviceContainer->has($id) || $this->reversibleLocator->has($id)) {
              return $id;
          }
  
          return null;
      }
code_tokens: public function getId ( $ service ) : ? string { if ( $ this -> serviceContainer === $ service ) { return 'service_container' ; } if ( null === $ id = ( $ this -> getServiceId ) ( $ service ) ) { return null ; } if ( $ this -> serviceContainer -> has ( $ id ) || $ this -> reversibleLocator -> has ( $ id ) ) { return $ id ; } return null ; }
docstring: Returns the id of the passed object when it exists as a service.
  
  To be reversible, services need to be either public or be tagged with "container.reversible".
  
  @param object $service
docstring_tokens: Returns the id of the passed object when it exists as a service .