Skip to content

Commit 2e04f41

Browse files
authored
Compatibility with PHP 8.1 & 8.2 (#29)
1 parent 443abac commit 2e04f41

File tree

7 files changed

+68
-28
lines changed

7 files changed

+68
-28
lines changed

.github/workflows/build.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
matrix:
14+
php-versions:
15+
- 7.2
16+
- 7.3
17+
- 7.4
18+
- 8.0
19+
- 8.1
20+
- 8.2
21+
name: PHP ${{ matrix.php-versions }}
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
26+
- name: Install PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
coverage: xdebug
30+
php-version: ${{ matrix.php-versions }}
31+
32+
- name: Install dependencies
33+
run: composer update --prefer-dist --no-progress --no-suggest
34+
35+
- name: Run tests
36+
run: vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover
37+
38+
# - name: Upload code coverage
39+
# run: vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
build
33
composer.lock
44
docs
5-
vendor
5+
vendor
6+
.phpunit.result.cache

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest Version](https://img.shields.io/github/tag/dragosprotung/php2wsdl.svg?style=flat-square)](https://github.com/dragosprotung/php2wsdl/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5-
[![Build Status](https://img.shields.io/travis/dragosprotung/php2wsdl/master.svg?style=flat-square)](https://travis-ci.org/dragosprotung/php2wsdl)
5+
[![Build Status](https://github.com/dragosprotung/php2wsdl/actions/workflows/build.yml/badge.svg)](https://github.com/dragosprotung/php2wsdl/actions/workflows/build.yml)
66
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/dragosprotung/php2wsdl.svg?style=flat-square)](https://scrutinizer-ci.com/g/dragosprotung/php2wsdl/code-structure)
77
[![Quality Score](https://img.shields.io/scrutinizer/g/dragosprotung/php2wsdl.svg?style=flat-square)](https://scrutinizer-ci.com/g/dragosprotung/php2wsdl)
88
[![Total Downloads](https://img.shields.io/packagist/dt/php2wsdl/php2wsdl.svg?style=flat-square)](https://packagist.org/packages/php2wsdl/php2wsdl)
@@ -21,7 +21,7 @@ $ composer require php2wsdl/php2wsdl
2121

2222
``` php
2323
$class = "Vendor\\MyClass";
24-
$serviceURI = "http://www.myservice.com/soap";
24+
$serviceURI = "https://www.myservice.com/soap";
2525
$wsdlGenerator = new PHP2WSDL\PHPClass2WSDL($class, $serviceURI);
2626
// Generate the WSDL from the class adding only the public methods that have @soap annotation.
2727
$wsdlGenerator->generateWSDL(true);
@@ -34,7 +34,7 @@ $wsdlXML = $wsdlGenerator->save('foo/example.wsdl');
3434
## Testing
3535

3636
``` bash
37-
$ phpunit
37+
$ vendor/bin/simple-phpunit
3838
```
3939

4040
## Security

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=5.6",
22+
"php": ">=7.2",
2323
"wingu/reflection": "~1.0"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "~5.7",
26+
"symfony/phpunit-bridge": "^6.0",
2727
"scrutinizer/ocular": "~1.1"
2828
},
2929
"autoload": {

phpunit.xml.dist

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
backupGlobals="false"
6-
colors="true"
7-
verbose="true">
8-
<testsuites>
9-
<testsuite name="PHP2WSDL Test Suite">
10-
<directory>tests</directory>
11-
</testsuite>
12-
</testsuites>
13-
<filter>
14-
<whitelist>
15-
<directory suffix=".php">src/</directory>
16-
</whitelist>
17-
</filter>
18-
<logging>
19-
<log type="coverage-text"/>
20-
<log type="coverage-clover" target="coverage.clover"/>
21-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" verbose="true">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="build/logs/clover.xml"/>
9+
<html outputDirectory="build/coverage"/>
10+
<text outputFile="build/coverage.txt"/>
11+
</report>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="PHP2WSDL Test Suite">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<logging>
19+
<junit outputFile="build/report.junit.xml"/>
20+
</logging>
2221
</phpunit>

src/PHPClass2WSDL.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ protected function addMethodToWsdl(ReflectionMethod $method, DOMElement $port, D
250250

251251
// Add any documentation for the operation.
252252
$description = $method->getReflectionDocComment()->getFullDescription();
253-
if (strlen($description) > 0) {
253+
if (isset($description) && (strlen($description) > 0)) {
254254
$this->wsdl->addDocumentation($portOperation, $description);
255255
}
256256

tests/PHP2WSDLTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace PHP2WSDL\Test;
44

55
use PHP2WSDL\PHPClass2WSDL;
6+
use PHPUnit\Framework\TestCase as BaseTestCase;
67

7-
class PHP2WSDLTest extends \PHPUnit_Framework_TestCase
8+
class PHP2WSDLTest extends BaseTestCase
89
{
910

1011
public function testSimpleClassWithSoapTagAnnotations()

0 commit comments

Comments
 (0)