Skip to content

Commit 41ab376

Browse files
committed
Merge branch 'release/2.0.0'
2 parents ce19bd4 + e15a859 commit 41ab376

25 files changed

+443
-857
lines changed

.docker/Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
FROM php:7.2-apache AS dom_handler_php
1+
FROM splitbrain/phpfarm:jessie
22

3-
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
4-
COPY . /var/www/html
5-
6-
RUN apt-get update \
7-
&& apt-get install -y zip git
3+
RUN apt-get update && apt-get install -y git zip
84

9-
ENV COMPOSER_ALLOW_SUPERUSER=1
10-
11-
WORKDIR /var/www/html
5+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
6+
COPY . /var/www/
127

13-
RUN composer self-update \
14-
&& composer validate \
15-
&& composer update --prefer-dist --no-scripts --no-progress --no-suggest
8+
WORKDIR /var/www/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
vendor/
1+
vendor
22
composer.lock
33
phpunit.xml
44
.idea
5+
.phpunit.result.cache

.php_cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ $finder = PhpCsFixer\Finder::create()
55
->in(__DIR__);
66

77
return PhpCsFixer\Config::create()
8-
->setUsingCache(false)
8+
->setUsingCache(false)
99
->setRules(array(
1010
'@PSR2' => true,
1111
'binary_operator_spaces' => true,
1212
'no_whitespace_in_blank_line' => true,
1313
'ternary_operator_spaces' => true,
1414
'cast_spaces' => true,
1515
'trailing_comma_in_multiline_array' => true
16-
))
16+
))
1717
->setFinder($finder);

.travis.yml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
language: php
22

3-
sudo: false
3+
jobs:
4+
include:
5+
- name: 'Tests under PHP 7.4'
6+
php: '7.4'
7+
dist: bionic
8+
- name: 'Tests under PHP 8.0'
9+
php: '8.0'
10+
dist: bionic
11+
- name: 'Tests under PHP nightly'
12+
php: 'nightly'
13+
dist: bionic
414

5-
matrix:
6-
include:
7-
- php: 5.3
8-
dist: precise
9-
10-
php:
11-
- 5.4
12-
- 5.5
13-
- 5.6
14-
- 7.0
15-
- 7.1
16-
- 7.2
15+
fast_finish: true
16+
allow_failures:
17+
- php: 'nightly'
1718

1819
cache:
19-
directories:
20-
- $HOME/.composer/cache
20+
directories:
21+
- $HOME/.composer/cache
2122

2223
install:
23-
- composer install
24+
- composer install
2425

2526
script:
26-
- ./vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover
27+
- php -dmemory_limit=-1 -dxdebug.mode=coverage ./vendor/phpunit/phpunit/phpunit --coverage-text --coverage-clover=coverage.clover
2728

