PHPackages                             asispts/ptscs - 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. asispts/ptscs

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

asispts/ptscs
=============

 PSR-12 coding standard with stricter rules

2.1.1(9mo ago)35.7k1[2 issues](https://github.com/asispts/ptscs/issues)[1 PRs](https://github.com/asispts/ptscs/pulls)2MITPHPPHP &gt;=7.2CI passing

Since Apr 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/asispts/ptscs)[ Packagist](https://packagist.org/packages/asispts/ptscs)[ Docs](https://github.com/asispts/ptscs)[ RSS](/packages/asispts-ptscs/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (4)Versions (7)Used By (2)

 ptscs
=====

[](#ptscs)

### » PSR-12 coding standard with stricter rules «

[](#-psr-12-coding-standard-with-stricter-rules-)

[![CI](https://github.com/asispts/ptscs/actions/workflows/ci.yml/badge.svg)](https://github.com/asispts/ptscs/actions/workflows/ci.yml)[![License](https://camo.githubusercontent.com/27978c14bfc0b2161b25577dab9dfb0f495319d6ada9ed2622067be43bd7b094/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f617369737074732f7074736373)](./LICENSE)[![PHP Version](https://camo.githubusercontent.com/61618f66200905748dd9b5157246bfa9e857b399f688545353d2f7877995ce5b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617369737074732f70747363732f6465762d6d61696e)](https://github.com/asispts/ptscs)[![Stable Version](https://camo.githubusercontent.com/7880aa04102cdb9d852b17a00462ea1b15c8efcfc55acb4b2e7870df06683508/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617369737074732f70747363733f6c6162656c3d737461626c65)](https://packagist.org/packages/asispts/ptscs)[![Downloads](https://camo.githubusercontent.com/b64df2b76ce8393600a5d13ceb914a9c3b3e05f17c35c47c25bba569d672ab59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617369737074732f7074736373)](https://packagist.org/packages/asispts/ptscs)

`ptscs` is a [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) ruleset based on **PSR-12** with stricter rules for consistency, readability, and best practices.

Installation
------------

[](#installation)

```
composer require --dev asispts/ptscs
```

Usage
-----

[](#usage)

Create a `phpcs.xml.dist` file in your project root with the following configuration (customize as needed for your project structure):

```

  src
  tests

  vendor

    src/Entity

```

Notable Rules
-------------

[](#notable-rules)

This coding standard uses PSR-12 with some changes and stricter requirements:

1. `declare(strict_types=1)` is required in all PHP files and must be on the same line as the opening tag: ```
