PHPackages                             sercode/coding-standard-101 - 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. sercode/coding-standard-101

ActiveLibrary

sercode/coding-standard-101
===========================

Easy setup for PHP\_CodeSniffer with extending from another packages with rulesets.

1.0.0(8y ago)03.2k↓100%MITPHPPHP ^7.0

Since Apr 27Pushed 8y agoCompare

[ Source](https://github.com/SerCode/coding-standard-101)[ Packagist](https://packagist.org/packages/sercode/coding-standard-101)[ RSS](/packages/sercode-coding-standard-101/feed)WikiDiscussions master Synced 1mo ago

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

Coding Standard 101
===================

[](#coding-standard-101)

### Easy way to implement coding standards to your project

[](#easy-way-to-implement-coding-standards-to-your-project)

About
-----

[](#about)

Easy

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

[](#requirements)

PHP 5.6 or higher.

Instalation
-----------

[](#instalation)

Easiest and best option via composer. Just add to composer.json

```
"require-dev": {
	"sercode/coding-standard-101": "~0.1"
},

```

or from command line

```
$ composer require sercode/coding-standard-101 --dev

```

Basic usage
-----------

[](#basic-usage)

Run with Code sniffer for check code:

```
vendor/bin/phpcs src --standard=vendor/sercode/coding-standard-101/src/ruleset.xml -p
```

Run this for fix all errors in project:

```
vendor/bin/phpcbf src --standard=vendor/sercode/coding-standard-101/src/ruleset.xml -p
```

That's all for really base usage! This check all files in your project against default `ruleset.xml`

How to be safe
--------------

[](#how-to-be-safe)

### Checking only files in commit

[](#checking-only-files-in-commit)

In case you don't want to use Php\_CodeSniffer manually for every change in the code you make, you can add pre-commit hook via `composer.json`. **Every time you try to commit, Php\_CodeSniffer will run on changed `.php` files for actual commit only.**

##### 1) Manual usage

[](#1-manual-usage)

```
"scripts": {
    "cs-install-prehook": [
		"SerCode\\CodingStandard101\\Composer\\ScriptHandler::addPhpCsToPreCommitHook"
	]
}
```

After you run **composer update** or **composer install** just run:

```
composer cs-install-prehook

```

**For proper use of all features you have to run this script**

*If you don't change path to `ruleset.xml` (see bellow), you don't need to run this script again*

##### 2) if you are lazy or just be sure

[](#2-if-you-are-lazy-or-just-be-sure)

Just add some code:

```
"scripts": {
	"post-install-cmd": [
		"@post-update-cmd"
	],
	"post-update-cmd": [
		"@cs-install-prehook"
	],
	"cs-install-prehook": [
		"SerCode\\CodingStandard101\\Composer\\ScriptHandler::addPhpCsToPreCommitHook"
	]
}
```

This secure install git commit prehook every time when you run **composer update** or **composer install**.

*First case is starts after you run composer install, second when composer update and install prehook with path to `ruleset.xml`. For more information see below.*

**If you want commit without running codesniffer, just add `--no-verify` to commit command**:

```
git commit -m "TEST" --no-verify

```

### Fixing only files in commit

[](#fixing-only-files-in-commit)

To `composer.json` put:

```
"scripts": {
  "fix-cs-commit": [
    "SerCode\\CodingStandard101\\Composer\\ScriptHandler::fixCsCommit"
  ]
}
```

and run

```
composer fix-cs-commit

```

---

Advanced usage
--------------

[](#advanced-usage)

*(will be added)*

You can create own rulest.

Create confgi file `.csStandard` with path to ruleset, inport differetn packages with codding standards and use them in your `ruleset.xml`.

....

---

Setup for MALL
--------------

[](#setup-for-mall)

add to `composer.json` to section require-dev `"sercode/coding-standard-101": "^0.1"` and add block

```
"scripts": {
    "cs-install-prehook": [
        "SerCode\\CodingStandard101\\Composer\\ScriptHandler::addPhpCsToPreCommitHook"
    ],
    "fix-cs-commit": [
        "SerCode\\CodingStandard101\\Composer\\ScriptHandler::fixCsCommit"
    ]
}

```

in root of project create file `.csStandard` with content

```
[ruleset]
0 = phpcs-ruleset.xml

```

run `composer cs-install-prehook` for install

for fix commitig files run script

```
composer fix-cs-commit

```

\*\* Files for fix (or check) MUST be in stage. That means dont commit with adding all files by `-a` option *(git commit -a -m "commit message")* \*\*

---

Inspired by

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~7 days

Total

4

Last Release

3278d ago

Major Versions

0.1.1 → 1.0.02017-05-16

PHP version history (3 changes)0.1.0PHP ^5.6

1.0.0PHP ^7.0

0.1.2PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e32bc80c95f1a5673ce8af883aeefb262fecd853dfaa9f6a4fc1456762a9908?d=identicon)[liner972](/maintainers/liner972)

---

Top Contributors

[![VladimirZahajsky](https://avatars.githubusercontent.com/u/26792538?v=4)](https://github.com/VladimirZahajsky "VladimirZahajsky (6 commits)")[![SerCode](https://avatars.githubusercontent.com/u/20697090?v=4)](https://github.com/SerCode "SerCode (4 commits)")

### Embed Badge

![Health badge](/badges/sercode-coding-standard-101/health.svg)

```
[![Health](https://phpackages.com/badges/sercode-coding-standard-101/health.svg)](https://phpackages.com/packages/sercode-coding-standard-101)
```

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[drupal/coder

Coder is a library to review Drupal code.

3043.6M460](/packages/drupal-coder)[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)[chromatic/usher

A collection of Robo commands for use on Chromatic projects.

13534.3k1](/packages/chromatic-usher)

PHPackages © 2026

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