PHPackages                             kohana/coding-standards - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. kohana/coding-standards

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

kohana/coding-standards
=======================

PHP\_CodeSniffer rules for the Kohana Framework coding style

v0.2.0(11y ago)5817.6k18[2 PRs](https://github.com/kohana/coding-standards/pulls)BSD-3-ClausePHP

Since May 27Pushed 5y ago15 watchersCompare

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

READMEChangelogDependencies (1)Versions (3)Used By (0)

PHP Codesniffer standard for the Kohana Framework
=================================================

[](#php-codesniffer-standard-for-the-kohana-framework)

This package contains a set of coding standard tests for the [kohana](http://kohanaframework.org) PHP framework.
The original tests were written by [Matthew Turland](http://matthewturland.com), see his [github repo](http://github.com/elazar/phpcs-kohana) for more info.

These tests are meant to be a guide and may not be 100% accurate. If you find a bug please report it on the [kohana issue tracker](http://dev.kohanaframework.org).

Requirements
------------

[](#requirements)

These tests are built for usage with [PHP Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer).

Installation - Composer
-----------------------

[](#installation---composer)

Add the package to the development dependencies in your project's composer.json

```
{
    "require-dev": {
        "kohana/coding-standards": "*",
    }
}

```

Run `composer --dev update` to update your composer.lock file and install the package. The sniffs will be installed in `vendor/kohana/coding-standards` in your project root directory and the `phpcs` command will be installed to `bin/phpcs`.

Installation - Manually or with PEAR
------------------------------------

[](#installation---manually-or-with-pear)

If you want the standard to be available system wide you can symlink them into the code sniffer dir like so:

```
git clone https://github.com/kohana/coding-standards.git kohana-coding-standards
cd kohana-coding-standards
sudo ln -sfn `pwd`/Kohana `pear config-get php_dir`/PHP/CodeSniffer/Standards/Kohana
sudo ln -sfn `pwd`/test/PHP_CodeSniffer/CodeSniffer/Standards/Kohana `pear config-get test_dir`/PHP_CodeSniffer/CodeSniffer/Standards/Kohana

```

Running
-------

[](#running)

If you installed with composer, reference the standard from your vendor directory:

```
bin/phpcs --standard=vendor/kohana/coding-standards/Kohana modules/

```

Or, from a raw clone, you can simply reference the local copy:

```
phpcs --standard=path/to/coding-standards/Kohana kohana/core

```

If installed globally (symlinked into PEAR), you can reference the standard like so:

```
phpcs --standard=Kohana application/

```

Customising your project standard
---------------------------------

[](#customising-your-project-standard)

It is also possible to extend the rules in use for your project, or to include some but not all of the Kohana standards (for example, if you are working on something that is not intended as a kohana module). You do this by adding a `coding_standard.xml` to your project root which specifies which rules to include and customises any variables. See the [PHP\_CodeSniffer docs](https://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php) for more details.

Testing
-------

[](#testing)

Like all things code related, sniffs need to be tested! To run the tests they need to be in the codesniffer dir (i.e. you should run the above commands to symlink the sniffs / tests in) and you need to [patch phpcs' AllSniffs.php](http://pear.php.net/bugs/bug.php?id=17902&edit=12&patch=fix-cant-run-symlinked-tests.patch&revision=latest)

Then just run the tests like so:

```
phpunit --bootstrap=`pear config-get php_dir`/PHP/CodeSniffer.php `pear config-get test_dir`/PHP_CodeSniffer/CodeSniffer/Standards/AllSniffs.php

```

### Known issues

[](#known-issues)

- There are some problems with expressions in ternary operators

Please report any new issues to the K3 bug tracker and file it under "PHPCS Coding Standards"

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

4373d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38203?v=4)[Woody Gilk](/maintainers/shadowhand)[@shadowhand](https://github.com/shadowhand)

---

Top Contributors

[![BRMatt](https://avatars.githubusercontent.com/u/20394?v=4)](https://github.com/BRMatt "BRMatt (16 commits)")[![cbandy](https://avatars.githubusercontent.com/u/106560?v=4)](https://github.com/cbandy "cbandy (15 commits)")[![kiall](https://avatars.githubusercontent.com/u/52713?v=4)](https://github.com/kiall "kiall (10 commits)")[![elazar](https://avatars.githubusercontent.com/u/15487?v=4)](https://github.com/elazar "elazar (4 commits)")[![bobeagan](https://avatars.githubusercontent.com/u/100226?v=4)](https://github.com/bobeagan "bobeagan (1 commits)")[![acoulton](https://avatars.githubusercontent.com/u/416566?v=4)](https://github.com/acoulton "acoulton (1 commits)")[![mintbridge](https://avatars.githubusercontent.com/u/32777?v=4)](https://github.com/mintbridge "mintbridge (1 commits)")

---

Tags

standardsphpcsCode stylekohanacode standardcoding stanards

### Embed Badge

![Health badge](/badges/kohana-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/kohana-coding-standards/health.svg)](https://phpackages.com/packages/kohana-coding-standards)
```

###  Alternatives

[phpcompatibility/php-compatibility

A set of sniffs for PHP\_CodeSniffer that checks for PHP cross-version compatibility.

2.3k74.3M1.3k](/packages/phpcompatibility-php-compatibility)[automattic/vipwpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions

25510.2M145](/packages/automattic-vipwpcs)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)[orisai/coding-standard

Strict PHP coding standard

19193.5k62](/packages/orisai-coding-standard)

PHPackages © 2026

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