Skip to content

Commit

Permalink
[TASK] Provide the source code language in the code snippets in the R…
Browse files Browse the repository at this point in the history
…EADME

This enables syntax highlighting when rendering the README.
  • Loading branch information
Oliver Klee committed Jan 4, 2018
1 parent ad95c5f commit f4ad88c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
24 changes: 18 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ schema once. Assuming that your database is named `phplist_test`, the user is
named `phplist`, and the password is `batterystaple`, the command looks like
this:

mysql -u phplist_test --password=batterystaple phplist_test < vendor/phplist/phplist4-core/Database/Schema.sql
```bash
mysql -u phplist_test --password=batterystaple phplist_test < vendor/phplist/phplist4-core/Database/Schema.sql
```

When running the integration tests, you will need to specify the database name
and access credentials on the command line (in the same line):

PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
```bash
PHPLIST_DATABASE_NAME=phplist_test PHPLIST_DATABASE_USER=phplist PHPLIST_DATABASE_PASSWORD=batterystaple vendor/bin/phpunit -c Configuration/PHPUnit/phpunit.xml Tests/Integration/
```


## Coding Style
Expand All @@ -103,18 +107,26 @@ We will only merge pull requests that follow the project's coding style.

Please check your code with the provided PHP_CodeSniffer standard:

vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
```bash
vendor/bin/phpcs --standard=vendor/phplist/phplist4-core/Configuration/PhpCodeSniffer/ Classes/ Tests/
```

Please also check the code structure using PHPMD:

vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml
```bash
vendor/bin/phpmd Classes/ text vendor/phplist/phplist4-core/Configuration/PHPMD/rules.xml
```

And also please run the static code analysis:

vendor/bin/phpstan analyse -l 5 Classes/ Tests/
```bash
vendor/bin/phpstan analyse -l 5 Classes/ Tests/
```

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

This will execute all tests except for the unit tests and the integration
tests.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ increase web server performance:
For running the application in development mode using the built-in PHP server,
use this command:

bin/console server:run -d web/
```bash
bin/console server:run -d web/
```

The server will then listen on `http://127.0.0.1:8000` (or, if port 8000 is
already in use, on the next free port after 8000).
Expand All @@ -136,14 +138,18 @@ You can stop the server with CTRL + C.
To run the server in testing mode (which normally will only be needed for the
automated tests, provide the `--env` option:

bin/console server:run -d web/ --env=test
```bash
bin/console server:run -d web/ --env=test
```


## Useful Composer scripts

You can get a list of all installed phpList modules with this command:

composer run-script list-modules
```bash
composer run-script list-modules
```


## Creating a .tar.gz package of this distribution
Expand Down

0 comments on commit f4ad88c

Please sign in to comment.