PHPackages                             vishwac09/extended-php-guidelines - 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. vishwac09/extended-php-guidelines

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

vishwac09/extended-php-guidelines
=================================

Provides set of additional coding/style guidelines to sniff PHP code.

1.0.0(4y ago)02GPL-2.0+PHPPHP &gt;=7.1

Since Mar 1Pushed 4y ago1 watchersCompare

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

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

Extended PHP Guidelines
=======================

[](#extended-php-guidelines)

Apart from the [PSR-1](https://www.php-fig.org/psr/psr-1/), [PSR-2](https://www.php-fig.org/psr/psr-2/), [PSR-12](https://www.php-fig.org/psr/psr-12/)and the [Drupal](https://www.drupal.org/docs/develop/standards) standard's, we follow few [more](#List) to achieve consistency of code project wide.

I work mostly on Drupal projects, so normally use the Drupal Coding standard to sniff the custom code for any violations. This PHP library is a type of PHP-CodeSniffer standard which checks PHP code against the below list.

List
----

[](#list)

1. Order of imports - `Group Drupal/Symfony imports and third party libraries added via composer separately.`
2. Avoid Switch case - `PHP >= 8.0 provides match() {} expression, can be replaced in place of switch() case:.`
3. Avoid Static Class references - `Cannot be injected.`
4. Order of member functions - `Order member function in ascending order, improves readability.`

Usage
-----

[](#usage)

Create a project, and add this packages as **DEV** dependancy.

#### Installation

[](#installation)

Add via composer as local dependencies

```
composer require --dev dealerdirect/phpcodesniffer-composer-installer
composer require --dev vishwac09/extended-php-guidelines

```

**OR**

Add via composer as global dependencies

```
composer require global --dev dealerdirect/phpcodesniffer-composer-installer
composer require global --dev vishwac09/extended-php-guidelines

```

Add via GIT

```
git clone git@github.com:vishwac09/extended-php-guidelines.git

```

add the standard to phpcs

```
phpcs --config-set installed_paths /path/to/extended-php-guidelines/EPG

```

### Run

[](#run)

Check if the new stanadard is configures with phpcs.

```
phpcs -i

```

Sniff code for the above violation.

```
phpcs --standard=EPG --colors file1.php, file2.inc

```

### Example

[](#example)

```
FILE: /Users/hp/Documents/temp.php
------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------
  1 | WARNING | Group Drupal/Symfony imports and third party libraries added via composer separately.
 26 | WARNING | Member functions of class must be defined in ascending order
 28 | WARNING | Do not use static class references.
 40 | WARNING | Member functions of interface must be defined in ascending order
 50 | WARNING | Do not use switch expression. With PHP >= 8.0 use the new match expression
    |         | (https://www.php.net/manual/en/control-structures.match.php).
------------------------------------------------------------------------------------------------------

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1533d ago

### Community

Maintainers

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

---

Top Contributors

[![vishwac09](https://avatars.githubusercontent.com/u/7726776?v=4)](https://github.com/vishwac09 "vishwac09 (2 commits)")

---

Tags

phpphpcs-standardstandardsphpcscode review

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vishwac09-extended-php-guidelines/health.svg)

```
[![Health](https://phpackages.com/badges/vishwac09-extended-php-guidelines/health.svg)](https://phpackages.com/packages/vishwac09-extended-php-guidelines)
```

###  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)[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[automattic/vipwpcs

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

25510.2M145](/packages/automattic-vipwpcs)[mayflower/mo4-coding-standard

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

17508.3k5](/packages/mayflower-mo4-coding-standard)[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)

PHPackages © 2026

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