public static function startsWith($value, $prefix, $message = '')
{
if (0 !== strpos($value, $prefix)) {
static::reportInvalidArgument(sprintf($message ?: 'Expected a value to start with %2$s. Got: %s', static::valueToString($value), static::valueToString($prefix)));
}
}
/** * Return the path with the basePath prefix * if it has been set. * * @param string $path * * @return string */ protected function resolvePath($path) { Assert::stringNotEmpty($path, 'The path must be a non-empty string. Got: %s'); Assert::startsWith($path, '/', 'The path %s is not absolute.'); if ($this->basePath) { $path = $this->basePath . $path; } $path = Path::canonicalize($path); return $path; }