original_string: public function activateEndpoint(Endpoint $newActive, $force = false)
      {
          if (!$this->getEndpoints()->contains($newActive)) {
              throw new InputException('Endpoint is not part of this manager');
          }
  
          if ($force === false && $this->canBeActivated($newActive) === false) {
              throw new InputException('Can not activate this endpoint');
          }
  
          $this->disableAll();
          $newActive->setStatus(Endpoint::STATUS_ACTIVE);
  
          return $newActive;
      }
code: public function activateEndpoint(Endpoint $newActive, $force = false)
      {
          if (!$this->getEndpoints()->contains($newActive)) {
              throw new InputException('Endpoint is not part of this manager');
          }
  
          if ($force === false && $this->canBeActivated($newActive) === false) {
              throw new InputException('Can not activate this endpoint');
          }
  
          $this->disableAll();
          $newActive->setStatus(Endpoint::STATUS_ACTIVE);
  
          return $newActive;
      }
code_tokens: public function activateEndpoint ( Endpoint $ newActive , $ force = false ) { if ( ! $ this -> getEndpoints ( ) -> contains ( $ newActive ) ) { throw new InputException ( 'Endpoint is not part of this manager' ) ; } if ( $ force === false && $ this -> canBeActivated ( $ newActive ) === false ) { throw new InputException ( 'Can not activate this endpoint' ) ; } $ this -> disableAll ( ) ; $ newActive -> setStatus ( Endpoint :: STATUS_ACTIVE ) ; return $ newActive ; }
docstring: Try to activate an Endpoint as the active endpoint.
  If endpoint status is Error, first check if it can be safely enabled.
  
  @param Endpoint $newActive Endpoint to be enabled
  @param bool     $force     when true, skips the cool down check
  
  @throws InputException
  
  @return Endpoint
docstring_tokens: Try to activate an Endpoint as the active endpoint . If endpoint status is Error first check if it can be safely enabled .