protected function ensureJsonPath($option, $rootDir, Path $file)
    {
        // normalize
        $realpath = $file->getRealWritingFilePath($option, $rootDir);

        // validate file
        $realFilePath = $file->getRealPath($realpath, $rootDir);

        if ($realFilePath !== false && !$file->isRealFileWritable($realFilePath)) {
            throw new InvalidConfigurationException("json_path is not writable: ${realFilePath}");
        }

        // validate parent dir
        $realDir = $file->getRealDir($realpath, $rootDir);

        if (!$file->isRealDirWritable($realDir)) {
            throw new InvalidConfigurationException("json_path is not writable: ${realFilePath}");
        }

        return $realpath;
    }
protected function ensureJsonPath($option, $rootDir, Path $file)
    {
        // normalize
        $realpath = $file->getRealWritingFilePath($option, $rootDir);

        // validate file
        $realFilePath = $file->getRealPath($realpath, $rootDir);

        if ($realFilePath !== false && !$file->isRealFileWritable($realFilePath)) {
            throw new InvalidConfigurationException("json_path is not writable: ${realFilePath}");
        }

        // validate parent dir
        $realDir = $file->getRealDir($realpath, $rootDir);

        if (!$file->isRealDirWritable($realDir)) {
            throw new InvalidConfigurationException("json_path is not writable: ${realFilePath}");
        }

        return $realpath;
    }
protected function ensureJsonPath ( $ option , $ rootDir , Path $ file ) { // normalize $ realpath = $ file -> getRealWritingFilePath ( $ option , $ rootDir ) ; // validate file $ realFilePath = $ file -> getRealPath ( $ realpath , $ rootDir ) ; if ( $ realFilePath !== false && ! $ file -> isRealFileWritable ( $ realFilePath ) ) { throw new InvalidConfigurationException ( "json_path is not writable: ${realFilePath}" ) ; } // validate parent dir $ realDir = $ file -> getRealDir ( $ realpath , $ rootDir ) ; if ( ! $ file -> isRealDirWritable ( $ realDir ) ) { throw new InvalidConfigurationException ( "json_path is not writable: ${realFilePath}" ) ; } return $ realpath ; }
Ensure json_path is valid.

@param string $option  json_path option
@param string $rootDir path to project root directory
@param Path   $file    path object

@throws \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException

@return string valid json_path
Ensure json_path is valid .