Passe générale php-cs-fixer
This commit is contained in:
parent
408d88f164
commit
dad2b76165
1
.php_cs.cache
Normal file
1
.php_cs.cache
Normal file
File diff suppressed because one or more lines are too long
@ -62,9 +62,9 @@ class SoapWebServiceController implements ContainerAwareInterface
|
||||
*/
|
||||
private $headers = array();
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
@ -48,7 +48,7 @@ class TypeRepository
|
||||
|
||||
public function fixTypeInformation(ServiceDefinition $definition)
|
||||
{
|
||||
foreach($definition->getAllTypes() as $type) {
|
||||
foreach ($definition->getAllTypes() as $type) {
|
||||
$phpType = $type->getPhpType();
|
||||
$xmlType = $type->getXmlType();
|
||||
|
||||
|
@ -60,7 +60,7 @@ class BeSimpleSoapExtension extends Extension
|
||||
|
||||
$container->setParameter('besimple.soap.definition.dumper.options.stylesheet', $config['wsdl_dumper']['stylesheet']);
|
||||
|
||||
foreach($config['services'] as $name => $serviceConfig) {
|
||||
foreach ($config['services'] as $name => $serviceConfig) {
|
||||
$serviceConfig['name'] = $name;
|
||||
$this->createWebServiceContext($serviceConfig, $container);
|
||||
}
|
||||
|
@ -96,8 +96,12 @@ class Configuration
|
||||
->info('proxy configuration')
|
||||
->addDefaultsIfNotSet()
|
||||
->beforeNormalization()
|
||||
->ifTrue(function ($v) { return !is_array($v); })
|
||||
->then(function ($v) { return array('host' => null === $v ? false : $v); })
|
||||
->ifTrue(function ($v) {
|
||||
return !is_array($v);
|
||||
})
|
||||
->then(function ($v) {
|
||||
return array('host' => null === $v ? false : $v);
|
||||
})
|
||||
->end()
|
||||
->children()
|
||||
->scalarNode('host')->defaultFalse()->end()
|
||||
|
@ -19,17 +19,17 @@ class DocumentLiteralWrappedRequestMessageBinder implements MessageBinderInterfa
|
||||
{
|
||||
public function processMessage(Method $messageDefinition, $message)
|
||||
{
|
||||
if(count($message) > 1) {
|
||||
if (count($message) > 1) {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$message = $message[0];
|
||||
|
||||
foreach($messageDefinition->getArguments() as $argument) {
|
||||
foreach ($messageDefinition->getArguments() as $argument) {
|
||||
$result[$argument->getName()] = $message->{$argument->getName()};
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ class DocumentLiteralWrappedResponseMessageBinder implements MessageBinderInterf
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,5 +24,5 @@ interface MessageBinderInterface
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function processMessage(Method $messageDefinition, $message, TypeRepository $typeRepository);
|
||||
public function processMessage(Method $messageDefinition, $message, TypeRepository $typeRepository);
|
||||
}
|
||||
|
@ -44,7 +44,8 @@ class ServiceBinder
|
||||
* @param MessageBinderInterface $requestMessageBinder
|
||||
* @param MessageBinderInterface $responseMessageBinder
|
||||
*/
|
||||
public function __construct(Definition $definition, MessageBinderInterface $requestHeaderMessageBinder, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder) {
|
||||
public function __construct(Definition $definition, MessageBinderInterface $requestHeaderMessageBinder, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder)
|
||||
{
|
||||
$this->definition = $definition;
|
||||
|
||||
$this->requestHeaderMessageBinder = $requestHeaderMessageBinder;
|
||||
|
@ -53,4 +53,4 @@ class ComplexType extends Configuration
|
||||
{
|
||||
return 'complextype';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,5 @@ interface ConfigurationInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getAliasName();
|
||||
}
|
||||
public function getAliasName();
|
||||
}
|
||||
|
@ -19,4 +19,4 @@ class Header extends Param
|
||||
{
|
||||
return 'header';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,4 +42,4 @@ class Method extends Configuration
|
||||
{
|
||||
return 'method';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,4 @@ class Param extends Configuration implements TypedElementInterface
|
||||
{
|
||||
return 'param';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,4 +42,4 @@ class Result extends Configuration implements TypedElementInterface
|
||||
{
|
||||
return 'result';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ namespace BeSimple\SoapBundle\ServiceDefinition\Annotation;
|
||||
|
||||
interface TypedElementInterface
|
||||
{
|
||||
function getPhpType();
|
||||
function getXmlType();
|
||||
function setPhpType($phpType);
|
||||
function setXmlType($xmlType);
|
||||
}
|
||||
public function getPhpType();
|
||||
public function getXmlType();
|
||||
public function setPhpType($phpType);
|
||||
public function setXmlType($xmlType);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class AnnotationClassLoader extends Loader
|
||||
*/
|
||||
private function getController(\ReflectionClass $class, \ReflectionMethod $method, Annotation\Method $annotation)
|
||||
{
|
||||
if(null !== $annotation->getService()) {
|
||||
if (null !== $annotation->getService()) {
|
||||
return $annotation->getService() . ':' . $method->name;
|
||||
} else {
|
||||
return $class->name . '::' . $method->name;
|
||||
|
@ -69,7 +69,7 @@ class SoapRequest extends Request
|
||||
*/
|
||||
public function getSoapMessage()
|
||||
{
|
||||
if(null === $this->soapMessage) {
|
||||
if (null === $this->soapMessage) {
|
||||
$this->soapMessage = $this->initializeSoapMessage();
|
||||
}
|
||||
|
||||
@ -88,12 +88,12 @@ class SoapRequest extends Request
|
||||
|
||||
protected function initializeSoapMessage()
|
||||
{
|
||||
if($this->server->has('CONTENT_TYPE')) {
|
||||
if ($this->server->has('CONTENT_TYPE')) {
|
||||
$type = $this->splitContentTypeHeader($this->server->get('CONTENT_TYPE'));
|
||||
|
||||
switch($type['_type']) {
|
||||
switch ($type['_type']) {
|
||||
case 'multipart/related':
|
||||
if($type['type'] == 'application/xop+xml') {
|
||||
if ($type['type'] == 'application/xop+xml') {
|
||||
return $this->initializeMtomSoapMessage($type, $this->getContent());
|
||||
} else {
|
||||
//log error
|
||||
@ -114,7 +114,7 @@ class SoapRequest extends Request
|
||||
|
||||
protected function initializeMtomSoapMessage(array $contentTypeHeader, $content)
|
||||
{
|
||||
if(!isset($contentTypeHeader['start']) || !isset($contentTypeHeader['start-info']) || !isset($contentTypeHeader['boundary'])) {
|
||||
if (!isset($contentTypeHeader['start']) || !isset($contentTypeHeader['start-info']) || !isset($contentTypeHeader['boundary'])) {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
|
||||
@ -129,11 +129,11 @@ class SoapRequest extends Request
|
||||
|
||||
// TODO: add more checks to achieve full compatibility to MTOM spec
|
||||
// http://www.w3.org/TR/soap12-mtom/
|
||||
if($rootPart->id != $soapMimePartId || $rootPartType['_type'] != 'application/xop+xml' || $rootPartType['type'] != $soapMimePartType) {
|
||||
if ($rootPart->id != $soapMimePartId || $rootPartType['_type'] != 'application/xop+xml' || $rootPartType['type'] != $soapMimePartType) {
|
||||
throw new \InvalidArgumentException();
|
||||
}
|
||||
|
||||
foreach($mimeParts as $mimePart) {
|
||||
foreach ($mimeParts as $mimePart) {
|
||||
$this->soapAttachments->add(new SoapAttachment(
|
||||
$mimePart->id,
|
||||
$mimePart->type,
|
||||
@ -153,7 +153,7 @@ class SoapRequest extends Request
|
||||
|
||||
$result['_type'] = array_shift($parts);
|
||||
|
||||
foreach($parts as $part) {
|
||||
foreach ($parts as $part) {
|
||||
list($key, $value) = explode('=', trim($part), 2);
|
||||
|
||||
$result[$key] = trim($value, '"');
|
||||
|
@ -21,7 +21,7 @@ class Assert
|
||||
|
||||
public static function thatArgument($name, $condition, $message = self::ARGUMENT_INVALID)
|
||||
{
|
||||
if(!$condition) {
|
||||
if (!$condition) {
|
||||
throw new \InvalidArgumentException(sprintf($message, $name));
|
||||
}
|
||||
}
|
||||
|
@ -62,4 +62,4 @@ class Collection implements \IteratorAggregate, \Countable
|
||||
{
|
||||
return new \ArrayIterator($this->elements);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class String
|
||||
*/
|
||||
public static function startsWith($str, $substr)
|
||||
{
|
||||
if(is_string($str) && is_string($substr) && strlen($str) >= strlen($substr)) {
|
||||
if (is_string($str) && is_string($substr) && strlen($str) >= strlen($substr)) {
|
||||
return $substr == substr($str, 0, strlen($substr));
|
||||
}
|
||||
}
|
||||
@ -42,8 +42,8 @@ class String
|
||||
*/
|
||||
public static function endsWith($str, $substr)
|
||||
{
|
||||
if(is_string($str) && is_string($substr) && strlen($str) >= strlen($substr)) {
|
||||
if (is_string($str) && is_string($substr) && strlen($str) >= strlen($substr)) {
|
||||
return $substr == substr($str, strlen($str) - strlen($substr));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ class WebServiceContext
|
||||
|
||||
public function getWsdlFile($endpoint = null)
|
||||
{
|
||||
$file = sprintf ('%s/%s.%s.wsdl', $this->options['cache_dir'], $this->options['name'], md5($endpoint));
|
||||
$file = sprintf('%s/%s.%s.wsdl', $this->options['cache_dir'], $this->options['name'], md5($endpoint));
|
||||
$cache = new ConfigCache($file, $this->options['debug']);
|
||||
|
||||
if(!$cache->isFresh()) {
|
||||
if (!$cache->isFresh()) {
|
||||
$definition = $this->getServiceDefinition();
|
||||
|
||||
if ($endpoint) {
|
||||
|
@ -251,7 +251,6 @@ class Curl
|
||||
$errorCodeMapping = $this->getErrorCodeMapping();
|
||||
$errorNumber = curl_errno($this->ch);
|
||||
if (isset($errorCodeMapping[$errorNumber])) {
|
||||
|
||||
return $errorCodeMapping[$errorNumber];
|
||||
}
|
||||
|
||||
|
@ -338,10 +338,10 @@ class SoapClient extends \SoapClient
|
||||
$options['typemap'][] = array(
|
||||
'type_name' => $converter->getTypeName(),
|
||||
'type_ns' => $converter->getTypeNamespace(),
|
||||
'from_xml' => function($input) use ($converter) {
|
||||
'from_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertXmlToPhp($input);
|
||||
},
|
||||
'to_xml' => function($input) use ($converter) {
|
||||
'to_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertPhpToXml($input);
|
||||
},
|
||||
);
|
||||
@ -380,4 +380,4 @@ class SoapClient extends \SoapClient
|
||||
|
||||
return $cacheFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ class SoapRequest extends CommonSoapRequest
|
||||
|
||||
return $request;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ abstract class AbstractWebServerTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @var ProcessBuilder
|
||||
*/
|
||||
static protected $webserver;
|
||||
static protected $websererPortLength;
|
||||
protected static $webserver;
|
||||
protected static $websererPortLength;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
|
@ -4,4 +4,4 @@ namespace BeSimple\SoapClient\Tests\AxisInterop\Fixtures;
|
||||
|
||||
class AttachmentRequest extends AttachmentType
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ class AttachmentType
|
||||
{
|
||||
public $fileName;
|
||||
public $binaryData;
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
||||
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class WsSecurityUserPassAxisInteropTest extends TestCase
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData( 'libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST );
|
||||
$wssFilter->addUserData('libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
@ -4,4 +4,4 @@ namespace BeSimple\SoapClient\Tests\ServerInterop\Fixtures;
|
||||
|
||||
class AttachmentRequest extends AttachmentType
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ class AttachmentType
|
||||
{
|
||||
public $fileName;
|
||||
public $binaryData;
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,6 @@ try {
|
||||
$attachment->binaryData = $b64;
|
||||
|
||||
var_dump($sc->attachment($attachment));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
@ -46,4 +45,4 @@ try {
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
||||
// );
|
||||
|
@ -29,7 +29,6 @@ $options = array(
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/SwA.wsdl', $options);
|
||||
|
||||
try {
|
||||
|
||||
$upload = new uploadFile();
|
||||
$upload->name = 'upload.txt';
|
||||
$upload->data = 'This is a test. :)';
|
||||
@ -49,4 +48,4 @@ try {
|
||||
// $sc->__getLastRequest(),
|
||||
// $sc->__getLastResponseHeaders(),
|
||||
// $sc->__getLastResponse()
|
||||
// );
|
||||
// );
|
||||
|
@ -26,4 +26,4 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
||||
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,6 @@ try {
|
||||
$ab->type = 'scifi';
|
||||
|
||||
var_dump($sc->addBook($ab));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ try {
|
||||
$ab->type = 'scifi';
|
||||
|
||||
var_dump($sc->addBook($ab));
|
||||
|
||||
} catch (Exception $e) {
|
||||
var_dump($e);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class WsSecurityUserPassServerInteropTest extends TestCase
|
||||
$sc = new BeSimpleSoapClient(__DIR__.'/Fixtures/WsSecurityUserPass.wsdl', $this->options);
|
||||
|
||||
$wssFilter = new BeSimpleWsSecurityFilter(true, 600);
|
||||
$wssFilter->addUserData( 'libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST );
|
||||
$wssFilter->addUserData('libuser', 'books', BeSimpleWsSecurityFilter::PASSWORD_TYPE_DIGEST);
|
||||
|
||||
$soapKernel = $sc->getSoapKernel();
|
||||
$soapKernel->registerFilter($wssFilter);
|
||||
|
@ -25,9 +25,9 @@ use org\bovigo\vfs\vfsStreamWrapper;
|
||||
*/
|
||||
class WsdlDownloaderTest extends AbstractWebserverTest
|
||||
{
|
||||
static protected $filesystem;
|
||||
protected static $filesystem;
|
||||
|
||||
static protected $fixturesPath;
|
||||
protected static $fixturesPath;
|
||||
|
||||
/**
|
||||
* @dataProvider provideDownload
|
||||
|
@ -157,7 +157,6 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||
public function getReferenceParameter($ns, $parameter)
|
||||
{
|
||||
if (isset($this->referenceParametersRecieved[$ns][$parameter])) {
|
||||
|
||||
return $this->referenceParametersRecieved[$ns][$parameter];
|
||||
}
|
||||
|
||||
@ -344,4 +343,4 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,6 @@ class WsSecurityFilter extends WsSecurityFilterClientServer implements SoapReque
|
||||
if (null !== $this->password
|
||||
&& (null === $this->userSecurityKey
|
||||
|| (null !== $this->userSecurityKey && !$this->userSecurityKey->hasPrivateKey()))) {
|
||||
|
||||
if (self::PASSWORD_TYPE_DIGEST === $this->passwordType) {
|
||||
$nonce = mt_rand();
|
||||
$password = base64_encode(sha1($nonce . $createdTimestamp . $this->password, true));
|
||||
|
@ -56,7 +56,7 @@ class WsdlDownloader
|
||||
/**
|
||||
* Resolve WSDl/XSD includes.
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $resolveRemoteIncludes = true;
|
||||
|
||||
@ -64,13 +64,13 @@ class WsdlDownloader
|
||||
* Constructor.
|
||||
*
|
||||
* @param \BeSimple\SoapClient\Curl $curl Curl instance
|
||||
* @param boolean $resolveRemoteIncludes WSDL/XSD include enabled?
|
||||
* @param boolean $cacheWsdl Cache constant
|
||||
* @param bool $resolveRemoteIncludes WSDL/XSD include enabled?
|
||||
* @param bool $cacheWsdl Cache constant
|
||||
*/
|
||||
public function __construct(Curl $curl, $resolveRemoteIncludes = true, $cacheWsdl = Cache::TYPE_DISK)
|
||||
{
|
||||
$this->curl = $curl;
|
||||
$this->resolveRemoteIncludes = (Boolean) $resolveRemoteIncludes;
|
||||
$this->curl = $curl;
|
||||
$this->resolveRemoteIncludes = (bool) $resolveRemoteIncludes;
|
||||
|
||||
// get current WSDL caching config
|
||||
$this->cacheEnabled = $cacheWsdl === Cache::TYPE_NONE ? Cache::DISABLED : Cache::ENABLED == Cache::isEnabled();
|
||||
@ -107,13 +107,13 @@ class WsdlDownloader
|
||||
file_put_contents($cacheFilePath, $response);
|
||||
}
|
||||
} else {
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '" . $wsdl ."'");
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '".$wsdl."'");
|
||||
}
|
||||
} elseif (file_exists($wsdl)) {
|
||||
$response = file_get_contents($wsdl);
|
||||
$this->resolveRemoteIncludes($response, $cacheFilePath);
|
||||
} else {
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '" . $wsdl ."'");
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '".$wsdl."'");
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ class WsdlDownloader
|
||||
return realpath($wsdl);
|
||||
}
|
||||
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '" . $wsdl ."'");
|
||||
throw new \ErrorException("SOAP-ERROR: Parsing WSDL: Couldn't load from '".$wsdl."'");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +130,7 @@ class WsdlDownloader
|
||||
*
|
||||
* @param string $file File URL/path
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
private function isRemoteFile($file)
|
||||
{
|
||||
@ -147,11 +147,9 @@ class WsdlDownloader
|
||||
/**
|
||||
* Resolves remote WSDL/XSD includes within the WSDL files.
|
||||
*
|
||||
* @param string $xml XML file
|
||||
* @param string $cacheFilePath Cache file name
|
||||
* @param boolean $parentFilePath Parent file name
|
||||
*
|
||||
* @return void
|
||||
* @param string $xml XML file
|
||||
* @param string $cacheFilePath Cache file name
|
||||
* @param bool $parentFilePath Parent file name
|
||||
*/
|
||||
private function resolveRemoteIncludes($xml, $cacheFilePath, $parentFilePath = null)
|
||||
{
|
||||
@ -214,10 +212,10 @@ class WsdlDownloader
|
||||
$urlParts = parse_url($base);
|
||||
|
||||
// combine base path with relative path
|
||||
if (isset($urlParts['path']) && '/' === $relative{0}) {
|
||||
if (isset($urlParts['path']) && '/' === $relative[0]) {
|
||||
// $relative is absolute path from domain (starts with /)
|
||||
$path = $relative;
|
||||
} elseif (isset($urlParts['path']) && strrpos($urlParts['path'], '/') === (strlen($urlParts['path']) )) {
|
||||
} elseif (isset($urlParts['path']) && strrpos($urlParts['path'], '/') === (strlen($urlParts['path']))) {
|
||||
// base path is directory
|
||||
$path = $urlParts['path'].$relative;
|
||||
} elseif (isset($urlParts['path'])) {
|
||||
@ -247,7 +245,7 @@ class WsdlDownloader
|
||||
break;
|
||||
}
|
||||
|
||||
$keyToDelete--;
|
||||
--$keyToDelete;
|
||||
}
|
||||
|
||||
unset($parts[$key]);
|
||||
|
@ -65,6 +65,5 @@ class XmlMimeFilter implements SoapRequestFilter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ abstract class AbstractSoapBuilder
|
||||
/**
|
||||
* @return AbstractSoapBuilder
|
||||
*/
|
||||
static public function createWithDefaults()
|
||||
public static function createWithDefaults()
|
||||
{
|
||||
$builder = new static();
|
||||
|
||||
|
@ -25,24 +25,24 @@ class Cache
|
||||
const TYPE_MEMORY = WSDL_CACHE_MEMORY;
|
||||
const TYPE_DISK_MEMORY = WSDL_CACHE_BOTH;
|
||||
|
||||
static protected $types = array(
|
||||
protected static $types = array(
|
||||
self::TYPE_NONE,
|
||||
self::TYPE_DISK,
|
||||
self::TYPE_MEMORY,
|
||||
self::TYPE_DISK_MEMORY,
|
||||
);
|
||||
|
||||
static public function getTypes()
|
||||
public static function getTypes()
|
||||
{
|
||||
return self::$types;
|
||||
}
|
||||
|
||||
static public function isEnabled()
|
||||
public static function isEnabled()
|
||||
{
|
||||
return self::iniGet('soap.wsdl_cache_enabled');
|
||||
}
|
||||
|
||||
static public function setEnabled($enabled)
|
||||
public static function setEnabled($enabled)
|
||||
{
|
||||
if (!in_array($enabled, array(self::ENABLED, self::DISABLED), true)) {
|
||||
throw new \InvalidArgumentException();
|
||||
@ -51,12 +51,12 @@ class Cache
|
||||
self::iniSet('soap.wsdl_cache_enabled', $enabled);
|
||||
}
|
||||
|
||||
static public function getType()
|
||||
public static function getType()
|
||||
{
|
||||
return self::iniGet('soap.wsdl_cache');
|
||||
}
|
||||
|
||||
static public function setType($type)
|
||||
public static function setType($type)
|
||||
{
|
||||
if (!in_array($type, self::getTypes(), true)) {
|
||||
throw new \InvalidArgumentException('The cache type has to be either Cache::TYPE_NONE, Cache::TYPE_DISK, Cache::TYPE_MEMORY or Cache::TYPE_DISK_MEMORY');
|
||||
@ -65,12 +65,12 @@ class Cache
|
||||
self::iniSet('soap.wsdl_cache', $type);
|
||||
}
|
||||
|
||||
static public function getDirectory()
|
||||
public static function getDirectory()
|
||||
{
|
||||
return self::iniGet('soap.wsdl_cache_dir');
|
||||
}
|
||||
|
||||
static public function setDirectory($directory)
|
||||
public static function setDirectory($directory)
|
||||
{
|
||||
if (!is_dir($directory)) {
|
||||
mkdir($directory, 0777, true);
|
||||
@ -79,33 +79,33 @@ class Cache
|
||||
self::iniSet('soap.wsdl_cache_dir', $directory);
|
||||
}
|
||||
|
||||
static public function getLifetime()
|
||||
public static function getLifetime()
|
||||
{
|
||||
return self::iniGet('soap.wsdl_cache_ttl');
|
||||
}
|
||||
|
||||
static public function setLifetime($lifetime)
|
||||
public static function setLifetime($lifetime)
|
||||
{
|
||||
self::iniSet('soap.wsdl_cache_ttl', $lifetime);
|
||||
}
|
||||
|
||||
static public function getLimit()
|
||||
public static function getLimit()
|
||||
{
|
||||
return self::iniGet('soap.wsdl_cache_limit');
|
||||
}
|
||||
|
||||
static public function setLimit($limit)
|
||||
public static function setLimit($limit)
|
||||
{
|
||||
self::iniSet('soap.wsdl_cache_limit', $limit);
|
||||
}
|
||||
|
||||
static protected function iniGet($key)
|
||||
protected static function iniGet($key)
|
||||
{
|
||||
return ini_get($key);
|
||||
}
|
||||
|
||||
static protected function iniSet($key, $value)
|
||||
protected static function iniSet($key, $value)
|
||||
{
|
||||
ini_set($key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,4 @@ class Classmap
|
||||
$this->add($type, $classname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,4 +44,3 @@ class DateTimeTypeConverter implements TypeConverterInterface
|
||||
return sprintf('<%1$s>%2$s</%1$s>', $this->getTypeName(), $data->format('Y-m-d\TH:i:sP'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,4 +44,3 @@ class DateTypeConverter implements TypeConverterInterface
|
||||
return sprintf('<%1$s>%2$s</%1$s>', $this->getTypeName(), $data->format('Y-m-d'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,10 +65,8 @@ class MtomTypeConverter implements TypeConverterInterface, SoapKernelAwareInterf
|
||||
$contentId = urldecode(substr($ref, 4));
|
||||
|
||||
if (null !== ($part = $this->soapKernel->getAttachment($contentId))) {
|
||||
|
||||
return $part->getContent();
|
||||
} else {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -28,5 +28,5 @@ interface SoapKernelAwareInterface
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setKernel(SoapKernel $soapKernel);
|
||||
}
|
||||
public function setKernel(SoapKernel $soapKernel);
|
||||
}
|
||||
|
@ -61,10 +61,8 @@ class SwaTypeConverter implements TypeConverterInterface, SoapKernelAwareInterfa
|
||||
$contentId = urldecode(substr($ref, 4));
|
||||
|
||||
if (null !== ($part = $this->soapKernel->getAttachment($contentId))) {
|
||||
|
||||
return $part->getContent();
|
||||
} else {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ class TypeConverterCollection
|
||||
$typemap[] = array(
|
||||
'type_name' => $converter->getTypeName(),
|
||||
'type_ns' => $converter->getTypeNamespace(),
|
||||
'from_xml' => function($input) use ($converter) {
|
||||
'from_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertXmlToPhp($input);
|
||||
},
|
||||
'to_xml' => function($input) use ($converter) {
|
||||
'to_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertPhpToXml($input);
|
||||
},
|
||||
);
|
||||
|
@ -24,14 +24,14 @@ interface TypeConverterInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getTypeNamespace();
|
||||
public function getTypeNamespace();
|
||||
|
||||
/**
|
||||
* Get type name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getTypeName();
|
||||
public function getTypeName();
|
||||
|
||||
/**
|
||||
* Convert given XML string to PHP type.
|
||||
@ -40,7 +40,7 @@ interface TypeConverterInterface
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function convertXmlToPhp($data);
|
||||
public function convertXmlToPhp($data);
|
||||
|
||||
/**
|
||||
* Convert PHP type to XML string.
|
||||
@ -49,5 +49,5 @@ interface TypeConverterInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function convertPhpToXml($data);
|
||||
}
|
||||
public function convertPhpToXml($data);
|
||||
}
|
||||
|
@ -175,4 +175,4 @@ class FilterHelper
|
||||
$this->namespaces[$namespaceURI] = $prefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +172,8 @@ class Helper
|
||||
return sprintf(
|
||||
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
// 32 bits for "time_low"
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0xffff),
|
||||
// 16 bits for "time_mid"
|
||||
mt_rand(0, 0xffff),
|
||||
// 16 bits for "time_hi_and_version",
|
||||
@ -183,7 +184,9 @@ class Helper
|
||||
// two most significant bits holds zero and one for variant DCE1.1
|
||||
mt_rand(0, 0x3fff) | 0x8000,
|
||||
// 48 bits for "node"
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
|
||||
mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0xffff)
|
||||
);
|
||||
}
|
||||
|
||||
@ -218,4 +221,4 @@ class Helper
|
||||
return SOAP_1_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -172,4 +172,4 @@ class MultiPart extends PartHeader
|
||||
{
|
||||
return 'urn:uuid:' . Helper::generateUUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,4 +184,4 @@ class Parser
|
||||
}
|
||||
$part->setContent($content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,4 +166,4 @@ class Part extends PartHeader
|
||||
{
|
||||
return 'urn:uuid:' . Helper::generateUUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -143,4 +143,4 @@ abstract class PartHeader
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ abstract class SoapMessage
|
||||
*
|
||||
* @var array(string=>string)
|
||||
*/
|
||||
static protected $versionToContentTypeMap = array(
|
||||
protected static $versionToContentTypeMap = array(
|
||||
SOAP_1_1 => 'text/xml; charset=utf-8',
|
||||
SOAP_1_2 => 'application/soap+xml; charset=utf-8'
|
||||
);
|
||||
|
@ -22,5 +22,4 @@ use BeSimple\SoapCommon\SoapMessage;
|
||||
*/
|
||||
class SoapRequest extends SoapMessage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ interface SoapRequestFilter
|
||||
* @param SoapRequest $request SOAP request
|
||||
*/
|
||||
public function filterRequest(SoapRequest $request);
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,4 @@ use BeSimple\SoapCommon\SoapMessage;
|
||||
*/
|
||||
class SoapResponse extends SoapMessage
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,4 +28,4 @@ interface SoapResponseFilter
|
||||
* @param SoapResponse $response SOAP response
|
||||
*/
|
||||
public function filterResponse(SoapResponse $response);
|
||||
}
|
||||
}
|
||||
|
@ -78,4 +78,4 @@ class ClassmapTest extends \PHPUnit_Framework_TestCase
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
$classmap1->addClassmap($classmap2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,4 +51,3 @@ class DateTimeTypeConverterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($date);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,4 +49,3 @@ class DateTypeConverterTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNull($date);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,4 +90,4 @@ class TypeConverterCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
$converters1->addCollection($converters2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,13 +131,13 @@ class MultiPartTest extends \PHPUnit_Framework_TestCase
|
||||
$mp->addPart($p2);
|
||||
|
||||
$withoutMain = array(
|
||||
trim($p2->getHeader('Content-ID'),'<>') => $p2,
|
||||
trim($p2->getHeader('Content-ID'), '<>') => $p2,
|
||||
);
|
||||
$this->assertEquals($withoutMain, $mp->getParts());
|
||||
|
||||
$withMain = array(
|
||||
trim($p1->getHeader('Content-ID'),'<>') => $p1,
|
||||
trim($p2->getHeader('Content-ID'),'<>') => $p2,
|
||||
trim($p1->getHeader('Content-ID'), '<>') => $p1,
|
||||
trim($p2->getHeader('Content-ID'), '<>') => $p2,
|
||||
);
|
||||
$this->assertEquals($withMain, $mp->getParts(true));
|
||||
}
|
||||
|
@ -338,7 +338,6 @@ abstract class WsSecurityFilterClientServer
|
||||
return XmlSecurityKey::factory($algorithm, $key, false, XmlSecurityKey::TYPE_PRIVATE);
|
||||
} elseif (Helper::NS_WSS === $referencedNode->namespaceURI
|
||||
&& 'BinarySecurityToken' == $referencedNode->localName) {
|
||||
|
||||
$key = XmlSecurityPem::formatKeyInPemFormat($referencedNode->textContent);
|
||||
|
||||
return XmlSecurityKey::factory(XmlSecurityKey::RSA_SHA1, $key, false, XmlSecurityKey::TYPE_PUBLIC);
|
||||
|
@ -113,4 +113,4 @@ class WsSecurityKey
|
||||
{
|
||||
return null !== $this->publicKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class SoapRequest extends CommonSoapRequest
|
||||
} else {
|
||||
$url .= 'http://';
|
||||
}
|
||||
$url .= isset( $_SERVER['SERVER_NAME'] ) ? $_SERVER['SERVER_NAME'] : '';
|
||||
$url .= isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';
|
||||
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80) {
|
||||
$url .= ":{$_SERVER['SERVER_PORT']}";
|
||||
}
|
||||
|
@ -158,10 +158,10 @@ class SoapServer extends \SoapServer
|
||||
$options['typemap'][] = array(
|
||||
'type_name' => $converter->getTypeName(),
|
||||
'type_ns' => $converter->getTypeNamespace(),
|
||||
'from_xml' => function($input) use ($converter) {
|
||||
'from_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertXmlToPhp($input);
|
||||
},
|
||||
'to_xml' => function($input) use ($converter) {
|
||||
'to_xml' => function ($input) use ($converter) {
|
||||
return $converter->convertPhpToXml($input);
|
||||
},
|
||||
);
|
||||
|
@ -33,7 +33,7 @@ class SoapServerBuilder extends AbstractSoapBuilder
|
||||
*
|
||||
* @return \BeSimple\SoapServer\SoapServerBuilder
|
||||
*/
|
||||
static public function createWithDefaults()
|
||||
public static function createWithDefaults()
|
||||
{
|
||||
return parent::createWithDefaults()
|
||||
->withErrorReporting(false);
|
||||
@ -197,4 +197,4 @@ class SoapServerBuilder extends AbstractSoapBuilder
|
||||
throw new \InvalidArgumentException('The handler has to be configured!');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,5 @@ class XmlMimeFilter implements SoapResponseFilter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user