PHPackages                             strictphp/conventions - 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. strictphp/conventions

ActiveLibrary

strictphp/conventions
=====================

Our code conventions forced by PHPStan, Easy Coding Standard, RectorPHP and appropriate custom rules and configs.

v1.0.5(1y ago)0806↑150%[1 issues](https://github.com/strictphp/conventions/issues)[1 PRs](https://github.com/strictphp/conventions/pulls)2MITPHPPHP &gt;=8.1

Since Apr 6Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/strictphp/conventions)[ Packagist](https://packagist.org/packages/strictphp/conventions)[ RSS](/packages/strictphp-conventions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (2)

StrictPHP Conventions
=====================

[](#strictphp-conventions)

[![.github/banner.webp](.github/banner.webp)](.github/banner.webp)

[![Latest Stable Version](https://camo.githubusercontent.com/dcb90cb4fbc00418d829c382a04c0297b05d0cafa721414516ebe52eb6c5d998/68747470733a2f2f706f7365722e707567782e6f72672f7374726963747068702f636f6e76656e74696f6e732f76)](https://packagist.org/packages/strictphp/conventions)[![Total Downloads](https://camo.githubusercontent.com/98b0195694f8d009009dee05abf5c8efbf3de590fe742697ad10e280357d5d1b/68747470733a2f2f706f7365722e707567782e6f72672f7374726963747068702f636f6e76656e74696f6e732f646f776e6c6f616473)](https://packagist.org/packages/strictphp/conventions)[![License](https://camo.githubusercontent.com/e2bea49a842c0a5661a516af7fceea060be1cbfa82cdb42280c5bca71758692d/68747470733a2f2f706f7365722e707567782e6f72672f7374726963747068702f636f6e76656e74696f6e732f6c6963656e7365)](https://packagist.org/packages/strictphp/conventions)[![PHP Version Require](https://camo.githubusercontent.com/9070ee66815e0063de2183b15fe6a007a6a0855772841472229d8fbb6e8f7a74/68747470733a2f2f706f7365722e707567782e6f72672f7374726963747068702f636f6e76656e74696f6e732f726571756972652f706870)](https://packagist.org/packages/strictphp/conventions)

Welcome to StrictPHP Conventions, a Composer package designed to standardize PHP code across various our projects. This package is an assembly of tools and configurations to enhance code quality, maintainability, and adherence to best practices. It's crafted with care for developers seeking consistency and excellence in their projects, and we encourage its adoption. Pull Requests are welcome!

Features Included
-----------------

[](#features-included)

This package bundles a selection of powerful tools and configurations to support your development workflow:

- **PHPStan Configuration and Custom Rules**: Integrates [PHPStan](https://phpstan.org), with pre-defined configurations and rules tailored for our projects.
- **Easy Coding Standard Configuration**: Utilizes [Easy Coding Standard](https://github.com/symplify/coding-standard)for enforcing consistent coding styles and practices.
- **PHPUnit 10/11 Support**: Ensures compatibility with [PHPUnit](https://phpunit.de) to facilitate comprehensive testing.
- **RectorPHP Configuration**: Provides configurations for [RectorPHP](https://getrector.org) for better code quality.
- **Extended PHPStan Packages**: Includes additional packages to augment PHPStan's capabilities. For more details, see the included `composer.json` file.

For Laravel use [LaraStrict conventions](https://github.com/larastrict/conventions).

Prerequisites
-------------

[](#prerequisites)

Before installing, please ensure your environment meets the following requirements:

- PHP version 8.1 or higher.
- Composer
- Enabled [Extension installer for PHPStan](https://github.com/phpstan/extension-installer) - it is installed by our package to allow extension discovery.

**Only latest major version of this package is maintained.**

VersionPHPUnitPHP1.x10/118.1+0.x98.1+Installation
------------

[](#installation)

To incorporate StrictPHP Conventions into your project, simply run the following command in your terminal:

```
composer require strictphp/conventions --dev
```

This will install the package as a development dependency. You will be asked to confirm the installation of the plugin:

> Do you trust "phpstan/extension-installer" to execute code and wish to enable it now? (yes/no) \[y\]:

Type `y` to use all the extensions provided by the package.

Getting Started
---------------

[](#getting-started)

After installation, you can extend the provided configurations to suit your project's specific needs.

### Setting Up Easy Coding Standard

[](#setting-up-easy-coding-standard)

To use the Easy Coding Standard, create an `ecs.php` file at your project's root with this setup or update your configuration:

```
