public function search(
        $baseDn = null,
        $filter = null,
        $inDepth = true,
        $attributes = null
    ) {
        $this->validateBinding();

        $result = new SearchResult();

        $baseDn = (null === $baseDn)?$this->configuration['base_dn']:$baseDn;
        $filter = (null === $filter)?'(objectclass=*)':$filter;
        $attributes = (is_array($attributes))?$attributes:null;
        $scope = $inDepth?SearchInterface::SCOPE_ALL:SearchInterface::SCOPE_ONE;

        try {
            $search = $this->connection->search($scope, $baseDn, $filter, $attributes);
        } catch (NoResultException $e) {
            return $result;
        }
        $result->setSearch($search);

        return $result;
    }