2829
after_script:
29-
- wget https://scrutinizer-ci.com/ocular.phar
30-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
30+
- wget https://scrutinizer-ci.com/ocular.phar
31+
- php -dmemory_limit=-1 ocular.phar code-coverage:upload --format=php-clover coverage.clover
32+
33+
after_success:
34+
- bash <(curl -s https://codecov.io/bash)

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 2.0.0 - 2021/01/26
4+
- use `splitbrain/phpfarm:jessie` as Docker image and fix docker image settings
5+
- Code requires PHP >= 7.4
6+
- Code cleaning
7+
- Update README
8+
- Update Travis CI settings
9+
- Update PHPUnit settings
10+
- Update LICENSE file
11+
- Version 1.0 is no more maintained
12+
313
## 1.0.1
414
- Initialize Docker settings
515
- pull request #1 - Update namespace in test classes to match the actual location

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2018 Mikaël DELSOL
1+
Copyright (c) 2012-2021 Mikaël DELSOL
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,29 @@
77
[![Build Status](https://travis-ci.org/WsdlToPhp/DomHandler.svg)](https://travis-ci.org/WsdlToPhp/DomHandler)
88
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/DomHandler/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/DomHandler/)
99
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/DomHandler/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/DomHandler/)
10+
[![Total Downloads](https://poser.pugx.org/wsdltophp/domhandler/downloads)](https://packagist.org/packages/wsdltophp/domhandler)
1011
[![StyleCI](https://styleci.io/repos/87977980/shield)](https://styleci.io/repos/87977980)
1112
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/6bac01d7-5243-4682-9264-8166407c8a30/mini.png)](https://insight.sensiolabs.com/projects/6bac01d7-5243-4682-9264-8166407c8a30)
1213

1314
DomHandler uses the [decorator design pattern](https://en.wikipedia.org/wiki/Decorator_pattern) in order to ease DOM handling.
1415

1516
The source code has been originally created into the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) project but it felt that it had the possibility to live by itself and to evolve independtly from the PackageGenerator project if necessary.
1617

17-
## Testing
18+
## Testing using [Docker](https://www.docker.com/)
19+
Thanks to the [Docker image](https://hub.docker.com/r/splitbrain/phpfarm) of [phpfarm](https://github.com/fpoirotte/phpfarm), tests can be run locally under *any* PHP version using the cli:
20+
- php-7.4
1821

22+
First of all, you need to create your container which you can do using [docker-compose](https://docs.docker.com/compose/) by running the below command line from the root directory of the project:
1923
```bash
20-
# composer test
24+
$ docker-compose up -d --build
25+
```
26+
27+
You then have a container named `dom_handler` in which you can run `composer` commands and `php cli` commands such as:
28+
```bash
29+
# install deps in container (using update ensure it does use the composer.lock file if there is any)
30+
$ docker exec -it dom_handler php-7.4 /usr/bin/composer update
31+
# run tests in container
32+
$ docker exec -it dom_handler php-7.4 -dmemory_limit=-1 vendor/bin/phpunit
2133
```
2234

2335
## Contributing

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=5.3.3"
26+
"php": ">=7.4",
27+
"ext-dom": "*"
2728
},
2829
"require-dev": {
2930
"friendsofphp/php-cs-fixer": "~2.0",
30-
"phpunit/phpunit": "^4.8 || ^6.0"
31+
"phpunit/phpunit": "^9"
3132
},
3233
"config": {
3334
"sort-packages": true
@@ -43,8 +44,8 @@
4344
}
4445
},
4546
"scripts": {
46-
"lint": "vendor/bin/php-cs-fixer fix",
47-
"test": "vendor/bin/phpunit"
47+
"test": "vendor/bin/phpunit",
48+
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
4849
},
4950
"support": {
5051
"email": "[email protected]"

docker-compose.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
version: '3.4'
22

33
services:
4-
php:
5-
build:
6-
context: .
7-
dockerfile: .docker/Dockerfile
8-
target: dom_handler_php
9-
volumes:
10-
- .:/var/www/html:rw
11-
container_name: dom_handler
4+
php:
5+
build:
6+
context: .
7+
dockerfile: .docker/Dockerfile
8+
volumes:
9+
- .:/var/www:rw
10+
container_name: dom_handler

phpunit.xml.dist

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
5-
backupGlobals="false"
6-
colors="true"
7-
bootstrap="vendor/autoload.php">
8-
<php>
9-
<ini name="error_reporting" value="-1" />
10-
</php>
11-
<testsuites>
12-
<testsuite name="full">
13-
<directory>./tests</directory>
14-
</testsuite>
15-
</testsuites>
16-
17-
<filter>
18-
<whitelist>
19-
<directory>./</directory>
20-
<exclude>
21-
<directory>./tests</directory>
22-
<directory>./vendor</directory>
23-
</exclude>
24-
</whitelist>
25-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
3+
<coverage>
4+
<include>
5+
<directory>./</directory>
6+
</include>
7+
<exclude>
8+
<directory>./tests</directory>
9+
<directory>./vendor</directory>
10+
</exclude>
11+
</coverage>
12+
<php>
13+
<ini name="error_reporting" value="-1"/>
14+
</php>
15+
<testsuites>
16+
<testsuite name="full">
17+
<directory>./tests</directory>
18+
</testsuite>
19+
</testsuites>
2620
</phpunit>

0 commit comments

Comments
 (0)