Skip to content

Commit 97d06c6

Browse files
committed
Merge branch 'release/2.0.0'
2 parents 6a450af + af21580 commit 97d06c6

20 files changed

+303
-657
lines changed

.docker/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM php:7.2-apache
1+
FROM splitbrain/phpfarm:jessie
22

3-
RUN apt-get update \
4-
&& apt-get install -y libxml2-dev git zip zlib1g \
5-
&& docker-php-ext-install soap
3+
RUN apt-get update && apt-get install -y git zip
64

75
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
8-
COPY . /var/www/html
6+
COPY . /var/www/
97

10-
WORKDIR /var/www/html
8+
WORKDIR /var/www/

.gitignore

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

.travis.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +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-
php:
6-
- 5.4
7-
- 5.5
8-
- 5.6
9-
- 7.0
10-
- 7.1
11-
- 7.2
15+
fast_finish: true
16+
allow_failures:
17+
- php: 'nightly'
18+
19+
cache:
20+
directories:
21+
- $HOME/.composer/cache
1222

1323
install:
1424
- composer install
1525

1626
script:
17-
- ./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
1828

1929
after_script:
2030
- wget https://scrutinizer-ci.com/ocular.phar
21-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
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.2.2
414
- Merged PR #9
515

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,27 @@ The `WsSecurity::createWsSecuritySoapHeader` parameters are defined in this orde
4646
- **$usernameId**: the id to attach to the UsernameToken element, optional
4747
- **$addNonce**: _true_ by default, if true, it adds the nonce element to the header, if false it does not add the nonce element to the header
4848

49-
## Unit tests
50-
You can run the unit tests with the following command at the root directory of this project:
49+
## Testing using [Docker](https://www.docker.com/)
50+
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:
51+
- php-7.4
52+
53+
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:
54+
```bash
55+
$ docker-compose up -d --build
5156
```
52-
$ composer test
57+
58+
You then have a container named `ws_security` in which you can run `composer` commands and `php cli` commands such as:
59+
```bash
60+
# install deps in container (using update ensure it does use the composer.lock file if there is any)
61+
$ docker exec -it ws_security php-7.4 /usr/bin/composer update
62+
# run tests in container
63+
$ docker exec -it ws_security php-7.4 -dmemory_limit=-1 vendor/bin/phpunit
5364
```
5465

55-
## Feedback
56-
Any feedback is appreciated at contact@wsdltophp.com or by creating an issue on this project.
66+
## FAQ
67+
68+
If you have a question, feel free to [create an issue](https://github.com/WsdlToPhp/WsSecurity/issues/new).
69+
70+
## License
5771

72+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,17 @@
3535
"email" : "contact@wsdltophp.com"
3636
},
3737
"require" : {
38-
"php" : ">=5.4",
39-
"ext-soap": "*"
38+
"php" : ">=7.4",
39+
"ext-soap": "*",
40+
"ext-dom": "*"
4041
},
4142
"scripts": {
4243
"test": "vendor/bin/phpunit",
4344
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
4445
},
4546
"require-dev": {
4647
"friendsofphp/php-cs-fixer": "^2.0",
47-
"phpunit/phpunit": "^4.8 || ^6.0"
48+
"phpunit/phpunit": "^9"
4849
},
4950
"autoload" : {
5051
"psr-4" : {

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ services:
66
context: .
77
dockerfile: .docker/Dockerfile
88
volumes:
9-
- .:/var/www/html:rw
9+
- .:/var/www:rw
1010
container_name: ws_security

phpunit.xml.dist

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
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>./src/resources</directory>
22-
<directory>./tests</directory>
23-
<directory>./vendor</directory>
24-
</exclude>
25-
</whitelist>
26-
</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>./src/resources</directory>
9+
<directory>./tests</directory>
10+
<directory>./vendor</directory>
11+
</exclude>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="full">
15+
<directory>./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
<php>
19+
<ini name="error_reporting" value="-1"/>
20+
</php>
2721
</phpunit>

src/Created.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace WsdlToPhp\WsSecurity;
46

57
class Created extends Element
68
{
7-
/**
8-
* Element name.
9-
*
10-
* @var string
11-
*/
129
const NAME = 'Created';
1310

14-
/**
15-
* Constructor for Created element.
16-
*
17-
* @param int $_timestamp the timestamp value
18-
* @param string $_namespace the namespace
19-
*/
20-
public function __construct($_timestamp, $_namespace = self::NS_WSSU)
11+
public function __construct(int $timestamp, string $namespace = self::NS_WSSU)
2112
{
22-
$this->setTimestampValue($_timestamp);
23-
parent::__construct(self::NAME, $_namespace, $this->getTimestampValue(true));
13+
$this->setTimestampValue($timestamp);
14+
parent::__construct(self::NAME, $namespace, $this->getTimestampValue(true));
2415
}
2516
}

0 commit comments

Comments
 (0)