Skip to main content

Captain Hook PHP 8.2 compatibility

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

Captain Hook is my primary choice when it comes to managing Git Hooks. For a few days, Captain Hook supports PHP 8.2 - the latest and greatest PHP release.

Since we maintain some extensions for Captain Hook, I took the time to make sure those extensions are compatible with PHP 8.2 and the latest version 5.12.0 of Captain Hook.

Which extensions do we currently maintain?

bitexpert/captainhook-infection

This package provides an action for Captain Hook which invoke InfectionPHP for all changed PHP files of a commit. This helps in legacy projects to speed up the InfectionPHP run by not analyzing the whole project but the changed files only.

bitexpert/captainhook-validateauthor

This package provides an action for Captain Hook which rejects a git commit when the author name or email does not match a regex defined in the captainhook.json configuration file. This helps to avoid your personal email address ending up in your companies' git repositories.

bitexpert/captainhook-rejectpush

This package provides an action for Captain Hook which rejects a push to a remote when commit Ids configured in the captainhook.json configuration file are found in the Git history. The use case might be a bit exotic, sometimes you need to adjust files in your local checkout or cloned repository and you want to avoid pushing those changes to the customers' git repository as it would break things.

If you are using one those extensions, let us know.