MCPcopy Index your code
hub / github.com/jetify-com/devbox / phpVersion

Method phpVersion

pkg/autodetect/detector/php.go:56–70  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

54}
55
56func (d *PHPDetector) phpVersion(ctx context.Context) string {
57 require := d.composerJSON.Require
58
59 if require["php"] == "" {
60 return "latest"
61 }
62 // Remove the caret (^) if present
63 version := strings.TrimPrefix(require["php"], "^")
64
65 // Extract version in the format x, x.y, or x.y.z
66 re := regexp.MustCompile(`^(\d+(\.\d+){0,2})`)
67 match := re.FindString(version)
68
69 return determineBestVersion(ctx, "php", match)
70}
71
72func (d *PHPDetector) phpExtensions(ctx context.Context) ([]string, error) {
73 resolved, err := searcher.Client().ResolveV2(ctx, "php", d.phpVersion(ctx))

Callers 2

PackagesMethod · 0.95
phpExtensionsMethod · 0.95

Calls 1

determineBestVersionFunction · 0.85

Tested by

no test coverage detected