PHPackages                             ofbeaton/granite-php - 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. ofbeaton/granite-php

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

ofbeaton/granite-php
====================

Opinionated PHP Coding Style enforcement for PHP

6.9.0(7y ago)11.6k↓34.6%[21 issues](https://github.com/ofbeaton/granite-php/issues)1MIT

Since Jul 25Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ofbeaton/granite-php)[ Packagist](https://packagist.org/packages/ofbeaton/granite-php)[ Docs](https://github.com/ofbeaton/granite-php)[ RSS](/packages/ofbeaton-granite-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (38)Used By (1)

granite-php
===========

[](#granite-php)

Opinionated coding style enforcement for PHP.

Contains
--------

[](#contains)

We make use of the following programs:

- [PHP-Parallel-Lint](https://github.com/JakubOnderka/PHP-Parallel-Lint)
- [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)

Installing via Composer
-----------------------

[](#installing-via-composer)

The recommended way to install granite-php is through [Composer](http://getcomposer.org). Ensure you have it installed first.

Next, run the Composer command to install the latest stable version:

```
composer require ofbeaton/granite-php
composer require squizlabs/php_codesniffer
composer require jakub-onderka/php-parallel-lint jakub-onderka/php-console-highlighter
```

Edit your `composer.json` and add or modify `scripts` section:

```
{
  ...

  "scripts": {
    "check": [
      "parallel-lint . --exclude vendor",
      "phpcs -p --standard=vendor/ofbeaton/granite-php/phpcs/granite --ignore=vendor src"
    ],
    "fix": [
      "phpcbf -p --standard=vendor/ofbeaton/granite-php/phpcs/granite --ignore=vendor src"
    ],
    "check-tests": [
      "parallel-lint . --exclude vendor",
      "phpcs -p --standard=vendor/ofbeaton/granite-php/phpcs/granite-tests --ignore=vendor tests"
    ],
    "fix-tests": [
      "phpcbf -p --standard=vendor/ofbeaton/granite-php/phpcs/granite-tests --ignore=vendor tests"
    ],
    "test": [
      "@check",
      "@check-tests"
    ]
  },

  ...
}
```

And update your project:

```
composer update ofbeaton/granite-php
```

After updating, you can now run granite-php:

```
composer test
```

Running granite-php on test suites
----------------------------------

[](#running-granite-php-on-test-suites)

You usually want to relax some requirements for test suites, in that case run:

```
composer check-tests
```

Documentation
-------------

[](#documentation)

Please head over to the [PHP page](https://github.com/ofbeaton/granite/wiki/PHP) on the Granite wiki.

License
-------

[](#license)

This software is distributed under the MIT License. Please see [License file](LICENSE) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity75

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

Recently: every ~4 days

Total

37

Last Release

2615d ago

Major Versions

1.0.1 → 2.02018-01-31

2.1.1 → 3.02019-02-23

3.1 → 4.02019-02-25

4.0.2 → 5.0.02019-02-25

5.0.2 → 6.0.02019-02-25

### Community

Maintainers

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

---

Top Contributors

[![ofbeaton](https://avatars.githubusercontent.com/u/1781089?v=4)](https://github.com/ofbeaton "ofbeaton (53 commits)")

---

Tags

code-stylecodesniffer-ruleslinterCode stylePHP\_CodeSnifferlintcode sniffercoding-style

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ofbeaton-granite-php/health.svg)

```
[![Health](https://phpackages.com/badges/ofbeaton-granite-php/health.svg)](https://phpackages.com/packages/ofbeaton-granite-php)
```

###  Alternatives

[phpcsstandards/phpcsutils

A suite of utility functions for use with PHP\_CodeSniffer

6333.4M58](/packages/phpcsstandards-phpcsutils)[typo3/coding-standards

A set of coding guidelines for any TYPO3-related project or extension

662.8M379](/packages/typo3-coding-standards)[pragmarx/laravelcs

PHP\_CodeSniffer custom Sniff for Laravel coding standard

236111.7k2](/packages/pragmarx-laravelcs)[malukenho/docheader

A small library to check header docs

68380.8k136](/packages/malukenho-docheader)[jubeki/laravel-code-style

Combine Custom Fixers with the ruleset of Laravel Pint to fix your code style in Laravel Applications/Packages.

56521.7k8](/packages/jubeki-laravel-code-style)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20269.1k13](/packages/shopsys-coding-standards)

PHPackages © 2026

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