PHPackages                             hgtan/symfony-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hgtan/symfony-pre-commit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hgtan/symfony-pre-commit
========================

A Symfony pre-commit hook

1633.6k↓16.7%5[1 issues](https://github.com/hoangthienan/symfony-pre-commit/issues)PHP

Since Jul 3Pushed 5y ago2 watchersCompare

[ Source](https://github.com/hoangthienan/symfony-pre-commit)[ Packagist](https://packagist.org/packages/hgtan/symfony-pre-commit)[ RSS](/packages/hgtan-symfony-pre-commit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

A Symfony pre commit hook
=========================

[](#a-symfony-pre-commit-hook)

========================== Checks in our pre-commit hook

- Syntax check with php lint (“php -l”): We check every committed file has a valid PHP syntax.
- Sync check of composer.json and composer.lock files: We check these two files are committed together in order to avoid committing the json but not the lock and generate some issue to another developers.
- PHP CS Fixer check: With the –dry-run parameter it does not fix, just say what the problems are. With the –fixers parameter you can control what fixers you want to execute.
- PHP Code Sniffer check: Same as before, but another rule that checks another rules.
- PHPMD: We have enabled the controversial rules.
- Unit Testing check: We run around 3.000 tests right now.

**INSTALLATION:**

[![Latest Stable Version](https://camo.githubusercontent.com/bc4c409e4448cf29c28a2451477820aa47a4204f9f7b447d2cd82f9ad5df762f/68747470733a2f2f706f7365722e707567782e6f72672f686774616e2f73796d666f6e792d7072652d636f6d6d69742f762f737461626c652e737667)](https://packagist.org/packages/hgtan/symfony-pre-commit) [![Total Downloads](https://camo.githubusercontent.com/bd6623275d1e02b6008100eff62599aa746aebe838a040bae5792961af909b31/68747470733a2f2f706f7365722e707567782e6f72672f686774616e2f73796d666f6e792d7072652d636f6d6d69742f646f776e6c6f6164732e737667)](https://packagist.org/packages/hgtan/symfony-pre-commit) [![Latest Unstable Version](https://camo.githubusercontent.com/53b1a45b8e62a1e82b7bd9eea6f55bdcc2958b585e26a2bcb424f469d721573e/68747470733a2f2f706f7365722e707567782e6f72672f686774616e2f73796d666f6e792d7072652d636f6d6d69742f762f756e737461626c652e737667)](https://packagist.org/packages/hgtan/symfony-pre-commit) [![License](https://camo.githubusercontent.com/d19bf9cf3bcd27611965ae5af8a087b36f27e9b6dd5ec114493405507d763bb9/68747470733a2f2f706f7365722e707567782e6f72672f686774616e2f73796d666f6e792d7072652d636f6d6d69742f6c6963656e73652e737667)](https://packagist.org/packages/hgtan/symfony-pre-commit)

[![SensioLabsInsight](https://camo.githubusercontent.com/c9eeea5511b611f77448b4800a89ab3ce8bb05eeaf380d366817910ce5aa5230/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37373631346637362d363137612d343238382d386537352d3261643338303337656438392f6269672e706e67)](https://insight.sensiolabs.com/projects/77614f76-617a-4288-8e75-2ad38037ed89)

This library is available on [Packagist](https://packagist.org/packages/hgtan/symfony-pre-commit). The recommended way to install this library is through [Composer](http://getcomposer.org):

add hgtan/symfony-pre-commit as a composer dependency.

composer.json

```
"require-dev": {
    ...
    "hgtan/symfony-pre-commit": "dev-master"
}
php composer.phar update hgtan/symfony-pre-commit
```

**USAGE:**

When a developer clones the project, it just needs to:

```
-- linux
cd [project]
rm -rf .git/hooks
ln -s ../vendor/hgtan/symfony-pre-commit/hooks .git/hooks

-- windows
cd [project]
rd .git\hooks
mklink /D /J .git\hooks vendor\hgtan\symfony-pre-commit\hooks

```

Remembering to set up the hooks

```
"scripts": {
    "pre-update-cmd": "Hgtan\\Composer\\Script\\Hooks::checkHooks",
    "pre-install-cmd": "Hgtan\\Composer\\Script\\Hooks::checkHooks"
}

```

Have a look at [Write your git hooks in PHP and keep them under git control](http://bit.ly/git-hooks-in-php) for more usage information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4636bdcaa20fe8d4863fed9e077accfc51cd58edc8ce0dea0700eed917c649ab?d=identicon)[hoangthienan](/maintainers/hoangthienan)

---

Top Contributors

[![hoangthienan](https://avatars.githubusercontent.com/u/92070?v=4)](https://github.com/hoangthienan "hoangthienan (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/hgtan-symfony-pre-commit/health.svg)

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

PHPackages © 2026

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