PHPackages                             richweber/yii2-code-sniffer-git-hook - 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. richweber/yii2-code-sniffer-git-hook

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

richweber/yii2-code-sniffer-git-hook
====================================

Code Sniffer Git Hook

0.1.1(9y ago)023.5k2BSD-3-ClausePHP

Since Aug 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/RichWeber/yii2-code-sniffer-git-hook)[ Packagist](https://packagist.org/packages/richweber/yii2-code-sniffer-git-hook)[ RSS](/packages/richweber-yii2-code-sniffer-git-hook/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (0)

Yii2 Code Sniffer Git Hook
==========================

[](#yii2-code-sniffer-git-hook)

You can read about Yii2 standard here:

How to install
--------------

[](#how-to-install)

### Getting Yii2 code standard

[](#getting-yii2-code-standard)

```
$ git clone git://github.com/yiisoft/yii2-coding-standards.git

```

### Install composer

[](#install-composer)

```
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

```

### Install Code Sniffer

[](#install-code-sniffer)

```
$ composer global require "squizlabs/php_codesniffer=*"

```

### Install Yii2 code standard

[](#install-yii2-code-standard)

```
$ cd yii2-coding-standards
$ cp -r Yii2 ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Yii2

```

Check Yii2 standard

```
$ phpcs -i

```

Set Yii2 as coding standard by default:

```
$ phpcs --config-set default_standard Yii2

```

### Install Git hooks

[](#install-git-hooks)

```
$ git clone git@github.com:RichWeber/yii2-code-sniffer-git-hook.git
$ cp yii2-code-sniffer-git-hook/pre-commit /YOUR_PROJECT/.git/hooks/pre-commit
$ cp yii2-code-sniffer-git-hook/pre-commit_yii2cs /YOUR_PROJECT/.git/hooks/pre-commit_yii2cs
$ cp yii2-code-sniffer-git-hook/.hooks_ignore /YOUR_PROJECT/.hooks_ignore

```

### Check Git hooks

[](#check-git-hooks)

```
$ cd /YOUR_PROJECT
$ git commit

```

[![RESULT](console.png)](console.png)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3568d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1702252?v=4)[Roman Bahatyi](/maintainers/RichWeber)[@RichWeber](https://github.com/RichWeber)

---

Top Contributors

[![RichWeber](https://avatars.githubusercontent.com/u/1702252?v=4)](https://github.com/RichWeber "RichWeber (10 commits)")

---

Tags

codegityii2snifferHOOK

### Embed Badge

![Health badge](/badges/richweber-yii2-code-sniffer-git-hook/health.svg)

```
[![Health](https://phpackages.com/badges/richweber-yii2-code-sniffer-git-hook/health.svg)](https://phpackages.com/packages/richweber-yii2-code-sniffer-git-hook)
```

###  Alternatives

[bruli/php-git-hooks

Git hooks for PHP projects.

675370.8k5](/packages/bruli-php-git-hooks)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[nilportugues/php_backslasher

Adds all PHP internal functions to its namespace by adding backslash to them. Improves the application's performance when OPCache is on.

889.3k18](/packages/nilportugues-php-backslasher)[amphibee/laravel-pint-pre-commit

Laravel Pint pre-commit hook allow you to analyse your code with the awesome Laravel Pint.

1943.9k](/packages/amphibee-laravel-pint-pre-commit)[nilportugues/php_todo

Looks into the code using a user-defined list of to-do phrases and stops commit if the total amount increased or is above a threshold.

1210.0k](/packages/nilportugues-php-todo)

PHPackages © 2026

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