PHPackages                             arispati/phpcs-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. arispati/phpcs-pre-commit

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

arispati/phpcs-pre-commit
=========================

Run phpcs before git commit

v1.2.1(1y ago)0228MITPHPPHP ^8.2|^8.3|^8.4

Since Jun 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/arispati/phpcs-pre-commit)[ Packagist](https://packagist.org/packages/arispati/phpcs-pre-commit)[ RSS](/packages/arispati-phpcs-pre-commit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

PHPCS Pre Commit
================

[](#phpcs-pre-commit)

Run phpcs before git commit

Table of Contents
-----------------

[](#table-of-contents)

- [Requirement](#requirement)
- [Installation](#installation)
- [Uninstall](#uninstall)

### Requirement

[](#requirement)

- PHP &gt;= ^8.2 | ^8.3
- Laravel &gt;= ^10.0 | ^11.0

### Installation

[](#installation)

- Add this command to your composer.json on script section at `post-install-cmd` and `post-update-cmd` attribute

```
@php artisan arispati:phpcs-install
```

```
// composer.json
{
    ...
    "scripts": {
        "post-install-cmd": [
            "@php artisan arispati:phpcs-install"
        ],
        "post-update-cmd": [
            "@php artisan arispati:phpcs-install"
        ],
    },
    ...
}
```

- Then install the package with composer

```
composer require --dev arispati/phpcs-pre-commit
```

- Now when you commit the changes and got an error, its look like this

```
[PRE-COMMIT] Running PHP_CodeSniffer using the PSR12 standard

E 1 / 1 (100%)

FILE: ...~/HomeController.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 11 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
 11 | ERROR | [x] Expected 1 space after closing parenthesis; found newline
 12 | ERROR | [x] Line indented incorrectly; expected at least 8 spaces, found 4
 13 | ERROR | [x] Line indented incorrectly; expected at least 12 spaces, found 8
 14 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 4
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 138ms; Memory: 10MB

[PRE-COMMIT] Please fix all of the violations or commit with the --no-verify option
```

### Uninstall

[](#uninstall)

- Run this command to remove git hook script

```
php artisan arispati:phpcs-uninstall
```

- Remove composer script `@php artisan arispati:phpcs-install` both `post-install-cmd` and `post-update-cmd` attribute
- Then remove the package with composer

```
composer remove --dev arispati/phpcs-pre-commit
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance43

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~87 days

Total

4

Last Release

448d ago

PHP version history (2 changes)v1.0.0PHP ^8.2|^8.3

v1.2.1PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/e638cfbb3ba72c6bd02fc45df34123e0a8c7e9363b3a23de94ebe79e382b4c7a?d=identicon)[arispati](/maintainers/arispati)

---

Top Contributors

[![arispati](https://avatars.githubusercontent.com/u/13604647?v=4)](https://github.com/arispati "arispati (5 commits)")

---

Tags

gitlaravelphpcs

### Embed Badge

![Health badge](/badges/arispati-phpcs-pre-commit/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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