(ctx context.Context)
| 54 | } |
| 55 | |
| 56 | func (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 | |
| 72 | func (d *PHPDetector) phpExtensions(ctx context.Context) ([]string, error) { |
| 73 | resolved, err := searcher.Client().ResolveV2(ctx, "php", d.phpVersion(ctx)) |
no test coverage detected