public function addSchemaDir($dir)
    {
        if (!is_dir($dir)) {
            throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
        }

        if (in_array($dir, $this->schemaDirs)) {
            throw new \InvalidArgumentException(sprintf('The directory "%s" is already configured.', $dir));
        }

        return $this;
    }