-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[breaking] Support PHP versions 7.4 and 8
This necessarily drops support for PHP <7.4. All unit tests pass, but code coverage reporting doesn't work with these changes due to autoloading errors that I haven't yet solved.
- Loading branch information
1 parent
035ff51
commit a4b7043
Showing
102 changed files
with
730 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
vendor/ | ||
test-coverage/ | ||
coverage.xml | ||
test-coverage.* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
Contributing | ||
=== | ||
# Contributing | ||
|
||
Dash's modular design makes it easy to contribute. Operations are implemented as pure functions that can be reused and composed to make new operations. The best way to understand how Dash works is to examine the source code of any of the existing operations. | ||
|
||
If you encounter a bug or have a suggestion, please [create a new GitHub issue](https://github.com/mpetrovich/dash/issues/new). We want your feedback! | ||
|
||
### Organization | ||
|
||
This repository is organized as follows: | ||
- `src/`: Individual operations implemented as pure functions. | ||
- `src/Curry/`: Curried versions of most operations. | ||
- `tests/`: Unit tests for all operations. Curried and non-curried versions of the same operation are tested in the same test class. | ||
- `docs/`: Documentation. | ||
- `bin/`: Utility scripts, such as one for generating documentation from all operations' docblock comments. | ||
- `Makefile`: Makefile used to build, run tests, check coding style, and more. | ||
|
||
- `src/`: Individual operations implemented as pure functions. | ||
- `src/Curry/`: Curried versions of most operations. | ||
- `tests/`: Unit tests for all operations. Curried and non-curried versions of the same operation are tested in the same test class. | ||
- `docs/`: Documentation. | ||
- `bin/`: Utility scripts, such as one for generating documentation from all operations' docblock comments. | ||
- `Makefile`: Makefile used to build, run tests, check coding style, and more. | ||
|
||
### Important notes | ||
- Dash supports legacy versions of PHP, so make sure your contributions work on the oldest supported version of PHP. | ||
- Dash uses [PHPUnit](https://phpunit.de/) for unit testing, and unit tests are automatically run on [Travis CI](https://travis-ci.org/mpetrovich/dash) against new branches and pull requests. Tests are run across all supported PHP versions. | ||
- Dash uses [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for linting. | ||
- Dash is **strict** about following [semantic versioning](https://semver.org/). | ||
|
||
- Dash supports legacy versions of PHP, so make sure your contributions work on the oldest supported version of PHP. | ||
- Dash uses [PHPUnit](https://phpunit.de/) for unit testing, and unit tests are automatically run on [Travis CI](https://travis-ci.org/mpetrovich/dash) against new branches and pull requests. Tests are run across all supported PHP versions. | ||
- Dash uses [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for linting. | ||
- Dash is **strict** about following [semantic versioning](https://semver.org/). | ||
|
||
### Docker tips | ||
|
||
Build the Docker container: | ||
|
||
``` | ||
docker build . -t dash | ||
``` | ||
|
||
Run the Docker container in an interactive shell: | ||
|
||
``` | ||
docker run -it dash /bin/bash | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
FROM php:7.4-fpm | ||
ENV DRIVER pcov | ||
|
||
COPY ./php.ini /usr/local/etc/php/php.ini | ||
COPY . /usr/src/dash | ||
WORKDIR /usr/src/dash | ||
|
||
RUN apt-get update && \ | ||
apt-get install --yes --no-install-recommends git zip unzip libzip-dev | ||
RUN pecl install pcov | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
RUN composer update --with-all-dependencies | ||
|
||
RUN make | ||
CMD make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extension = pcov | ||
pcov.enabled = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
colors="true" | ||
> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit> | ||
<testsuites> | ||
<testsuite> | ||
<testsuite name="unit"> | ||
<directory suffix="Test.php">src</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist checkForUnintentionallyCoveredCode="true"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
<exclude> | ||
<directory suffix="Test.php">src</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-html" target="test-coverage" lowUpperBound="50" highLowerBound="70" /> | ||
<log type="coverage-clover" target="coverage.xml" /> | ||
</logging> | ||
</include> | ||
</coverage> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.