Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'feature/7263'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Mar 25, 2015
184 parents f6f963c + 4277515 + 73e728b + 1bf9aba + 3ec9aa4 + 38be842 + 4ebc653 + 52f7747 + 57b39fa + b06e239 + 156b2cc + 991d497 + 5abe4b0 + d089acd + 6fcf214 + bcbd2dd + 91375d9 + da20dbf + 8cb31b9 + 34aaa76 + a941379 + 5ec4274 + 1a8b800 + 045212a + c918e2c + 1d51877 + 073ffb1 + 6cc70c4 + cca448e + 5f78560 + 1c0be41 + 02f7335 + 88a04db + b1c3dd1 + f3d5365 + 88de986 + fb38487 + 7bfe758 + 2e55342 + 6a04f31 + 57ecc1a + b78abaa + 30a9569 + f96aa9d + 23f86e7 + d43d656 + 4de219f + 3c20bba + a0d3747 + 456d331 + e503406 + 95c2a28 + 1fc5b65 + bc3880f + 2989a80 + e8f73d2 + fcc59de + ad50dbb + a46cbd4 + 6192f93 + bb42677 + 02419fd + cf6df36 + 92345be + 737b39e + fde18af + 43ca092 + e3acc17 + b5bc61a + 30d69f9 + 7dbd12c + 9f45cc7 + 473bfa3 + 916cd80 + 5aac7b0 + 6f66646 + 12c90a3 + 435c161 + 9bb6b33 + 6c32cce + f3c637f + c54876c + e1d13eb + daa8e6c + 5570955 + 388a6c0 + ac33840 + 00e233b + 532572e + 1e1f8d2 + b636e56 + 18878ed + 79ce391 + 9db7d70 + 0c2ce53 + 8dbc4b8 + b8b5d22 + 3dac49c + c87ef97 + 1ffe869 + fbe0570 + 802848d + 9fd0967 + 537b471 + 8cc3c9d + 7f51755 + 71ea52c + f2338ea + 226aada + 6f2818d + fafc8ae + 06d397d + 42a5665 + 9b6e2d1 + 96a0498 + 8cc5c74 + e3d1211 + ec85470 + a6f2c9c + fd7b83c + 6d8b4af + b29c8c0 + 64f42ce + 1a82cad + becf6c6 + 2ef3150 + 298e4df + 829ed04 + 4f30658 + ca02442 + 93fe9e8 + 28004c9 + ee4145b + 5e1f577 + 783b983 + 7b0d8d0 + 93db32e + 2b88f8e + fddfc5a + 7bc42fb + 0fe8dfb + 5ee657c + 5f406b6 + c948fa3 + 960d3da + c281e33 + 62224a4 + 6f2357e + 20aefa2 + 31e6b5a + 8a77c3a + 4982e89 + 1386ed7 + 67368ff + 95214da + 6434c7e + 659bce0 + e6b0ec4 + 5fcb527 + 19f72a6 + 8993ba7 + b8734d1 + e0c31db + 3a7c753 + f31a6f9 + 1a8bac6 + 2c9c99a + c36df00 + 996a250 + 13b7c35 + 6901b30 + f0c8580 + 92424ea + 2340663 + 463b567 + 4e6645a + 6b6cbe1 + 43892df + 9ee3034 + fb74ed3 + 474dcc0 + e16a42e + c71991f + 268a87f commit 364510b
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/Server.php
Expand Up @@ -448,7 +448,10 @@ public function setTypemap($typeMap)

foreach ($typeMap as $type) {
if (!is_callable($type['from_xml'])) {
throw new Exception\InvalidArgumentException('Invalid from_xml callback for type: ' . $type['type_name']);
throw new Exception\InvalidArgumentException(sprintf(
'Invalid from_xml callback for type: %s',
$type['type_name']
));
}
if (!is_callable($type['to_xml'])) {
throw new Exception\InvalidArgumentException('Invalid to_xml callback for type: ' . $type['type_name']);
Expand Down Expand Up @@ -590,7 +593,9 @@ public function addFunction($function, $namespace = '')
public function setClass($class, $namespace = '', $argv = null)
{
if (isset($this->class)) {
throw new Exception\InvalidArgumentException('A class has already been registered with this soap server instance');
throw new Exception\InvalidArgumentException(
'A class has already been registered with this soap server instance'
);
}

if (is_object($class)) {
Expand Down Expand Up @@ -914,7 +919,7 @@ public function handle($request = null)

// Restore original error handler
restore_error_handler();
ini_set('display_errors', $displayErrorsOriginalState);
ini_set('display_errors', (string) $displayErrorsOriginalState);

// Send a fault, if we have one
if ($fault instanceof SoapFault && !$this->returnResponse) {
Expand Down Expand Up @@ -947,7 +952,7 @@ public function handle($request = null)
protected function _initializeSoapErrorContext()
{
$displayErrorsOriginalState = ini_get('display_errors');
ini_set('display_errors', false);
ini_set('display_errors', '0');
set_error_handler(array($this, 'handlePhpErrors'), E_USER_ERROR);
return $displayErrorsOriginalState;
}
Expand Down Expand Up @@ -976,14 +981,18 @@ public function registerFaultException($class)
foreach ($class as $row) {
$this->registerFaultException($row);
}
} elseif (is_string($class) && class_exists($class) && (is_subclass_of($class, 'Exception') || 'Exception' === $class)) {
} elseif (is_string($class)
&& class_exists($class)
&& (is_subclass_of($class, 'Exception') || 'Exception' === $class)
) {
$ref = new ReflectionClass($class);

$this->faultExceptions[] = $ref->getName();
$this->faultExceptions = array_unique($this->faultExceptions);
} else {
throw new Exception\InvalidArgumentException(
'Argument for Zend\Soap\Server::registerFaultException should be string or array of strings with valid exception names'
'Argument for Zend\Soap\Server::registerFaultException should be'
. ' string or array of strings with valid exception names'
);
}

Expand Down Expand Up @@ -1075,7 +1084,14 @@ public function fault($fault = null, $code = 'Receiver')
$message = 'Unknown error';
}

$allowedFaultModes = array('VersionMismatch', 'MustUnderstand', 'DataEncodingUnknown', 'Sender', 'Receiver', 'Server');
$allowedFaultModes = array(
'VersionMismatch',
'MustUnderstand',
'DataEncodingUnknown',
'Sender',
'Receiver',
'Server'
);
if (!in_array($code, $allowedFaultModes)) {
$code = 'Receiver';
}
Expand Down

0 comments on commit 364510b

Please sign in to comment.