src/Writer.php
public function useKeyAsIndex($key, $normalize = false)
    {
        if (null === $key) {
            $this->indexKey = null;
            return;
        }

        if (true !== $normalize && !$this->isValidNodeName($key)) {
            throw new \InvalidArgumentException(sprintf('%s is an invalid node name', $key));
        }

        $this->indexKey = $normalize ? $this->normalizer->normalize($key) : $key;
    }
public function useKeyAsIndex($key, $normalize = false)
    {
        if (null === $key) {
            $this->indexKey = null;
            return;
        }

        if (true !== $normalize && !$this->isValidNodeName($key)) {
            throw new \InvalidArgumentException(sprintf('%s is an invalid node name', $key));
        }

        $this->indexKey = $normalize ? $this->normalizer->normalize($key) : $key;
    }
public function useKeyAsIndex ( $ key , $ normalize = false ) { if ( null === $ key ) { $ this -> indexKey = null ; return ; } if ( true !== $ normalize && ! $ this -> isValidNodeName ( $ key ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s is an invalid node name' , $ key ) ) ; } $ this -> indexKey = $ normalize ? $ this -> normalizer -> normalize ( $ key ) : $ key ; }
Sets the index key used as key -> node identifier.

@param string $key
@param bool $normalize

@throws \InvalidArgumentException if $key is an invalid nodename.
@return void
Sets the index key used as key - > node identifier .