PHPackages                             xip-solid-foundation/pre-commit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. xip-solid-foundation/pre-commit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

xip-solid-foundation/pre-commit
===============================

Package for pre-commit hook and basic testing

v1.0.9(4y ago)055MITShell

Since Jan 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/xip-solid-foundation/pre-commit)[ Packagist](https://packagist.org/packages/xip-solid-foundation/pre-commit)[ RSS](/packages/xip-solid-foundation-pre-commit/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (10)Used By (0)

pre-commit
==========

[](#pre-commit)

A pre-commit hook installer with basic testing

Pre-requisite
-------------

[](#pre-requisite)

1. Docker Compose, [install Docker Compose](https://docs.docker.com/compose/install/)
2. PHP docker image

You may use [Symfony-Docker](https://github.com/dunglas/symfony-docker) to download and install Docker for Symfony.

Installation
============

[](#installation)

Applications that use Symfony Flex Installation
-----------------------------------------------

[](#applications-that-use-symfony-flex-installation)

```
$ composer require xip-solid-foundation/pre-commit

```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Install the Bundle

[](#step-1-install-the-bundle)

Open a command console, enter your project directory and execute the following command to install the latest stable version of this bundle:

```
$ composer require xip-solid-foundation/pre-commit
```

### Step 2: Added Pre-commit file

[](#step-2-added-pre-commit-file)

Example:

```
# Automatic usage by installing symbolic link:
# ln -sf ../../bin/pre-commit .git/hooks/pre-commit

# Enable TTY, so fastest runs on a single line and looks cooler
exec < /dev/tty

if [[ -z `docker ps -q --no-trunc | grep $(docker-compose ps -q apache2)` ]]; then
    echo -e "\e[41m COMMIT FAILED: Docker-compose is not running! \e[0m";
    exit 1
fi

# Install phpunit synchronously to avoid problems.
docker-compose exec php bin/phpunit install

docker-compose exec -T php bin/console cache:warmup --env=prod
if [[ $? != "0" ]]
then
    echo -e "\e[41m COMMIT FAILED: Cannot warm cache for env=prod! \e[0m":
    exit 1
fi

# see which files you wanted to commit, fix code style and re-add
FILES=` git status --porcelain | grep -e '^[AM]\(.*\).php$' | cut -c 3- | tr '\n' ' '`
if [[ $FILES ]]
then
    FILES_NO_APPLICATION=`echo ${FILES} | sed "s/api\///g"`
    docker-compose exec -T php vendor/bin/php-cs-fixer fix
    git add ${FILES}
fi

# remove outdated code coverage files
rm -rf var/coverage.txt public/test.html

# warmup test cache to speed up tests
docker-compose exec php bin/console cache:warmup --env=test

# Run Tests and generate code coverage
docker-compose exec php bash -c "XDEBUG_MODE=coverage vendor/bin/paratest --coverage-html=public/test.html --coverage-text=var/coverage.txt tests"
if [[ $? != "0" ]]
then
    echo -e "\e[41m COMMIT FAILED: You have test errors! \e[0m":
    exit 1
fi

# merge code coverage
echo "Full HTML coverage at http://0.0.0.0/test.html/index.html"

OK=`docker-compose exec -T php head -n10 var/coverage.txt | grep Lines | grep "100.00%"`
if [[ ${OK} = "" ]]
then
    echo -e "\e[41m COMMIT FAILED: Code coverage not 100%! \e[0m":
    exit 1
fi

echo ""

```

Usage
=====

[](#usage)

Now you can run the pre-commit by using

```
$ bin/pre-commit

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

9

Last Release

1619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f162ba77227571cbe31a48af76a8fdfeda7ac38ae1c67d126b8b4baa2b2ea39?d=identicon)[mohd.e.mustafa](/maintainers/mohd.e.mustafa)

---

Top Contributors

[![mustafa-natiq](https://avatars.githubusercontent.com/u/94644429?v=4)](https://github.com/mustafa-natiq "mustafa-natiq (17 commits)")

### Embed Badge

![Health badge](/badges/xip-solid-foundation-pre-commit/health.svg)

```
[![Health](https://phpackages.com/badges/xip-solid-foundation-pre-commit/health.svg)](https://phpackages.com/packages/xip-solid-foundation-pre-commit)
```

###  Alternatives

[pestphp/pest

The elegant PHP Testing Framework.

11.6k72.2M20.6k](/packages/pestphp-pest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.9k](/packages/orchestra-testbench)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
