Skip to content

Commit 9cd07be

Browse files
style(coding): Add dev dependency to phpcs
1 parent 3d0c128 commit 9cd07be

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"symfony/var-dumper": "^5.2",
4242
"phpunit/phpunit": "8.5.21",
4343
"clean/phpdoc-md": "^0.19.1",
44-
"phpmd/phpmd": "@stable"
44+
"phpmd/phpmd": "@stable",
45+
"squizlabs/php_codesniffer": "^3.6.2"
4546
}
4647
}

docs/ddev.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ LAPI will advise you to ban this IP as it's within the 1.2.3.4/30 range.
221221

222222
### Coding standards
223223

224-
#### PHPCS
224+
#### PHPCS Fixer
225225

226226
We are using the [PHP Coding Standards Fixer](https://cs.symfony.com/)
227227

@@ -239,9 +239,23 @@ ddev phpcsfixer my-own-modules/crowdsec-php-lib tools/php-cs-fixer
239239

240240
#### PHP Mess Detector
241241

242-
To use the `phpmd` tool, you can run:
242+
To use the [PHPMD](https://github.com/phpmd/phpmd) tool, you can run:
243243

244244
```
245245
ddev phpmd ./my-own-modules/crowdsec-php-lib tools/phpmd/rulesets.xml src
246246
247+
```
248+
249+
#### PHPCS and PHPCBF
250+
251+
To use [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) tools, you can run:
252+
253+
```
254+
ddev phpcs ./my-own-modules/crowdsec-php-lib/vendor/bin/phpcs my-own-modules/crowdsec-php-lib/src
255+
```
256+
257+
and:
258+
259+
```
260+
ddev phpcbf ./my-own-modules/crowdsec-php-lib/vendor/bin/phpcs my-own-modules/crowdsec-php-lib/src
247261
```

0 commit comments

Comments
 (0)