humanmade / humanmade/linter-bot

Update PHP Version and make it configurable

Open
#161 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16
Forks
2
Avg merge
17d 47m
Merged PRs (30d)
1

Description

When the lambda is built we copy the pre-built binary of PHP from an S3 bucket and install it to `/bin/php`.

The current version is PHP 7.1 and needs to be updated to a minimum of PHP 7.4 in order to not flag false negatives for PHP syntax errors.

Specifically we are seeing this error:

```
PHP syntax error: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
```

For code like the following:

```php
class Test {
public int $id;
}
```

Acceptance criteria:

- [ ] Document process for building and uploading PHP binaries
- [ ] Rename current binary on S3 to `php@7.1`
- [ ] Build & add PHP binary for 7.4 to S3 as `php@7.4`
- [ ] _Optional:_ Build and add PHP 8.1 binary to S3 as `php@8.1`
- [ ] Update PHPCS linter to spawn child PHP process using `php@7.4` by default
- [ ] Update PHPCS linter to read config for PHP version and spawn child process with configured version

Suggested config for PHP version:

```yml
phpcs:
php: 7 # latest PHP 7 version, same for 8

phpcs:
php: 7.1 # specific php version, must match available binaries
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.