public static function resolveReal(string $path, string $workingDir = null)
    {
        if (null === $workingDir
        /**
         * Path includes full (absolute) path, which doesn't need
         * working directory.
         */
            && file_exists($real = Filesystem::resolve($path))) {
            return $real;
        } elseif (null !== $workingDir) {
        /**
         * ...Otherwise, add $workingDir before trying to find it.
         */
            $fullPath = Filesystem::slash($workingDir, $path);
            $real = Filesystem::resolve($fullPath);
            return file_exists($real) ? $real : null;
        }

        return null;
    }
public static function resolveReal(string $path, string $workingDir = null)
    {
        if (null === $workingDir
        /**
         * Path includes full (absolute) path, which doesn't need
         * working directory.
         */
            && file_exists($real = Filesystem::resolve($path))) {
            return $real;
        } elseif (null !== $workingDir) {
        /**
         * ...Otherwise, add $workingDir before trying to find it.
         */
            $fullPath = Filesystem::slash($workingDir, $path);
            $real = Filesystem::resolve($fullPath);
            return file_exists($real) ? $real : null;
        }

        return null;
    }
public static function resolveReal ( string $ path , string $ workingDir = null ) { if ( null === $ workingDir /**
         * Path includes full (absolute) path, which doesn't need
         * working directory.
         */ && file_exists ( $ real = Filesystem :: resolve ( $ path ) ) ) { return $ real ; } elseif ( null !== $ workingDir ) { /**
         * ...Otherwise, add $workingDir before trying to find it.
         */ $ fullPath = Filesystem :: slash ( $ workingDir , $ path ) ; $ real = Filesystem :: resolve ( $ fullPath ) ; return file_exists ( $ real ) ? $ real : null ; } return null ; }
Resolve paths to real locations.

A wrapper for `Filesystem::resolve()` that returns real paths. It will
fully evaluate symbolic links, so they will return their targets.

If a directory/file does not exist, this method returns `null`.

In certain situations, this may return `null` for files that are,
technically accessible (see php.net documentation for `file_exists()`).

This will always return an absolute path.

@see https://secure.php.net/manual/en/function.file-exists.php

@param string $path
@param string|null $workingDir   The directory to use as the base.
@return bool|string              Real path if it exists, bool false otherwise.
Resolve paths to real locations .