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
Copy file name to clipboardExpand all lines: README.md
+14-25Lines changed: 14 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,5 @@
1
1
# php-code-quality
2
-
The objective is to include multiple PHP code quality tools in an easy to use Docker image. The
3
-
tools include PHP static analysis, lines of PHP code report, mess detector, code smell highlighting,
4
-
copy/paste detection, and the application compatibility from one version of PHP to another for modernization efforts.
2
+
My objective is to include multiple PHP code quality tools in an easy-to-use Docker image. The tools include PHP static analysis, lines of PHP code report, mess detector, code smell highlighting, copy/paste detection, and the application compatibility from one version of PHP to another for modernization efforts.
5
3
6
4
More specifically the Docker image includes:
7
5
@@ -16,6 +14,8 @@ More specifically the Docker image includes:
16
14
- phpunit/phpunit
17
15
- friendsofphp/php-cs-fixer
18
16
17
+
Now available through both Docker Hub and Github Container Repository. (see below)
18
+
19
19
## Usage
20
20
21
21
Note: This image does nothing when invoking it without a followup command (as shown below in `Some example commands` for each tool), such as:
Also, note the example above is for using the Docker Hub repository. Alternatively, you can also use the Github Package repository as well by prepending `ghcr.io/` to the image identifier, like the following:
29
+
Also, note the example above is for using the Docker Hub repository. Alternatively, you can also use the Github Package repository as well by prepending `ghcr.io/` to the image identifier, like the following: (Replacing the placeholders in angle brackets with your values.)
30
30
31
31
```
32
-
$ cd </path/to/desired/directory>
32
+
$ cd </path/to/your/project>
33
33
$ docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
Windows users: The use of "$PWD" for present working directory will not work as expected, instead use the full path.
38
-
Such as "//c/Users/adamculp/project".
37
+
WINDOWS USERS: The use of "$PWD" for present working directory will not work as expected, instead use the full path. Such as "//c/Users/adamculp/project".
39
38
40
-
In the example above, Docker runs an interactive terminal to be removed when all is completed, and mounts the current host directory ($PWD) inside the container, sets this as the current working directory, and then loads the image adamculp/php-code-quality.
39
+
In the example above, Docker runs an interactive terminal to be removed when all is completed, and mounts the current host directory ($PWD) inside the container, sets this as the current working directory, and then loads the image `adamculp/php-code-quality` or `ghcr.io/adamculp/php-code-quality` as the case may be.
41
40
42
41
Following this the user can add any commands to be executed within the container. (such as running the tools provided by the image)
43
42
44
-
This is the most common use case, enabling the user to run the tools on everything in and/or below the working
45
-
directory.
43
+
This is the most common use case, enabling the user to run the tools on everything in and/or below the working directory.
46
44
47
45
Available commands provided by the adamculp/php-code-quality image:
48
46
47
+
* sh (or any other command) + args
49
48
* php + args
50
49
* composer + args
51
-
* vendor/bin/phpstan + args
52
-
* vendor/bin/phpcs + args
53
-
* vendor/bin/phploc + args
54
-
* vendor/bin/phpmd + args
55
-
* vendor/bin/pdepend + args
56
-
* vendor/bin/phpcpd + args
57
-
* vendor/bin/phpmetrics + args
58
-
* vendor/bin/phpunit + args
59
-
* vendor/bin/php-cs-fixer + args
60
-
61
-
* sh (or any other command) + args
50
+
* vendor/bin/<chosen-tool-command-below> + args
62
51
63
52
### Some example commands:
64
53
@@ -75,7 +64,7 @@ php -d memory_limit=1G
75
64
See [PHPStan Documentation](https://phpstan.org/user-guide/getting-started) for more documentation on use.
Rather than allowing Docker to retrieve the image from the Docker Hub or Github image repositories, users could also build the docker image locally by cloning the image repo from Github.
147
+
Rather than allowing Docker to retrieve the image from the Docker Hub or Github Container Repositories, users may also build the docker image locally by cloning the image repo from Github.
159
148
160
149
Why? As an example, a different version of PHP may be desired. Or a specific version of any tools might be required.
Please star, on [Docker Hub](https://hub.docker.com/repository/docker/adamculp/php-code-quality) and[Github](https://github.com/adamculp/php-code-quality), if you find this helpful.
172
+
Please star, on [Docker Hub](https://hub.docker.com/repository/docker/adamculp/php-code-quality), [Github Container Repository](https://github.com/adamculp/php-code-quality/pkgs/container/php-code-quality), or[Github](https://github.com/adamculp/php-code-quality), if you find this helpful.
0 commit comments