LdapTools\Schema\Parser\SchemaYamlParser::getSchemaFileName PHP Method

getSchemaFileName() protected method

Check for a YML file of the specified schema name and return the full path.
protected getSchemaFileName ( string $folder, string $schema ) : string
$folder string
$schema string
return string
    protected function getSchemaFileName($folder, $schema)
    {
        $file = null;
        foreach (['yml', 'yaml'] as $ext) {
            $fileCheck = $folder . '/' . $schema . '.' . $ext;
            if (is_readable($fileCheck)) {
                $file = $fileCheck;
                break;
            }
        }
        if (is_null($file)) {
            throw new SchemaParserException(sprintf('Cannot find schema for "%s" in "%s"', $schema, $folder));
        }
        return $file;
    }