src/Hooks/PrepareCommitMsg.php
public function prepareCommitMsg(
        string &$message,
        InputInterface $input,
        OutputInterface $output,
        ParameterBagInterface $configuration,
        ?string $type = null,
        ?string $sha = null
    ): bool {
        // Lets add some sweet text to the commit message
        $message = 'sweet text '.$message;

        // And return true, because the message is good
        return true;
    }
public function prepareCommitMsg(
        string &$message,
        InputInterface $input,
        OutputInterface $output,
        ParameterBagInterface $configuration,
        ?string $type = null,
        ?string $sha = null
    ): bool {
        // Lets add some sweet text to the commit message
        $message = 'sweet text '.$message;

        // And return true, because the message is good
        return true;
    }
public function prepareCommitMsg ( string & $ message , InputInterface $ input , OutputInterface $ output , ParameterBagInterface $ configuration , ? string $ type = null , ? string $ sha = null ) : bool { // Lets add some sweet text to the commit message $ message = 'sweet text ' . $ message ; // And return true, because the message is good return true ; }
Called after receiving the default commit message, just prior to firing up the commit message editor.

Returning false aborts the commit.

This is used to edit the message in a way that cannot be suppressed.

@param string                $message       Commit message
@param InputInterface        $input
@param OutputInterface       $output
@param ParameterBagInterface $configuration
@param string|null           $type          Type of commit message (message, template, merge, squash, or commit)
@param string|null           $sha           SHA-1 of the commit (only available if working on a existing commit)

@return bool
Called after receiving the default commit message just prior to firing up the commit message editor .