protected function resolveTargetFilePath($target, $basePath)
    {
        switch (true) {

            // resource
            case strpos($target, '@') === 0:
                $targetPath = $this->fileLocator->locate($target);
                break;

            // kernel related
            case strpos($target, '/') === 0:
                $targetPath = sprintf('%s%s',
                    $this->kernelDir,
                    $target
                );
                break;

            // related file
            default:
                $targetPath = sprintf('%s/%s', $basePath, $target);
                break;
        }

        if (!is_writable($targetPath)) {
            throw new \InvalidArgumentException(sprintf(
                'Unable to resolve "%s" target, resolved into "%s" file path which is not writable.',
                $target,
                $targetPath
            ));
        }

        return $targetPath;
    }
protected function resolveTargetFilePath($target, $basePath)
    {
        switch (true) {

            // resource
            case strpos($target, '@') === 0:
                $targetPath = $this->fileLocator->locate($target);
                break;

            // kernel related
            case strpos($target, '/') === 0:
                $targetPath = sprintf('%s%s',
                    $this->kernelDir,
                    $target
                );
                break;

            // related file
            default:
                $targetPath = sprintf('%s/%s', $basePath, $target);
                break;
        }

        if (!is_writable($targetPath)) {
            throw new \InvalidArgumentException(sprintf(
                'Unable to resolve "%s" target, resolved into "%s" file path which is not writable.',
                $target,
                $targetPath
            ));
        }

        return $targetPath;
    }
protected function resolveTargetFilePath ( $ target , $ basePath ) { switch ( true ) { // resource case strpos ( $ target , '@' ) === 0 : $ targetPath = $ this -> fileLocator -> locate ( $ target ) ; break ; // kernel related case strpos ( $ target , '/' ) === 0 : $ targetPath = sprintf ( '%s%s' , $ this -> kernelDir , $ target ) ; break ; // related file default : $ targetPath = sprintf ( '%s/%s' , $ basePath , $ target ) ; break ; } if ( ! is_writable ( $ targetPath ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Unable to resolve "%s" target, resolved into "%s" file path which is not writable.' , $ target , $ targetPath ) ) ; } return $ targetPath ; }
resolve given target file path

@param  string $target
@param  string $basePath

@return string

@throws \InvalidArgumentException if path cannot be resolved
resolve given target file path