Skip to content

Commit 5fcca66

Browse files
authored
[TASK] Provide the code language in the code snippets in the README (#239)
This enables syntax highlighting when rendering the README. Also update the copyright year.
1 parent 5956454 commit 5fcca66

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

.github/CONTRIBUTING.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ code coverage of the fixed bugs and the new features.
7878

7979
To run the existing unit tests, run this command:
8080

81-
vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/
81+
```bash
82+
vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Unit/
83+
```
8284

8385
### Running the integration tests
8486

@@ -90,14 +92,18 @@ schema once. Assuming that your database is named `phplist_test`, the user is
9092
named `phplist`, and the password is `batterystaple`, the command looks like
9193
this:
9294

93-
mysql -u phplist_test --password=batterystaple phplist_test < Database/Schema.sql
95+
```bash
96+
mysql -u phplist_test --password=batterystaple phplist_test < Database/Schema.sql
97+
```
9498

9599
For running the integration tests, please first enter the database name
96100
and access credentials in `Configuration/parameters.yml`.
97101

98102
After that has been done, you can run the integration tests:
99103

100-
vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
104+
```bash
105+
vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
106+
```
101107

102108

103109
## Coding Style
@@ -111,18 +117,27 @@ We will only merge pull requests that follow the project's coding style.
111117

112118
Please check your code with the provided PHP_CodeSniffer standard:
113119

114-
vendor/bin/phpcs --standard=Configuration/PhpCodeSniffer/ bin/ Classes/ Tests/ web/
120+
```bash
121+
vendor/bin/phpcs --standard=Configuration/PhpCodeSniffer/ bin/ Classes/ Tests/ web/
122+
```
115123

116124
Please also check the code structure using PHPMD:
117125

118-
vendor/bin/phpmd Classes/ text Configuration/PHPMD/rules.xml
126+
```bash
127+
vendor/bin/phpmd Classes/ text Configuration/PHPMD/rules.xml
128+
```
119129

120130
And also please run the static code analysis:
121131

122-
vendor/bin/phpstan analyse -l 5 bin/ Classes/ Tests/ web/
132+
```bash
133+
vendor/bin/phpstan analyse -l 5 bin/ Classes/ Tests/ web/
134+
```
123135

124136
You can also run all code style checks using one long line from a bash shell:
125-
find Classes/ Tests/ web/ core/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l && php -l bin/* && vendor/bin/phpstan analyse -l 5 bin/ Classes/ Tests/ web/ && vendor/bin/phpmd Classes/ text Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=Configuration/PhpCodeSniffer/ bin/ Classes/ Tests/ web/
137+
138+
```bash
139+
find Classes/ Tests/ web/ core/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l && php -l bin/* && vendor/bin/phpstan analyse -l 5 bin/ Classes/ Tests/ web/ && vendor/bin/phpmd Classes/ text Configuration/PHPMD/rules.xml && vendor/bin/phpcs --standard=Configuration/PhpCodeSniffer/ bin/ Classes/ Tests/ web/
140+
```
126141

127142
This will execute all tests except for the unit tests and the integration
128143
tests.

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ Please first set the database credentials in `Configuration/parameters.yml`.
7070
For running the application in development mode using the built-in PHP server,
7171
use this command:
7272

73-
bin/console server:run -d web/
73+
```bash
74+
bin/console server:run -d web/
75+
```
7476

7577
The server will then listen on `http://127.0.0.1:8000` (or, if port 8000 is
7678
already in use, on the next free port after 8000).
@@ -82,7 +84,9 @@ You can stop the server with CTRL + C.
8284
To run the server in testing mode (which normally will only be needed for the
8385
automated tests, provide the `--env` option:
8486

85-
bin/console server:run -d web/ --env=test
87+
```bash
88+
bin/console server:run -d web/ --env=test
89+
```
8690

8791
### Production
8892

@@ -110,7 +114,7 @@ have the type `phplist-module`.
110114
If your module provides any Symfony bundles, the bundle class names need to be
111115
listed in the `extra` section of the module's `composer.json` like this:
112116

113-
````
117+
```json
114118
"extra": {
115119
"phplist/phplist4-core": {
116120
"bundles": [
@@ -119,7 +123,7 @@ listed in the `extra` section of the module's `composer.json` like this:
119123
]
120124
}
121125
}
122-
````
126+
```
123127

124128
Please note that the key of the section with `extra` needs to always be
125129
`phplist/phplist4-core`, not the name of your module package. Please have a
@@ -130,7 +134,7 @@ for an example.
130134
Similarly, if your module provides any routes, those also need to be listed in
131135
the `extra` section of the module's `composer.json` like this:
132136

133-
````
137+
```json
134138
"extra": {
135139
"phplist/phplist4-core": {
136140
"routes": {
@@ -141,11 +145,11 @@ the `extra` section of the module's `composer.json` like this:
141145
}
142146
}
143147
}
144-
````
148+
```
145149

146150
You can also provide system configuration for your module:
147151

148-
````
152+
```json
149153
"extra": {
150154
"phplist/phplist4-core": {
151155
"configuration": {
@@ -159,7 +163,7 @@ You can also provide system configuration for your module:
159163
}
160164
}
161165
}
162-
````
166+
```
163167

164168
It is recommended to define the routes using
165169
[annotations](https://symfony.com/doc/current/routing.html#routing-examples)
@@ -194,4 +198,4 @@ phpList module), please use the
194198

195199
## Copyright
196200

197-
phpList is copyright (C) 2000-2017 [phpList Ltd](https://www.phplist.com/).
201+
phpList is copyright (C) 2000-2018 [phpList Ltd](https://www.phplist.com/).

0 commit comments

Comments
 (0)