#!/bin/bash

echo "Running Code Sniffer..."
./vendor/bin/phpcs --standard=BEIntegrationCodingStandard BEIntegrationCodingStandard tests
if [ $? != 0 ]
then
    echo "Fix the error before commit."
    exit 1
fi

echo "Running PHPstan"
./vendor/bin/phpstan analyze -c phpstan.neon BEIntegrationCodingStandard
if [ $? != 0 ]
then
    echo "Fix the error before commit."
    exit 1
fi

exit $?
