public function hasEndpoint($uri)
    {
        /** @var ArrayCollection $urlsFound */
        $urlsFound = $this->getEndpoints()->filter(function (Endpoint $endpoint) use ($uri) {
            // return when URI and URI string are equal
            return (string) $endpoint->getUri() === $uri;
        });

        return $urlsFound->isEmpty() === false;
    }
public function hasEndpoint($uri)
    {
        /** @var ArrayCollection $urlsFound */
        $urlsFound = $this->getEndpoints()->filter(function (Endpoint $endpoint) use ($uri) {
            // return when URI and URI string are equal
            return (string) $endpoint->getUri() === $uri;
        });

        return $urlsFound->isEmpty() === false;
    }
public function hasEndpoint ( $ uri ) { /** @var ArrayCollection $urlsFound */ $ urlsFound = $ this -> getEndpoints ( ) -> filter ( function ( Endpoint $ endpoint ) use ( $ uri ) { // return when URI and URI string are equal return ( string ) $ endpoint -> getUri ( ) === $ uri ; } ) ; return $ urlsFound -> isEmpty ( ) === false ; }
Checks if the given uri is already added to collection.

@param string $uri

@return bool
Checks if the given uri is already added to collection .