public function search($key)
    {
        $binarySearch = new BinarySearch($this);
        $result = $binarySearch->search($key);
        if (\is_null($result) || $result->getKey() != $key) {
            return null;
            
        }
        return $result;
    }
public function search($key)
    {
        $binarySearch = new BinarySearch($this);
        $result = $binarySearch->search($key);
        if (\is_null($result) || $result->getKey() != $key) {
            return null;
            
        }
        return $result;
    }
public function search ( $ key ) { $ binarySearch = new BinarySearch ( $ this ) ; $ result = $ binarySearch -> search ( $ key ) ; if ( \ is_null ( $ result ) || $ result -> getKey ( ) != $ key ) { return null ; } return $ result ; }
Searches for the container with that key

Returns null if the key wasn't found.

@param string $key Key in the index

@return Result
@throws ReadDataIndexException
Searches for the container with that key