Skip to content

Commit

Permalink
Merge pull request #214 from mentax/master
Browse files Browse the repository at this point in the history
Php8 compatibility - Fix #213
  • Loading branch information
Garethp authored Sep 17, 2021
2 parents fccadcf + 6effbe1 commit 5141e1e
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 5.5
- 5.6
- 7.0
- 8.0

before_script:
- chmod a+x ./.travis.sh
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"require-dev": {
"phpunit/phpunit": "~9.5",
"squizlabs/php_codesniffer": "~3.6.0",
"mockery/mockery": "~0.9.4",
"goetas/xsd2php": "2.*@dev",
"goetas/xsd-reader": "2.*@dev"
"mockery/mockery": "^1.4",
"goetas/xsd2php": "^2.1",
"goetas/xsd-reader": "^2.0-dev"
}
}
15 changes: 0 additions & 15 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,4 @@
<directory>tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
<exclude>
<directory>Type</directory>
<directory>Enumeration</directory>
</exclude>
</whitelist>
<blacklist>
<directory>tests</directory>
<directory>vendor</directory>
<directory>src/Type</directory>
<directory>src/Enumeration</directory>
</blacklist>
</filter>
</phpunit>
10 changes: 8 additions & 2 deletions src/API/ExchangeWebServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,20 @@ protected function createClient($server, $auth, $options)
$this->server = $server;
$this->version = $options['version'];

$backup = libxml_disable_entity_loader(false);
if (version_compare(PHP_VERSION, '8', '<')) {
$backup = libxml_disable_entity_loader(false);
}

$this->soap = new NTLMSoapClient(
$location,
$auth,
dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl',
$options
);
libxml_disable_entity_loader($backup);

if (version_compare(PHP_VERSION, '8', '<')) {
libxml_disable_entity_loader($backup);
}

if (isset($options['primarySmtpEmailAddress'])) {
$this->setPrimarySmtpEmailAddress($options['primarySmtpEmailAddress']);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Calendar/CalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use garethp\ews\Test\BaseTestCase;

class APITest extends BaseTestCase
class CalendarTest extends BaseTestCase
{
public function setUp(): void
{
Expand Down

0 comments on commit 5141e1e

Please sign in to comment.