Skip to content

Commit

Permalink
Compatibility with PHP 8.1 & 8.2 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierabion committed May 11, 2023
1 parent 443abac commit 2e04f41
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 28 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
php-versions:
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
name: PHP ${{ matrix.php-versions }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest

- name: Run tests
run: vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover

# - name: Upload code coverage
# run: vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
build
composer.lock
docs
vendor
vendor
.phpunit.result.cache
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

``` bash
$ phpunit
$ vendor/bin/simple-phpunit
```

## Security
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.2",
"wingu/reflection": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~5.7",
"symfony/phpunit-bridge": "^6.0",
"scrutinizer/ocular": "~1.1"
},
"autoload": {
Expand Down
39 changes: 19 additions & 20 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="vendor/autoload.php"
backupGlobals="false"
colors="true"
verbose="true">
<testsuites>
<testsuite name="PHP2WSDL Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-text"/>
<log type="coverage-clover" target="coverage.clover"/>
</logging>
<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">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
</report>
</coverage>
<testsuites>
<testsuite name="PHP2WSDL Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion src/PHPClass2WSDL.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected function addMethodToWsdl(ReflectionMethod $method, DOMElement $port, D

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

Expand Down
3 changes: 2 additions & 1 deletion tests/PHP2WSDLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace PHP2WSDL\Test;

use PHP2WSDL\PHPClass2WSDL;
use PHPUnit\Framework\TestCase as BaseTestCase;

class PHP2WSDLTest extends \PHPUnit_Framework_TestCase
class PHP2WSDLTest extends BaseTestCase
{

public function testSimpleClassWithSoapTagAnnotations()
Expand Down

0 comments on commit 2e04f41

Please sign in to comment.