src/Hooks/Committer.php
public function preCommit(
        InputInterface $input,
        OutputInterface $output,
        ParameterBagInterface $configuration
    ): bool {
        // Here we can fx run phpunit on in the code
        // Or we can just post something to httpbin
        // As this module requires guzzle via composer, we can ofcourse utialize it
        $client = new Client(
            [
                'base_uri' => 'http://httpbin.org',
                'timeout' => 2.0,
            ]
        );

        $request = new Request('GET', '/');
        $promise = $client->sendAsync($request)->then(
            function (Response $response) use ($output) {
                $output->writeln('I completed! '.$response->getBody());

                return true;
            }
        );

        return $promise->wait();
    }
public function preCommit(
        InputInterface $input,
        OutputInterface $output,
        ParameterBagInterface $configuration
    ): bool {
        // Here we can fx run phpunit on in the code
        // Or we can just post something to httpbin
        // As this module requires guzzle via composer, we can ofcourse utialize it
        $client = new Client(
            [
                'base_uri' => 'http://httpbin.org',
                'timeout' => 2.0,
            ]
        );

        $request = new Request('GET', '/');
        $promise = $client->sendAsync($request)->then(
            function (Response $response) use ($output) {
                $output->writeln('I completed! '.$response->getBody());

                return true;
            }
        );

        return $promise->wait();
    }
public function preCommit ( InputInterface $ input , OutputInterface $ output , ParameterBagInterface $ configuration ) : bool { // Here we can fx run phpunit on in the code // Or we can just post something to httpbin // As this module requires guzzle via composer, we can ofcourse utialize it $ client = new Client ( [ 'base_uri' => 'http://httpbin.org' , 'timeout' => 2.0 , ] ) ; $ request = new Request ( 'GET' , '/' ) ; $ promise = $ client -> sendAsync ( $ request ) -> then ( function ( Response $ response ) use ( $ output ) { $ output -> writeln ( 'I completed! ' . $ response -> getBody ( ) ) ; return true ; } ) ; return $ promise -> wait ( ) ; }
This hook is called before obtaining the proposed commit message.

Returning false will abort the commit.

It is used to check the commit itself (rather than the message).

@param InputInterface        $input
@param OutputInterface       $output
@param ParameterBagInterface $configuration

@return bool
This hook is called before obtaining the proposed commit message .