Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 51de174

Browse files
committed
Minor edits for usability
Signed-off-by: adamculp <adamculp@uws.net>
1 parent 837d20e commit 51de174

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

‎README.md‎

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# 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.
53

64
More specifically the Docker image includes:
75

@@ -16,6 +14,8 @@ More specifically the Docker image includes:
1614
- phpunit/phpunit
1715
- friendsofphp/php-cs-fixer
1816

17+
Now available through both Docker Hub and Github Container Repository. (see below)
18+
1919
## Usage
2020

2121
Note: This image does nothing when invoking it without a followup command (as shown below in `Some example commands` for each tool), such as:
@@ -26,39 +26,28 @@ $ docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
2626
adamculp/php-code-quality:latest <followup-command-with-arguments>
2727
```
2828

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:
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.)
3030

3131
```
32-
$ cd </path/to/desired/directory>
32+
$ cd </path/to/your/project>
3333
$ docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
34-
ghcr.io/adamculp/php-code-quality:latest <followup-command-with-arguments>
34+
adamculp/php-code-quality:latest <followup-command-with-arguments>
3535
```
3636

37-
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".
3938

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.
4140

4241
Following this the user can add any commands to be executed within the container. (such as running the tools provided by the image)
4342

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.
4644

4745
Available commands provided by the adamculp/php-code-quality image:
4846

47+
* sh (or any other command) + args
4948
* php + args
5049
* 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
6251

6352
### Some example commands:
6453

@@ -75,7 +64,7 @@ php -d memory_limit=1G
7564
See [PHPStan Documentation](https://phpstan.org/user-guide/getting-started) for more documentation on use.
7665

7766
```
78-
$ docker run -it --rm --name php-code-quality -v "$PWD":/usr/src/myapp -w /usr/src/myapp ghcr.io/adamculp/php-code-quality:latest sh -c 'php /usr/local/lib/php-code-quality/vendor/bin/phpstan analyse -l 0 --error-format=table > ./php_code_quality/phpcompatibility_results.txt .'
67+
$ docker run -it --rm --name php-code-quality -v "$PWD":/usr/src/myapp -w /usr/src/myapp adamculp/php-code-quality:latest sh -c 'php /usr/local/lib/php-code-quality/vendor/bin/phpstan analyse -l 0 --error-format=table > ./php_code_quality/phpstan_results.txt .'
7968
```
8069

8170
#### PHP Codesniffer (phpcs)
@@ -155,7 +144,7 @@ php /usr/local/lib/php-code-quality/vendor/bin/phpmetrics --excluded-dirs 'vendo
155144

156145
## Alternative Preparations
157146

158-
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.
159148

160149
Why? As an example, a different version of PHP may be desired. Or a specific version of any tools might be required.
161150

@@ -180,4 +169,4 @@ $ docker build -t adamculp/php-code-quality https://github.com/adamculp/php-code
180169

181170
## Enjoy!
182171

183-
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /