PHPackages                             smile/magento2-smilelab-quality-suite - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. smile/magento2-smilelab-quality-suite

ActiveLibrary[Testing &amp; Quality](/categories/testing)

smile/magento2-smilelab-quality-suite
=====================================

Complete suite of quality tools for Magento projects.

4.0.0(1y ago)560.3k↓41.7%20OSL-3.0

Since Feb 6Pushed 1y ago8 watchersCompare

[ Source](https://github.com/Smile-SA/magento2-smilelab-quality-suite)[ Packagist](https://packagist.org/packages/smile/magento2-smilelab-quality-suite)[ RSS](/packages/smile-magento2-smilelab-quality-suite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (20)

Smile Lab Quality Suite (Magento)
=================================

[](#smile-lab-quality-suite-magento)

This library provides coding standards / rulesets that can be used on Magento projects.

It includes the following packages:

- [Smile Lab PHPCS Coding Standard](https://github.com/Smile-SA/magento2-smilelab-phpcs)
- [Smile Lab PHPMD Ruleset](https://github.com/Smile-SA/magento2-smilelab-phpmd)
- [SmileLab PHPStan Extension](https://github.com/Smile-SA/magento2-smilelab-phpstan)

Table of content
----------------

[](#table-of-content)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Fix your code](#fix-your-code)
- [Ci](#ci)
- [Baseline](#baseline)

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

[](#installation)

```
composer require --dev smile/magento2-smilelab-quality-suite
```

Configuration
-------------

[](#configuration)

Create three files at the root of your project directory:

- phpcs.xml.dist ([example](https://github.com/Smile-SA/magento2-module-debug-toolbar/blob/master/phpcs.xml.dist))
- phpmd.xml.dist ([example](https://github.com/Smile-SA/magento2-module-debug-toolbar/blob/master/phpmd.xml.dist))
- phpstan.neon.dist ([example](https://github.com/Smile-SA/magento2-module-debug-toolbar/blob/master/phpstan.neon.dist))

Usage
-----

[](#usage)

```
# Check registered vulnerabilities
composer audit

# Analyse php syntax
vendor/bin/parallel-lint --exclude vendor [src path]

# Analyse code style
vendor/bin/phpcs

# Analyse code complexity
vendor/bin/phpmd [src path] text phpmd.xml.dist

# Analyse code logic
vendor/bin/phpstan analyse
```

Fix your code
-------------

[](#fix-your-code)

A lot of style errors can be fixed automatically by running this command:

```
vendor/bin/phpcbf --extensions=php,phtml
```

CI
--

[](#ci)

### GitHub Workflow

[](#github-workflow)

Example of `.github/workflows/static-analysis.yaml` file:

```
name: 'Static Analysis'

on:
    pull_request: ~
    push:
        branches:
            - 'master'

jobs:
    tests:
        runs-on: 'ubuntu-latest'

        steps:
            - name: 'Checkout'
              uses: 'actions/checkout@v3'

            - name: 'Install PHP'
              uses: 'shivammathur/setup-php@v2'
              with:
                  php-version: '8.1'
                  coverage: 'none'
                  tools: 'composer:v2'
              env:
                  COMPOSER_AUTH_JSON: |
                      {
                          "http-basic": {
                              "repo.magento.com": {
                                  "username": "${{ secrets.MAGENTO_USERNAME }}",
                                  "password": "${{ secrets.MAGENTO_PASSWORD }}"
                              }
                          }
                      }

            - name: 'Get composer cache directory'
              id: 'composer-cache'
              run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

            - name: 'Cache dependencies'
              uses: 'actions/cache@v3'
              with:
                  path: '${{ steps.composer-cache.outputs.dir }}'
                  key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
                  restore-keys: '${{ runner.os }}-composer-'

            - name: 'Install dependencies'
              run: 'composer install --prefer-dist'

            - name: 'Run composer audit'
              run: 'composer audit --format=plain'

            - name: 'Run Parallel Lint'
              run: 'vendor/bin/parallel-lint --exclude vendor [src path]'

            - name: 'Run PHP CodeSniffer'
              run: 'vendor/bin/phpcs --extensions=php,phtml'

            - name: 'Run PHPMD'
              run: 'vendor/bin/phpmd [src path] xml phpmd.xml.dist'

            - name: 'Run PHPStan'
              run: 'vendor/bin/phpstan analyse'
```

### GitLab Runner

[](#gitlab-runner)

Example of `.gitlab-ci.yml` file:

```
before_script:
  - 'composer install'

sniffers:
    variables:
        COMPOSER_AUTH: $COMPOSER_AUTH
    script:
        - 'composer audit --format=plain'
        - 'vendor/bin/parallel-lint --exclude vendor [src path]'
        - 'vendor/bin/phpcs --extensions=php,phtml'
        - 'vendor/bin/phpmd [src path] text phpmd.xml.dist'
        - 'vendor/bin/phpstan analyse'
    tags:
        - 'php81'
```

Baseline
--------

[](#baseline)

If you want to add this coding standard on an existing project, it might be complicated to fix all issues. The baseline is a mechanism that allows you to keep your legacy code as it is and enforces the quality analysis for the code you will add in the future.

> ❗ **It is always better to fix all issues. Baseline are a tweak to help you have a fresh start. But keep in mind that all errors (in the baseline or not) must be corrected eventually.**

To generate the baselines, run these commands:

```
# PHPCS
composer require --dev digitalrevolution/php-codesniffer-baseline
vendor/bin/phpcs --report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml --extensions=php,phtml

# PHPMD
vendor/bin/phpmd app ansi phpmd.xml.dist --generate-baseline

# PHPSTAN
vendor/bin/phpstan analyse --generate-baseline
```

For phpstan, you'll need to add the file `phpstan-baseline.neon` to the `include` part of the `phpstan.neon.dist` file and config `reportUnmatchedIgnoredErrors: false` to the `parameters` part of the same file.

The baseline files must be added to git.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance46

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community30

Small or concentrated contributor base

Maturity71

Established project with proven stability

 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

Every ~229 days

Recently: every ~478 days

Total

14

Last Release

404d ago

Major Versions

1.1.0 → 2.0.02019-02-27

2.2.0 → 3.0.02022-10-13

3.0.1 → 4.0.02025-04-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c4859b63b960878ef37185d533dbd629247859679dfcdf465259d6a4a488ee7?d=identicon)[romainruaud](/maintainers/romainruaud)

![](https://www.gravatar.com/avatar/53fd29100f3b7087742b99c75f58c5488b95a3858d68636f3ad6d3d8b5f91168?d=identicon)[rbayet](/maintainers/rbayet)

![](https://www.gravatar.com/avatar/965d8c2ff0fdcac3a8b6058d27705410e735b11b6a0e926fcd0cc6c2ce87e4ba?d=identicon)[guvra](/maintainers/guvra)

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

---

Top Contributors

[![guvra](https://avatars.githubusercontent.com/u/3967259?v=4)](https://github.com/guvra "guvra (9 commits)")[![romainruaud](https://avatars.githubusercontent.com/u/15340849?v=4)](https://github.com/romainruaud "romainruaud (7 commits)")[![PierreGauthier](https://avatars.githubusercontent.com/u/4659198?v=4)](https://github.com/PierreGauthier "PierreGauthier (3 commits)")[![afoucret](https://avatars.githubusercontent.com/u/529238?v=4)](https://github.com/afoucret "afoucret (1 commits)")

---

Tags

magento2

### Embed Badge

![Health badge](/badges/smile-magento2-smilelab-quality-suite/health.svg)

```
[![Health](https://phpackages.com/badges/smile-magento2-smilelab-quality-suite/health.svg)](https://phpackages.com/packages/smile-magento2-smilelab-quality-suite)
```

###  Alternatives

[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[moodlehq/moodle-plugin-ci

Helps running Moodle plugins analysis checks and tests under various CI environments.

612.6M](/packages/moodlehq-moodle-plugin-ci)[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32902.4k](/packages/acquia-orca)[vijaycs85/drupal-quality-checker

Setups code quality checking tools for Drupal project.

52192.3k4](/packages/vijaycs85-drupal-quality-checker)[axelerant/drupal-quality-checker

Code quality checking tools for Drupal project.

13197.9k1](/packages/axelerant-drupal-quality-checker)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13176.9k8](/packages/youwe-testing-suite)

PHPackages © 2026

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