Skip to content

DevToolsPathResolver

github-actions[bot] edited this page May 1, 2026 · 1 revision

Resolves canonical paths for the DevTools package itself.


  • Full name: \FastForward\DevTools\Path\DevToolsPathResolver
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Constants

Constant Visibility Type Value
BINARY public string 'bin/dev-tools'
RESOURCES public string 'resources'

Methods

getPackagePath

Returns the DevTools package directory or a path under it.

public static getPackagePath(string $path = ''): string
  • This method is static. Parameters:
Parameter Type Description
$path string the optional relative segment to append under the package directory

getBinaryPath

Returns the packaged DevTools binary path.

public static getBinaryPath(): string
  • This method is static.

getBinaryCommand

Returns the packaged DevTools binary command with a subcommand.

public static getBinaryCommand(string $command): string
  • This method is static. Parameters:
Parameter Type Description
$command string the DevTools subcommand to append

getResourcesPath

Returns the packaged resources directory or a path under it.

public static getResourcesPath(string $path = ''): string
  • This method is static. Parameters:
Parameter Type Description
$path string the optional relative segment to append under resources

getPackagePathRelativeToProject

Returns a packaged path rendered relative to the active project root when possible.

public static getPackagePathRelativeToProject(string $path, string $projectPath = '', string $packagePath = ''): string

When the project root and package root do not share a filesystem root, the packaged absolute path MUST be returned unchanged so globally installed DevTools can still point hooks at the packaged fallback file.

  • This method is static. Parameters:
Parameter Type Description
$path string the relative path under the package root
$projectPath string an optional project root path; defaults to the working project root
$packagePath string an optional package root path; defaults to the current package root

getRuntimeAutoloadPath

Returns the active Composer autoload file for the current DevTools installation mode.

public static getRuntimeAutoloadPath(string $packagePath = ''): string

When DevTools runs as a dependency, the runtime autoloader lives at the Composer vendor root. Repository checkouts instead use the package-local vendor/autoload.php.

  • This method is static. Parameters:
Parameter Type Description
$packagePath string an optional package root path; defaults to the current package root

getRuntimeToolBinaryPath

Returns the active Composer runtime binary path for the current DevTools installation mode.

public static getRuntimeToolBinaryPath(string $binary, string $packagePath = ''): string

Repository checkouts use the package-local vendor/bin/<binary>, while dependency installs resolve binaries from the active Composer vendor root.

  • This method is static. Parameters:
Parameter Type Description
$binary string the binary name relative to vendor/bin
$packagePath string an optional package root path; defaults to the current package root

getRuntimeVendorPath

Returns the active Composer vendor path for the current DevTools installation mode.

public static getRuntimeVendorPath(string $path, string $packagePath = ''): string

Relative vendor paths MAY be passed either with or without a leading vendor/ prefix.

  • This method is static. Parameters:
Parameter Type Description
$path string the vendor-relative path to resolve
$packagePath string an optional package root path; defaults to the current package root

getPreferredToolBinaryPath

Returns the preferred tooling binary path for the active project and DevTools runtime.

public static getPreferredToolBinaryPath(string $binary, string $projectPath = '', string $packagePath = ''): string

Consumer projects SHOULD take precedence when they provide a local vendor/bin/<binary> entry. If the binary is absent locally, the method MUST fall back to the active DevTools runtime binary path.

  • This method is static. Parameters:
Parameter Type Description
$binary string the binary name relative to vendor/bin
$projectPath string an optional project root path; defaults to the working project root
$packagePath string an optional package root path; defaults to the current package root

getPreferredVendorPath

Returns the preferred Composer vendor path for the active project and DevTools runtime.

public static getPreferredVendorPath(string $path, string $projectPath = '', string $packagePath = ''): string

Consumer projects SHOULD take precedence when they provide the requested vendor path locally. If the path is absent locally, the method MUST fall back to the active DevTools runtime vendor path.

  • This method is static. Parameters:
Parameter Type Description
$path string the vendor-relative path to resolve
$projectPath string an optional project root path; defaults to the working project root
$packagePath string an optional package root path; defaults to the current package root

isInstalledAsDependency

Detects whether the provided path belongs to an installed vendor copy of DevTools.

public static isInstalledAsDependency(string $packagePath = ''): bool
  • This method is static. Parameters:
Parameter Type Description
$packagePath string an optional path within the package; defaults to the package root

isRepositoryCheckout

Detects whether the provided path belongs to the DevTools repository checkout itself.

public static isRepositoryCheckout(string $packagePath = ''): bool
  • This method is static. Parameters:
Parameter Type Description
$packagePath string an optional path within the package; defaults to the package root

Clone this wiki locally