src/Generators/SchemaGenerator.php
private function validateFilesPaths(array $definitionFileDirectories): bool
    {
        if (count($definitionFileDirectories) < 1) {
            throw new InvalidConfigurationException(
                'The "schema_paths" config value is empty, it should contain a value with a valid path for the following keys: mutations, queries, types'
            );
        }

        if (array_diff(array_keys($definitionFileDirectories), $this->requiredSchemaFileKeys)) {
            throw new InvalidConfigurationException(
                'The "schema_paths" config value is incomplete, it should contain a value with a valid path for the following keys: mutations, queries, types'
            );
        }
        foreach ($definitionFileDirectories as $key => $path) {
            if (empty($path)) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'The "schema_paths" config value for key "%s" is empty, it should contain a value with a valid path',
                        $key
                    )
                );
            }

            if (! file_exists($path)) {
                throw new InvalidConfigurationException(
                    sprintf('The "schema_paths" config value for key "%s" contains a path that does not exist', $key)
                );
            }
        }

        return true;
    }
private function validateFilesPaths(array $definitionFileDirectories): bool
    {
        if (count($definitionFileDirectories) < 1) {
            throw new InvalidConfigurationException(
                'The "schema_paths" config value is empty, it should contain a value with a valid path for the following keys: mutations, queries, types'
            );
        }

        if (array_diff(array_keys($definitionFileDirectories), $this->requiredSchemaFileKeys)) {
            throw new InvalidConfigurationException(
                'The "schema_paths" config value is incomplete, it should contain a value with a valid path for the following keys: mutations, queries, types'
            );
        }
        foreach ($definitionFileDirectories as $key => $path) {
            if (empty($path)) {
                throw new InvalidConfigurationException(
                    sprintf(
                        'The "schema_paths" config value for key "%s" is empty, it should contain a value with a valid path',
                        $key
                    )
                );
            }

            if (! file_exists($path)) {
                throw new InvalidConfigurationException(
                    sprintf('The "schema_paths" config value for key "%s" contains a path that does not exist', $key)
                );
            }
        }

        return true;
    }
private function validateFilesPaths ( array $ definitionFileDirectories ) : bool { if ( count ( $ definitionFileDirectories ) < 1 ) { throw new InvalidConfigurationException ( 'The "schema_paths" config value is empty, it should contain a value with a valid path for the following keys: mutations, queries, types' ) ; } if ( array_diff ( array_keys ( $ definitionFileDirectories ) , $ this -> requiredSchemaFileKeys ) ) { throw new InvalidConfigurationException ( 'The "schema_paths" config value is incomplete, it should contain a value with a valid path for the following keys: mutations, queries, types' ) ; } foreach ( $ definitionFileDirectories as $ key => $ path ) { if ( empty ( $ path ) ) { throw new InvalidConfigurationException ( sprintf ( 'The "schema_paths" config value for key "%s" is empty, it should contain a value with a valid path' , $ key ) ) ; } if ( ! file_exists ( $ path ) ) { throw new InvalidConfigurationException ( sprintf ( 'The "schema_paths" config value for key "%s" contains a path that does not exist' , $ key ) ) ; } } return true ; }
Validates if the given defintionFileDirectories contains;
- All required keys
- Filled values for each key
- Existing paths for each key

@param array $definitionFileDirectories
@return bool
@throws InvalidConfigurationException
Validates if the given defintionFileDirectories contains ; - All required keys - Filled values for each key - Existing paths for each key