Skip to content

Commit

Permalink
Apply suggestion from review and improve markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-mxp committed Feb 18, 2024
1 parent 21f15df commit b3c1b94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,60 @@

Exercism exercises in PHP

Follow these instructions, if you want to contribute to the track.
You must have a BASH shell to run the tooling locally.

If you only want to solve the exercises, go to the [track docs][track-docs] and choose your installation option there.
Follow these instructions to contribute to the PHP track.
To solve the exercises, head to the [PHP track][exercism-track-home] and check the [documentation][exercism-track-installation].

## Install Dependencies

You must have installed `composer` as a global tool as recommended in the [PHP track installation docs][composer-installation-docs].
The following system dependencies are required:

- `composer`, as recommended in the [PHP track installation docs][exercism-track-installation-composer].
- [`bash` shell][gnu-bash]

Run the following commands to get started with this project:

```shell
bin/fetch-configlet
composer install
bin/fetch-configlet # The official tool for managing Exercism language track repositories
composer install # Required dependencies to develop this track
```

You now have all tools required to contribute.

## Running Exercism resources management

`bin/configlet` is a tool to manage exercism resources in this track.
See [Building Exercism docs][configlet-docs].
See [Building Exercism docs][exercism-configlet].

## Running Unit Test Suite

We use PHPUnit 9.6.x and a shell loop injecting `exemplar.php` as the solution for testing:
The tests are run with PHPUnit. A shell loop injecting `exemplar.php` is provided to ease testing.

Execute the following command to run the tests:

```shell
composer test:run
```

## Running Style Checker

We use a slightly [modified] version of [PSR-12] and some exceptions:

```shell
composer lint:check
```

To auto-fix the coding styles:
This project use a slightly [modified][local-file-phpcs-config] version of [PSR-12].
Use the following commands to apply code style:

```shell
composer lint:fix
composer lint:check # Checks the files against the code style rules
composer lint:fix # Automatically fix codestyle issues
```

## Contributing

- Read the documentation at [Exercism][docs].
- Follow the [PSR-12] coding style (Exercisms PHP track uses a slightly [modified] version of [PSR-12]).
- Read the documentation at [Exercism][exercism-docs].
- Follow the [PSR-12] coding style (Exercisms PHP track uses a slightly [modified][local-file-phpcs-config] version of [PSR-12]).
- CI is run on all pull requests, it must pass the required checks for merge.
- CI is running all tests on PHP 8.0 to PHP 8.2

[composer-installation-docs]: https://exercism.org/docs/tracks/php/installation#h-install-composer
[configlet-docs]: https://exercism.org/docs/building/configlet
[docs]: https://exercism.org/docs
[modified]: phpcs.xml
[exercism-configlet]: https://exercism.org/docs/building/configlet
[exercism-docs]: https://exercism.org/docs
[exercism-track-home]: https://exercism.org/docs/tracks/php
[exercism-track-installation]: https://exercism.org/docs/tracks/php/installation
[exercism-track-installation-composer]: https://exercism.org/docs/tracks/php/installation#h-install-composer
[gnu-bash]: https://www.gnu.org/software/bash/
[local-file-phpcs-config]: phpcs.xml
[psr-12]: https://www.php-fig.org/psr/psr-12
[track-docs]: https://exercism.org/docs/tracks/php/installation
6 changes: 2 additions & 4 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
<!-- A TAB is 4 chars wide (does not replace them, for calculation only!) -->
<arg name="tab-width" value="4" />

<!-- Run on 10 files in parallel -->
<arg name="parallel" value="10" />
<!-- Run on 60 files in parallel -->
<arg name="parallel" value="60" />

<file>exercises</file>
<file>src</file>

<arg value="n" />

<!-- Include all sniffs in the PSR12 standard except... -->
<rule ref="PSR12">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
Expand Down

0 comments on commit b3c1b94

Please sign in to comment.