From 8788d7595d7ae026d76b21f7f57407db345ad4bc Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 2 Dec 2013 16:02:29 +0100 Subject: [PATCH] Cleaned unused method, property, variable or parameter --- .../SoapBundle/Converter/TypeRepository.php | 2 -- .../BeSimpleSoapExtension.php | 8 +++---- .../RpcLiteralRequestMessageBinder.php | 1 - .../RpcLiteralResponseMessageBinder.php | 1 - .../ServiceDefinition/Definition.php | 2 -- .../Loader/AnnotationClassLoader.php | 24 ------------------- .../Loader/AnnotationFileLoader.php | 2 +- src/BeSimple/SoapBundle/WebServiceContext.php | 2 -- src/BeSimple/SoapClient/MimeFilter.php | 4 ++-- src/BeSimple/SoapClient/WsSecurityFilter.php | 2 +- .../WsSecurityFilterClientServer.php | 3 +-- src/BeSimple/SoapCommon/WsdlHandler.php | 4 ++-- src/BeSimple/SoapServer/MimeFilter.php | 4 ++-- src/BeSimple/SoapServer/WsSecurityFilter.php | 2 +- 14 files changed, 14 insertions(+), 47 deletions(-) diff --git a/src/BeSimple/SoapBundle/Converter/TypeRepository.php b/src/BeSimple/SoapBundle/Converter/TypeRepository.php index 1e21799..79b571e 100644 --- a/src/BeSimple/SoapBundle/Converter/TypeRepository.php +++ b/src/BeSimple/SoapBundle/Converter/TypeRepository.php @@ -48,8 +48,6 @@ class TypeRepository public function fixTypeInformation(ServiceDefinition $definition) { - $typeMap = $this->defaultTypeMap; - foreach($definition->getAllTypes() as $type) { $phpType = $type->getPhpType(); $xmlType = $type->getXmlType(); diff --git a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php index 395e767..267968d 100644 --- a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php +++ b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php @@ -84,7 +84,7 @@ class BeSimpleSoapExtension extends Extension foreach ($config as $client => $options) { $definition = new DefinitionDecorator('besimple.soap.client.builder'); - $context = $container->setDefinition(sprintf('besimple.soap.client.builder.%s', $client), $definition); + $container->setDefinition(sprintf('besimple.soap.client.builder.%s', $client), $definition); $definition->replaceArgument(0, $options['wsdl']); @@ -118,7 +118,7 @@ class BeSimpleSoapExtension extends Extension private function createClientClassmap($client, array $classmap, ContainerBuilder $container) { $definition = new DefinitionDecorator('besimple.soap.classmap'); - $context = $container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition); + $container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition); $definition->setMethodCalls(array( array('set', array($classmap)), @@ -130,7 +130,7 @@ class BeSimpleSoapExtension extends Extension private function createClient($client, ContainerBuilder $container) { $definition = new DefinitionDecorator('besimple.soap.client'); - $context = $container->setDefinition(sprintf('besimple.soap.client.%s', $client), $definition); + $container->setDefinition(sprintf('besimple.soap.client.%s', $client), $definition); $definition->setFactoryService(sprintf('besimple.soap.client.builder.%s', $client)); } @@ -142,7 +142,7 @@ class BeSimpleSoapExtension extends Extension $contextId = 'besimple.soap.context.'.$config['name']; $definition = new DefinitionDecorator('besimple.soap.context.'.$bindingSuffix); - $context = $container->setDefinition($contextId, $definition); + $container->setDefinition($contextId, $definition); if (isset($config['cache_type'])) { $config['cache_type'] = $this->getCacheType($config['cache_type']); diff --git a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php index bbabe6c..efba52b 100644 --- a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php +++ b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralRequestMessageBinder.php @@ -54,7 +54,6 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface if ($type instanceof ArrayOfType) { $isArray = true; $array = array(); - $arrayType = $type; $type = $this->typeRepository->getType($type->get('item')->getType()); } diff --git a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php index 7e97b11..ed7ecf8 100644 --- a/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php +++ b/src/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php @@ -42,7 +42,6 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface $type = $this->typeRepository->getType($phpType); if ($type instanceof ArrayOfType) { $isArray = true; - $arrayType = $type; $type = $this->typeRepository->getType($type->get('item')->getType()); } diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Definition.php b/src/BeSimple/SoapBundle/ServiceDefinition/Definition.php index 4afd642..857ad63 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Definition.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Definition.php @@ -21,8 +21,6 @@ use BeSimple\SoapCommon\Definition\Type\TypeRepository; */ class Definition extends BaseDefinition { - private $complexTypes; - public function __construct(TypeRepository $typeRepository) { $this->typeRepository = $typeRepository; diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationClassLoader.php b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationClassLoader.php index d994ad9..649cb20 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationClassLoader.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationClassLoader.php @@ -141,30 +141,6 @@ class AnnotationClassLoader extends Loader } } - /** - * @param \ReflectionMethod $method - * @param \BeSimple\SoapBundle\ServiceDefinition\Annotation\Param $annotation - * - * @return \BeSimple\SoapBundle\ServiceDefinition\Type - */ - private function getArgumentType(\ReflectionMethod $method, Annotation\Param $annotation) - { - $phpType = $annotation->getPhpType(); - $xmlType = $annotation->getXmlType(); - - if (null === $phpType) { - foreach ($method->getParameters() as $param) { - if ($param->name === $annotation->getName()) { - $phpType = $param->getClass()->name; - - break; - } - } - } - - return new Definition\Type($phpType, $xmlType); - } - private function loadType($phpType) { if (false !== $arrayOf = $this->typeRepository->getArrayOf($phpType)) { diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationFileLoader.php b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationFileLoader.php index 6d90431..b995980 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationFileLoader.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationFileLoader.php @@ -61,7 +61,7 @@ class AnnotationFileLoader extends FileLoader $path = $this->locator->locate($file); if ($class = $this->findClass($path)) { - return $definition = $this->loader->load($class, $type); + return $this->loader->load($class, $type); } return null; diff --git a/src/BeSimple/SoapBundle/WebServiceContext.php b/src/BeSimple/SoapBundle/WebServiceContext.php index 9e2dc86..28316f6 100644 --- a/src/BeSimple/SoapBundle/WebServiceContext.php +++ b/src/BeSimple/SoapBundle/WebServiceContext.php @@ -26,8 +26,6 @@ use Symfony\Component\Config\Loader\LoaderInterface; */ class WebServiceContext { - private $converterRepository; - private $options; private $serviceDefinition; diff --git a/src/BeSimple/SoapClient/MimeFilter.php b/src/BeSimple/SoapClient/MimeFilter.php index beee156..0dd9905 100644 --- a/src/BeSimple/SoapClient/MimeFilter.php +++ b/src/BeSimple/SoapClient/MimeFilter.php @@ -90,7 +90,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter // TODO $headers = $multipart->getHeadersForHttp(); - list($name, $contentType) = explode(': ', $headers[0]); + list(, $contentType) = explode(': ', $headers[0]); $request->setContentType($contentType); } @@ -135,4 +135,4 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter $response->setAttachments($attachmentsRecieved); } } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapClient/WsSecurityFilter.php b/src/BeSimple/SoapClient/WsSecurityFilter.php index dc99cdf..af51a62 100644 --- a/src/BeSimple/SoapClient/WsSecurityFilter.php +++ b/src/BeSimple/SoapClient/WsSecurityFilter.php @@ -210,7 +210,7 @@ class WsSecurityFilter extends WsSecurityFilterClientServer implements SoapReque $referenceList = XmlSecurityEnc::createReferenceList($encryptedKey); // token reference to encrypted key $keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid); - $nodes = $this->createNodeListForEncryption($dom, $security); + $nodes = $this->createNodeListForEncryption($dom); foreach ($nodes as $node) { $type = XmlSecurityEnc::ELEMENT; if ($node->localName == 'Body') { diff --git a/src/BeSimple/SoapCommon/WsSecurityFilterClientServer.php b/src/BeSimple/SoapCommon/WsSecurityFilterClientServer.php index cf89531..15b0d25 100644 --- a/src/BeSimple/SoapCommon/WsSecurityFilterClientServer.php +++ b/src/BeSimple/SoapCommon/WsSecurityFilterClientServer.php @@ -242,11 +242,10 @@ abstract class WsSecurityFilterClientServer * Create a list of \DOMNodes that should be encrypted. * * @param \DOMDocument $dom DOMDocument to query - * @param \DOMElement $security Security element * * @return \DOMNodeList */ - protected function createNodeListForEncryption(\DOMDocument $dom, \DOMElement $security) + protected function createNodeListForEncryption(\DOMDocument $dom) { $xpath = new \DOMXPath($dom); $xpath->registerNamespace('SOAP-ENV', $dom->documentElement->namespaceURI); diff --git a/src/BeSimple/SoapCommon/WsdlHandler.php b/src/BeSimple/SoapCommon/WsdlHandler.php index 6fd044b..a52a995 100644 --- a/src/BeSimple/SoapCommon/WsdlHandler.php +++ b/src/BeSimple/SoapCommon/WsdlHandler.php @@ -174,7 +174,7 @@ class WsdlHandler return true; // type/* match } else { - list($ctype, $csubtype) = explode('/', $currentMimeType); + list($ctype) = explode('/', $currentMimeType); foreach ($mimeTypes as $mimeType) { list($type, $subtype) = explode('/', $mimeType); if ($subtype == '*' && $type == $ctype) { @@ -202,4 +202,4 @@ class WsdlHandler $this->domXpath->registerNamespace('soap', $this->wsdlSoapNamespace); } } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapServer/MimeFilter.php b/src/BeSimple/SoapServer/MimeFilter.php index 84f16ba..502f3f4 100644 --- a/src/BeSimple/SoapServer/MimeFilter.php +++ b/src/BeSimple/SoapServer/MimeFilter.php @@ -130,9 +130,9 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter // TODO $headers = $multipart->getHeadersForHttp(); - list($name, $contentType) = explode(': ', $headers[0]); + list(, $contentType) = explode(': ', $headers[0]); $response->setContentType($contentType); } } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapServer/WsSecurityFilter.php b/src/BeSimple/SoapServer/WsSecurityFilter.php index 756a1a9..b2e86a0 100644 --- a/src/BeSimple/SoapServer/WsSecurityFilter.php +++ b/src/BeSimple/SoapServer/WsSecurityFilter.php @@ -226,7 +226,7 @@ class WsSecurityFilter extends WsSecurityFilterClientServer implements SoapReque $referenceList = XmlSecurityEnc::createReferenceList($encryptedKey); // token reference to encrypted key $keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid); - $nodes = $this->createNodeListForEncryption($dom, $security); + $nodes = $this->createNodeListForEncryption($dom); foreach ($nodes as $node) { $type = XmlSecurityEnc::ELEMENT; if ($node->localName == 'Body') {