public function hasDuplicates($target)
    {
        if ($this->exists($target)) {
            $duplicates = $this->getDuplicates();
            return (int) $duplicates[$target] > 1;

        } else {
            throw new RuntimeException(sprintf(
                'Attempted to read non-existing value %s', $target
            ));
        }
    }
public function hasDuplicates($target)
    {
        if ($this->exists($target)) {
            $duplicates = $this->getDuplicates();
            return (int) $duplicates[$target] > 1;

        } else {
            throw new RuntimeException(sprintf(
                'Attempted to read non-existing value %s', $target
            ));
        }
    }
public function hasDuplicates ( $ target ) { if ( $ this -> exists ( $ target ) ) { $ duplicates = $ this -> getDuplicates ( ) ; return ( int ) $ duplicates [ $ target ] > 1 ; } else { throw new RuntimeException ( sprintf ( 'Attempted to read non-existing value %s' , $ target ) ) ; } }
Checks if a value has duplicates in a sequence

@param string $target
@throws \RuntimeException if $target does not belong to the collection
@return boolean
Checks if a value has duplicates in a sequence