public function setMetadataDirs(array $namespacePrefixToDirMap): self
    {
        foreach ($namespacePrefixToDirMap as $dir) {
            if (!is_dir($dir)) {
                throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
            }
        }

        $this->metadataDirs = $namespacePrefixToDirMap;

        return $this;
    }
public function setMetadataDirs(array $namespacePrefixToDirMap): self
    {
        foreach ($namespacePrefixToDirMap as $dir) {
            if (!is_dir($dir)) {
                throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
            }
        }

        $this->metadataDirs = $namespacePrefixToDirMap;

        return $this;
    }
public function setMetadataDirs ( array $ namespacePrefixToDirMap ) : self { foreach ( $ namespacePrefixToDirMap as $ dir ) { if ( ! is_dir ( $ dir ) ) { throw new InvalidArgumentException ( sprintf ( 'The directory "%s" does not exist.' , $ dir ) ) ; } } $ this -> metadataDirs = $ namespacePrefixToDirMap ; return $ this ; }
Sets a map of namespace prefixes to directories.

This method overrides any previously defined directories.

@param array <string,string> $namespacePrefixToDirMap

@return SerializerBuilder

@throws InvalidArgumentException When a directory does not exist.
Sets a map of namespace prefixes to directories .