#!/bin/bash

echo "Running pre-commit checks..."

# make sure dependencies exist
composer install

# run the static analysis tool
./vendor/phpstan/phpstan/phpstan analyze ./src

# run the code standards tool
./vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --allow-risky=yes --dry-run --diff

echo "Apply any changes automatically with: bin/php-cs-fixer fix --allow-risky=yes"

