PHPackages                             almacareer/coding-standard - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. almacareer/coding-standard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

almacareer/coding-standard
==========================

Coding standard used in Alma Career projects

5.0.0(9mo ago)1739.1k↓53.9%11[3 issues](https://github.com/alma-oss/php-coding-standard/issues)[1 PRs](https://github.com/alma-oss/php-coding-standard/pulls)1MITPHPPHP ^8.0CI passing

Since Apr 3Pushed 7mo ago8 watchersCompare

[ Source](https://github.com/alma-oss/php-coding-standard)[ Packagist](https://packagist.org/packages/almacareer/coding-standard)[ RSS](/packages/almacareer-coding-standard/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (11)Versions (33)Used By (1)

Alma Career Coding Standard for PHP
===================================

[](#alma-career-coding-standard-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/09deb875f3686c7ba3c2024f6bd5b4dc920b3437327fb6c3e87757bb6ec3303f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6d616361726565722f636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/almacareer/coding-standard)

PHP coding standard used in [Alma Career](https://www.almacareer.com/) (formerly LMC) products.

The standard is based on [PSR-12](https://www.php-fig.org/psr/psr-12/) and partially [PER 2.0](https://www.php-fig.org/per/coding-style/) and adds various checks to make sure the code is readable, follows the same conventions, and does not contain common mistakes.

We use [EasyCodingStandard](https://github.com/easy-coding-standard/easy-coding-standard) to define and execute checks created for both [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) and [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).

Switching from lmc/coding-standard
----------------------------------

[](#switching-from-lmccoding-standard)

The package `almacareer/coding-standard` is 1:1 replacement for the previous deprecated `lmc/coding-standard` package.

⚠️ **Note:** Starting from version 5.0.0, the namespace has changed from `Lmc\CodingStandard` to `AlmaOss\CodingStandard`. See [UPGRADE-5.0.md](UPGRADE-5.0.md) for detailed upgrade instructions.

To change the package, you only need to do the following changes in your project:

### 1. Update dependency in composer.json

[](#1-update-dependency-in-composerjson)

```
-        "lmc/coding-standard": "^4.1",
+        "almacareer/coding-standard": "^5.0",
```

And then run `composer update`.

### 2. Change path to ecs.php in your ecs.php

[](#2-change-path-to-ecsphp-in-your-ecsphp)

You can also use `SetList::ALMACAREER` instead of explicitly specifying path to the file:

```
    ->withSets(
        [
-            __DIR__ . '/vendor/lmc-eu/coding-standard/ecs.php',
+            \AlmaOss\CodingStandard\Set\SetList::ALMACAREER,
        ]
    );
```

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

[](#installation)

```
composer require --dev almacareer/coding-standard
```

Usage
-----

[](#usage)

1. Create `ecs.php` file in the root directory of your project and import the code-style rules:

```
