original_string: public function addEndpoint(Endpoint $newEndpoint)
      {
          if ($this->hasEndpoint((string) $newEndpoint->getUri())) {
              throw new InputException('Endpoint already added');
          }
  
          // all newly added Endpoints are set to DISABLED, apart from the first one
          $status = $this->getEndpoints()->isEmpty() ? Endpoint::STATUS_ACTIVE : Endpoint::STATUS_DISABLED;
          $newEndpoint->setStatus($status);
  
          $this->getEndpoints()->add($newEndpoint);
      }
code: public function addEndpoint(Endpoint $newEndpoint)
      {
          if ($this->hasEndpoint((string) $newEndpoint->getUri())) {
              throw new InputException('Endpoint already added');
          }
  
          // all newly added Endpoints are set to DISABLED, apart from the first one
          $status = $this->getEndpoints()->isEmpty() ? Endpoint::STATUS_ACTIVE : Endpoint::STATUS_DISABLED;
          $newEndpoint->setStatus($status);
  
          $this->getEndpoints()->add($newEndpoint);
      }
code_tokens: public function addEndpoint ( Endpoint $ newEndpoint ) { if ( $ this -> hasEndpoint ( ( string ) $ newEndpoint -> getUri ( ) ) ) { throw new InputException ( 'Endpoint already added' ) ; } // all newly added Endpoints are set to DISABLED, apart from the first one $ status = $ this -> getEndpoints ( ) -> isEmpty ( ) ? Endpoint :: STATUS_ACTIVE : Endpoint :: STATUS_DISABLED ; $ newEndpoint -> setStatus ( $ status ) ; $ this -> getEndpoints ( ) -> add ( $ newEndpoint ) ; }
docstring: Add Endpoint into the pool.
  
  @param Endpoint $newEndpoint
  
  @throws InputException
docstring_tokens: Add Endpoint into the pool .