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

Abandoned → [ofbeaton/granite-php](/?search=ofbeaton%2Fgranite-php)Library

ofbeaton/granite
================

Opinionated PHP Coding Style enforcement for PHP

6.9.0(7y ago)11.5k↓34.6%[21 issues](https://github.com/ofbeaton/granite/issues)2MIT

Since Jul 25Pushed 7y ago2 watchersCompare

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

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

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

Community11

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/health.svg)

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

###  Alternatives

[laravel/pint

An opinionated code formatter for PHP.

3.1k147.7M13.2k](/packages/laravel-pint)[symplify/easy-coding-standard

Use Coding Standard with 0-knowledge of PHP-CS-Fixer and PHP\_CodeSniffer.

1.6k34.6M1.5k](/packages/symplify-easy-coding-standard)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

598161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[overtrue/phplint

`phplint` is a tool that can speed up linting of php files by running several lint processes at once.

1.0k13.2M726](/packages/overtrue-phplint)[php-parallel-lint/php-parallel-lint

This tool checks the syntax of PHP files about 20x faster than serial check.

35455.8M1.7k](/packages/php-parallel-lint-php-parallel-lint)[phpcsstandards/phpcsextra

A collection of sniffs and standards for use with PHP\_CodeSniffer.

10324.3M44](/packages/phpcsstandards-phpcsextra)

PHPackages © 2026

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