require php5.6+

This commit is contained in:
Robin Appelman 2018-03-09 14:54:36 +01:00
commit 0cbfd0872d
5 changed files with 47 additions and 37 deletions

View file

@ -10,6 +10,7 @@ namespace Icewind\SMB;
use Icewind\SMB\Exception\Exception;
use Icewind\SMB\Exception\RevisionMismatchException;
class NotifyHandler implements INotifyHandler {
/**
@ -24,10 +25,9 @@ class NotifyHandler implements INotifyHandler {
private $listening = true;
// todo replace with static once <5.6 support is dropped
// see error.h
private static $exceptionMap = [
ErrorCodes::RevisionMismatch => '\Icewind\SMB\Exception\RevisionMismatchException',
const EXCEPTION_MAP = [
ErrorCodes::RevisionMismatch => RevisionMismatchException::class,
];
/**
@ -93,7 +93,7 @@ class NotifyHandler implements INotifyHandler {
private function checkForError($line) {
if (substr($line, 0, 16) === 'notify returned ') {
$error = substr($line, 16);
throw Exception::fromMap(self::$exceptionMap, $error, 'Notify is not supported with the used smb version');
throw Exception::fromMap(array_merge(self::EXCEPTION_MAP, Parser::EXCEPTION_MAP), $error, 'Notify is not supported with the used smb version');
}
}