Skip to content
PHP Ecosystem
Explore

PackageName

API reference › Foxy › Native › PackageName

final readonly classFoxy\Native\PackageName
Sourcesrc/Native/PackageName.php

Validates the package names the native manager reads from manifests, lock files, and registry metadata.

A valid name is at most 214 bytes long and is an optional @scope/ prefix followed by a name, where the scope and the name each start with an ASCII letter or digit and continue with letters, digits, ., _, or -.

MethodDescriptionDefined by
isValid() staticReturns whether the name matches the grammar, which rules out empty parts, path separators outside the scope separator, leading dots, and absolute paths.PackageName
public static function isValid(string $name): bool

Returns whether the name matches the grammar, which rules out empty parts, path separators outside the scope separator, leading dots, and absolute paths.

Parameters

ParameterTypeDescription
$namestring

Returns

bool