Skip to content

Commit 89f0243

Browse files
authored
Merge pull request #122 from alma-oss/rename-package
Rename the Packagist package to almacareer/coding-standard
2 parents 2c34ae8 + e521dfa commit 89f0243

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Alma Career Coding Standard for PHP
22

3-
[![Latest Stable Version](https://img.shields.io/packagist/v/lmc/coding-standard.svg?style=flat-square)](https://packagist.org/packages/lmc/coding-standard)
3+
[![Latest Stable Version](https://img.shields.io/packagist/v/almacareer/coding-standard.svg?style=flat-square)](https://packagist.org/packages/almacareer/coding-standard)
44

55
PHP coding standard used in [Alma Career][Alma Career] (formerly LMC) products.
66

@@ -9,10 +9,36 @@ various checks to make sure the code is readable, follows the same conventions,
99

1010
We use [EasyCodingStandard][ecs] to define and execute checks created for both [PHP-CS-Fixer] and [PHP_CodeSniffer].
1111

12+
## Switching from lmc/coding-standard
13+
14+
The package `almacareer/coding-standard` is 1:1 replacement for the previous deprecated `lmc/coding-standard` package.
15+
To change the package, you only need to do the following changes in your project:
16+
17+
### 1. Update dependency in composer.json
18+
```diff
19+
- "lmc/coding-standard": "^4.1",
20+
+ "almacareer/coding-standard": "^4.1",
21+
```
22+
23+
and then run `composer update`.
24+
25+
### 2. Change path to ecs.php in your ecs.php
26+
27+
You can also use `SetList:ALMACAREER` instead of explicitly specifying path to the file:
28+
29+
```diff
30+
->withSets(
31+
[
32+
- __DIR__ . '/vendor/lmc-eu/coding-standard/ecs.php',
33+
+ \Lmc\CodingStandard\Set\SetList::ALMACAREER,
34+
]
35+
);
36+
```
37+
1238
## Installation
1339

1440
```bash
15-
composer require --dev lmc/coding-standard
41+
composer require --dev almacareer/coding-standard
1642
```
1743

1844
## Usage

UPGRADE-4.0.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Upgrading from 3.x to 4.0
22

33
### 1. Update dependency in composer.json
4-
In the `require-dev` section of `composer.json` change the version constraint:
4+
In the `require-dev` section of `composer.json` change the version constraint. This also includes
5+
renaming of the package to `almacareer/coding-standard`:
56

67
```diff
78
- "lmc/coding-standard": "^3.3",
8-
+ "lmc/coding-standard": "^4.0",
9+
+ "almacareer/coding-standard": "^4.0",
910
```
1011

1112
Then run `composer update`.
@@ -16,13 +17,14 @@ The configuration now uses `ECSConfig` class instead of `ContainerConfigurator`.
1617
Update your `ecs.php` file to use the new configuration style:
1718

1819
```diff
20+
+use Lmc\CodingStandard\Set\SetList;
1921
-use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2022
+use Symplify\EasyCodingStandard\Config\ECSConfig;
2123

2224
-return static function (ContainerConfigurator $containerConfigurator): void {
2325
+return ECSConfig::configure()
2426
+ ->withSets([
25-
+ __DIR__ . '/vendor/lmc/coding-standard/ecs.php',
27+
+ SetList::ALMACAREER,
2628
+ ]);
2729
// ...
2830
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "lmc/coding-standard",
2+
"name": "almacareer/coding-standard",
33
"description": "Coding standard used in Alma Career projects",
44
"license": "MIT",
55
"type": "library",

0 commit comments

Comments
 (0)