You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. PHP_CodeSniffer comes with two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations.
76
80
77
81
```
78
82
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpcs /app
79
83
```
80
84
81
-
#### PHP Copy/Paste Detector (PHPCPD) ####
85
+
#### PHP Copy/Paste Detector (PHPCPD)
86
+
82
87
[PHP Copy/Paste Detector (PHPCPD)](https://github.com/sebastianbergmann/phpcpd) is a Copy/Paste Detector (CPD) for PHP code. It checks all the files under the folder given as a parameter and determines the code blocks which are copied and pasted.
83
88
84
89
```
85
90
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpcpd /app
86
91
```
87
92
88
-
#### PHP Dead Code Detector ####
93
+
#### PHP Dead Code Detector
94
+
89
95
[PHP Dead Code Detector](https://github.com/sebastianbergmann/phpdcd) is a Dead Code Detector (DCD) for PHP code. It scans a PHP project for all declared functions and methods and reports those as being "dead code" that are not called at least once.
90
96
91
97
```
92
98
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpdcd /app
93
99
```
94
100
95
-
#### SensioLabs Security Checker ####
101
+
#### SensioLabs Security Checker
102
+
96
103
**Warning** The tool is deprecated and you can use [Local PHP Security Checker](#local-php-security-checker) instead. Don't use this piece of software anymore as the underlying web service will stop working after the end of January 2021.
97
104
98
105
The [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker) is a command line tool that checks if your application uses dependencies with known security vulnerabilities. It uses the [Security Check Web service](https://security.symfony.com/) and the [Security Advisories Database](https://github.com/FriendsOfPHP/security-advisories).
@@ -101,145 +108,166 @@ The [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker
101
108
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 security-checker security:check /app
102
109
```
103
110
104
-
#### PhpMetrics ####
111
+
#### PhpMetrics
112
+
105
113
[PhpMetrics](https://www.phpmetrics.org/) provides software metrics about PHP project and classes. It generates readable and accessible reports about maintainability, quality and complexity of a source code.
106
114
107
115
```
108
116
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpmetrics /app
109
117
```
110
118
111
-
#### Psecio Parse ####
119
+
#### Psecio Parse
120
+
112
121
[Psecio Parse](https://github.com/psecio/parse) scanner is a static scanning tool to review your PHP code for potential security-related issues. . It requires atleast PHP 7.0.
113
122
114
123
```
115
124
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 psecio-parse scan /app
116
125
```
117
-
#### PHP VarDump Check ####
126
+
127
+
#### PHP VarDump Check
128
+
118
129
[PHP VarDump Check](https://github.com/php-parallel-lint/PHP-Var-Dump-Check) is a PHP console application for finding forgotten variable dump lines. It supports PHP build in method print_r, var_dump and var_export methods and also methods from Tracy debugger, Ladybug, Symfony, Laravel, Doctrine and Zend Framework.
119
130
120
131
```
121
132
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 var-dump-check /app
122
133
```
123
134
124
-
#### PHP Parallel Lint ####
135
+
#### PHP Parallel Lint
136
+
125
137
[PHP Parallel Lint](https://github.com/php-parallel-lint/PHP-Parallel-Lint) checks syntax of PHP files faster than serial check with a fancier output. Running parallel jobs in PHP is inspired by Nette framework tests.
126
138
127
139
```
128
140
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 parallel-lint /app
129
141
```
130
142
131
-
#### PHP Magic Number Detector (PHPMND) ####
143
+
#### PHP Magic Number Detector (PHPMND)
144
+
132
145
[PHP Magic Number Detector (PHPMND)](https://github.com/povils/phpmnd) is a tool that aims to help you to detect [magic numbers](https://github.com/povils/phpmnd#what-is-a-magic-number) in your PHP code. By default 0 and 1 are not considered to be magic numbers. This tool is incompatible with PHP 8.0.
133
146
134
147
```
135
148
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpmnd /app
136
149
```
137
150
138
-
#### PHP Assumptions ####
151
+
#### PHP Assumptions
152
+
139
153
[PHP Assumptions](https://github.com/rskuipers/php-assumptions) is the result of a proof of concept inspired by the "From assumptions to assertions" blog post. It's a static code analysis tool doing checks for weak assumptions.
140
154
141
155
```
142
156
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpa /app
143
157
```
144
158
145
-
#### churn-php ####
159
+
#### churn-php
160
+
146
161
[churn-php](https://github.com/bmitch/churn-php) is a package that helps you identify php files in your project that could be good candidates for refactoring. It requires atleast PHP 7.1.
147
162
148
163
```
149
164
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 churn run src /app
150
165
```
151
166
152
-
#### Fink ####
167
+
#### Fink
168
+
153
169
[Fink](https://github.com/dantleech/fink) (pronounced "Phpink") is a command line tool for checking HTTP links written in PHP. It requires atleast PHP 7.1.
154
170
155
171
```
156
172
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 fink http://yoursite.domain
157
173
```
158
174
159
-
#### PHPMD ####
175
+
#### PHPMD
176
+
160
177
[PHPMD](https://github.com/phpmd/phpmd) is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. [PHPMD](https://github.com/phpmd/phpmd) can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.
161
178
162
179
```
163
180
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpmd /app text codesize,unusedcode,naming
164
181
```
165
182
166
-
#### PHP_Testability ####
183
+
#### PHP_Testability
184
+
167
185
[PHP_Testability](https://github.com/edsonmedina/php_testability) analyses and produces a report with testability issues of a php codebase. It requires atleast PHP 7.0.
168
186
169
187
```
170
188
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 testability /app -o report
171
189
```
172
190
173
-
#### composer-normalize ####
191
+
#### composer-normalize
192
+
174
193
[composer-normalize](https://github.com/ergebnis/composer-normalize) Provides a composer plugin for normalizing `composer.json`. It requires atleast PHP 7.1.
175
194
176
195
```
177
196
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 cd /app && composer normalize
178
197
```
179
198
180
-
#### infection ####
199
+
#### infection
200
+
181
201
[Infection](https://infection.github.io/) is a PHP mutation testing framework based on AST (Abstract Syntax Tree) mutations. It works as a CLI tool and can be executed from your project’s root.
182
202
183
203
```
184
204
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 infection
185
205
```
186
206
187
-
#### Deptrac ####
207
+
#### Deptrac
208
+
188
209
[Deptrac](https://github.com/sensiolabs-de/deptrac) is a static code analysis tool that helps to enforce rules for dependencies between software layers in your PHP projects. It requires atleast PHP 7.1.
189
210
190
-
#### PHP Insights ####
191
-
[PHP Insights](https://phpinsights.com/) was carefully crafted to simplify the analysis of your code directly from your terminal. It requires atleast PHP 7.2 and It is not supporting PHP 8.0 for now.
211
+
#### PHP Insights
212
+
213
+
[PHP Insights](https://phpinsights.com/) was carefully crafted to simplify the analysis of your code directly from your terminal. It requires atleast PHP 7.2 and It is not supporting PHP 8.0 for now.
192
214
193
215
```
194
216
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.3 phpinsights
195
217
```
196
218
197
-
#### PHPStan ####
219
+
#### PHPStan
220
+
198
221
[PHPStan](https://github.com/phpstan/phpstan) focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It requires atleast PHP 7.1.
199
222
200
223
```
201
224
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.3 phpstan analyse
202
225
```
203
226
204
-
#### Local PHP Security Checker ####
227
+
#### Local PHP Security Checker
228
+
205
229
[The Local PHP Security Checker](https://github.com/fabpot/local-php-security-checker) is a command line tool that checks if your PHP application depends on PHP packages with known security vulnerabilities. It uses the [Security Advisories Database](https://github.com/FriendsOfPHP/security-advisories).
206
230
207
231
```
208
232
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.3 local-php-security-checker --path=/app/composer.lock
209
233
```
210
234
211
-
#### Pint ####
235
+
#### Pint
236
+
212
237
[Pint](https://github.com/laravel/pint) is an opinionated PHP code style fixer for minimalists. Pint is built on top of [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) and makes it simple to ensure that your code style stays clean and consistent. Pint requires atleast PHP 8.0.
213
238
214
239
```
215
240
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:8.1 pint
216
241
```
217
242
218
-
## Custom Tools ##
243
+
## Custom Tools
244
+
219
245
-**Gitignore Checker:**`gitignore_checker` checks the .gitignore file under the directory that the command executed and finds if there are file or files both in the git ignore file and the repository.
220
-
-**Git Merge Conflict Marker Checker:**`merge_conflict_checker` checks all the files in the given folder (current folder is checked if not given) to find the forgotten merge conflict markers like "<<<<<<< HEAD".
246
+
-**Git Merge Conflict Marker Checker:**`merge_conflict_checker` checks all the files in the given folder (current folder is checked if not given) to find the forgotten merge conflict markers like "<<<<<<< HEAD".
247
+
248
+
## How to use images locally
221
249
222
-
## How to use images locally ##
223
-
* A sample execution for [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer);
250
+
- A sample execution for [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer);
224
251
225
252
```
226
253
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 phpcs /app
227
254
```
228
255
229
-
* A sample execution for [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker);
256
+
- A sample execution for [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker);
230
257
231
258
```
232
259
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 security-checker security:check /app/composer.lock
233
260
```
234
261
235
-
* A sample execution for [Psecio Parse](https://github.com/psecio/parse);
262
+
- A sample execution for [Psecio Parse](https://github.com/psecio/parse);
236
263
237
264
```
238
265
docker run -v /path/to/project:/app umutphp/php-docker-images-for-ci:7.1 /root/.composer/vendor/bin/psecio-parse scan /app
239
266
```
240
267
241
-
## How to Use in Gitlab CI ##
242
-
You need to enable Docker executors on Gitlab CI. You can find sample job definitions for executing the tools on Gitlab CI pipeline for your repo.
268
+
## How to Use in Gitlab CI
269
+
270
+
You need to enable Docker executors on Gitlab CI. You can find sample job definitions for executing the tools on Gitlab CI pipeline for your repo.
243
271
244
272
A sample job definition for [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer);
245
273
@@ -249,7 +277,7 @@ code_sniffer:
249
277
image: umutphp/php-docker-images-for-ci:7.1
250
278
script:
251
279
- cd /path/to/code/base
252
-
- phpcs
280
+
- phpcs
253
281
```
254
282
255
283
A sample job definition for [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker);
@@ -272,7 +300,8 @@ security_psecio_parse:
272
300
- psecio-parse scan /path/to/your/codebase/
273
301
```
274
302
275
-
## How to Use in CircleCI ##
303
+
## How to Use in CircleCI
304
+
276
305
You can make some static code checks before bulding and testing your application on CircleCI.
277
306
278
307
```
@@ -285,19 +314,19 @@ jobs:
285
314
- image: umutphp/php-docker-images-for-ci:7.2
286
315
steps:
287
316
- checkout
288
-
- run:
317
+
- run:
289
318
name: Composer-normalize
290
319
no_output_timeout: 20m
291
320
command: composer normalize --dry-run
292
-
- run:
321
+
- run:
293
322
name: PHP-Lint
294
323
no_output_timeout: 20m
295
324
command: parallel-lint --exclude vendor .
296
-
- run:
325
+
- run:
297
326
name: Var-Dump-Check
298
327
no_output_timeout: 20m
299
328
command: var-dump-check .
300
-
- run:
329
+
- run:
301
330
name: Merge-Conflict-Checker
302
331
no_output_timeout: 20m
303
332
command: merge_conflict_checker .
@@ -308,9 +337,10 @@ workflows:
308
337
- checks
309
338
```
310
339
340
+
## How To Contribute
311
341
312
-
## How To Contribute ##
313
342
Please read the instructions in [CONTRIBUTING.md](CONTRIBUTING.md) file.
314
343
315
-
## Code of Conduct ##
344
+
## Code of Conduct
345
+
316
346
See [CODE_OF_CONDUCT](CODE_OF_CONDUCT) for information.
0 commit comments